Skip to contentSkip to conversation

MPC8567 - TEXT BASE boot rom question... Half the message was missing.. trying again..

U-Boot Bob Winslow 2 participants 5 messages Dec 11, 2009

lore
Share & tools
lore
#0 lore raw

Hi all,

MPC8567 u-boot question for the experts out there...

I must be doing something stupid, or I just don't understand how the 8567 boots from rom..., law entries, tables, etc...

Our board is using a MPC8567 with a 4 MEGByte boot rom flash (16 bit).... It has just 512MB of DDR2 memory(no ram on
the local bus). I can get u-boot to come up to the prompt ok but only
with a rom image(u-boot.bin) of 4MEG BYTE size and
the settings in the files, see below. I am using the BDI to write the 4meg image to the rom.

I guess I don't understand TEXT_BASE very well.. and how it relates to the boot location:

#1 lore raw
Quoted 7 lines · Bob Winslow

I guess I don't understand TEXT_BASE very well.. and how it relates to the boot location:

From the manual:
4.4.3.3 Boot ROM Location
The MPC8568E defines the default boot ROM address range
to be 8 Mbytes at address 0x0_FF80_0000

Quoted 8 lines
                to 0x0_FFFF_FFFF. However, which peripheral interface

handles these boot ROM accesses can be
selected at power on.

What do I need to change to get a uboot image for the rom of reasonable size(say 512k instead of the 4meg)??? I have tried to change the value of TEXT_BASE to (xFFF8_0000) in the config.mk file(and other entries) but I must not be doing something else right..

What specifically happened when you tried changing TEXT_BASE?

Quoted 4 lines

Any
suggestions/help would
be greatly appreciated!! Am I writng the u-boot.bin to the wrong
location in the flash when it is 512k?

You should write it to the end of flash.

Quoted 10 lines

Below is the relevant info from the files I think:

Thanks for your help in advance!

Bob

*********** config.mk file

TEXT_BASE = 0xffc00000

The size of your image is going to be RESET_VECTOR_ADDRESS - TEXT_BASE +
4. Note that TEXT_BASE/RESET_VECTOR_ADDRESS should be set to the appropriate offset from where u-boot puts the flash. This isn't necessarily where the hardware maps the flash on power-on, though from your board config it doesn't look like you move it.

Quoted 11 lines

********** from the include/configs/sevis8567.h file

/*
* Base addresses -- Note these are effective addresses where the
* actual resources get mapped (not physical addresses) */
#define CONFIG_SYS_CCSRBAR_DEFAULT 0xff700000 /* CCSRBAR
Default */
#define CONFIG_SYS_CCSRBAR 0xe0000000 /* relocated
CCSRBAR */
#define CONFIG_SYS_CCSRBAR_PHYS CONFIG_SYS_CCSRBAR /* physical addr

Quoted 8 lines

of CCSRBAR */
#define CONFIG_SYS_IMMR CONFIG_SYS_CCSRBAR /* PQII uses
CONFIG_SYS_IMMR */
#define CONFIG_SYS_DDR_SDRAM_BASE 0x00000000 /* DDR is system
memory*/
#define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_SDRAM_BASE
#define CONFIG_SYS_FLASH_BASE 0xfe000000 /* start of
FLASH 8M */

4M flash or 8M?

Quoted 5 lines

#define CONFIG_SYS_LBC_FLASH_BASE CONFIG_SYS_FLASH_BASE

/*Chip select 0 - Flash*/
#define CONFIG_SYS_BR0_PRELIM 0xfe001001
#define CONFIG_SYS_OR0_PRELIM 0xfe006ff7

This is configuring the flash window for 32M... It should be harmless, though -- the flash contents should just repeat within that window.

Quoted 10 lines

**************** from board/sevis/law.c

struct law_entry law_table[] = {
        SET_LAW(CONFIG_SYS_DDR_SDRAM_BASE, LAW_SIZE_512M, LAW_TRGT_IF_DDR),

