kernel/eka/drivers/medmmc/toc.h
author hgs
Mon, 26 Jul 2010 10:52:56 +0100
changeset 231 75252ea6123b
parent 202 9aca3be14c27
child 300 1d28c8722707
permissions -rw-r--r--
201029_03
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
202
9aca3be14c27 201027_08
hgs
parents:
diff changeset
     1
// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
9aca3be14c27 201027_08
hgs
parents:
diff changeset
     2
// All rights reserved.
9aca3be14c27 201027_08
hgs
parents:
diff changeset
     3
// This component and the accompanying materials are made available
9aca3be14c27 201027_08
hgs
parents:
diff changeset
     4
// under the terms of the License "Eclipse Public License v1.0"
9aca3be14c27 201027_08
hgs
parents:
diff changeset
     5
// which accompanies this distribution, and is available
9aca3be14c27 201027_08
hgs
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
9aca3be14c27 201027_08
hgs
parents:
diff changeset
     7
//
9aca3be14c27 201027_08
hgs
parents:
diff changeset
     8
// Initial Contributors:
9aca3be14c27 201027_08
hgs
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    10
//
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    11
// Contributors:
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    12
//
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    13
// Description:
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    14
// TOC Partition Management for Embedded MMC devices
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    15
// 
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    16
//
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    17
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    18
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    19
#ifndef __EMMC_TOC_H__
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    20
#define __EMMC_TOC_H__
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    21
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    22
#include <emmcptn.h>
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    23
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    24
// TOC item
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    25
const TUint  KMaxItemNameLen = 12;
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    26
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    27
struct STocItem
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    28
    {
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    29
    TUint32 iStart;
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    30
    TUint32 iSize;
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    31
    TUint32 iFlags;
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    32
    TUint32 iAlign;
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    33
    TUint32 iLoadAddress;
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    34
    TText8  iFileName[KMaxItemNameLen];
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    35
	};
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    36
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    37
//- Constants ---------------------------------------------------------------
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    38
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    39
const TUint32 KTocStartSector       = 1280; // TOC starts from 0xA0000 / 0x200
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    40
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    41
const TText8  KTocRofsName[]        = "SOS-ROFS";
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    42
const TText8  KTocRofsName1[]       = "SOS+ROFS"; 
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    43
const TText8  KTocRofsExtName[]     = "SOS-ROFX";
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    44
const TText8  KTocRofsGeneric[]     = "ROFS";  
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    45
const TText8  KTocRomGeneric[]      = "SOS+CORE";  
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    46
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    47
const TText8  KTocCps[]             = "SOS-CPS";
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    48
const TText8  KTocRofsExtGeneric[]  = "ROFX";    
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    49
const TText8  KTocSwap[]            = "SOS-SWAP";
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    50
const TText8  KTocUserName[]        = "SOS-USER";
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    51
const TText8  KTocCrashLog[]        = "SOS-CRASH";
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    52
const TText8  KTocToc[]             = "TOC";
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    53
const TText8  KTocSosToc[]          = "SOS-TOC";
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    54
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    55
const TUint8  KMaxNbrOfTocItems     = 16;
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    56
const TUint8  KXMaxNbrOfTocItems    = 16;
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    57
const TUint32 KEndOfToc             = 0xFFFFFFFFUL;
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    58
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    59
const TText8  KTocRofs1Generic[]    = "ROFS1";
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    60
const TText8  KTocRofs2Generic[]    = "ROFS2";
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    61
const TText8  KTocRofs3Generic[]    = "ROFS3"; 
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    62
const TText8  KTocRofs4Generic[]    = "ROFS4";
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    63
const TText8  KTocRofs5Generic[]    = "ROFS5";
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    64
const TText8  KTocRofs6Generic[]    = "ROFS6";
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    65
const TUint   KNoOfROFSPartitions   = 6;
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    66
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    67
const TInt    KSectorShift          = 9;
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    68
/**
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    69
TOC access for kernel side clients.
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    70
*/
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    71
class Toc
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    72
    {
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    73
    public:
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    74
        /**
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    75
         *  Search entry in TOC with aName as part of ItemName.
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    76
         *  @return KErrNone if successful 
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    77
         */
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    78
        TInt GetItemByName(const TText8* aName, STocItem& aItem);
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    79
		
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    80
	public:
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    81
		/**	Array for keep whole TOC */
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    82
		STocItem iTOC[KMaxNbrOfTocItems];
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    83
				
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    84
		/** Offset of TOC from beginning*/
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    85
		TUint32  iTocStartSector;
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    86
    };
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    87
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    88
#endif // __EMMC_TOC_H__
9aca3be14c27 201027_08
hgs
parents:
diff changeset
    89