]> git.sur5r.net Git - u-boot/commitdiff
Merge branch 'master' of git://www.denx.de/git/u-boot-ppc4xx
authorWolfgang Denk <wd@denx.de>
Sat, 3 May 2008 18:46:40 +0000 (20:46 +0200)
committerWolfgang Denk <wd@denx.de>
Sat, 3 May 2008 18:46:40 +0000 (20:46 +0200)
18 files changed:
Makefile
common/cmd_nand.c
common/env_nand.c
cpu/mcf5227x/config.mk
cpu/mcf523x/config.mk
cpu/mcf52x2/config.mk
cpu/mcf532x/config.mk
cpu/mcf5445x/config.mk
cpu/mcf547x_8x/config.mk
cpu/mpc86xx/speed.c
drivers/mtd/onenand/onenand_base.c
drivers/net/fsl_mcdmafec.c
drivers/rtc/m41t62.c
include/asm-m68k/global_data.h
include/configs/M5475EVB.h
include/configs/M5485EVB.h
include/net.h
post/board/lwmon5/sysmon.c

index 10324d263e6c29505b0df034a316bb5e8a5ef0f7..ac0a17f6ce5dccaa836389321ae13dd6f876d286 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -201,7 +201,6 @@ OBJS := $(addprefix $(obj),$(OBJS))
 LIBS  = lib_generic/libgeneric.a
 LIBS += $(shell if [ -f board/$(VENDOR)/common/Makefile ]; then echo \
        "board/$(VENDOR)/common/lib$(VENDOR).a"; fi)
-LIBS += board/$(BOARDDIR)/lib$(BOARD).a
 LIBS += cpu/$(CPU)/lib$(CPU).a
 ifdef SOC
 LIBS += cpu/$(CPU)/$(SOC)/lib$(SOC).a
@@ -248,6 +247,9 @@ LIBS += post/libpost.a
 LIBS := $(addprefix $(obj),$(LIBS))
 .PHONY : $(LIBS) $(VERSION_FILE)
 
+LIBBOARD = board/$(BOARDDIR)/lib$(BOARD).a
+LIBBOARD := $(addprefix $(obj),$(LIBBOARD))
+
 # Add GCC lib
 PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
 
@@ -270,7 +272,7 @@ U_BOOT_ONENAND = $(obj)u-boot-onenand.bin
 endif
 
 __OBJS := $(subst $(obj),,$(OBJS))
-__LIBS := $(subst $(obj),,$(LIBS))
+__LIBS := $(subst $(obj),,$(LIBS)) $(subst $(obj),,$(LIBBOARD))
 
 #########################################################################
 #########################################################################
@@ -313,8 +315,9 @@ $(obj)u-boot.sha1:  $(obj)u-boot.bin
 $(obj)u-boot.dis:      $(obj)u-boot
                $(OBJDUMP) -d $< > $@
 
-$(obj)u-boot:          depend $(SUBDIRS) $(OBJS) $(LIBS) $(LDSCRIPT)
-               UNDEF_SYM=`$(OBJDUMP) -x $(LIBS) |sed  -n -e 's/.*\($(SYM_PREFIX)__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
+$(obj)u-boot:          depend $(SUBDIRS) $(OBJS) $(LIBBOARD) $(LIBS) $(LDSCRIPT)
+               UNDEF_SYM=`$(OBJDUMP) -x $(LIBBOARD) $(LIBS) | \
+               sed  -n -e 's/.*\($(SYM_PREFIX)__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
                cd $(LNDIR) && $(LD) $(LDFLAGS) $$UNDEF_SYM $(__OBJS) \
                        --start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \
                        -Map u-boot.map -o u-boot
@@ -325,6 +328,9 @@ $(OBJS):    depend $(obj)include/autoconf.mk
 $(LIBS):       depend $(obj)include/autoconf.mk
                $(MAKE) -C $(dir $(subst $(obj),,$@))
 
+$(LIBBOARD):   depend $(LIBS) $(obj)include/autoconf.mk
+               $(MAKE) -C $(dir $(subst $(obj),,$@))
+
 $(SUBDIRS):    depend $(obj)include/autoconf.mk
                $(MAKE) -C $@ all
 
index 1a3c1df03e01fe9fca9d1d5d39afffcc69fa121e..37eb41b20e642363b0035dcbe7c18eb3787fa230 100644 (file)
@@ -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;
                                }
index 0dddddf0a1fada90b5d991faf2d037ce1233d578..49742f5bfb580697c9fce4c1fab2c69e5c464531 100644 (file)
@@ -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;
index 8d60fd66bf08bbfbef35328f4e96a86fbf72abbe..2e5069687c9b522898e517a0de265adacbea82d1 100644 (file)
@@ -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
index 93645a31e0a086c4c12d6d2d9ec8cd4b93f12f50..73fb08d1cec3e7fcfed6dfd53c2cbf9dcc0b20ec 100644 (file)
@@ -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
index 650e340aee8deea980598f84c2022e332ed4791d..be360f882295732fa42dd7fafed0d6316fa95055 100644 (file)
@@ -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
index 16a0bc3264b1031b394d0180fd5dac5c6a08b269..e4a3cf9fdcbd79a06bfad4cc9f54de9420be5ff1 100644 (file)
@@ -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
index 88433f2f6d6e04494d46b662e528ea5a1547a049..a85d0f9fc50da1a9e74cf656808ac09c50c691c8 100644 (file)
@@ -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
index e5f4385dd35f7ea23099a97f3f9bcd7d33b0140e..eb6b50b2127106dfb89fb998daa0b5260e7d99bd 100644 (file)
@@ -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
index 7e884f8e0142334c96bf15996199d1f6d75d2a76..da5b58b73f29441761d0abd430f8d1f19a879103 100644 (file)
@@ -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;
index 174384eab98d03131d150ce027e481189736b0ee..d1b9f8f5464e0e380e96bb5eecf7ca3e1b9ccd00 100644 (file)
@@ -21,7 +21,7 @@
 #include <asm/errno.h>
 
 /* It should access 16-bit instead of 8-bit */
