diff options
author | Haavard Skinnemoen <haavard.skinnemoen@atmel.com> | 2008-08-06 15:12:38 +0200 |
---|---|---|
committer | Haavard Skinnemoen <haavard.skinnemoen@atmel.com> | 2008-08-06 15:12:38 +0200 |
commit | 7772c13ba07eaabd42499998f3713b23350fc119 (patch) | |
tree | 32718a8e67114d0ea5dbdb1fdcf58aad09dd52dc /drivers | |
parent | b2b15ebb66f0e7958dff8916077da0aceb2982a8 (diff) | |
parent | 0eb5717a85b6cba3f67c11fa89bdde38dcd081b5 (diff) | |
download | u-boot-imx-7772c13ba07eaabd42499998f3713b23350fc119.zip u-boot-imx-7772c13ba07eaabd42499998f3713b23350fc119.tar.gz u-boot-imx-7772c13ba07eaabd42499998f3713b23350fc119.tar.bz2 |
Merge branch 'favr-32' of git://git.denx.de/u-boot-avr32
Conflicts:
MAINTAINERS
MAKEALL
Makefile
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/i2c/fsl_i2c.c | 9 | ||||
-rw-r--r-- | drivers/net/e1000.c | 13 | ||||
-rw-r--r-- | drivers/serial/Makefile | 12 | ||||
-rw-r--r-- | drivers/serial/atmel_usart.c | 3 | ||||
-rw-r--r-- | drivers/serial/mcfuart.c | 3 | ||||
-rw-r--r-- | drivers/serial/s3c4510b_uart.c | 4 | ||||
-rw-r--r-- | drivers/serial/serial_max3100.c | 4 | ||||
-rw-r--r-- | drivers/serial/serial_xuartlite.c | 4 | ||||
-rw-r--r-- | drivers/serial/usbtty.c | 5 | ||||
-rw-r--r-- | drivers/video/atmel_lcdfb.c | 4 |
10 files changed, 21 insertions, 40 deletions
diff --git a/drivers/i2c/fsl_i2c.c b/drivers/i2c/fsl_i2c.c index 9d5df8a..3f78e2f 100644 --- a/drivers/i2c/fsl_i2c.c +++ b/drivers/i2c/fsl_i2c.c @@ -173,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; @@ -188,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); @@ -213,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/net/e1000.c b/drivers/net/e1000.c index 060b518..c8b4e98 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 c9e797e..de6fbab 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 f35b997..f3b146c 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 5eb4f45..a1fcd05 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 ddcd591..aa378e1 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 0611fc1..4abc271 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 74546ce..00d0eaa 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 */ @@ -77,5 +75,3 @@ int serial_tstc(void) { return (in_be32((u32 *) UARTLITE_STATUS) & SR_RX_FIFO_VALID_DATA); } - -#endif /* CONFIG_MICROBLZE */ diff --git a/drivers/serial/usbtty.c b/drivers/serial/usbtty.c index 2bc5c3c..e738c56 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/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c index 27df449..b332a82 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; |