From 6c0bf27d74510d1d7fac9208e766eae8efac2592 Mon Sep 17 00:00:00 2001 From: Jason Jin Date: Mon, 22 Aug 2011 17:24:45 +0800 Subject: ColdFire: Cleanup for partial linking and --gc-sections Introduce the --gc-sections for ColdFire platform and clean up the corresponding lds file. Signed-off-by: TsiChung Liew Signed-off-by: Jason Jin --- board/freescale/m5253demo/u-boot.lds | 65 ++++++------------------------------ 1 file changed, 11 insertions(+), 54 deletions(-) (limited to 'board/freescale/m5253demo') diff --git a/board/freescale/m5253demo/u-boot.lds b/board/freescale/m5253demo/u-boot.lds index 3644838..cbd2831 100644 --- a/board/freescale/m5253demo/u-boot.lds +++ b/board/freescale/m5253demo/u-boot.lds @@ -22,52 +22,18 @@ */ OUTPUT_ARCH(m68k) -/* Do we need any of these for elf? - __DYNAMIC = 0; */ + 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 : { - /* WARNING - the following is hand-optimized to fit within */ - /* the sector layout of our flash chips! XXX FIXME XXX */ - - arch/m68k/cpu/mcf52x2/start.o (.text) - arch/m68k/lib/traps.o (.text) - arch/m68k/cpu/mcf52x2/interrupts.o (.text) - common/dlmalloc.o (.text) - lib/zlib.o (.text) + arch/m68k/cpu/mcf52x2/start.o (.text*) . = DEFINED(env_offset) ? env_offset : .; - common/env_embedded.o (.text) + common/env_embedded.o (.text*) - - *(.text) - *(.fixup) - *(.got1) + *(.text*) } _etext = .; PROVIDE (etext = .); @@ -75,9 +41,6 @@ SECTIONS { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } - .fini : { *(.fini) } =0 - .ctors : { *(.ctors) } - .dtors : { *(.dtors) } /* Read-write section, merged into data segment: */ . = (. + 0x00FF) & 0xFFFFFF00; @@ -87,24 +50,20 @@ SECTIONS .reloc : { __got_start = .; - *(.got) + KEEP(*(.got)) __got_end = .; _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 = .); @@ -114,7 +73,6 @@ SECTIONS .u_boot_cmd : { *(.u_boot_cmd) } __u_boot_cmd_end = .; - . = .; __start___ex_table = .; __ex_table : { *(__ex_table) } @@ -131,9 +89,8 @@ SECTIONS .bss : { _sbss = .; - *(.sbss) *(.scommon) - *(.dynbss) - *(.bss) + *(.sbss*) + *(.bss*) *(COMMON) . = ALIGN(4); _ebss = .; -- cgit v1.1 From 6752da6b2612c56e37bd8e9e176a7fedf4607bcc Mon Sep 17 00:00:00 2001 From: Jason Jin Date: Mon, 18 Apr 2011 17:54:04 +0800 Subject: ColdFire:Add mb for 5253 dram initialization The dram initialization sequence should be in order. This patch add mb for the dram intialization code to make sure the compiler do not disorder the code. Signed-off-by: Jason Jin --- board/freescale/m5253demo/m5253demo.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'board/freescale/m5253demo') diff --git a/board/freescale/m5253demo/m5253demo.c b/board/freescale/m5253demo/m5253demo.c index 4772074..8ffb2cc 100644 --- a/board/freescale/m5253demo/m5253demo.c +++ b/board/freescale/m5253demo/m5253demo.c @@ -27,6 +27,7 @@ #include #include #include +#include int checkboard(void) { @@ -63,10 +64,12 @@ phys_size_t initdram(int board_type) __asm__("nop"); mbar_writeLong(MCFSIM_DACR0, 0x0000322c); + mb(); __asm__("nop"); /* Write to this block to initiate precharge */ *(u32 *) (CONFIG_SYS_SDRAM_BASE) = 0xa5a5a5a5; + mb(); __asm__("nop"); /* Set RE bit in DACR */ @@ -83,6 +86,7 @@ phys_size_t initdram(int board_type) __asm__("nop"); *(u32 *) (CONFIG_SYS_SDRAM_BASE + 0x800) = 0xa5a5a5a5; + mb(); } return dramsize; -- cgit v1.1