-static inline void *memcpy(void *dst, const void *src, unsigned int len)
+static inline void *memcpy_16(void *dst, const void *src, unsigned int len)
 {
        void *ret = dst;
        short *d = dst;
@@ -358,7 +358,7 @@ static int onenand_read_bufferram(struct mtd_info *mtd, int area,
        bufferram = this->base + area;
        bufferram += onenand_bufferram_offset(mtd, area);
 
-       memcpy(buffer, bufferram + offset, count);
+       memcpy_16(buffer, bufferram + offset, count);
 
        return 0;
 }
@@ -385,7 +385,7 @@ static int onenand_sync_read_bufferram(struct mtd_info *mtd, int area,
 
        this->mmcontrol(mtd, ONENAND_SYS_CFG1_SYNC_READ);
 
-       memcpy(buffer, bufferram + offset, count);
+       memcpy_16(buffer, bufferram + offset, count);
 
        this->mmcontrol(mtd, 0);
 
@@ -412,7 +412,7 @@ static int onenand_write_bufferram(struct mtd_info *mtd, int area,
        bufferram = this->base + area;
        bufferram += onenand_bufferram_offset(mtd, area);
 
-       memcpy(bufferram + offset, buffer, count);
+       memcpy_16(bufferram + offset, buffer, count);
 
        return 0;
 }
index 0c876f33bdc5e50fc8eae803e5e9c8bd7285b617..2ef91f2d224eafd2f0d77cb873a48635dc4b0319 100644 (file)
@@ -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",
index cf2a9574a98f146fd19a7c114fa7727e84b06a1f..89d4ccdb2c75112a6adb570e553b2971a26a0cec 100644 (file)
@@ -81,7 +81,7 @@ int rtc_get(struct rtc_time *tm)
        tm->tm_hour = BCD2BIN(buf[M41T62_REG_HOUR] & 0x3f);
        tm->tm_mday = BCD2BIN(buf[M41T62_REG_DAY] & 0x3f);
        tm->tm_wday = buf[M41T62_REG_WDAY] & 0x07;
-       tm->tm_mon = BCD2BIN(buf[M41T62_REG_MON] & 0x1f) - 1;
+       tm->tm_mon = BCD2BIN(buf[M41T62_REG_MON] & 0x1f);
 
        /* assume 20YY not 19YY, and ignore the Century Bit */
        /* U-Boot needs to add 1900 here */
@@ -119,7 +119,7 @@ void rtc_set(struct rtc_time *tm)
        buf[M41T62_REG_DAY] =
                BIN2BCD(tm->tm_mday) | (buf[M41T62_REG_DAY] & ~0x3f);
        buf[M41T62_REG_MON] =
-               BIN2BCD(tm->tm_mon + 1) | (buf[M41T62_REG_MON] & ~0x1f);
+               BIN2BCD(tm->tm_mon) | (buf[M41T62_REG_MON] & ~0x1f);
        /* assume 20YY not 19YY */
        buf[M41T62_REG_YEAR] = BIN2BCD(tm->tm_year % 100);
 
index 958736ec709d9131b8237dfa8bdd977b71ccfcd8..c897f2b2a856078f165a9573bfdcb13e1698506f 100644 (file)
@@ -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 */
index 6bb461913a72629203c030c703d2e35e17866401..fea7551cf1a3deb8b13e3e963eb0c15f1a0b5c74 100644 (file)
@@ -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
index cba51c87c1db062f4df65d974c596544e3ff2834..454d0a28dc27a7c67b05c36a23a45bb12e563a5e 100644 (file)
@@ -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
index f6decdca8836bf91fbb69e64fa8372de59cdfa31..9a2f03fe983547f121b0cb76750bb1cb13962ea7 100644 (file)
@@ -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 */
index 793f670e2461032cd0fc0969eddefaae5dd766da..e9c9624907ecc36a08767a1924f40bd14cd70506 100644 (file)
@@ -132,17 +132,17 @@ static sysmon_table_t sysmon_table[] =
 
        {
        "+ 5 V", "V", &sysmon_dspic, NULL, NULL,
-       100, 1000, 0, 0xFFFF, 0xFFFF,
-       VOLTAGE_5V_MIN, VOLTAGE_5V_MAX, 0,
-       VOLTAGE_5V_MIN, VOLTAGE_5V_MAX, 0,
+       100, 1000, -0x8000, 0x7FFF, 0xFFFF,
+       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, 0, 0xFFFF, 0xFFFF,
-       VOLTAGE_5V_STANDBY_MIN, VOLTAGE_5V_STANDBY_MAX, 0,
-       VOLTAGE_5V_STANDBY_MIN, VOLTAGE_5V_STANDBY_MAX, 0,
+       100, 1000, -0x8000, 0x7FFF, 0xFFFF,
+       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,
        },
 };