ColdFire:Fix the configuration broken for some boards.
Subsystems (4)
PATCH RESEND 1/9 ColdFire:Fix the configuration broken for some boards.
Some typoes in Makefile and boards.cfg make the M54455 board and M53017 board configuration broken.
--- Makefile | 1 + boards.cfg | 2 +- 2 files changed, 2 insertions(+), 1 deletions(-)
Makefile +1 -0
@@ -724,6 +724,7 @@ M54455EVB_stm33_config : unconfig cp $(obj)board/freescale/m54455evb/u-boot.stm $(obj)board/freescale/m54455evb/u-boot.lds ; \ fi; \ echo "#define CONFIG_SYS_INPUT_CLKSRC $${FREQ}" >> $(obj)include/config.h ; \ + $(XECHO) "... with $${FREQ}Hz input clock" @$(MKCONFIG) -n $@ -a M54455EVB m68k mcf5445x m54455evb freescale M5475AFE_config \
boards.cfg +1 -1
@@ -279,7 +279,7 @@ M5271EVB m68k mcf52x2 m5271evb freesca M5272C3 m68k mcf52x2 m5272c3 freescale M5275EVB m68k mcf52x2 m5275evb freescale M5282EVB m68k mcf52x2 m5282evb freescale -M53017EVB m68k mcf52x2 m53017evb freescale +M53017EVB m68k mcf532x m53017evb freescale EP2500 m68k mcf52x2 ep2500 Mercury microblaze-generic microblaze microblaze microblaze-generic xilinx dbau1000 mips mips32 dbau1x00 - au1x00 dbau1x00:DBAU1000
Signature · 1 line
1.6.4
PATCH v3 2/9 ColdFire: Update compile flags for each CPUs
Remove compiler version check for gcc 4.1 in config.mk.
---
Changes for V2:
use the cc-option to set different cppflags for different gcc version.
Changes for V3:
Remove the old gcc version support.
arch/m68k/cpu/mcf5227x/config.mk | 4 ---- arch/m68k/cpu/mcf523x/config.mk | 4 ---- arch/m68k/cpu/mcf52x2/config.mk | 7 ------- arch/m68k/cpu/mcf532x/config.mk | 6 ------ arch/m68k/cpu/mcf5445x/config.mk | 4 ---- arch/m68k/cpu/mcf547x_8x/config.mk | 4 ---- 6 files changed, 0 insertions(+), 29 deletions(-)
arch/m68k/cpu/mcf5227x/config.mk +0 -4
@@ -24,8 +24,4 @@ # PLATFORM_RELFLAGS += -ffixed-d7 -msep-data -ifneq ($(findstring 4.1,$(shell $(CC) --version)),4.1) PLATFORM_CPPFLAGS += -mcpu=52277 -fPIC -else -PLATFORM_CPPFLAGS += -m5307 -fPIC -endif
arch/m68k/cpu/mcf523x/config.mk +0 -4
@@ -24,8 +24,4 @@ # PLATFORM_RELFLAGS += -ffixed-d7 -msep-data -ifneq ($(findstring 4.1,$(shell $(CC) --version)),4.1) PLATFORM_CPPFLAGS += -mcpu=5235 -fPIC -else -PLATFORM_CPPFLAGS += -m5307 -fPIC -endif
arch/m68k/cpu/mcf52x2/config.mk +0 -7
@@ -34,9 +34,6 @@ is5272:=$(shell grep CONFIG_M5272 $(TOPDIR)/include/$(cfg)) is5275:=$(shell grep CONFIG_M5275 $(TOPDIR)/include/$(cfg)) is5282:=$(shell grep CONFIG_M5282 $(TOPDIR)/include/$(cfg)) - -ifneq ($(findstring 4.1,$(shell $(CC) --version)),4.1) - ifneq (,$(findstring CONFIG_M5208,$(is5208))) PLATFORM_CPPFLAGS += -mcpu=5208 endif
@@ -58,7 +55,3 @@ endif ifneq (,$(findstring CONFIG_M5282,$(is5282))) PLATFORM_CPPFLAGS += -mcpu=5282 endif - -else -PLATFORM_CPPFLAGS += -m5307 -endif
arch/m68k/cpu/mcf532x/config.mk +0 -6
@@ -29,15 +29,9 @@ cfg=$(shell grep configs $(OBJTREE)/include/config.h | sed 's/.*<\(configs.*\)>/ is5301x:=$(shell grep CONFIG_MCF5301x $(TOPDIR)/include/$(cfg)) is532x:=$(shell grep CONFIG_MCF532x $(TOPDIR)/include/$(cfg)) -ifneq ($(findstring 4.1,$(shell $(CC) --version)),4.1) - ifneq (,$(findstring CONFIG_MCF5301x,$(is5301x))) PLATFORM_CPPFLAGS += -mcpu=53015 -fPIC endif ifneq (,$(findstring CONFIG_MCF532x,$(is532x))) PLATFORM_CPPFLAGS += -mcpu=5329 -fPIC endif - -else -PLATFORM_CPPFLAGS += -m5307 -fPIC -endif
arch/m68k/cpu/mcf5445x/config.mk +0 -4
@@ -24,11 +24,7 @@ # PLATFORM_RELFLAGS += -ffixed-d7 -msep-data -ifneq ($(findstring 4.1,$(shell $(CC) --version)),4.1) PLATFORM_CPPFLAGS += -mcpu=54455 -fPIC -else -PLATFORM_CPPFLAGS += -m5407 -fPIC -endif ifneq (,$(findstring -linux-,$(shell $(CC) --version))) ifneq (,$(findstring GOT,$(shell $(LD) --help)))
arch/m68k/cpu/mcf547x_8x/config.mk +0 -4
@@ -24,11 +24,7 @@ # PLATFORM_RELFLAGS += -ffixed-d7 -msep-data -ifneq ($(findstring 4.1,$(shell $(CC) --version)),4.1) PLATFORM_CPPFLAGS += -mcpu=5485 -fPIC -else -PLATFORM_CPPFLAGS += -m5407 -fPIC -endif ifneq (,$(findstring -linux-,$(shell $(CC) --version))) ifneq (,$(findstring GOT,$(shell $(LD) --help)))
Signature · 1 line
1.6.4
PATCH v3 3/9 ColdFire: Cleanup for partial linking and --gc-sections
---
Changes for V2: Add clean up for more boards.
Changes for V3: Seperate the env settings to another patch. Merge the nommu board clean up into this patch. Add more clean up work to the lds files.
board/freescale/m5208evbe/u-boot.lds | 66 +++++------------------------ board/freescale/m52277evb/u-boot.spa | 72 +++++++------------------------- board/freescale/m5253demo/u-boot.lds | 65 +++++------------------------ board/freescale/m53017evb/u-boot.lds | 66 ++++++----------------------- board/freescale/m5329evb/u-boot.lds | 64 +++++----------------------- board/freescale/m5373evb/u-boot.lds | 64 +++++----------------------- board/freescale/m54451evb/u-boot.spa | 73 +++++--------------------------- board/freescale/m54451evb/u-boot.stm | 76 +++++---------------------------- board/freescale/m54455evb/u-boot.atm | 70 +++++-------------------------- board/freescale/m54455evb/u-boot.int | 67 +++++------------------------ board/freescale/m547xevb/u-boot.lds | 66 +++++------------------------ board/freescale/m548xevb/u-boot.lds | 68 +++++------------------------- 12 files changed, 144 insertions(+), 673 deletions(-)
board/freescale/m5208evbe/u-boot.lds +12 -54
@@ -22,61 +22,25 @@ */ 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/cpu/mcf52x2/libmcf52x2.o (.text) - arch/m68k/lib/libm68k.o (.text) - common/dlmalloc.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 = .); .rodata : { - *(.rodata) - *(.rodata1) + *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } - .fini : { *(.fini) } =0 - .ctors : { *(.ctors) } - .dtors : { *(.dtors) } /* Read-write section, merged into data segment: */ . = (. + 0x00FF) & 0xFFFFFF00;
@@ -86,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 = .);
@@ -113,7 +73,6 @@ SECTIONS .u_boot_cmd : { *(.u_boot_cmd) } __u_boot_cmd_end = .; - . = .; __start___ex_table = .; __ex_table : { *(__ex_table) }
@@ -130,9 +89,8 @@ SECTIONS .bss (NOLOAD) : { _sbss = .; - *(.sbss) *(.scommon) - *(.dynbss) - *(.bss) + *(.sbss*) + *(.bss*) *(COMMON) . = ALIGN(4); _ebss = .;
board/freescale/m52277evb/u-boot.spa +15 -57
121 lines not on this page · raw message
board/freescale/m5253demo/u-boot.lds +11 -54
112 lines not on this page · raw message
board/freescale/m53017evb/u-boot.lds +13 -53
113 lines not on this page · raw message
board/freescale/m5329evb/u-boot.lds +11 -53
111 lines not on this page · raw message
board/freescale/m5373evb/u-boot.lds +11 -53
111 lines not on this page · raw message
board/freescale/m54451evb/u-boot.spa +12 -61
120 lines not on this page · raw message
board/freescale/m54451evb/u-boot.stm +12 -64
123 lines not on this page · raw message
board/freescale/m54455evb/u-boot.atm +12 -58
117 lines not on this page · raw message
board/freescale/m54455evb/u-boot.int +12 -55
114 lines not on this page · raw message
board/freescale/m547xevb/u-boot.lds +11 -55
113 lines not on this page · raw message
board/freescale/m548xevb/u-boot.lds +12 -56
114 lines not on this page · raw message
Signature · 1 line
1.6.4
PATCH 4/9 ColdFire:Update the timer_init since it was unified.
--- arch/m68k/cpu/mcf547x_8x/slicetimer.c | 3 ++- arch/m68k/lib/board.c | 2 -- arch/m68k/lib/time.c | 6 +++++- 3 files changed, 7 insertions(+), 4 deletions(-)
arch/m68k/cpu/mcf547x_8x/slicetimer.c +2 -1
@@ -72,7 +72,7 @@ void dtimer_interrupt(void *not_used) } } -void timer_init (void ) +int timer_init (void ) {volatile slt_t *timerp = (slt_t *) (CONFIG_SYS_TMR_BASE );
@@ -93,6 +93,7 @@ void timer_init(void)/* set a period of 1us, set timer mode to restart and enable timer and interrupt */ timerp->cr =SLT_CR_RUN |SLT_CR_IEN |SLT_CR_TEN ; +return 0 ; }ulong get_timer (ulong base)
arch/m68k/lib/board.c +0 -2
@@ -78,8 +78,6 @@ static char *failed = "*** failed ***\n";extern ulong __init_end;extern ulong __bss_end__; -extern void timer_init (void ); -#if defined(CONFIG_WATCHDOG )# define INIT_FUNC_WATCHDOG_INIT watchdog_init,# define WATCHDOG_DISABLE watchdog_disable
arch/m68k/lib/time.c +5 -1
@@ -91,7 +91,7 @@ void dtimer_interrupt(void *not_used) } } -void timer_init (void ) +int timer_init (void ) {volatile dtmr_t *timerp = (dtmr_t *) (CONFIG_SYS_TMR_BASE );
@@ -114,6 +114,8 @@ void timer_init(void)/* set a period of 1us, set timer mode to restart and enable timer and interrupt */ timerp->tmr =CONFIG_SYS_TIMER_PRESCALER |DTIM_DTMR_CLK_DIV1 |DTIM_DTMR_FRR |DTIM_DTMR_ORRI |DTIM_DTMR_RST_EN ; + +return 0 ; }ulong get_timer (ulong base)
@@ -162,6 +164,8 @@ void timer_init(void) timerp->pcsr =PIT_PCSR_OVW ; timerp->pmr = lastinc =0 ; timerp->pcsr |=PIT_PCSR_PRE (CONFIG_SYS_PIT_PRESCALE ) |PIT_PCSR_EN ; + +return 0 ; }ulong get_timer (ulong base)
Signature · 1 line
1.6.4
PATCH RESEND 5/9 ColdFire:disable the NFS define for 52277 board.
There is no network device on ColdFire 52277EVB board.But the default cmd include NFS define which make the build error.
--- include/configs/M52277EVB.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
include/configs/M52277EVB.h +1 -0
@@ -69,6 +69,7 @@#define CONFIG_CMD_MEMORY #define CONFIG_CMD_MISC #undef CONFIG_CMD_NET +#undef CONFIG_CMD_NFS#define CONFIG_CMD_REGINFO #undef CONFIG_CMD_USB#undef CONFIG_CMD_BMP
Signature · 1 line
1.6.4
PATCH 6/9 ColdFire:Update the env settings for several boards.
Move the environment outside the u-boot for some boards and enlarge the u-boot size in some env settings.
--- include/configs/M5329EVB.h | 4 ++-- include/configs/M5373EVB.h | 4 ++-- include/configs/M54451EVB.h | 13 ++++++++----- include/configs/M54455EVB.h | 15 ++++++++++----- include/configs/M5475EVB.h | 13 ++++++++----- include/configs/M5485EVB.h | 12 +++++++----- 6 files changed, 37 insertions(+), 24 deletions(-)
include/configs/M5329EVB.h +2 -2
@@ -124,8 +124,8 @@"u-boot=u-boot.bin\0" \"load=tftp ${loadaddr) ${u-boot}\0" \"upd=run load; run prog\0" \ -"prog=prot off 0 2ffff;" \ -"era 0 2ffff;" \ +"prog=prot off 0 3ffff;" \ +"era 0 3ffff;" \"cp.b ${loadaddr} 0 ${filesize};" \"save\0" \""
include/configs/M5373EVB.h +2 -2
@@ -124,8 +124,8 @@"u-boot=u-boot.bin\0" \"load=tftp ${loadaddr) ${u-boot}\0" \"upd=run load; run prog\0" \ -"prog=prot off 0 2ffff;" \ -"era 0 2ffff;" \ +"prog=prot off 0 3ffff;" \ +"era 0 3ffff;" \"cp.b ${loadaddr} 0 ${filesize};" \"save\0" \""
include/configs/M54451EVB.h +8 -5
@@ -127,7 +127,7 @@"load=tftp ${loadaddr} ${sbfhdr};" \ "tftp " MK_STR(CONFIG_SYS_LOAD_ADDR2) " ${uboot} \0" \"upd=run load; run prog\0" \ -"prog=sf probe 0:1 10000 1;" \ +"prog=sf probe 0:1 1000000 3;" \"sf erase 0 30000;" \"sf write ${loadaddr} 0 30000;" \"save\0" \
@@ -244,14 +244,16 @@#define CONFIG_SYS_MEMTEST_END ((CONFIG_SYS_SDRAM_SIZE - 3) << 20)#ifdef CONFIG_CF_SBF +# define CONFIG_SERIAL_BOOT # define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_TEXT_BASE + 0x400)#else # define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_FLASH_BASE + 0x400)#endif #define CONFIG_SYS_BOOTPARAMS_LEN 64*1024#define CONFIG_SYS_MONITOR_LEN (256 << 10)/* Reserve 256 kB for Monitor */ -#define CONFIG_SYS_MALLOC_LEN (128 << 10)/* Reserve 128 kB for malloc() */ +/* Reserve 256 kB for malloc() */ +#define CONFIG_SYS_MALLOC_LEN (256 << 10)/* * For booting Linux, the board info and command line data * have to be in the first 8 MB of memory, since this is
@@ -261,7 +263,8 @@#define CONFIG_SYS_BOOTMAPSZ (CONFIG_SYS_SDRAM_BASE + (CONFIG_SYS_SDRAM_SIZE << 20))/* Configuration for environment -* Environment is embedded in u-boot in the second sector of the flash +* Environment is not embedded in u-boot. First time runing may have env +* crc error warning if there is no correct environment on the flash. */ #if defined(CONFIG_SYS_STMICRO_BOOT )# define CONFIG_ENV_IS_IN_SPI_FLASH 1
@@ -271,9 +274,9 @@# define CONFIG_ENV_SECT_SIZE 0x10000#else # define CONFIG_ENV_IS_IN_FLASH 1 -# define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + 0x8000) +# define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + 0x40000)# define CONFIG_ENV_SIZE 0x2000 -# define CONFIG_ENV_SECT_SIZE 0x8000 +# define CONFIG_ENV_SECT_SIZE 0x20000#endif #undef CONFIG_ENV_OVERWRITE
include/configs/M54455EVB.h +10 -5
@@ -134,7 +134,7 @@"load=tftp ${loadaddr} ${sbfhdr};" \ "tftp " MK_STR(CONFIG_SYS_LOAD_ADDR2) " ${uboot} \0" \"upd=run load; run prog\0" \ -"prog=sf probe 0:1 10000 1;" \ +"prog=sf probe 0:1 1000000 3;" \"sf erase 0 30000;" \"sf write ${loadaddr} 0 0x30000;" \"save\0" \
@@ -304,13 +304,16 @@#define CONFIG_SYS_MEMTEST_END ((CONFIG_SYS_SDRAM_SIZE - 3) << 20)#ifdef CONFIG_CF_SBF +# define CONFIG_SERIAL_BOOT # define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_TEXT_BASE + 0x400)#else # define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_FLASH_BASE + 0x400)#endif #define CONFIG_SYS_BOOTPARAMS_LEN 64*1024#define CONFIG_SYS_MONITOR_LEN (256 << 10)/* Reserve 256 kB for Monitor */ -#define CONFIG_SYS_MALLOC_LEN (128 << 10)/* Reserve 128 kB for malloc() */ + +/* Reserve 256 kB for malloc() */ +#define CONFIG_SYS_MALLOC_LEN (256 << 10)/* * For booting Linux, the board info and command line data
@@ -322,7 +325,8 @@/* * Configuration for environment -* Environment is embedded in u-boot in the second sector of the flash +* Environment is not embedded in u-boot. First time runing may have env +* crc error warning if there is no correct environment on the flash. */ #ifdef CONFIG_CF_SBF # define CONFIG_ENV_IS_IN_SPI_FLASH
@@ -346,8 +350,9 @@# define CONFIG_SYS_FLASH_BASE CONFIG_SYS_CS0_BASE# define CONFIG_SYS_FLASH0_BASE CONFIG_SYS_CS0_BASE# define CONFIG_SYS_FLASH1_BASE CONFIG_SYS_CS1_BASE -# define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + 0x4000) -# define CONFIG_ENV_SECT_SIZE 0x2000 +# define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + 0x40000) +# define CONFIG_ENV_SIZE 0x2000 +# define CONFIG_ENV_SECT_SIZE 0x10000#endif #ifdef CONFIG_SYS_INTEL_BOOT # define CONFIG_SYS_FLASH_BASE CONFIG_SYS_CS0_BASE
include/configs/M5475EVB.h +8 -5
@@ -171,7 +171,7 @@"load=tftp ${loadaddr) ${u-boot}\0" \"upd=run load; run prog\0" \"prog=prot off bank 1;" \ -"era ff800000 ff82ffff;" \ +"era ff800000 ff83ffff;" \"cp.b ${loadaddr} ff800000 ${filesize};" \"save\0" \""
@@ -243,8 +243,9 @@#define CONFIG_SYS_MONITOR_LEN (256 << 10)/* Reserve 256 kB for Monitor */ #define CONFIG_SYS_BOOTPARAMS_LEN 64*1024 -#define CONFIG_SYS_MALLOC_LEN (128 << 10)/* Reserve 128 kB for malloc() */ +/* Reserve 256 kB for malloc() */ +#define CONFIG_SYS_MALLOC_LEN (256 << 10)/* * For booting Linux, the board info and command line data * have to be in the first 8 MB of memory, since this is
@@ -274,10 +275,12 @@#endif /* Configuration for environment -* Environment is embedded in u-boot in the second sector of the flash +* Environment is not embedded in u-boot but@offset 0x40000 on the flash. +* First time runing may have env crc error warning if there is +* no correct environment on the flash. */ -#define CONFIG_ENV_OFFSET 0x2000 -#define CONFIG_ENV_SECT_SIZE 0x2000 +#define CONFIG_ENV_OFFSET 0x40000 +#define CONFIG_ENV_SECT_SIZE 0x10000#define CONFIG_ENV_IS_IN_FLASH 1/*-----------------------------------------------------------------------
include/configs/M5485EVB.h +7 -5
@@ -157,7 +157,7 @@"load=tftp ${loadaddr) ${u-boot}\0" \"upd=run load; run prog\0" \"prog=prot off bank 1;" \ -"era ff800000 ff82ffff;" \ +"era ff800000 ff83ffff;" \"cp.b ${loadaddr} ff800000 ${filesize};" \"save\0" \""
@@ -229,8 +229,9 @@#define CONFIG_SYS_MONITOR_LEN (256 << 10)/* Reserve 256 kB for Monitor */ #define CONFIG_SYS_BOOTPARAMS_LEN 64*1024 -#define CONFIG_SYS_MALLOC_LEN (128 << 10)/* Reserve 128 kB for malloc() */ +/* Reserve 256 kB for malloc() */ +#define CONFIG_SYS_MALLOC_LEN (256 << 10)/* * For booting Linux, the board info and command line data * have to be in the first 8 MB of memory, since this is
@@ -260,10 +261,11 @@#endif /* Configuration for environment -* Environment is embedded in u-boot in the second sector of the flash +* Environment is not embedded in u-boot. First time runing may have env +* crc error warning if there is no correct environment on the flash. */ -#define CONFIG_ENV_OFFSET 0x2000 -#define CONFIG_ENV_SECT_SIZE 0x2000 +#define CONFIG_ENV_OFFSET 0x40000 +#define CONFIG_ENV_SECT_SIZE 0x10000#define CONFIG_ENV_IS_IN_FLASH 1/*-----------------------------------------------------------------------
Signature · 1 line
1.6.4
PATCH 7/9 DM9000:Add a byte swap macro for dm9000 io operation.
commit a45dde2293c816138e53c26eca6fd0322583f9a6 changed the dm9000 direct register access to standard IO. This should work
on the ColdFire platform as there are corresponding macros for the LE devices. But the hardware settings on some ColdFire boards had swapped the byte order which make the original macros such as out_le16 cannot work. To avoid changing the common io access code on ColdFire platform, the DM9000_BYTE_SWAPPED define was added to make the dm9000 use __raw* IO access on some ColdFire boards.
---
Changes for V2: Remove the 'volatile' in the macro.
Changes for V3: Seperate the dm9000 code support and the platform code to two patches so that it can be accepted by different custodian.
drivers/net/dm9000x.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-)
drivers/net/dm9000x.c +9 -1
@@ -116,13 +116,21 @@ static u8 DM9000_ior(int);static void DM9000_iow (int reg,u8 value);/* DM9000 network board routine ---------------------------- */ - +#ifndef DM9000_BYTE_SWAPPED #define DM9000_outb (d,r) writeb(d, (volatile u8 *)(r))#define DM9000_outw (d,r) writew(d, (volatile u16 *)(r))#define DM9000_outl (d,r) writel(d, (volatile u32 *)(r))#define DM9000_inb (r) readb((volatile u8 *)(r))#define DM9000_inw (r) readw((volatile u16 *)(r))#define DM9000_inl (r) readl((volatile u32 *)(r)) +#else +#define DM9000_outb (d, r) __raw_writeb(d, r) +#define DM9000_outw (d, r) __raw_writew(d, r) +#define DM9000_outl (d, r) __raw_writel(d, r) +#define DM9000_inb (r) __raw_readb(r) +#define DM9000_inw (r) __raw_readw(r) +#define DM9000_inl (r) __raw_readl(r) +#endif #ifdef CONFIG_DM9000_DEBUG static void
Signature · 1 line
1.6.4
PATCH 8/9 ColdFire:Define the DM9000 byteswap for M5253 board.
The M5253DEMO board swapped the io pins which make the standard IO function did not work for dm9000. Define the byte swap to use raw io for dm9000.
--- include/configs/M5253DEMO.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
include/configs/M5253DEMO.h +1 -0
@@ -95,6 +95,7 @@# define DM9000_IO CONFIG_DM9000_BASE# define DM9000_DATA (CONFIG_DM9000_BASE + 4)# undef CONFIG_DM9000_DEBUG +# define DM9000_BYTE_SWAPPED # define CONFIG_OVERWRITE_ETHADDR_ONCE
Signature · 1 line
1.6.4
PATCH RESEND 9/9 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.
--- arch/m68k/include/asm/io.h | 2 ++ board/freescale/m5253demo/m5253demo.c | 4 ++++ 2 files changed, 6 insertions(+), 0 deletions(-)
arch/m68k/include/asm/io.h +2 -0
@@ -81,6 +81,8 @@#define outl (val, port) out_le32((u32 *)((port)+_IO_BASE), (val))#endif +#define mb () __asm__ __volatile__ ("" : : : "memory") +extern inline void _insb (volatile u8 * port,void *buf,int ns) {u8 *data = (u8 *) buf;
board/freescale/m5253demo/m5253demo.c +4 -0
@@ -27,6 +27,7 @@#include <common.h> #include <asm/immap.h> #include <netdev.h> +#include <asm/io.h> 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;
Signature · 1 line
1.6.4