From mboxrd@z Thu Jan 1 00:00:00 1970 From: Albert ARIBAUD Date: Sun, 30 Jan 2011 23:07:09 +0100 Subject: [U-Boot] calling pci_init before relocation? In-Reply-To: <4D45DA9F.5000903@discworld.dascon.de> References: <4D45DA9F.5000903@discworld.dascon.de> Message-ID: <4D45E10D.4020302@free.fr> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Michael, Le 30/01/2011 22:39, Michael Schwingen a ?crit : > Hi, > > ist it allowed to call pci_init before relocation? > > The code looks like this is not supposed to happen. However, on ARM, > arm_pci_init (which calls pci_init in turn) is called from > init_sequence, which happens before relocation. > > Am I overlooking some way in which this can actually work? Are there > boards using this? > > If I move pci_init down into board_init_r, I can get PCI working on > IXP42x, but I am worried if this will cause problems on other boards. I cannot see a reason why pci_init should not work before relocation as long as it does not read or write BSS variables or write non-const initialized data -- or overflow the (admittedly limited) C stack. Are you asking because you discovered that pci_init does not work when called from board_init_f? If so, did you determine exactly what goes wrong? > cu > Michael Amicalement, -- Albert.