        /* LBC window  */
        SET_LAW(CONFIG_SYS_LBC_CPLD_BASE,  LAW_SIZE_16M, LAW_TRGT_IF_LBC),
        SET_LAW(CONFIG_SYS_LBC_E1_IF_BASE, LAW_SIZE_16M, LAW_TRGT_IF_LBC),
        SET_LAW(CONFIG_SYS_LBC_DSP_BASE,   LAW_SIZE_16M, LAW_TRGT_IF_LBC),
        SET_LAW(CONFIG_SYS_LBC_FPGA_BASE,  LAW_SIZE_16M, LAW_TRGT_IF_LBC),
        SET_LAW(CONFIG_SYS_LBC_FLASH_BASE, LAW_SIZE_16M, LAW_TRGT_IF_LBC),

This looks like a problem -- you're setting the flash LAW to be only 16M, but the window is 32M... Either change TEXT_BASE/RESET_VECTOR_ADDRESS to be within the LAW, or extend/move the LAW.

-Scott

#2 lore raw

Thanks Scott, that helped alot... i think I understand a bit more..

Quoted 5 lines
Quoted 3 lines

I have tried to change the value of TEXT_BASE to (xFFF8_0000) in the
config.mk file(and other
entries) but I must not be doing something else right..

What specifically happened when you tried changing TEXT_BASE?

ok, I set TEXT_BASE to 0xFFF8_000 and it creates the 512kB u-boot.bin image just fine...

Quoted 3 lines

You should write it to the end of flash.

Yep, I think that was my issue all along.. I was always writing images to the beginning of the flash..
If I write the file to the last 512KB of the flash, it boots fine now...

Quoted 11 lines

The size of your image is going to be RESET_VECTOR_ADDRESS - TEXT_BASE
+ 4. Note that TEXT_BASE/RESET_VECTOR_ADDRESS should be set to the appropriate offset from where u-boot puts the flash. This isn't necessarily where the hardware maps the flash on power-on, though from your board config it doesn't look like you move it.

Quoted 3 lines

#define CONFIG_SYS_FLASH_BASE 0xfe000000 /* start of
FLASH 8M */

4M flash or 8M?

yep it is just 4M... I moved the BASE to 0xFFC0_0000 and will correct comments.. (wasn't worried about comments yet...)

Quoted 9 lines
Quoted 5 lines

#define CONFIG_SYS_LBC_FLASH_BASE CONFIG_SYS_FLASH_BASE

/*Chip select 0 - Flash*/
#define CONFIG_SYS_BR0_PRELIM 0xfe001001
#define CONFIG_SYS_OR0_PRELIM 0xfe006ff7

This is configuring the flash window for 32M... It should be harmless, though -- the flash contents should just repeat within that window.

Changed these to 0xFFCxxxxxxx so it is just 4M now...

Quoted 7 lines
Quoted 2 lines

SET_LAW(CONFIG_SYS_LBC_FLASH_BASE, LAW_SIZE_16M,
LAW_TRGT_IF_LBC),

This looks like a problem -- you're setting the flash LAW to be only 16M, but the window is 32M... Either change TEXT_BASE/RESET_VECTOR_ADDRESS to be within the LAW, or extend/move the LAW.

Flash base is at 0xFFC0_0000 now, so I changed it to 4M law size...

with these changes, it seems to work just fine if I put the u-boot image in the last 512kB of the 4M flash..... which is great, thanks!!

Is it possible to change TEXT_BASE and RESET_VECTOR_ADDRESS in such a way that I can put the 512kB uboot image at the
beginning of the 4M flash instead of the end??

Bob

#3 lore raw
Quoted 3 lines · Bob Winslow

Is it possible to change TEXT_BASE and RESET_VECTOR_ADDRESS in such a way that I can put the 512kB uboot image at the
beginning of the 4M flash instead of the end??

I don't think so -- the reset vector is fixed at 0xfffffffc, which will map to the last word of flash.

-Scott

#4 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line

I don't think so -- the reset vector is fixed at 0xfffffffc, which

will map to the last word of flash.

ok, understood. thanks again for the help!

Bob