From e7419b243a373de4ee042f7d4f45f66de787240d Mon Sep 17 00:00:00 2001 From: Sascha Laue Date: Wed, 30 Apr 2008 15:16:35 +0200 Subject: [PATCH 1/9] lwmon5: fix manual merge error in POST Signed-off-by: Sascha Laue --- post/board/lwmon5/sysmon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/post/board/lwmon5/sysmon.c b/post/board/lwmon5/sysmon.c index 793f670e24..23cb70926b 100644 --- a/post/board/lwmon5/sysmon.c +++ b/post/board/lwmon5/sysmon.c @@ -132,7 +132,7 @@ static sysmon_table_t sysmon_table[] = { "+ 5 V", "V", &sysmon_dspic, NULL, NULL, - 100, 1000, 0, 0xFFFF, 0xFFFF, + 100, 1000, -0x8000, 0x7FFF, 0xFFFF, VOLTAGE_5V_MIN, VOLTAGE_5V_MAX, 0, VOLTAGE_5V_MIN, VOLTAGE_5V_MAX, 0, REG_VOLTAGE_5V, @@ -140,7 +140,7 @@ static sysmon_table_t sysmon_table[] = { "+ 5 V standby", "V", &sysmon_dspic, NULL, NULL, - 100, 1000, 0, 0xFFFF, 0xFFFF, + 100, 1000, -0x8000, 0x7FFF, 0xFFFF, VOLTAGE_5V_STANDBY_MIN, VOLTAGE_5V_STANDBY_MAX, 0, VOLTAGE_5V_STANDBY_MIN, VOLTAGE_5V_STANDBY_MAX, 0, REG_VOLTAGE_5V_STANDBY, From 58b575e575c25fdf8c88141e145db201f3092149 Mon Sep 17 00:00:00 2001 From: Sascha Laue Date: Wed, 30 Apr 2008 15:23:38 +0200 Subject: [PATCH 2/9] lwmon5: fix offset error in sysmon0 POST Signed-off-by: Sascha Laue Signed-off-by: Wolfgang Denk --- post/board/lwmon5/sysmon.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/post/board/lwmon5/sysmon.c b/post/board/lwmon5/sysmon.c index 23cb70926b..e9c9624907 100644 --- a/post/board/lwmon5/sysmon.c +++ b/post/board/lwmon5/sysmon.c @@ -133,16 +133,16 @@ static sysmon_table_t sysmon_table[] = { "+ 5 V", "V", &sysmon_dspic, NULL, NULL, 100, 1000, -0x8000, 0x7FFF, 0xFFFF, - VOLTAGE_5V_MIN, VOLTAGE_5V_MAX, 0, - VOLTAGE_5V_MIN, VOLTAGE_5V_MAX, 0, + 0x8000 + VOLTAGE_5V_MIN, 0x8000 + VOLTAGE_5V_MAX, 0, + 0x8000 + VOLTAGE_5V_MIN, 0x8000 + VOLTAGE_5V_MAX, 0, REG_VOLTAGE_5V, }, { "+ 5 V standby", "V", &sysmon_dspic, NULL, NULL, 100, 1000, -0x8000, 0x7FFF, 0xFFFF, - VOLTAGE_5V_STANDBY_MIN, VOLTAGE_5V_STANDBY_MAX, 0, - VOLTAGE_5V_STANDBY_MIN, VOLTAGE_5V_STANDBY_MAX, 0, + 0x8000 + VOLTAGE_5V_STANDBY_MIN, 0x8000 + VOLTAGE_5V_STANDBY_MAX, 0, + 0x8000 + VOLTAGE_5V_STANDBY_MIN, 0x8000 + VOLTAGE_5V_STANDBY_MAX, 0, REG_VOLTAGE_5V_STANDBY, }, }; From 33a4a70d48d622cc4950c60a84fec23b9421f23e Mon Sep 17 00:00:00 2001 From: Anatolij Gustschin Date: Wed, 30 Apr 2008 13:34:40 +0200 Subject: [PATCH 3/9] Fix warnings while compiling net/net.c for MPC8610HPCD board MPC8610HPCD board adds -O2 gcc option to PLATFORM_CPPFLAGS causing overriding default -Os option. New gcc (ver. 4.2.2) produces warnings while compiling net/net.c file with -O2 option. The patch is an attempt to fix this. Signed-off-by: Anatolij Gustschin --- include/net.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/net.h b/include/net.h index f6decdca88..9a2f03fe98 100644 --- a/include/net.h +++ b/include/net.h @@ -412,10 +412,10 @@ extern void print_IPaddr (IPaddr_t); * footprint in our tests. */ /* return IP *in network byteorder* */ -static inline IPaddr_t NetReadIP(void *from) +static inline IPaddr_t NetReadIP(volatile void *from) { IPaddr_t ip; - memcpy((void*)&ip, from, sizeof(ip)); + memcpy((void*)&ip, (void*)from, sizeof(ip)); return ip; } @@ -434,9 +434,9 @@ static inline void NetWriteIP(void *to, IPaddr_t ip) } /* copy IP */ -static inline void NetCopyIP(void *to, void *from) +static inline void NetCopyIP(volatile void *to, void *from) { - memcpy(to, from, sizeof(IPaddr_t)); + memcpy((void*)to, from, sizeof(IPaddr_t)); } /* copy ulong */ From 378e7ec95da4751ec8fe461baacab2bf7d2512a9 Mon Sep 17 00:00:00 2001 From: "dirk.behme@googlemail.com" Date: Wed, 30 Apr 2008 18:02:59 +0200 Subject: [PATCH 4/9] Fix warning in env_nand.c if compiled for DaVinci Schmoogie Fix warnings nv_nand.c: In function 'saveenv': env_nand.c:200: warning: passing argument 3 of 'nand_write' from incompatible pointer type env_nand.c: In function 'env_relocate_spec': env_nand.c:275: warning: passing argument 3 of 'nand_read' from incompatible pointer type if compiled for davinci_schmoogie_config. Signed-off-by: Dirk Behme Ack by: Sergey Kubushyn --- common/env_nand.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/env_nand.c b/common/env_nand.c index 0dddddf0a1..49742f5bfb 100644 --- a/common/env_nand.c +++ b/common/env_nand.c @@ -102,7 +102,7 @@ uchar env_get_char_spec (int index) int env_init(void) { #if defined(ENV_IS_EMBEDDED) - ulong total; + size_t total; int crc1_ok = 0, crc2_ok = 0; env_t *tmp_env1, *tmp_env2; @@ -188,7 +188,7 @@ int saveenv(void) #else /* ! CFG_ENV_OFFSET_REDUND */ int saveenv(void) { - ulong total; + size_t total; int ret = 0; puts ("Erasing Nand..."); @@ -268,7 +268,7 @@ void env_relocate_spec (void) void env_relocate_spec (void) { #if !defined(ENV_IS_EMBEDDED) - ulong total; + size_t total; int ret; total = CFG_ENV_SIZE; From b7166e05a513c0806b63b9dfb6f1d77645cede2a Mon Sep 17 00:00:00 2001 From: TsiChung Liew Date: Wed, 30 Apr 2008 12:10:23 -0500 Subject: [PATCH 5/9] ColdFire: Get information from the correct GCC Signed-off-by: Kurt Mahan Signed-off-by: TsiChung Liew --- cpu/mcf5227x/config.mk | 2 +- cpu/mcf523x/config.mk | 2 +- cpu/mcf52x2/config.mk | 2 +- cpu/mcf532x/config.mk | 2 +- cpu/mcf5445x/config.mk | 2 +- cpu/mcf547x_8x/config.mk | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cpu/mcf5227x/config.mk b/cpu/mcf5227x/config.mk index 8d60fd66bf..2e5069687c 100644 --- a/cpu/mcf5227x/config.mk +++ b/cpu/mcf5227x/config.mk @@ -24,7 +24,7 @@ # PLATFORM_RELFLAGS += -ffixed-d7 -msep-data -ifeq ($(findstring 4.2,$(shell $(CC) --version)),4.2) +ifeq ($(findstring 4.2,$(shell $(CROSS_COMPILE)gcc --version)),4.2) PLATFORM_CPPFLAGS += -mcpu=5208 -fPIC else PLATFORM_CPPFLAGS += -m5307 -fPIC diff --git a/cpu/mcf523x/config.mk b/cpu/mcf523x/config.mk index 93645a31e0..73fb08d1ce 100644 --- a/cpu/mcf523x/config.mk +++ b/cpu/mcf523x/config.mk @@ -24,7 +24,7 @@ # PLATFORM_RELFLAGS += -ffixed-d7 -msep-data -ifeq ($(findstring 4.2,$(shell $(CC) --version)),4.2) +ifeq ($(findstring 4.2,$(shell $(CROSS_COMPILE)gcc --version)),4.2) PLATFORM_CPPFLAGS += -mcpu=5235 -fPIC else PLATFORM_CPPFLAGS += -m5307 -fPIC diff --git a/cpu/mcf52x2/config.mk b/cpu/mcf52x2/config.mk index 650e340aee..be360f8822 100644 --- a/cpu/mcf52x2/config.mk +++ b/cpu/mcf52x2/config.mk @@ -34,7 +34,7 @@ is5275:=$(shell grep CONFIG_M5275 $(TOPDIR)/include/$(cfg)) is5282:=$(shell grep CONFIG_M5282 $(TOPDIR)/include/$(cfg)) -ifeq ($(findstring 4.2,$(shell $(CC) --version)),4.2) +ifeq ($(findstring 4.2,$(shell $(CROSS_COMPILE)gcc --version)),4.2) ifneq (,$(findstring CONFIG_M5249,$(is5249))) PLATFORM_CPPFLAGS += -mcpu=5249 diff --git a/cpu/mcf532x/config.mk b/cpu/mcf532x/config.mk index 16a0bc3264..e4a3cf9fdc 100644 --- a/cpu/mcf532x/config.mk +++ b/cpu/mcf532x/config.mk @@ -24,7 +24,7 @@ # PLATFORM_RELFLAGS += -ffixed-d7 -msep-data -ifeq ($(findstring 4.2,$(shell $(CC) --version)),4.2) +ifeq ($(findstring 4.2,$(shell $(CROSS_COMPILE)gcc --version)),4.2) PLATFORM_CPPFLAGS += -mcpu=5329 -fPIC else PLATFORM_CPPFLAGS += -m5307 -fPIC diff --git a/cpu/mcf5445x/config.mk b/cpu/mcf5445x/config.mk index 88433f2f6d..a85d0f9fc5 100644 --- a/cpu/mcf5445x/config.mk +++ b/cpu/mcf5445x/config.mk @@ -24,7 +24,7 @@ # PLATFORM_RELFLAGS += -ffixed-d7 -msep-data -ifeq ($(findstring 4.2,$(shell $(CC) --version)),4.2) +ifeq ($(findstring 4.2,$(shell $(CROSS_COMPILE)gcc --version)),4.2) PLATFORM_CPPFLAGS += -mcpu=54455 -fPIC else PLATFORM_CPPFLAGS += -m5407 -fPIC diff --git a/cpu/mcf547x_8x/config.mk b/cpu/mcf547x_8x/config.mk index e5f4385dd3..eb6b50b212 100644 --- a/cpu/mcf547x_8x/config.mk +++ b/cpu/mcf547x_8x/config.mk @@ -24,7 +24,7 @@ # PLATFORM_RELFLAGS += -ffixed-d7 -msep-data -ifeq ($(findstring 4.2,$(shell $(CC) --version)),4.2) +ifeq ($(findstring 4.2,$(shell $(CROSS_COMPILE)gcc --version)),4.2) PLATFORM_CPPFLAGS += -mcpu=5485 -fPIC else PLATFORM_CPPFLAGS += -m5407 -fPIC From 886d90176fc257e0ab4d0db05d11d0749bbed3ca Mon Sep 17 00:00:00 2001 From: TsiChung Liew Date: Wed, 30 Apr 2008 12:10:47 -0500 Subject: [PATCH 6/9] ColdFire: Fix compilation issue caused by new changes in fsl_i2c.c Signed-off-by: Luigi Comio Mantellini Signed-off-by: TsiChung Liew --- include/asm-m68k/global_data.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/asm-m68k/global_data.h b/include/asm-m68k/global_data.h index 958736ec70..c897f2b2a8 100644 --- a/include/asm-m68k/global_data.h +++ b/include/asm-m68k/global_data.h @@ -46,6 +46,10 @@ typedef struct global_data { unsigned long inp_clk; unsigned long vco_clk; unsigned long flb_clk; +#endif +#ifdef CONFIG_FSL_I2C + unsigned long i2c1_clk; + unsigned long i2c2_clk; #endif unsigned long ram_size; /* RAM size */ unsigned long reloc_off; /* Relocation Offset */ From f32f7fe7bd3a5bda3a476520f00e1aca7c2103a9 Mon Sep 17 00:00:00 2001 From: TsiChung Liew Date: Wed, 30 Apr 2008 12:11:19 -0500 Subject: [PATCH 7/9] ColdFire: Fix ethernet hang issue for mcf547x_8x The ethernet hang is caused by receiving buffer in DRAM is not yet ready due to access cycles require longer time in DRAM. Relocate DMA buffer descriptors from DRAM to internal SRAM. Signed-off-by: TsiChung Liew --- drivers/net/fsl_mcdmafec.c | 22 +++++++++++++++++++++- include/configs/M5475EVB.h | 1 + include/configs/M5485EVB.h | 1 + 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/drivers/net/fsl_mcdmafec.c b/drivers/net/fsl_mcdmafec.c index 0c876f33bd..2ef91f2d22 100644 --- a/drivers/net/fsl_mcdmafec.c +++ b/drivers/net/fsl_mcdmafec.c @@ -95,7 +95,11 @@ struct fec_info_dma fec_info[] = { 0, /* duplex and speed */ 0, /* phy name */ 0, /* phy name init */ +#ifdef CFG_DMA_USE_INTSRAM + DBUF_LENGTH, /* RX BD */ +#else 0, /* RX BD */ +#endif 0, /* TX BD */ 0, /* rx Index */ 0, /* tx Index */ @@ -164,7 +168,8 @@ static void dbg_fec_regs(struct eth_device *dev) } #endif -static void set_fec_duplex_speed(volatile fecdma_t * fecp, bd_t * bd, int dup_spd) +static void set_fec_duplex_speed(volatile fecdma_t * fecp, bd_t * bd, + int dup_spd) { if ((dup_spd >> 16) == FULL) { /* Set maximum frame length */ @@ -513,6 +518,9 @@ int mcdmafec_initialize(bd_t * bis) { struct eth_device *dev; int i; +#ifdef CFG_DMA_USE_INTSRAM + u32 tmp = CFG_INTSRAM + 0x2000; +#endif for (i = 0; i < sizeof(fec_info) / sizeof(fec_info[0]); i++) { @@ -533,6 +541,17 @@ int mcdmafec_initialize(bd_t * bis) dev->recv = fec_recv; /* setup Receive and Transmit buffer descriptor */ +#ifdef CFG_DMA_USE_INTSRAM + fec_info[i].rxbd = (int)fec_info[i].rxbd + tmp; + tmp = fec_info[i].rxbd; + fec_info[i].txbd = + (int)fec_info[i].txbd + tmp + (PKTBUFSRX * sizeof(cbd_t)); + tmp = fec_info[i].txbd; + fec_info[i].txbuf = + (int)fec_info[i].txbuf + tmp + + (CFG_TX_ETH_BUFFER * sizeof(cbd_t)); + tmp = fec_info[i].txbuf; +#else fec_info[i].rxbd = (cbd_t *) memalign(CFG_CACHELINE_SIZE, (PKTBUFSRX * sizeof(cbd_t))); @@ -541,6 +560,7 @@ int mcdmafec_initialize(bd_t * bis) (CFG_TX_ETH_BUFFER * sizeof(cbd_t))); fec_info[i].txbuf = (char *)memalign(CFG_CACHELINE_SIZE, DBUF_LENGTH); +#endif #ifdef ET_DEBUG printf("rxbd %x txbd %x\n", diff --git a/include/configs/M5475EVB.h b/include/configs/M5475EVB.h index 6bb461913a..fea7551cf1 100644 --- a/include/configs/M5475EVB.h +++ b/include/configs/M5475EVB.h @@ -72,6 +72,7 @@ # define CONFIG_MII_INIT 1 # define CONFIG_HAS_ETH1 +# define CFG_DMA_USE_INTSRAM 1 # define CFG_DISCOVER_PHY # define CFG_RX_ETH_BUFFER 32 # define CFG_TX_ETH_BUFFER 48 diff --git a/include/configs/M5485EVB.h b/include/configs/M5485EVB.h index cba51c87c1..454d0a28dc 100644 --- a/include/configs/M5485EVB.h +++ b/include/configs/M5485EVB.h @@ -72,6 +72,7 @@ # define CONFIG_MII_INIT 1 # define CONFIG_HAS_ETH1 +# define CFG_DMA_USE_INTSRAM 1 # define CFG_DISCOVER_PHY # define CFG_RX_ETH_BUFFER 32 # define CFG_TX_ETH_BUFFER 48 From 1b9ed2574a38c93cb03dad41885fc06be4bfc9dd Mon Sep 17 00:00:00 2001 From: Timur Tabi Date: Fri, 4 Apr 2008 11:16:11 -0500 Subject: [PATCH 8/9] Fix calculation of I2C clock for some 86xx chips Some 86xx chips use CCB as the base clock for the I2C, and others used CCB/2. There is no pattern that can be used to determine which chips use which frequency, so the only way to determine is to look up the actual SOC designation and use the right value for that SOC. Signed-off-by: Timur Tabi --- cpu/mpc86xx/speed.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/cpu/mpc86xx/speed.c b/cpu/mpc86xx/speed.c index 7e884f8e01..da5b58b73f 100644 --- a/cpu/mpc86xx/speed.c +++ b/cpu/mpc86xx/speed.c @@ -105,8 +105,20 @@ int get_clocks(void) get_sys_info(&sys_info); gd->cpu_clk = sys_info.freqProcessor; gd->bus_clk = sys_info.freqSystemBus; + + /* + * The base clock for I2C depends on the actual SOC. Unfortunately, + * there is no pattern that can be used to determine the frequency, so + * the only choice is to look up the actual SOC number and use the value + * for that SOC. This information is taken from application note + * AN2919. + */ +#ifdef CONFIG_MPC8610 gd->i2c1_clk = sys_info.freqSystemBus; - gd->i2c2_clk = sys_info.freqSystemBus; +#else + gd->i2c1_clk = sys_info.freqSystemBus / 2; +#endif + gd->i2c2_clk = gd->i2c1_clk; if (gd->cpu_clk != 0) return 0; From 12bc4e94251c369c529ffa505cf58b148c372f7f Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Wed, 30 Apr 2008 22:38:17 +0200 Subject: [PATCH 9/9] cmd_nand: fix warning: str2long ncompatible pointer type Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- common/cmd_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/cmd_nand.c b/common/cmd_nand.c index 1a3c1df03e..37eb41b20e 100644 --- a/common/cmd_nand.c +++ b/common/cmd_nand.c @@ -110,7 +110,7 @@ arg_off_size(int argc, char *argv[], nand_info_t *nand, ulong *off, size_t *size } *off = part->offset; if (argc >= 2) { - if (!(str2long(argv[1], size))) { + if (!(str2long(argv[1], (ulong *)size))) { printf("'%s' is not a number\n", argv[1]); return -1; }