kernel/eka/drivers/medmmc/bgahsmmcptn.h
author hgs
Wed, 12 May 2010 10:34:10 +0100
changeset 133 2a0ada0a1bf8
parent 90 947f0dc9f7a8
child 202 9aca3be14c27
permissions -rw-r--r--
201019_04
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
52
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     1
// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     2
// All rights reserved.
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     3
// This component and the accompanying materials are made available
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     4
// under the terms of the License "Eclipse Public License v1.0"
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     5
// which accompanies this distribution, and is available
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     7
//
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     8
// Initial Contributors:
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    10
//
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    11
// Contributors:
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    12
//
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    13
// Description:
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    14
// Partition Management for Embedded MMC devices
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    15
// 
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    16
//
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    18
#ifndef BGAHSMMCPTN_H
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    19
#define BGAHSMMCPTN_H
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    20
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    21
/* Partition attributes */
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    22
#define BGAHSMMCPTN_ATTR_READ 0x00
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    23
#define BGAHSMMCPTN_ATTR_WRITE 0x01
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    24
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    25
/* Partition information ID and fixed size */
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    26
#define BGAHSMMCPTN_PI_ID "BGAHSMMCPI:"
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    27
#define BGAHSMMCPTN_PI_ID_SIZE 12 /* Fixed (4B aligned) */
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    28
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    29
/* Partition information version */
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    30
#define BGAHSMMCPTN_PI_VER_MAJOR	1
90
947f0dc9f7a8 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 52
diff changeset
    31
#define BGAHSMMCPTN_PI_VER_MINOR	1
947f0dc9f7a8 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 52
diff changeset
    32
947f0dc9f7a8 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 52
diff changeset
    33
/* Partition type field supported from version 1.1 onwards */
947f0dc9f7a8 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 52
diff changeset
    34
#define BGAHSMMCPTN_PART_TYPE_SUPP_VER_MINOR    1
52
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    35
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    36
#define BGAHSMMCPTN_LAST_DRIVE		7 /* MMC1_DRIVECOUNT - defined in variantmediadef.h */
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    37
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    38
typedef struct
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    39
{
90
947f0dc9f7a8 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 52
diff changeset
    40
	TUint32 iStart_sector;			/* Partition start sector */
947f0dc9f7a8 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 52
diff changeset
    41
	TUint32 iSize;					/* Partition size in sectors */
947f0dc9f7a8 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 52
diff changeset
    42
	TUint32 iAttributes;			/* RO, RW attributes (bitmask) */
947f0dc9f7a8 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 52
diff changeset
    43
	TUint8  iPartition_id;			/* Partition number - v1.0 - partition type v1.1 - drive number*/
947f0dc9f7a8 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 52
diff changeset
    44
	TUint8  iPartition_type;         /* Partition Type - v1.1 onwards */
947f0dc9f7a8 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 52
diff changeset
    45
	TUint8  iReserved1[2];			/* Reserved (padding for compiler alignment)*/
947f0dc9f7a8 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 52
diff changeset
    46
	TUint32 iPartition_attributes;	/* Partition attributes (see e32const.h) */
947f0dc9f7a8 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 52
diff changeset
    47
	TUint8  iReserved2[8];			/* Reserved */
52
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    48
/* = 28 bytes */
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    49
} BGAHSMMCPTN_PART_STR;
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    50
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    51
typedef struct
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    52
{
90
947f0dc9f7a8 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 52
diff changeset
    53
	TUint8  iId[BGAHSMMCPTN_PI_ID_SIZE];	/* Partition information version */
947f0dc9f7a8 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 52
diff changeset
    54
	TUint32 iSector_size;			/* Used sector size */
947f0dc9f7a8 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 52
diff changeset
    55
	TUint16 iMajor_ver;				/* Major version number */
947f0dc9f7a8 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 52
diff changeset
    56
	TUint16 iMinor_ver;				/* Minor version number */
947f0dc9f7a8 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 52
diff changeset
    57
	TUint16 iPartition_amount;		/* The amount of partitions */
947f0dc9f7a8 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 52
diff changeset
    58
	TUint8  iReserved[42];			/* Reserved */
52
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    59
/* = 64 bytes */
90
947f0dc9f7a8 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 52
diff changeset
    60
	BGAHSMMCPTN_PART_STR iPartitions[BGAHSMMCPTN_LAST_DRIVE];	
52
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    61
} BGAHSMMCPTN_PI_STR;
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    62
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    63
#define BGAHSMMCPTN_PI_STR_SIZE sizeof( BGAHSMMCPTN_PI_STR )
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    64
2d65c2f76d7b Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    65
#endif /*BGAHSMMCPTN_H*/