os/kernelhwsrv/kernel/eka/include/drivers/crashflashnor.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/kernel/eka/include/drivers/crashflashnor.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,103 @@
     1.4 +// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of the License "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// e32\drivers\crashflash\crashflashnor.h
    1.18 +// 
    1.19 +// WARNING: This file contains some APIs which are internal and are subject
    1.20 +//          to change without notice. Such APIs should therefore not be used
    1.21 +//          outside the Kernel and Hardware Services package.
    1.22 +//
    1.23 +
    1.24 +#ifndef __CRASH_FLASH_NOR_H__
    1.25 +#define __CRASH_FLASH_NOR_H__
    1.26 +
    1.27 +#ifndef EPOC32
    1.28 +
    1.29 +#include <crashflash.h>
    1.30 +#include <kernel/kernel.h>
    1.31 +
    1.32 +/* @file
    1.33 +@internalTechnology
    1.34 +*/
    1.35 +
    1.36 +/* The generic crash flash nor support allows for a 32, 16, or 8 bit interface
    1.37 + * to the nor flash chip.  One of the following should be defined in the
    1.38 + * variant's mmp file.
    1.39 + */
    1.40 +#ifdef TCFI_4BYTE_WORD
    1.41 +typedef TUint32 TCFIWord;
    1.42 +#elif defined(TCFI_2BYTE_WORD)
    1.43 +typedef TUint16 TCFIWord;
    1.44 +#elif defined(TCFI_1BYTE_WORD)
    1.45 +typedef TUint8 TCFIWord;
    1.46 +#else
    1.47 +#error One of TCFI_4BYTE_WORD, TCFI_2BYTE_WORD, or TCFI_1BYTE_WORD must be defined.
    1.48 +#endif
    1.49 +
    1.50 +/** 
    1.51 +An implmentation of the CrashFlash interface for nor flash.
    1.52 +@internalTechnology
    1.53 +*/
    1.54 +class CrashFlashNor : public CrashFlash
    1.55 +	{
    1.56 +public:
    1.57 +	TInt Initialise();
    1.58 +	void StartTransaction();
    1.59 +	void EndTransaction();
    1.60 +	void Write(const TDesC8& aDes);
    1.61 +	void WriteSignature(const TDesC8& aDes);
    1.62 +	void Read(TDes8& aDes);
    1.63 +	void SetReadPos(TUint aPos);
    1.64 +	void SetWritePos(const TUint aPos);
    1.65 +	void EraseLogArea();
    1.66 +	TUint BytesWritten();
    1.67 +	void EraseFlashBlock(TUint aBlock);
    1.68 +#ifdef _CRASHLOG_COMPR	
    1.69 +	TUint GetOutputLimit();
    1.70 +	TUint GetLogOffset();
    1.71 +#endif
    1.72 +protected:
    1.73 +	/** @publishedPartner
    1.74 +	@released */
    1.75 +	virtual TInt VariantInitialise()=0;
    1.76 +	/** @publishedPartner
    1.77 +	@released */
    1.78 +	virtual void DoWrite(TCFIWord aWord)=0;
    1.79 +	/** @publishedPartner
    1.80 +	@released */
    1.81 +	virtual TCFIWord DoRead()=0;
    1.82 +	/** @publishedPartner
    1.83 +	@released */
    1.84 +	virtual void DoEraseBlock(TUint aBlock)=0;
    1.85 +private:
    1.86 +	TCFIWord iWriteBuf;
    1.87 +	TCFIWord iReadBuf;
    1.88 +	TUint iWriteBufBytes;
    1.89 +	TUint iReadBufBytes;
    1.90 +protected:
    1.91 +	/** @publishedPartner
    1.92 +	@released */
    1.93 +	TUint iEraseBlockSize;
    1.94 +	/** @publishedPartner
    1.95 +	@released */
    1.96 +	TUint iWritePos;
    1.97 +	/** @publishedPartner
    1.98 +	@released */
    1.99 +	TUint iReadPos;
   1.100 +private:
   1.101 +	TUint iWriteTotal;
   1.102 +	};
   1.103 +
   1.104 +#endif
   1.105 +
   1.106 +#endif