source: trunk/tools/wrt350nv2-builder/src/upgrade.h

Last change on this file was 18761, checked in by nbd, 7 years ago

add wrt350n v2 image building code from #5970 (thx, maddes)

File size: 2.2 KB
Line 
1#ifndef _UPGRADE_H_
2#define _UPGRADE_H_
3
4#define FLASH_END_ADDR       0xffffffff
5#define FLASH_ADDR_BASE      0xff800000
6#define BOOT_ADDR_BASE                   0xfffc0000
7#define BOOT_ADDR_BASE_OFF   0x7c0000
8#define FLASH_SIZE           0x800000
9#define BOOT_SIZE            0x40000
10//NVRAM in boot area
11//#define NVRAM_ADDR_BASE      0xfff90000
12//#define NVRAM_ADDR_BASE_OFF  0x790000
13//#define NVRAM_SIZE           0x10000
14
15#define PID_OFFSET         (BOOT_SIZE- 0x46)
16#define NODE_ADDRESS       (BOOT_SIZE-0x60)
17#define NODE_BASE_OFF   (FLASH_SIZE-0x60)
18#define PIN_ADDRESS         (BOOT_SIZE-0x70)//WPS PIN,8bytes
19#define PIN_OFF                                 (FLASH_SIZE-0x70)
20#define KERNEL_CODE_OFFSET      0         
21#define SN_ADDRESS (BOOT_SIZE-0x80) //12bytes
22#define SN_OFF (FLASH_SIZE-0x80)
23
24
25#define UPGRADE_START_OFFSET  0
26#define UPGRADE_END_OFFSET    0x7A0000
27#define PRODUCT_ID_OFFSET     0x75ffe0//(UPGRADE_END_OFFSET  - 0x10)
28#define PROTOCOL_ID_OFFSET   (PRODUCT_ID_OFFSET + 0x02)
29#define FW_VERSION_OFFSET    (PRODUCT_ID_OFFSET + 0x04)
30#define SIGN_OFFSET          (PRODUCT_ID_OFFSET + 0x08)   /* eRcOmM */
31
32//#define LANG_UPGRADE
33#ifdef LANG_UPGRADE
34#define LANGBUF_BEGIN   0x1300000
35#define LANGBUF_END     0x1f00000
36#define LANGBUF_LENTH   (LANGBUF_END - LANGBUF_BEGIN)
37#endif
38#ifndef ERROR
39#define ERROR -1
40#endif
41
42#ifndef OK
43#define OK 0
44#endif
45
46#ifndef NULL
47#define NULL 0
48#endif
49
50
51void do_boot(void);
52void Download(void);
53void Assign(void);
54
55void gpio_init(void);
56void Led_Power(int value);
57void Led_security(int value);
58int PushButton(void);
59
60static unsigned short xchg ( unsigned short dwData);
61int FlashDriver(unsigned long dlAddress,unsigned char *dbData,unsigned long dlLength,unsigned long dlFlag);
62int ProgramChip(unsigned long dlAddress,unsigned char * dbData,unsigned long dlLength);
63int dl_Initialize(void);
64void dl_GetAddr(unsigned char *node);
65int dl_Receive(void);
66int dl_Transmit(char *buf,int len);
67void reset(void);
68void AssignHWAddress(unsigned char *psBuffer);
69int ResetChip(unsigned long ulRomDstAddr);
70int GetFlashType(void);
71
72#ifdef LANG_UPGRADE
73int save_lang_buf(unsigned long flash_addr, char *mem_addr,unsigned long length);
74int LangDriver(unsigned long flash_addr, char *mem_addr,unsigned long length, unsigned long dlFlag);
75#endif
76#endif
77
Note: See TracBrowser for help on using the repository browser.