#ifndef _FLASHER_H_ #define _FLASHER_H_ #include "defs.h" /* FLASHER version number */ #define FLASHER_VERSION_STRING "1.00" #define FLASHER_FLASH_TYPE "NOR" /* Used by FLASHER when doing UART boot */ #define FLASHER_MAGIC_NOR_RESTORE (0xA1ACED77) /* Download via UART & Restore NOR with binary data */ #define FLASHER_MAGIC_NOR_GLOBAL_ERASE (0xA1ACEDAA) /* Download via UART & Global erase the NOR Flash*/ /* Define UBL image size */ #define UBL_IMAGE_SIZE (0x00003800) /* Define maximum downloadable image size */ #define MAX_IMAGE_SIZE (0x02000000) /* Set details of RAM */ #define RAM_START_ADDR (0x80000000) #define RAM_END_ADDR (0x8FFFFFFF) typedef struct { uint32_t magicNum; /* Expected magic number */ uint32_t entryPoint; /* Entry point of the user application */ uint32_t numPage; /* Number of pages where boot loader is stored */ uint32_t block; /* starting block number where User boot loader is stored */ uint32_t page; /* starting page number where boot-loader is stored */ uint32_t ldAddress; /* Starting RAM address where image is to copied - XIP Mode */ } NAND_BOOT; typedef struct { uint32_t magicNum; uint32_t entryPoint; uint32_t appSize; uint32_t ldAddress; /* Starting RAM address where image is to copied - XIP Mode */ } NOR_BOOT; /*************************************************************** Function prototypes ***************************************************************/ /* * boot() has naked attribute (doesn't save registers since it is the entry point * out of boot and it doesn't have an exit point). This setup requires * that the gnu compiler uses the -nostdlib option. */ void boot( void ) __attribute__((naked,section (".boot"))); int32_t main(void); #endif /* _FLASHER_H_ */