📄 loader.h
字号:
//------------------------------------------------------------------------------
//
// Copyright (C) 2004, Motorola Inc. All Rights Reserved
//
//-----------------------------------------------------------------------------
//
// Copyright (C) 2004, Freescale Semiconductor, Inc. All Rights Reserved
// THIS SOURCE CODE IS CONFIDENTIAL AND PROPRIETARY AND MAY NOT
// BE USED OR DISTRIBUTED WITHOUT THE WRITTEN PERMISSION OF
// FREESCALE SEMICONDUCTOR, INC.
//
//-----------------------------------------------------------------------------
//
// Header: loader.h
//
// Provides Definitions for EBOOT.
//
//------------------------------------------------------------------------------
#ifndef __SRC_BOOTLOADER_EBOOT_LOADER_H
#define __SRC_BOOTLOADER_EBOOT_LOADER_H
//------------------------------------------------------------------------------
// INCLUDE FILES
//------------------------------------------------------------------------------
#include <halether.h>
#include "bsp.h"
#define NAND_BOOT_SUPPORT 1
//------------------------------------------------------------------------------
// MACRO DEFINITIONS
//------------------------------------------------------------------------------
// Revision information displayed on debug serial output
#define EBOOT_VERSION_MAJOR 0
#define EBOOT_VERSION_MINOR 1
// Magic number
// If stored magic number is different from this, configuration will be
// restored to default.
#define EbootCFGMagicNumber (EBOOT_VERSION_MAJOR << 8 | EBOOT_VERSION_MINOR)
// Platform String
#define PLATFORM_STRING "MX31"
#define EDBG_CPUID EDBG_CPU_ARM720
#define DELETE_CHAR { OEMWriteDebugByte(0x08); OEMWriteDebugByte(0xFF); OEMWriteDebugByte(0x08);}
// Flash and Ram addres defines
#define FLASH_CVBASE (DWORD)IMAGE_EBOOT_CODE_CA_START
#define RAM_PBASE (DWORD)IMAGE_BOOT_RAM_PA_START
#define RAM_CVBASE (DWORD)OALPAtoVA(RAM_PBASE, TRUE)
// Execution offset from sdram base address
#define EBOOT_IMAGE_SIZE IMAGE_EBOOT_CODE_SIZE
#define EBOOT_RAM_IMAGE_OFFSET 0x00040000
#define EBOOT_RAM_IMAGE_START (RAM_CVBASE + EBOOT_RAM_IMAGE_OFFSET)
#define EBOOT_FLASH_IMAGE_START (FLASH_CVBASE)
// OS image defines
#define OS_FLASH_IMAGE_START (EBOOT_FLASH_IMAGE_START + EBOOT_IMAGE_SIZE)
#define OS_RAM_IMAGE_START IMAGE_WINCE_CODE_RAM_CA_START
// Temporary storage for image to be flashed
#define EBOOT_FCACHE_OFFSET 0x00100000
#define EBOOT_FCACHE_START (RAM_CVBASE + EBOOT_FCACHE_OFFSET)
// NAND Loader defines
#define EBOOT_NANDLOADER_VER_MIN 0x0000
#define EBOOT_NANDLOADER_VER_MAJ 0x0001
#define EBOOT_NANDLOADER_SIG 0x4E414E44 // NAND
#ifdef __cplusplus
extern "C" {
#endif
//------------------------------------------------------------------------------
// ENUMERATIONS AND STRUCTURES
//------------------------------------------------------------------------------
// The BOOT_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 WORDS. Pad the structure if necessary.
// Add new members at the end. Also remember to increment the EBOOT version
// numbers.
typedef struct
{
UINT32 IP;
UINT32 subnetMask;
UINT32 dwLaunchAddr;
UINT16 ConfigMagicNumber;
UINT16 configFlags;
} EBOOT_CFG;
typedef struct
{
DWORD ConfigMagicNumber;
DWORD dwLaunchAddr;
DWORD dwRegionStart;
DWORD dwRegionLength;
DWORD dwImageOffset;
DWORD dwChainStart;
DWORD dwChainLength;
DWORD dwChainOffset;
} EBOOT_NANDCFG;
//------------------------------------------------------------------------------
// FUNCTION PROTOTYPES
//------------------------------------------------------------------------------
Launch(DWORD dwLaunchAddr);
// Ethernet support functions
void InitEthDevice(void);
BOOL OEMEthHardwareInit(BSP_ARGS *pBSPArgs, EDBG_ADDR *pMyAddr);
// Nand boot support functions
BOOL InitPartitionMgr(void);
void DeinitPartitionMgr(void);
BOOL WriteRegionsToNand(BOOT_CFG *pBootCfg);
BOOL ReadKernelRegionFromNand(BOOT_CFG *pBootCfg);
BOOL NandFlashMenu(BOOT_CFG *pBootCfg, BOOL *CFGChanged);
BOOL IsNandDevicePresent(void);
void SpinForever(void);
//------------------------------------------------------------------------------
// EXTERN DECLARATIONS
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// CLASS DEFINITIONS
//------------------------------------------------------------------------------
#ifdef __cplusplus
}
#endif
#endif /* __SRC_BOOTLOADER_EBOOT_LOADER_H */
//------------------------------------------------------------------------------
// END OF FILE
//------------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -