loader.h

来自「该BSP是基于PXA270+WINCE的BSP」· C头文件 代码 · 共 122 行

H
122
字号
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to use
// this source code. For a copy of the EULA, please see the LICENSE.RTF on your
// install media.
//
//------------------------------------------------------------------------------
//
//  File: loader.h
//
//  This file contains definitions specific to the bootloader.
//
#ifndef _LOADER_H_
#define _LOADER_H_

#include <blcommon.h>
#include <halether.h>
#include <image_cfg.h>
#include <oal_kitl.h>
#include <dbgserial.h>

//------------------------------------------------------------------------------
// Defines
//
#define EBOOT_VERSION_MAJOR             1
#define EBOOT_VERSION_MINOR             11

#define EBOOT_FLASH_CFG_START           ((UINT32) OALPAtoVA(MAINSTONEII_BASE_PA_BOOT_FLASH, FALSE) + IMAGE_BOOT_CONFIG_FLASH_OFFSET)

#define EBOOT_FLASHBLOCK_CACHE_START    ((UINT32) OALPAtoVA(MAINSTONEII_BASE_PA_SDRAM, FALSE) + IMAGE_BOOT_DOWNLOADCACHE_RAM_OFFSET)
#define EBOOT_FLASHBLOCK_CACHE_SIZE     IMAGE_BOOT_DOWNLOADCACHE_RAM_SIZE

//------------------------------------------------------------------------------
// External functions
//
extern void SpinForever(void);

extern BOOL FlashInit(UINT32 FlashStart, UINT32 FlashLength);
extern BOOL FlashRead(UINT32 StartAddr, UINT8 *pDataBuffer, UINT32 BufferLen);
extern BOOL FlashWrite(UINT32 FlashStart, UINT8 *pDataBuffer, UINT32 DataLength);

extern DWORD OEMEthGetSecs(void);

extern UINT32 InitSpecifiedEthDevice(OAL_KITL_ARGS *pKITLArgs, UINT32 EthDevice);

//------------------------------------------------------------------------------
// Structure definitions. 
//
// The EBOOT_CFG structure holds a variety of configuration parameters.
// When adding new parameters, make sure that the size of the structure in bytes is 
// an integral number of DWORDS.  Pad the structure if necessary.
#define EBOOT_CFG_MAGIC_NUMBER                0x01020304


//-------------------------------------------------------------------
typedef struct 
{
	unsigned short	CxScreen;	
	unsigned short	CyScreen;	
	unsigned short	Bpp;
	unsigned long	LCCR0;
	unsigned char	HSW;
	unsigned char	BLW;
	unsigned char	ELW;	
	unsigned char	VSW;
	unsigned char	BFW;
	unsigned char	EFW;
	unsigned char	PCD;
	unsigned long	LCCR3_OTHER;
	unsigned char	DoRotation;
} fDspRegVal;	//f- :for eboot cfg to be write to flash
//-------------------------------------------------------------------

typedef struct
{
    DWORD autoDownloadImage;
    DWORD IP;
    DWORD subnetMask;
    DWORD numBootMe;
    DWORD delay;
    DWORD DHCPEnable;
    DWORD bootDeviceOrder;
    DWORD dwPhysStart;
    DWORD dwPhysLen;
    DWORD dwLaunchAddr;
    DWORD dwDbgSerPhysAddr;
    DWORD XmodemDefault;
    DWORD ConfigMagicNumber;
    DWORD dwStoreAddr;
    UINT16 RNDISMac[3];
    DWORD CheckSignatures;
//-------------------------------------------------------------------
    fDspRegVal tDspRegVal;  	
//-------------------------------------------------------------------
} EBOOT_CFG, *PEBOOT_CFG;

//------------------------------------------------------------------------------
// Enumerated type definitions. 
//
typedef enum
{
    ETH_DEVICE_PCMCIA0 = 0,
    ETH_DEVICE_PCMCIA1,
    ETH_DEVICE_SMSC,
    ETH_DEVICE_USB
} ETH_DEVICE_TYPE;

typedef enum
{
    IMAGE_TYPE_RAMIMAGE,
    IMAGE_TYPE_FLASHIMAGE,
    IMAGE_TYPE_BOOTLOADER
} IMAGE_TYPE, *PIMAGE_TYPE;
//------------------------------------------------------------------------------

#endif  // _LOADER_H_.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?