diff options
Diffstat (limited to 'arch/powerpc/cpu/ppc4xx')
-rw-r--r-- | arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c | 4 | ||||
-rw-r--r-- | arch/powerpc/cpu/ppc4xx/4xx_ibm_ddr2_autocalib.c | 3 | ||||
-rw-r--r-- | arch/powerpc/cpu/ppc4xx/Makefile | 29 | ||||
-rw-r--r-- | arch/powerpc/cpu/ppc4xx/cmd_ecctest.c | 6 | ||||
-rw-r--r-- | arch/powerpc/cpu/ppc4xx/config.mk | 5 | ||||
-rw-r--r-- | arch/powerpc/cpu/ppc4xx/start.S | 13 | ||||
-rw-r--r-- | arch/powerpc/cpu/ppc4xx/u-boot.lds | 53 |
7 files changed, 32 insertions, 81 deletions
diff --git a/arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c b/arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c index cf9d66d..9634deb 100644 --- a/arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c +++ b/arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c @@ -50,8 +50,6 @@ #include "ecc.h" -#if defined(CONFIG_SDRAM_PPC4xx_IBM_DDR2) - #define PPC4xx_IBM_DDR2_DUMP_REGISTER(mnemonic) \ do { \ u32 data; \ @@ -3194,5 +3192,3 @@ inline void ppc4xx_ibm_ddr2_register_dump(void) PPC4xx_IBM_DDR2_DUMP_REGISTER(RTSR); #endif /* defined(DEBUG) */ } - -#endif /* CONFIG_SDRAM_PPC4xx_IBM_DDR2 */ diff --git a/arch/powerpc/cpu/ppc4xx/4xx_ibm_ddr2_autocalib.c b/arch/powerpc/cpu/ppc4xx/4xx_ibm_ddr2_autocalib.c index e90c93e..b909fca 100644 --- a/arch/powerpc/cpu/ppc4xx/4xx_ibm_ddr2_autocalib.c +++ b/arch/powerpc/cpu/ppc4xx/4xx_ibm_ddr2_autocalib.c @@ -44,8 +44,6 @@ #include "ecc.h" -#if defined(CONFIG_PPC4xx_DDR_AUTOCALIBRATION) - /* * Only compile the DDR auto-calibration code for NOR boot and * not for NAND boot (NAND SPL and NAND U-Boot - NUB) @@ -1253,4 +1251,3 @@ u32 DQS_autocalibration(void) return 0; } #endif /* !defined(CONFIG_NAND_U_BOOT) && !defined(CONFIG_NAND_SPL) */ -#endif /* defined(CONFIG_PPC4xx_DDR_AUTOCALIBRATION) */ diff --git a/arch/powerpc/cpu/ppc4xx/Makefile b/arch/powerpc/cpu/ppc4xx/Makefile index fa8d10c..d97ca20 100644 --- a/arch/powerpc/cpu/ppc4xx/Makefile +++ b/arch/powerpc/cpu/ppc4xx/Makefile @@ -23,7 +23,7 @@ include $(TOPDIR)/config.mk -LIB = $(obj)lib$(CPU).a +LIB = $(obj)lib$(CPU).o START := resetvec.o START += start.o @@ -34,31 +34,27 @@ SOBJS += kgdb.o COBJS := 40x_spd_sdram.o +ifndef CONFIG_NAND_SPL +ifndef CONFIG_NAND_U_BOOT COBJS += 44x_spd_ddr.o -COBJS += 44x_spd_ddr2.o -ifdef CONFIG_PPC4xx_DDR_AUTOCALIBRATION -COBJS += 4xx_ibm_ddr2_autocalib.o endif +endif +COBJS-$(CONFIG_SDRAM_PPC4xx_IBM_DDR2) += 44x_spd_ddr2.o +COBJS-$(CONFIG_PPC4xx_DDR_AUTOCALIBRATION) += 4xx_ibm_ddr2_autocalib.o COBJS += 4xx_pci.o COBJS += 4xx_pcie.o COBJS += bedbug_405.o -ifdef CONFIG_CMD_CHIP_CONFIG -COBJS += cmd_chip_config.o -endif +COBJS-$(CONFIG_CMD_CHIP_CONFIG) += cmd_chip_config.o COBJS += cpu.o COBJS += cpu_init.o COBJS += denali_data_eye.o COBJS += denali_spd_ddr2.o COBJS += ecc.o -ifdef CONFIG_CMD_ECCTEST -COBJS += cmd_ecctest.o -endif +COBJS-$(CONFIG_CMD_ECCTEST) += cmd_ecctest.o COBJS += fdt.o COBJS += interrupts.o COBJS += iop480_uart.o -ifdef CONFIG_CMD_REGINFO -COBJS += reginfo.o -endif +COBJS-$(CONFIG_CMD_REGINFO) += reginfo.o COBJS += sdram.o COBJS += speed.o COBJS += tlb.o @@ -66,23 +62,22 @@ COBJS += traps.o COBJS += usb.o COBJS += usb_ohci.o COBJS += usbdev.o +COBJS-$(CONFIG_XILINX_440) += xilinx_irq.o ifndef CONFIG_XILINX_440 COBJS += 4xx_uart.o COBJS += gpio.o COBJS += miiphy.o COBJS += uic.o -else -COBJS += xilinx_irq.o endif SRCS := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c) -OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS)) +OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS) $(COBJS-y)) START := $(addprefix $(obj),$(START)) all: $(obj).depend $(START) $(LIB) $(LIB): $(OBJS) - $(AR) $(ARFLAGS) $@ $(OBJS) + $(call cmd_link_o_target, $(OBJS)) ######################################################################### diff --git a/arch/powerpc/cpu/ppc4xx/cmd_ecctest.c b/arch/powerpc/cpu/ppc4xx/cmd_ecctest.c index fd81b70..542ab69 100644 --- a/arch/powerpc/cpu/ppc4xx/cmd_ecctest.c +++ b/arch/powerpc/cpu/ppc4xx/cmd_ecctest.c @@ -190,15 +190,13 @@ static int do_ecctest(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) int error; if (argc < 3) { - cmd_usage(cmdtp); - return 1; + return cmd_usage(cmdtp); } ptr = (u32 *)simple_strtoul(argv[1], NULL, 16); error = simple_strtoul(argv[2], NULL, 16); if ((error < 1) || (error > 2)) { - cmd_usage(cmdtp); - return 1; + return cmd_usage(cmdtp); } printf("Using address %p for %d bit ECC error injection\n", diff --git a/arch/powerpc/cpu/ppc4xx/config.mk b/arch/powerpc/cpu/ppc4xx/config.mk index 5bda710..d862bb4 100644 --- a/arch/powerpc/cpu/ppc4xx/config.mk +++ b/arch/powerpc/cpu/ppc4xx/config.mk @@ -1,5 +1,5 @@ # -# (C) Copyright 2000 +# (C) Copyright 2000-2010 # Wolfgang Denk, DENX Software Engineering, wd@denx.de. # # See file CREDITS for list of people who contributed to this @@ -32,6 +32,3 @@ PLATFORM_CPPFLAGS += -Wa,-m440 -mcpu=440 else PLATFORM_CPPFLAGS += -Wa,-m405 -mcpu=405 endif - -# Use default linker script. Board port can override in board/*/config.mk -LDSCRIPT := $(SRCTREE)/arch/powerpc/cpu/ppc4xx/u-boot.lds diff --git a/arch/powerpc/cpu/ppc4xx/start.S b/arch/powerpc/cpu/ppc4xx/start.S index 65195f5..0e75794 100644 --- a/arch/powerpc/cpu/ppc4xx/start.S +++ b/arch/powerpc/cpu/ppc4xx/start.S @@ -1389,8 +1389,8 @@ in32r: relocate_code: #if defined(CONFIG_4xx_DCACHE) || defined(CONFIG_SYS_INIT_DCACHE_CS) /* - * We need to flush the initial global data (gd_t) before the dcache - * will be invalidated. + * We need to flush the initial global data (gd_t) and bd_info + * before the dcache will be invalidated. */ /* Save registers */ @@ -1398,10 +1398,11 @@ relocate_code: mr r10, r4 mr r11, r5 - /* Flush initial global data range */ - mr r3, r4 - addi r4, r4, GENERATED_GBL_DATA_SIZE@l - bl flush_dcache_range + /* + * Flush complete dcache, this is faster than flushing the + * ranges for global_data and bd_info instead. + */ + bl flush_dcache #if defined(CONFIG_SYS_INIT_DCACHE_CS) /* diff --git a/arch/powerpc/cpu/ppc4xx/u-boot.lds b/arch/powerpc/cpu/ppc4xx/u-boot.lds index eca1f9d..dac0e5b 100644 --- a/arch/powerpc/cpu/ppc4xx/u-boot.lds +++ b/arch/powerpc/cpu/ppc4xx/u-boot.lds @@ -27,8 +27,7 @@ #endif OUTPUT_ARCH(powerpc) -/* Do we need any of these for elf? - __DYNAMIC = 0; */ + PHDRS { text PT_LOAD; @@ -39,43 +38,16 @@ SECTIONS { /* Read-only sections, merged into text segment: */ . = + SIZEOF_HEADERS; - .interp : { *(.interp) } - .hash : { *(.hash) } - .dynsym : { *(.dynsym) } - .dynstr : { *(.dynstr) } - .rel.text : { *(.rel.text) } - .rela.text : { *(.rela.text) } - .rel.data : { *(.rel.data) } - .rela.data : { *(.rela.data) } - .rel.rodata : { *(.rel.rodata) } - .rela.rodata : { *(.rela.rodata) } - .rel.got : { *(.rel.got) } - .rela.got : { *(.rela.got) } - .rel.ctors : { *(.rel.ctors) } - .rela.ctors : { *(.rela.ctors) } - .rel.dtors : { *(.rel.dtors) } - .rela.dtors : { *(.rela.dtors) } - .rel.bss : { *(.rel.bss) } - .rela.bss : { *(.rela.bss) } - .rel.plt : { *(.rel.plt) } - .rela.plt : { *(.rela.plt) } - .init : { *(.init) } - .plt : { *(.plt) } .text : { - *(.text) - *(.got1) + *(.text*) } :text _etext = .; PROVIDE (etext = .); .rodata : { - *(.eh_frame) *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } :text - .fini : { *(.fini) } =0 - .ctors : { *(.ctors) } - .dtors : { *(.dtors) } /* Read-write section, merged into data segment: */ . = (. + 0x00FF) & 0xFFFFFF00; @@ -83,23 +55,19 @@ SECTIONS PROVIDE (erotext = .); .reloc : { - *(.got) + KEEP(*(.got)) _GOT2_TABLE_ = .; - *(.got2) + KEEP(*(.got2)) _FIXUP_TABLE_ = .; - *(.fixup) + KEEP(*(.fixup)) } __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2; __fixup_entries = (. - _FIXUP_TABLE_) >> 2; .data : { - *(.data) - *(.data1) - *(.sdata) - *(.sdata2) - *(.dynamic) - CONSTRUCTORS + *(.data*) + *(.sdata*) } _edata = .; PROVIDE (edata = .); @@ -138,7 +106,7 @@ SECTIONS .resetvec RESET_VECTOR_ADDRESS : { - *(.resetvec) + KEEP(*(.resetvec)) } :text = 0xffff . = RESET_VECTOR_ADDRESS + 0x4; @@ -157,9 +125,8 @@ SECTIONS __bss_start = .; .bss (NOLOAD) : { - *(.sbss) *(.scommon) - *(.dynbss) - *(.bss) + *(.bss*) + *(.sbss*) *(COMMON) } :bss |