summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/i2c/fsl_i2c.c18
-rw-r--r--drivers/mmc/atmel_mci.c16
-rw-r--r--drivers/mtd/cfi_flash.c5
-rw-r--r--drivers/mtd/spi/atmel.c6
-rw-r--r--drivers/net/e1000.c13
-rw-r--r--drivers/serial/Makefile12
-rw-r--r--drivers/serial/atmel_usart.c3
-rw-r--r--drivers/serial/mcfuart.c3
-rw-r--r--drivers/serial/s3c4510b_uart.c4
-rw-r--r--drivers/serial/serial_max3100.c4
-rw-r--r--drivers/serial/serial_xuartlite.c18
-rw-r--r--drivers/serial/usbtty.c5
-rw-r--r--drivers/usb/usbdcore.c2
-rw-r--r--drivers/video/atmel_lcdfb.c4
14 files changed, 58 insertions, 55 deletions
diff --git a/drivers/i2c/fsl_i2c.c b/drivers/i2c/fsl_i2c.c
index 9f2c1eced4..3f78e2f5c8 100644
--- a/drivers/i2c/fsl_i2c.c
+++ b/drivers/i2c/fsl_i2c.c
@@ -143,12 +143,15 @@ void
i2c_init(int speed, int slaveadd)
{
struct fsl_i2c *dev;
+ unsigned int temp;
dev = (struct fsl_i2c *) (CFG_IMMR + CFG_I2C_OFFSET);
writeb(0, &dev->cr); /* stop I2C controller */
udelay(5); /* let it shutdown in peace */
- i2c_bus_speed[0] = set_i2c_bus_speed(dev, gd->i2c1_clk, speed);
+ temp = set_i2c_bus_speed(dev, gd->i2c1_clk, speed);
+ if (gd->flags & GD_FLG_RELOC)
+ i2c_bus_speed[0] = temp;
writeb(slaveadd << 1, &dev->adr); /* write slave address */
writeb(0x0, &dev->sr); /* clear status register */
writeb(I2C_CR_MEN, &dev->cr); /* start I2C controller */
@@ -158,7 +161,9 @@ i2c_init(int speed, int slaveadd)
writeb(0, &dev->cr); /* stop I2C controller */
udelay(5); /* let it shutdown in peace */
- i2c_bus_speed[1] = set_i2c_bus_speed(dev, gd->i2c2_clk, speed);
+ temp = set_i2c_bus_speed(dev, gd->i2c2_clk, speed);
+ if (gd->flags & GD_FLG_RELOC)
+ i2c_bus_speed[1] = temp;
writeb(slaveadd << 1, &dev->adr); /* write slave address */
writeb(0x0, &dev->sr); /* clear status register */
writeb(I2C_CR_MEN, &dev->cr); /* start I2C controller */
@@ -168,12 +173,11 @@ i2c_init(int speed, int slaveadd)
static __inline__ int
i2c_wait4bus(void)
{
- ulong timeval = get_timer(0);
+ unsigned long long timeval = get_ticks();
while (readb(&i2c_dev[i2c_bus_num]->sr) & I2C_SR_MBB) {
- if (get_timer(timeval) > I2C_TIMEOUT) {
+ if ((get_ticks() - timeval) > usec2ticks(I2C_TIMEOUT))
return -1;
- }
}
return 0;
@@ -183,7 +187,7 @@ static __inline__ int
i2c_wait(int write)
{
u32 csr;
- ulong timeval = get_timer(0);
+ unsigned long long timeval = get_ticks();
do {
csr = readb(&i2c_dev[i2c_bus_num]->sr);
@@ -208,7 +212,7 @@ i2c_wait(int write)
}
return 0;
- } while (get_timer (timeval) < I2C_TIMEOUT);
+ } while ((get_ticks() - timeval) < usec2ticks(I2C_TIMEOUT));
debug("i2c_wait: timed out\n");
return -1;
diff --git a/drivers/mmc/atmel_mci.c b/drivers/mmc/atmel_mci.c
index 61aa1849c2..a151488d12 100644
--- a/drivers/mmc/atmel_mci.c
+++ b/drivers/mmc/atmel_mci.c
@@ -135,10 +135,10 @@ mmc_cmd(unsigned long cmd, unsigned long arg,
status = mmci_readl(SR);
} while (!(status & MMCI_BIT(CMDRDY)));
- pr_debug("mmc: status 0x%08lx\n", status);
+ pr_debug("mmc: status 0x%08x\n", status);
if (status & error_flags) {
- printf("mmc: command %lu failed (status: 0x%08lx)\n",
+ printf("mmc: command %lu failed (status: 0x%08x)\n",
cmd, status);
return -EIO;
}
@@ -245,7 +245,7 @@ out:
read_error:
mmc_cmd(MMC_CMD_SEND_STATUS, mmc_rca << 16, &card_status, R1 | NCR);
- printf("mmc: bread failed, status = %08x, card status = %08x\n",
+ printf("mmc: bread failed, status = %08x, card status = %08lx\n",
status, card_status);
goto out;
}
@@ -284,13 +284,13 @@ static void sd_parse_cid(struct mmc_cid *cid, unsigned long *resp)
static void mmc_dump_cid(const struct mmc_cid *cid)
{
- printf("Manufacturer ID: %02lX\n", cid->mid);
- printf("OEM/Application ID: %04lX\n", cid->oid);
+ printf("Manufacturer ID: %02X\n", cid->mid);
+ printf("OEM/Application ID: %04X\n", cid->oid);
printf("Product name: %s\n", cid->pnm);
- printf("Product Revision: %lu.%lu\n",
+ printf("Product Revision: %u.%u\n",
cid->prv >> 4, cid->prv & 0x0f);
printf("Product Serial Number: %lu\n", cid->psn);
- printf("Manufacturing Date: %02lu/%02lu\n",
+ printf("Manufacturing Date: %02u/%02u\n",
cid->mdt >> 4, cid->mdt & 0x0f);
}
@@ -501,7 +501,7 @@ int mmc_init(int verbose)
mmc_blkdev.part_type = PART_TYPE_DOS;
mmc_blkdev.block_read = mmc_bread;
sprintf((char *)mmc_blkdev.vendor,
- "Man %02x%04x Snr %08x",
+ "Man %02x%04x Snr %08lx",
cid.mid, cid.oid, cid.psn);
strncpy((char *)mmc_blkdev.product, cid.pnm,
sizeof(mmc_blkdev.product));
diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index 4340b1b5c7..12647ef986 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -306,6 +306,9 @@ static void flash_make_cmd(flash_info_t *info, u32 cmd, void *cmdbuf)
int i;
int cword_offset;
int cp_offset;
+#if defined(__LITTLE_ENDIAN) || defined(CFG_WRITE_SWAPPED_DATA)
+ u32 cmd_le = cpu_to_le32(cmd);
+#endif
uchar val;
uchar *cp = (uchar *) cmdbuf;
@@ -313,7 +316,7 @@ static void flash_make_cmd(flash_info_t *info, u32 cmd, void *cmdbuf)
cword_offset = (info->portwidth-i)%info->chipwidth;
#if defined(__LITTLE_ENDIAN) || defined(CFG_WRITE_SWAPPED_DATA)
cp_offset = info->portwidth - i;
- val = *((uchar*)&cmd + cword_offset);
+ val = *((uchar*)&cmd_le + cword_offset);
#else
cp_offset = i - 1;
val = *((uchar*)&cmd + sizeof(u32) - cword_offset - 1);
diff --git a/drivers/mtd/spi/atmel.c b/drivers/mtd/spi/atmel.c
index fb7a4a939b..10fcf0cdde 100644
--- a/drivers/mtd/spi/atmel.c
+++ b/drivers/mtd/spi/atmel.c
@@ -205,7 +205,7 @@ static int dataflash_write_at45(struct spi_flash *flash,
byte_addr = 0;
}
- debug("SF: AT45: Successfully programmed %u bytes @ 0x%x\n",
+ debug("SF: AT45: Successfully programmed %zu bytes @ 0x%x\n",
len, offset);
ret = 0;
@@ -268,7 +268,7 @@ int dataflash_erase_at45(struct spi_flash *flash, u32 offset, size_t len)
page_addr++;
}
- debug("SF: AT45: Successfully erased %u bytes @ 0x%x\n",
+ debug("SF: AT45: Successfully erased %zu bytes @ 0x%x\n",
len, offset);
ret = 0;
@@ -351,7 +351,7 @@ struct spi_flash *spi_flash_probe_atmel(struct spi_slave *spi, u8 *idcode)
* params->blocks_per_sector
* params->nr_sectors;
- debug("SF: Detected %s with page size %u, total %u bytes\n",
+ debug("SF: Detected %s with page size %lu, total %u bytes\n",
params->name, page_size, asf->flash.size);
return &asf->flash;
diff --git a/drivers/net/e1000.c b/drivers/net/e1000.c
index 060b518996..c8b4e98c66 100644
--- a/drivers/net/e1000.c
+++ b/drivers/net/e1000.c
@@ -513,9 +513,11 @@ e1000_read_mac_addr(struct eth_device *nic)
nic->enetaddr[5] += 1;
}
#ifdef CONFIG_E1000_FALLBACK_MAC
- if ( *(u32*)(nic->enetaddr) == 0 || *(u32*)(nic->enetaddr) == ~0 )
- for ( i=0; i < NODE_ADDRESS_SIZE; i++ )
- nic->enetaddr[i] = (CONFIG_E1000_FALLBACK_MAC >> (8*(5-i))) & 0xff;
+ if ( *(u32*)(nic->enetaddr) == 0 || *(u32*)(nic->enetaddr) == ~0 ) {
+ unsigned char fb_mac[NODE_ADDRESS_SIZE] = CONFIG_E1000_FALLBACK_MAC;
+
+ memcpy (nic->enetaddr, fb_mac, NODE_ADDRESS_SIZE);
+ }
#endif
#else
/*
@@ -531,10 +533,9 @@ e1000_read_mac_addr(struct eth_device *nic)
DEBUGFUNC();
s = getenv ("ethaddr");
- if (s == NULL){
+ if (s == NULL) {
return -E1000_ERR_EEPROM;
- }
- else{
+ } else {
for(ii = 0; ii < 6; ii++) {
nic->enetaddr[ii] = s ? simple_strtoul (s, &e, 16) : 0;
if (s){
diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index c9e797e8c0..de6fbab740 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -25,18 +25,18 @@ include $(TOPDIR)/config.mk
LIB := $(obj)libserial.a
-COBJS-y += atmel_usart.o
-COBJS-y += mcfuart.o
+COBJS-$(CONFIG_ATMEL_USART) += atmel_usart.o
+COBJS-$(CONFIG_MCFUART) += mcfuart.o
COBJS-y += ns9750_serial.o
COBJS-y += ns16550.o
-COBJS-y += s3c4510b_uart.o
+COBJS-$(CONFIG_DRIVER_S3C4510_UART) += s3c4510b_uart.o
COBJS-y += serial.o
-COBJS-y += serial_max3100.o
+COBJS-$(CONFIG_MAX3100_SERIAL) += serial_max3100.o
COBJS-y += serial_pl010.o
COBJS-y += serial_pl011.o
-COBJS-y += serial_xuartlite.o
+COBJS-$(CONFIG_XILINX_UARTLITE) += serial_xuartlite.o
COBJS-y += serial_sh.o
-COBJS-y += usbtty.o
+COBJS-$(CONFIG_USB_TTY) += usbtty.o
COBJS := $(COBJS-y)
SRCS := $(COBJS:.o=.c)
diff --git a/drivers/serial/atmel_usart.c b/drivers/serial/atmel_usart.c
index f35b99730f..f3b146c22d 100644
--- a/drivers/serial/atmel_usart.c
+++ b/drivers/serial/atmel_usart.c
@@ -17,7 +17,6 @@
*/
#include <common.h>
-#ifdef CONFIG_ATMEL_USART
#include <asm/io.h>
#include <asm/arch/clk.h>
#include <asm/arch/memory-map.h>
@@ -96,5 +95,3 @@ int serial_tstc(void)
{
return (usart3_readl(CSR) & USART3_BIT(RXRDY)) != 0;
}
-
-#endif /* CONFIG_ATMEL_USART */
diff --git a/drivers/serial/mcfuart.c b/drivers/serial/mcfuart.c
index 5eb4f458f8..a1fcd057a4 100644
--- a/drivers/serial/mcfuart.c
+++ b/drivers/serial/mcfuart.c
@@ -29,8 +29,6 @@
#include <common.h>
-#ifdef CONFIG_MCFUART
-
#include <asm/immap.h>
#include <asm/uart.h>
@@ -130,4 +128,3 @@ void serial_setbrg(void)
uart->ucr = UART_UCR_RX_ENABLED | UART_UCR_TX_ENABLED;
}
-#endif /* CONFIG_MCFUART */
diff --git a/drivers/serial/s3c4510b_uart.c b/drivers/serial/s3c4510b_uart.c
index ddcd591f84..aa378e1ac1 100644
--- a/drivers/serial/s3c4510b_uart.c
+++ b/drivers/serial/s3c4510b_uart.c
@@ -45,8 +45,6 @@
#include <common.h>
-#ifdef CONFIG_DRIVER_S3C4510_UART
-
#include <asm/hardware.h>
#include "s3c4510b_uart.h"
@@ -212,5 +210,3 @@ void serial_puts (const char *s)
uart->m_ctrl.bf.sendBreak = 0;
}
-
-#endif
diff --git a/drivers/serial/serial_max3100.c b/drivers/serial/serial_max3100.c
index 0611fc1dd4..4abc27109b 100644
--- a/drivers/serial/serial_max3100.c
+++ b/drivers/serial/serial_max3100.c
@@ -26,8 +26,6 @@
#include <common.h>
#include <watchdog.h>
-#ifdef CONFIG_MAX3100_SERIAL
-
DECLARE_GLOBAL_DATA_PTR;
/**************************************************************/
@@ -298,5 +296,3 @@ int serial_tstc(void)
void serial_setbrg(void)
{
}
-
-#endif
diff --git a/drivers/serial/serial_xuartlite.c b/drivers/serial/serial_xuartlite.c
index 61e68873eb..ef6371e66e 100644
--- a/drivers/serial/serial_xuartlite.c
+++ b/drivers/serial/serial_xuartlite.c
@@ -27,8 +27,6 @@
#include <config.h>
#include <asm/io.h>
-#ifdef CONFIG_XILINX_UARTLITE
-
#define RX_FIFO_OFFSET 0 /* receive FIFO, read only */
#define TX_FIFO_OFFSET 4 /* transmit FIFO, write only */
#define STATUS_REG_OFFSET 8 /* status register, read only */
@@ -56,8 +54,13 @@ void serial_putc(const char c)
{
if (c == '\n')
serial_putc('\r');
+<<<<<<< .merge_file_kaofiJ
while (in_be32((void *)UARTLITE_STATUS) & SR_TX_FIFO_FULL);
out_be32((void *)UARTLITE_TX_FIFO, (unsigned char) (c & 0xff));
+=======
+ while (in_be32((u32 *) UARTLITE_STATUS) & SR_TX_FIFO_FULL);
+ out_be32((u32 *) UARTLITE_TX_FIFO, (unsigned char) (c & 0xff));
+>>>>>>> .merge_file_zSz9BG
}
void serial_puts(const char * s)
@@ -69,13 +72,20 @@ void serial_puts(const char * s)
int serial_getc(void)
{
+<<<<<<< .merge_file_kaofiJ
while (!(in_be32((void *)UARTLITE_STATUS) & SR_RX_FIFO_VALID_DATA));
return in_be32((void *)UARTLITE_RX_FIFO) & 0xff;
+=======
+ while (!(in_be32((u32 *) UARTLITE_STATUS) & SR_RX_FIFO_VALID_DATA));
+ return in_be32((u32 *) UARTLITE_RX_FIFO) & 0xff;
+>>>>>>> .merge_file_zSz9BG
}
int serial_tstc(void)
{
+<<<<<<< .merge_file_kaofiJ
return (in_be32((void *)UARTLITE_STATUS) & SR_RX_FIFO_VALID_DATA);
+=======
+ return (in_be32((u32 *) UARTLITE_STATUS) & SR_RX_FIFO_VALID_DATA);
+>>>>>>> .merge_file_zSz9BG
}
-
-#endif /* CONFIG_MICROBLZE */
diff --git a/drivers/serial/usbtty.c b/drivers/serial/usbtty.c
index 2bc5c3c838..e738c56271 100644
--- a/drivers/serial/usbtty.c
+++ b/drivers/serial/usbtty.c
@@ -23,8 +23,6 @@
#include <common.h>
-#ifdef CONFIG_USB_TTY
-
#include <circbuf.h>
#include <devices.h>
#include "usbtty.h"
@@ -1007,6 +1005,3 @@ void usbtty_poll (void)
udc_irq();
}
-
-
-#endif
diff --git a/drivers/usb/usbdcore.c b/drivers/usb/usbdcore.c
index 808da9faa5..53ed669e97 100644
--- a/drivers/usb/usbdcore.c
+++ b/drivers/usb/usbdcore.c
@@ -552,7 +552,7 @@ struct urb *usbd_alloc_urb (struct usb_device_instance *device,
struct urb *urb;
if (!(urb = (struct urb *) malloc (sizeof (struct urb)))) {
- usberr (" F A T A L: malloc(%u) FAILED!!!!",
+ usberr (" F A T A L: malloc(%zu) FAILED!!!!",
sizeof (struct urb));
return NULL;
}
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index 27df449660..b332a825e3 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -100,7 +100,11 @@ void lcd_ctrl_init(void *lcdbase)
value << ATMEL_LCDC_CLKVAL_OFFSET);
/* Initialize control register 2 */
+#ifdef CONFIG_AVR32
+ value = ATMEL_LCDC_MEMOR_BIG | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE;
+#else
value = ATMEL_LCDC_MEMOR_LITTLE | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE;
+#endif
if (panel_info.vl_tft)
value |= ATMEL_LCDC_DISTYPE_TFT;