|
发表于 2010-4-28 17:08:44
|
显示全部楼层
看了下代码,根据硬件配置的地址应该是INTERNAL_MEM_MAP_ADDR,然后在rominit.s里面通过INTERNAL_MEM_MAP_ADDR配置BR、OR
/*
* Internal Memory Map base Address calculation
*
* If config.h has IMMAP_REMAP defined, then the internal mamory map
* is defined to be 0x04700000, as defined in the ADS8266-PCI manual.
*
* Otherwise the memory map is defined by the Hard Reset Configuration Word
* and must be determined by looking at bits 13:15 of the configuration word.
* Bits 13:15 are bits 5:7 of the second byte of the config word: HRCW_BYTE_1
*/
#if ((HRCW_BYTE_1 & 0x07) == 0)
# define RST_INTERNAL_MEM_MAP_ADDR 0x00000000
#elif ((HRCW_BYTE_1 & 0x07) == 1)
# define RST_INTERNAL_MEM_MAP_ADDR 0x00F00000
#elif ((HRCW_BYTE_1 & 0x07) == 2)
# define RST_INTERNAL_MEM_MAP_ADDR 0x0F000000
#elif ((HRCW_BYTE_1 & 0x07) == 3)
# define RST_INTERNAL_MEM_MAP_ADDR 0x0FF00000
#elif ((HRCW_BYTE_1 & 0x07) == 4)
# define RST_INTERNAL_MEM_MAP_ADDR 0xF0000000
#elif ((HRCW_BYTE_1 & 0x07) == 5)
# define RST_INTERNAL_MEM_MAP_ADDR 0xF0F00000
#elif ((HRCW_BYTE_1 & 0x07) == 6)
# define RST_INTERNAL_MEM_MAP_ADDR 0xFF000000
#elif ((HRCW_BYTE_1 & 0x07) == 7)
# define RST_INTERNAL_MEM_MAP_ADDR 0xFFF00000
#endif
#if defined (IMMAP_REMAP)
# define INTERNAL_MEM_MAP_ADDR 0x04700000 /* defined by bsp */
#else
# define INTERNAL_MEM_MAP_ADDR RST_INTERNAL_MEM_MAP_ADDR
#endif
/* load the base register 0 */
lis r5, HIADJ (ROM_BASE_ADRS | 0x00000801)
addi r5, r5, LO (ROM_BASE_ADRS | 0x00000801)
lis r6, HIADJ (M8260_BR0 (INTERNAL_MEM_MAP_ADDR))
addi r6, r6, LO (M8260_BR0 (INTERNAL_MEM_MAP_ADDR))
/* load the option register 0 */
stw r5, 0(r6) |
|