I am trying to boot my MPC8309 custom board with NOR Flash with same memory map as referenced in MPC8309twr.
The above memory map is given in the TWR-MPC8309_Linux_BSP_User_Manual.pdf.
so i have programmed u-boot.bin to its location 0xFE00_0000(NOR Flash base address) and later programmed the QE-ucode to its location 0xFE7E_0000.
what i was expected is u-boot has to be executed from its location 0xFE000000, but it doesn't boot.
so after again i studied the MPC8309RM.pdf(Refernce Manual) here i got doubt in BMS bit in RCWHR.
BMS defines the initial value of the e300 core MSR[IP] bit, which specifies the location of the interrupt
vectors (including the hard reset exception vector). The device defines the default boot ROM memory
space to be 8 Mbytes at addresses 0x0000_0000 to 0x007F_FFFF or 0xFF80_0000 to 0xFFFF_FFFF.
When the core comes out of reset, if it is enabled to boot, it fetches boot code from one of two addresses,
0x0000_0100 or 0xFFF0_0100, and exceptions are vectored to the physical addresses, 0x000n_nnnn or
0xFFFn_nnnn appropriately. This bit specifies whether an interrupt vector offset is prepended with 0xFFF
or 0x000. In the description below, n_nnnn is the offset of the exception vector.
According to my preset values of CFG_RESET_SOURCE[0:3]=1000
RCWLR [0:31] = 0x42040003 & RCWHR [0:31] = 0xA460000
so i decoded this and i got '1' in BMS bit, according to BMS bit1 the boot code will be fetched from 0xFFF0_0100.
I again programmed the u-boot.bin at 0xFFF0_0000 location without erasing the previous programmed u-boot sectors(0xFE00_0000 - 0xFE09_FFFF) and my board gets up and i am able to load the kernel and mount my file system and it works fine(now uboot is at two locations in flash).
later i erased the previously programmed uboot sectors to confirm that the boot code is executed from 0xFFF0_0000 ad restarted the board, again the board stops booting. so i have loaded the u-boot.bin again to 0xFE00_0000 location then the board gets up. I dont understand that when boot code(u-boot) is present at two location then only board gets up otherwise it is not getting up and i have checked with md command in MPC8309twr reference board( here i have boot code in only at flash base address) but in my custom board the boot code is present at two locations(at flash base address & 0xFFF0_0000).
** i am justifying the board gets up by checking the uboot console prints.
If any one know the boot procedure that where the core fetches the boot code & where exactly the boot code has to be placed in Flash, please share me some information.