From 858290178f222d998b6425d85cf06822467918f3 Mon Sep 17 00:00:00 2001 From: Peter Tyser Date: Mon, 21 Sep 2009 11:20:25 -0500 Subject: ppc: Enable full relocation to RAM The following changes allow U-Boot to fully relocate from flash to RAM: - Remove linker scripts' .fixup sections from the .text section - Add -mrelocatable to PLATFORM_RELFLAGS for all boards - Define CONFIG_RELOC_FIXUP_WORKS for all boards Previously, U-Boot would partially relocate, but statically initialized pointers needed to be manually relocated. Signed-off-by: Peter Tyser --- board/freescale/mpc7448hpc2/u-boot.lds | 1 - board/freescale/mpc8610hpcd/u-boot.lds | 1 - board/freescale/mpc8641hpcn/u-boot.lds | 1 - 3 files changed, 3 deletions(-) (limited to 'board/freescale') diff --git a/board/freescale/mpc7448hpc2/u-boot.lds b/board/freescale/mpc7448hpc2/u-boot.lds index cd11f3939..247779f6c 100644 --- a/board/freescale/mpc7448hpc2/u-boot.lds +++ b/board/freescale/mpc7448hpc2/u-boot.lds @@ -63,7 +63,6 @@ SECTIONS /* common/env_embedded.o(.text) */ *(.text) - *(.fixup) *(.got1) } _etext = .; diff --git a/board/freescale/mpc8610hpcd/u-boot.lds b/board/freescale/mpc8610hpcd/u-boot.lds index 5cc88aeea..b573807fe 100644 --- a/board/freescale/mpc8610hpcd/u-boot.lds +++ b/board/freescale/mpc8610hpcd/u-boot.lds @@ -61,7 +61,6 @@ SECTIONS lib_ppc/extable.o (.text) lib_generic/zlib.o (.text) *(.text) - *(.fixup) *(.got1) } _etext = .; diff --git a/board/freescale/mpc8641hpcn/u-boot.lds b/board/freescale/mpc8641hpcn/u-boot.lds index e18872202..2b98b5a9c 100644 --- a/board/freescale/mpc8641hpcn/u-boot.lds +++ b/board/freescale/mpc8641hpcn/u-boot.lds @@ -62,7 +62,6 @@ SECTIONS lib_generic/zlib.o (.text) drivers/bios_emulator/atibios.o (.text) *(.text) - *(.fixup) *(.got1) } _etext = .; -- cgit v1.2.3 From b32a894011b1436758905fa10e6a03b8539c43c9 Mon Sep 17 00:00:00 2001 From: Peter Tyser Date: Mon, 21 Sep 2009 11:20:28 -0500 Subject: ppc: Remove pci config table pointer relocation fixups Signed-off-by: Peter Tyser --- board/freescale/mpc8548cds/mpc8548cds.c | 7 ------- board/mpl/common/pci.c | 18 ------------------ 2 files changed, 25 deletions(-) (limited to 'board/freescale') diff --git a/board/freescale/mpc8548cds/mpc8548cds.c b/board/freescale/mpc8548cds/mpc8548cds.c index 80de6f876..73e7c2109 100644 --- a/board/freescale/mpc8548cds/mpc8548cds.c +++ b/board/freescale/mpc8548cds/mpc8548cds.c @@ -276,7 +276,6 @@ pci_init_board(void) { volatile ccsr_fsl_pci_t *pci = (ccsr_fsl_pci_t *) CONFIG_SYS_PCI1_ADDR; struct pci_controller *hose = &pci1_hose; - struct pci_config_table *table; struct pci_region *r = hose->regions; uint pci_32 = gur->pordevsr & MPC85xx_PORDEVSR_PCI1_PCI32; /* PORDEVSR[15] */ @@ -312,12 +311,6 @@ pci_init_board(void) PCI_REGION_IO); hose->region_count = r - hose->regions; - /* relocate config table pointers */ - hose->config_table = \ - (struct pci_config_table *)((uint)hose->config_table + gd->reloc_off); - for (table = hose->config_table; table && table->vendor; table++) - table->config_device += gd->reloc_off; - hose->first_busno=first_free_busno; fsl_pci_init(hose, (u32)&pci->cfg_addr, (u32)&pci->cfg_data); diff --git a/board/mpl/common/pci.c b/board/mpl/common/pci.c index e0ba620d1..f9bb6ab2b 100644 --- a/board/mpl/common/pci.c +++ b/board/mpl/common/pci.c @@ -94,29 +94,11 @@ static struct pci_controller hose = { }; -static void reloc_pci_cfg_table(struct pci_config_table *table) -{ - unsigned long addr; - - for (; table && table->vendor; table++) { - addr = (ulong) (table->config_device) + gd->reloc_off; -#ifdef DEBUG - printf ("device \"%d\": 0x%08lx => 0x%08lx\n", - table->device, (ulong) (table->config_device), addr); -#endif - table->config_device = - (void (*)(struct pci_controller* hose, pci_dev_t dev, - struct pci_config_table *))addr; - table->priv[0]+=gd->reloc_off; - } -} - void pci_init_board(void) { /*we want the ptrs to RAM not flash (ie don't use init list)*/ hose.fixup_irq = pci_pip405_fixup_irq; hose.config_table = pci_pip405_config_table; - reloc_pci_cfg_table(hose.config_table); #ifdef DEBUG printf("Init PCI: fixup_irq=%p config_table=%p hose=%p\n",pci_pip405_fixup_irq,pci_pip405_config_table,hose); #endif -- cgit v1.2.3