diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mtd/onenand/onenand_base.c | 8 | ||||
-rw-r--r-- | drivers/net/fsl_mcdmafec.c | 22 | ||||
-rw-r--r-- | drivers/rtc/m41t62.c | 4 |
3 files changed, 27 insertions, 7 deletions
diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c index 174384e..d1b9f8f 100644 --- a/drivers/mtd/onenand/onenand_base.c +++ b/drivers/mtd/onenand/onenand_base.c @@ -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; } diff --git a/drivers/net/fsl_mcdmafec.c b/drivers/net/fsl_mcdmafec.c index 0c876f3..2ef91f2 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/drivers/rtc/m41t62.c b/drivers/rtc/m41t62.c index cf2a957..89d4ccd 100644 --- a/drivers/rtc/m41t62.c +++ b/drivers/rtc/m41t62.c @@ -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); |