u-boot porting problem (Execution after code relocated to sdram)
Hi ,
In u-boot porting, i am facing a problem.
Here after the relocation of the code to the sdram, the code is
executed from sdram,
at some point we have to do the pci initialization. so we are storing
the configuration
function in a structure based on the device we want to configure. I am
able to detect
the device. After dectecting device, when the configuration function
if being called,
the flash address is loaded and control is jumping it to flash address. At that flash address there is no valid code, but "uboot.dis"
disassemble file shows the
valid code at that address.
Shouldn't the control jump to relocated sdram address of the
configuration function ?
--------------------------------------------------------------
File: drivers/pci.c
In pci_hose_scan_bus()
if (cfg) {
cfg->config_device(hose, dev, cfg);
#ifdef CONFIG_PCI_PNP
} else {
int n = pciauto_config_device(hose, dev);
sub_bus = max(sub_bus, n);#endif
--------------------------------------------------------------
In my board related file:
static struct pci_config_table pci_tb0286_config_table[] = {
{ 0x126F, 0x0501, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,PCI_ANY_ID,
pci_cfgfunc_config_device, { PCI_ENET0_IOADDR,
PCI_ENET0_MEMADDR, PCI_COMMAND_MEMORY |PCI_COMMAND_MASTER }},
{ }
};
---------------------------------------------------------------
Please provide your feedback on this.
Thanks & Regards
Robin
Quoted 1 line · In message <[email protected]> you wrote:
...
Quoted 3 lines
at some point we have to do the pci initialization. so we are storing
the configuration
function in a structure based on the device we want to configure. I am
...
So you have static function pointers.
Quoted 2 lines
Shouldn't the control jump to relocated sdram address of the
configuration function ?
Yes, it should. but thus relocation has to be done manually. See for example the code to relocate the command table in board_init_r().
Best regards,
Wolfgang Denk
Signature · 4 lines
Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "The great question... which I have not been able to answer... is, `What does woman want?'" - Sigmund Freud