From 4109df6f75fc00ab7da56d286ba50149a0d16a69 Mon Sep 17 00:00:00 2001 From: Kim Phillips Date: Thu, 10 Jul 2008 14:00:15 -0500 Subject: silence misc printf formatting compiler warnings Signed-off-by: Kim Phillips --- drivers/block/fsl_sata.c | 2 +- drivers/block/libata.c | 2 +- drivers/rtc/ds1374.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/block/fsl_sata.c b/drivers/block/fsl_sata.c index d441a30..55f593a 100644 --- a/drivers/block/fsl_sata.c +++ b/drivers/block/fsl_sata.c @@ -510,7 +510,7 @@ static int fsl_sata_exec_cmd(struct fsl_sata *sata, struct cfis *cfis, int rc; if (tag > SATA_HC_MAX_CMD || tag < 0) { - printf("tag is out of range, tag=\n\r", tag); + printf("tag is out of range, tag=%d\n\r", tag); return -1; } diff --git a/drivers/block/libata.c b/drivers/block/libata.c index 90e9a43..65b0203 100644 --- a/drivers/block/libata.c +++ b/drivers/block/libata.c @@ -107,7 +107,7 @@ void ata_dump_id(u16 *id) /* Total sectors of device */ n_sectors = ata_id_n_sectors(id); - printf("Capablity: %d sectors\n\r", n_sectors); + printf("Capablity: %lld sectors\n\r", n_sectors); printf ("id[49]: capabilities = 0x%04x\n" "id[53]: field valid = 0x%04x\n" diff --git a/drivers/rtc/ds1374.c b/drivers/rtc/ds1374.c index f6bb296..1533b60 100644 --- a/drivers/rtc/ds1374.c +++ b/drivers/rtc/ds1374.c @@ -141,7 +141,7 @@ int rtc_get (struct rtc_time *tm){ rel = -1; } - DEBUGR ("Get RTC s since 1.1.1970: %d\n", time1); + DEBUGR ("Get RTC s since 1.1.1970: %ld\n", time1); to_tm(time1, tm); /* To Gregorian Date */ @@ -176,7 +176,7 @@ void rtc_set (struct rtc_time *tmp){ tmp->tm_mday, tmp->tm_hour, tmp->tm_min, tmp->tm_sec); - DEBUGR ("Set RTC s since 1.1.1970: %d (0x%02x)\n", time, time); + DEBUGR ("Set RTC s since 1.1.1970: %ld (0x%02lx)\n", time, time); /* write to RTC_TOD_CNT_BYTEn_ADDR */ for (i = 0; i <= 3; i++) { -- cgit v1.1 From c6457e3b8bc79a97381cf7deffa08f7c5a24f86c Mon Sep 17 00:00:00 2001 From: Sergey Lapin Date: Thu, 5 Jun 2008 11:06:29 +0400 Subject: DataFlash AT45DB021 support Some boards based on AT91SAM926X-EK use smaller DF chips to keep bootstrap, u-boot and its environment, using NAND or other external storage for kernel and rootfs. This patch adds support for small 1024x263 chip. Signed-off-by: Sergey Lapin --- drivers/mtd/dataflash.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'drivers') diff --git a/drivers/mtd/dataflash.c b/drivers/mtd/dataflash.c index 8247aa0..a092dc6 100644 --- a/drivers/mtd/dataflash.c +++ b/drivers/mtd/dataflash.c @@ -54,6 +54,17 @@ int AT91F_DataflashInit (void) &dataflash_info[i].Desc); switch (dfcode) { + case AT45DB021: + dataflash_info[i].Device.pages_number = 1024; + dataflash_info[i].Device.pages_size = 263; + dataflash_info[i].Device.page_offset = 9; + dataflash_info[i].Device.byte_mask = 0x300; + dataflash_info[i].Device.cs = cs[i].cs; + dataflash_info[i].Desc.DataFlash_state = IDLE; + dataflash_info[i].logical_address = cs[i].addr; + dataflash_info[i].id = dfcode; + found[i] += dfcode;; + break; case AT45DB161: dataflash_info[i].Device.pages_number = 4096; dataflash_info[i].Device.pages_size = 528; @@ -178,6 +189,9 @@ void dataflash_print_info (void) if (dataflash_info[i].id != 0) { printf("DataFlash:"); switch (dataflash_info[i].id) { + case AT45DB021: + printf("AT45DB021\n"); + break; case AT45DB161: printf("AT45DB161\n"); break; -- cgit v1.1 From 9b55a2536919f4de1bb1044e6eb8262c2f53bc96 Mon Sep 17 00:00:00 2001 From: Wolfgang Denk Date: Fri, 11 Jul 2008 01:16:00 +0200 Subject: Fix some more print() format errors. Signed-off-by: Wolfgang Denk --- drivers/net/uli526x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/net/uli526x.c b/drivers/net/uli526x.c index 7145b72..d87638c 100644 --- a/drivers/net/uli526x.c +++ b/drivers/net/uli526x.c @@ -563,7 +563,7 @@ static int uli526x_rx_packet(struct eth_device *dev) /* error summary bit check */ if (rdes0 & 0x8000) { /* This is a error packet */ - printf("Eroor: rdes0: %lx\n", rdes0); + printf("Error: rdes0: %x\n", rdes0); } if (!(rdes0 & 0x8000) || -- cgit v1.1 From 81cc32322acb1b3225ee45606ced48e2a14824dc Mon Sep 17 00:00:00 2001 From: TsiChung Liew Date: Thu, 29 May 2008 12:21:54 -0500 Subject: ColdFire: Fix UART baudrate formula The formula "counter = (u32) (gd->bus_clk / gd->baudrate) / 32" can generate the wrong divisor due to integer division truncation. Round the calculated divisor value by adding 1/2 the baudrate before dividing by the baudrate. Signed-off-by: TsiChung Liew Acked-by: Gerald Van Baren --- drivers/serial/mcfuart.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/serial/mcfuart.c b/drivers/serial/mcfuart.c index 88f3eb1..5eb4f45 100644 --- a/drivers/serial/mcfuart.c +++ b/drivers/serial/mcfuart.c @@ -63,8 +63,8 @@ int serial_init(void) uart->umr = UART_UMR_SB_STOP_BITS_1; /* Setting up BaudRate */ - counter = (u32) (gd->bus_clk / (gd->baudrate)); - counter >>= 5; + counter = (u32) ((gd->bus_clk / 32) + (gd->baudrate / 2)); + counter = counter / gd->baudrate; /* write to CTUR: divide counter upper byte */ uart->ubg1 = (u8) ((counter & 0xff00) >> 8); -- cgit v1.1 From bde63587622c4b830a27d1ddf7265843de9e994f Mon Sep 17 00:00:00 2001 From: Wolfgang Denk Date: Fri, 11 Jul 2008 22:56:11 +0200 Subject: Fix some more printf() format issues. Signed-off-by: Wolfgang Denk --- drivers/net/tsi108_eth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/net/tsi108_eth.c b/drivers/net/tsi108_eth.c index 57c0dc3..2534097 100644 --- a/drivers/net/tsi108_eth.c +++ b/drivers/net/tsi108_eth.c @@ -899,7 +899,7 @@ static int tsi108_eth_send (struct eth_device *dev, status = le32_to_cpu(tx_descr->config_status); if ((status & DMA_DESCR_TX_OK) == 0) { #ifdef TX_PRINT_ERRORS - printf ("TX packet error: 0x%08x\n %s%s%s%s\n", status, + printf ("TX packet error: 0x%08lx\n %s%s%s%s\n", status, status & DMA_DESCR_TX_OK ? "tx error, " : "", status & DMA_DESCR_TX_RETRY_LIMIT ? "retry limit reached, " : "", @@ -959,7 +959,7 @@ static int tsi108_eth_recv (struct eth_device *dev) status = le32_to_cpu(rx_descr->config_status); if (status & DMA_DESCR_RX_BAD_FRAME) { #ifdef RX_PRINT_ERRORS - printf ("RX packet error: 0x%08x\n %s%s%s%s%s%s\n", + printf ("RX packet error: 0x%08lx\n %s%s%s%s%s%s\n", status, status & DMA_DESCR_RX_FRAME_IS_TYPE ? "too big, " : "", -- cgit v1.1 From ef130d3093bdf88f01cf3e000fe5df249ebf2b1a Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Fri, 11 Jul 2008 10:24:15 -0400 Subject: Fix integer overflow warning in calc_divisor() which happened when rounding the serial port clock divisor Signed-off-by: Hugo Villeneuve --- drivers/serial/serial.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c index 182ca2d..4ccaee2 100644 --- a/drivers/serial/serial.c +++ b/drivers/serial/serial.c @@ -124,6 +124,8 @@ static NS16550_t serial_ports[4] = { static int calc_divisor (NS16550_t port) { + uint32_t clk_divisor; + #ifdef CONFIG_OMAP1510 /* If can't cleanly clock 115200 set div to 1 */ if ((CFG_NS16550_CLK == 12000000) && (gd->baudrate == 115200)) { @@ -147,10 +149,15 @@ static int calc_divisor (NS16550_t port) /* Compute divisor value. Normally, we should simply return: * CFG_NS16550_CLK) / MODE_X_DIV / gd->baudrate - * but we need to round that value by adding 0.5 or 8/16. + * but we need to round that value by adding 0.5 (2/4). * Rounding is especially important at high baud rates. */ - return (((16 * CFG_NS16550_CLK) / MODE_X_DIV / gd->baudrate) + 8) / 16; + clk_divisor = (((4 * CFG_NS16550_CLK) / + (MODE_X_DIV * gd->baudrate)) + 2) / 4; + + debug("NS16550 clock divisor = %d\n", clk_divisor); + + return clk_divisor; } #if !defined(CONFIG_SERIAL_MULTI) -- cgit v1.1 From 53ea981c3124b13c137c2d10e975b7c6672266e0 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Fri, 11 Jul 2008 10:10:31 +0200 Subject: microblaze: Clean uartlite driver Redesign uartlite driver to in_be32 and out_be32 macros Fix missing header in io.h Signed-off-by: Michal Simek Acked-by: Grant Likely --- drivers/serial/serial_xuartlite.c | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) (limited to 'drivers') diff --git a/drivers/serial/serial_xuartlite.c b/drivers/serial/serial_xuartlite.c index d678ab6..5c41a1c 100644 --- a/drivers/serial/serial_xuartlite.c +++ b/drivers/serial/serial_xuartlite.c @@ -1,6 +1,8 @@ /* - * (C) Copyright 2004 Atmark Techno, Inc. + * (C) Copyright 2008 Michal Simek + * Clean driver and add xilinx constant from header file * + * (C) Copyright 2004 Atmark Techno, Inc. * Yasushi SHOJI * * See file CREDITS for list of people who contributed to this @@ -13,7 +15,7 @@ * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License @@ -23,19 +25,21 @@ */ #include +#include #ifdef CONFIG_XILINX_UARTLITE -#include +#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 */ -/* FIXME: we should convert these to in32 and out32 */ -#define IO_WORD(offset) (*(volatile unsigned long *)(offset)) -#define IO_SERIAL(offset) IO_WORD(CONFIG_SERIAL_BASE + (offset)) +#define SR_TX_FIFO_FULL 0x08 /* transmit FIFO full */ +#define SR_RX_FIFO_VALID_DATA 0x01 /* data in receive FIFO */ +#define SR_RX_FIFO_FULL 0x02 /* receive FIFO full */ -#define IO_SERIAL_RX_FIFO IO_SERIAL(XUL_RX_FIFO_OFFSET) -#define IO_SERIAL_TX_FIFO IO_SERIAL(XUL_TX_FIFO_OFFSET) -#define IO_SERIAL_STATUS IO_SERIAL(XUL_STATUS_REG_OFFSET) -#define IO_SERIAL_CONTROL IO_SERIAL(XUL_CONTROL_REG_OFFSET) +#define UARTLITE_STATUS (CONFIG_SERIAL_BASE + STATUS_REG_OFFSET) +#define UARTLITE_TX_FIFO (CONFIG_SERIAL_BASE + TX_FIFO_OFFSET) +#define UARTLITE_RX_FIFO (CONFIG_SERIAL_BASE + RX_FIFO_OFFSET) int serial_init(void) { @@ -50,9 +54,10 @@ void serial_setbrg(void) void serial_putc(const char c) { - if (c == '\n') serial_putc('\r'); - while (IO_SERIAL_STATUS & XUL_SR_TX_FIFO_FULL); - IO_SERIAL_TX_FIFO = (unsigned char) (c & 0xff); + if (c == '\n') + serial_putc('\r'); + while (in_be32(UARTLITE_STATUS) & SR_TX_FIFO_FULL); + out_be32(UARTLITE_TX_FIFO, (unsigned char) (c & 0xff)); } void serial_puts(const char * s) @@ -64,13 +69,13 @@ void serial_puts(const char * s) int serial_getc(void) { - while (!(IO_SERIAL_STATUS & XUL_SR_RX_FIFO_VALID_DATA)); - return IO_SERIAL_RX_FIFO & 0xff; + while (!(in_be32(UARTLITE_STATUS) & SR_RX_FIFO_VALID_DATA)); + return in_be32(UARTLITE_RX_FIFO) & 0xff; } int serial_tstc(void) { - return (IO_SERIAL_STATUS & XUL_SR_RX_FIFO_VALID_DATA); + return (in_be32(UARTLITE_STATUS) & SR_RX_FIFO_VALID_DATA); } #endif /* CONFIG_MICROBLZE */ -- cgit v1.1 From 6ecbb45bb027e90c19d63b48e7b0c05acc1a87c0 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Fri, 11 Jul 2008 11:50:53 +0200 Subject: hwmon: Cleaning hwmon devices Clean Makefile Move device specific values to driver for better reading Signed-off-by: Michal Simek Acked-by: Stefan Roese --- drivers/hwmon/Makefile | 12 ++++++------ drivers/hwmon/adm1021.c | 35 +++++++++++++++++++++++++++++++---- drivers/hwmon/ds1621.c | 12 ++++++++---- drivers/hwmon/ds1722.c | 5 ----- drivers/hwmon/ds1775.c | 8 ++++---- drivers/hwmon/lm73.c | 6 ++++++ drivers/hwmon/lm75.c | 8 ++++---- drivers/hwmon/lm81.c | 8 +++++--- 8 files changed, 64 insertions(+), 30 deletions(-) (limited to 'drivers') diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile index 065433a..61b028f 100644 --- a/drivers/hwmon/Makefile +++ b/drivers/hwmon/Makefile @@ -30,13 +30,13 @@ include $(TOPDIR)/config.mk LIB = $(obj)libhwmon.a -COBJS-y += adm1021.o -COBJS-y += ds1621.o -COBJS-y += ds1722.o -COBJS-y += ds1775.o +COBJS-$(CONFIG_DTT_ADM1021) += adm1021.o +COBJS-$(CONFIG_DTT_DS1621) += ds1621.o +COBJS-$(CONFIG_DS1722) += ds1722.o +COBJS-$(CONFIG_DTT_DS1775) += ds1775.o COBJS-$(CONFIG_DTT_LM73) += lm73.o -COBJS-y += lm75.o -COBJS-y += lm81.o +COBJS-$(CONFIG_DTT_LM75) += lm75.o +COBJS-$(CONFIG_DTT_LM81) += lm81.o COBJS := $(COBJS-y) SRCS := $(COBJS:.o=.c) diff --git a/drivers/hwmon/adm1021.c b/drivers/hwmon/adm1021.c index 9f65cfb..b791ec0 100644 --- a/drivers/hwmon/adm1021.c +++ b/drivers/hwmon/adm1021.c @@ -33,11 +33,40 @@ #include -#ifdef CONFIG_DTT_ADM1021 - #include #include +#define DTT_READ_LOC_VALUE 0x00 +#define DTT_READ_REM_VALUE 0x01 +#define DTT_READ_STATUS 0x02 +#define DTT_READ_CONFIG 0x03 +#define DTT_READ_CONVRATE 0x04 +#define DTT_READ_LOC_HIGHLIM 0x05 +#define DTT_READ_LOC_LOWLIM 0x06 +#define DTT_READ_REM_HIGHLIM 0x07 +#define DTT_READ_REM_LOWLIM 0x08 +#define DTT_READ_DEVID 0xfe + +#define DTT_WRITE_CONFIG 0x09 +#define DTT_WRITE_CONVRATE 0x0a +#define DTT_WRITE_LOC_HIGHLIM 0x0b +#define DTT_WRITE_LOC_LOWLIM 0x0c +#define DTT_WRITE_REM_HIGHLIM 0x0d +#define DTT_WRITE_REM_LOWLIM 0x0e +#define DTT_WRITE_ONESHOT 0x0f + +#define DTT_STATUS_BUSY 0x80 /* 1=ADC Converting */ +#define DTT_STATUS_LHIGH 0x40 /* 1=Local High Temp Limit Tripped */ +#define DTT_STATUS_LLOW 0x20 /* 1=Local Low Temp Limit Tripped */ +#define DTT_STATUS_RHIGH 0x10 /* 1=Remote High Temp Limit Tripped */ +#define DTT_STATUS_RLOW 0x08 /* 1=Remote Low Temp Limit Tripped */ +#define DTT_STATUS_OPEN 0x04 /* 1=Remote Sensor Open-Circuit */ + +#define DTT_CONFIG_ALERT_MASKED 0x80 /* 0=ALERT Enabled, 1=ALERT Masked */ +#define DTT_CONFIG_STANDBY 0x40 /* 0=Run, 1=Standby */ + +#define DTT_ADM1021_DEVID 0x41 + typedef struct { uint i2c_addr:7; /* 7bit i2c chip address */ @@ -170,5 +199,3 @@ dtt_get_temp (int sensor) return (int) val; } /* dtt_get_temp() */ - -#endif /* CONFIG_DTT_ADM1021 */ diff --git a/drivers/hwmon/ds1621.c b/drivers/hwmon/ds1621.c index 4948181..749aa26 100644 --- a/drivers/hwmon/ds1621.c +++ b/drivers/hwmon/ds1621.c @@ -27,7 +27,6 @@ #include -#ifdef CONFIG_DTT_DS1621 #if !defined(CFG_EEPROM_PAGE_WRITE_ENABLE) || \ (CFG_EEPROM_PAGE_WRITE_BITS < 1) # error "CFG_EEPROM_PAGE_WRITE_ENABLE must be defined and CFG_EEPROM_PAGE_WRITE_BITS must be greater than 1 to use CONFIG_DTT_DS1621" @@ -39,6 +38,14 @@ * Device code */ #define DTT_I2C_DEV_CODE 0x48 /* Dallas Semi's DS1621 */ +#define DTT_READ_TEMP 0xAA +#define DTT_READ_COUNTER 0xA8 +#define DTT_READ_SLOPE 0xA9 +#define DTT_WRITE_START_CONV 0xEE +#define DTT_WRITE_STOP_CONV 0x22 +#define DTT_TEMP_HIGH 0xA1 +#define DTT_TEMP_LOW 0xA2 +#define DTT_CONFIG 0xAC int dtt_read(int sensor, int reg) { @@ -185,6 +192,3 @@ int dtt_get_temp(int sensor) return (dtt_read(sensor, DTT_READ_TEMP) / 256); } /* dtt_get_temp() */ - - -#endif /* CONFIG_DTT_DS1621 */ diff --git a/drivers/hwmon/ds1722.c b/drivers/hwmon/ds1722.c index c19ee01..7e2f1ed 100644 --- a/drivers/hwmon/ds1722.c +++ b/drivers/hwmon/ds1722.c @@ -1,8 +1,5 @@ #include - -#ifdef CONFIG_DS1722 - #include static void ds1722_select(int dev) @@ -138,5 +135,3 @@ int ds1722_probe(int dev) printf("%d.%d deg C\n\n", (char)(temp >> 8), temp & 0xff); return 0; } - -#endif diff --git a/drivers/hwmon/ds1775.c b/drivers/hwmon/ds1775.c index 0fbb0b4..6a4d8e5 100644 --- a/drivers/hwmon/ds1775.c +++ b/drivers/hwmon/ds1775.c @@ -21,11 +21,14 @@ #include -#ifdef CONFIG_DTT_DS1775 #include #include #define DTT_I2C_DEV_CODE CFG_I2C_DTT_ADDR /* Dallas Semi's DS1775 device code */ +#define DTT_READ_TEMP 0x0 +#define DTT_CONFIG 0x1 +#define DTT_TEMP_HYST 0x2 +#define DTT_TEMP_OS 0x3 int dtt_read(int sensor, int reg) { @@ -151,6 +154,3 @@ int dtt_get_temp(int sensor) { return (dtt_read(sensor, DTT_READ_TEMP) / 256); } - - -#endif /* CONFIG_DTT_DS1775 */ diff --git a/drivers/hwmon/lm73.c b/drivers/hwmon/lm73.c index 98e8bd2..dd24683 100644 --- a/drivers/hwmon/lm73.c +++ b/drivers/hwmon/lm73.c @@ -38,6 +38,12 @@ * Device code */ #define DTT_I2C_DEV_CODE 0x48 /* National Semi's LM73 device */ +#define DTT_READ_TEMP 0x0 +#define DTT_CONFIG 0x1 +#define DTT_TEMP_HIGH 0x2 +#define DTT_TEMP_LOW 0x3 +#define DTT_CONTROL 0x4 +#define DTT_ID 0x7 int dtt_read(int const sensor, int const reg) { diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c index c348517..8051cb2 100644 --- a/drivers/hwmon/lm75.c +++ b/drivers/hwmon/lm75.c @@ -27,7 +27,6 @@ #include -#ifdef CONFIG_DTT_LM75 #if !defined(CFG_EEPROM_PAGE_WRITE_ENABLE) || \ (CFG_EEPROM_PAGE_WRITE_BITS < 1) # error "CFG_EEPROM_PAGE_WRITE_ENABLE must be defined and CFG_EEPROM_PAGE_WRITE_BITS must be greater than 1 to use CONFIG_DTT_LM75" @@ -36,11 +35,14 @@ #include #include - /* * Device code */ #define DTT_I2C_DEV_CODE 0x48 /* ON Semi's LM75 device */ +#define DTT_READ_TEMP 0x0 +#define DTT_CONFIG 0x1 +#define DTT_TEMP_HYST 0x2 +#define DTT_TEMP_SET 0x3 int dtt_read(int sensor, int reg) { @@ -200,5 +202,3 @@ int dtt_get_temp(int sensor) } return (int)((int16_t) ret / 256); } /* dtt_get_temp() */ - -#endif /* CONFIG_DTT_LM75 */ diff --git a/drivers/hwmon/lm81.c b/drivers/hwmon/lm81.c index 03bc53d..9349eb6 100644 --- a/drivers/hwmon/lm81.c +++ b/drivers/hwmon/lm81.c @@ -32,7 +32,6 @@ #include -#ifdef CONFIG_DTT_LM81 #if !defined(CFG_EEPROM_PAGE_WRITE_ENABLE) || \ (CFG_EEPROM_PAGE_WRITE_BITS < 1) # error "CFG_EEPROM_PAGE_WRITE_ENABLE must be defined and CFG_EEPROM_PAGE_WRITE_BITS must be greater than 1 to use CONFIG_DTT_LM81" @@ -45,6 +44,11 @@ * Device code */ #define DTT_I2C_DEV_CODE 0x2c /* ON Semi's LM81 device */ +#define DTT_READ_TEMP 0x27 +#define DTT_CONFIG_TEMP 0x4b +#define DTT_TEMP_MAX 0x39 +#define DTT_TEMP_HYST 0x3a +#define DTT_CONFIG 0x40 int dtt_read(int sensor, int reg) { @@ -144,5 +148,3 @@ int dtt_get_temp(int sensor) return (TEMP_FROM_REG((val << 1) + ((tmpcnf & 0x80) >> 7))) / 10; } /* dtt_get_temp() */ - -#endif /* CONFIG_DTT_LM81 */ -- cgit v1.1 From 18c8a28aad49803780bd8d52432ded528e37e701 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Fri, 11 Jul 2008 15:11:57 +0200 Subject: hwmon: rename CONFIG_DS1722 to CONFIG_DTT_DS1722 Signed-off-by: Michal Simek Acked-by: Stefan Roese --- drivers/hwmon/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile index 61b028f..f09f145 100644 --- a/drivers/hwmon/Makefile +++ b/drivers/hwmon/Makefile @@ -32,7 +32,7 @@ LIB = $(obj)libhwmon.a COBJS-$(CONFIG_DTT_ADM1021) += adm1021.o COBJS-$(CONFIG_DTT_DS1621) += ds1621.o -COBJS-$(CONFIG_DS1722) += ds1722.o +COBJS-$(CONFIG_DTT_DS1722) += ds1722.o COBJS-$(CONFIG_DTT_DS1775) += ds1775.o COBJS-$(CONFIG_DTT_LM73) += lm73.o COBJS-$(CONFIG_DTT_LM75) += lm75.o -- cgit v1.1 From 0a5676befb0c590212a53f7627fa5d0d8a84bf34 Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Sat, 12 Jul 2008 14:36:34 +0200 Subject: Fix some more printf() format issues. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- drivers/mtd/dataflash.c | 2 +- drivers/net/smc911x.c | 4 ++-- drivers/usb/usbdcore.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/mtd/dataflash.c b/drivers/mtd/dataflash.c index a092dc6..0ad48cd 100644 --- a/drivers/mtd/dataflash.c +++ b/drivers/mtd/dataflash.c @@ -173,7 +173,7 @@ void AT91F_DataflashSetEnv (void) if((env & FLAG_SETENV) == FLAG_SETENV) { start = dataflash_info[i].Device.area_list[j].start; - sprintf((char*) s,"%X",start); + sprintf((char*) s,"%lX",start); setenv((char*) area_list[part].label,(char*) s); } part++; diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c index 1484b0b..0fff820 100644 --- a/drivers/net/smc911x.c +++ b/drivers/net/smc911x.c @@ -597,7 +597,7 @@ int eth_init(bd_t *bd) val = reg_read(BYTE_TEST); if (val != 0x87654321) { - printf(DRIVERNAME ": Invalid chip endian 0x%08x\n", val); + printf(DRIVERNAME ": Invalid chip endian 0x%08lx\n", val); goto err_out; } @@ -606,7 +606,7 @@ int eth_init(bd_t *bd) if (chip_ids[i].id == val) break; } if (!chip_ids[i].id) { - printf(DRIVERNAME ": Unknown chip ID %04x\n", val); + printf(DRIVERNAME ": Unknown chip ID %04lx\n", val); goto err_out; } diff --git a/drivers/usb/usbdcore.c b/drivers/usb/usbdcore.c index a621ce7..58e710f 100644 --- a/drivers/usb/usbdcore.c +++ b/drivers/usb/usbdcore.c @@ -551,7 +551,7 @@ struct urb *usbd_alloc_urb (struct usb_device_instance *device, struct usb_endpo struct urb *urb; if( !(urb = (struct urb*)malloc(sizeof(struct urb))) ) { - usberr(" F A T A L: malloc(%u) FAILED!!!!", sizeof(struct urb)); + usberr(" F A T A L: malloc(%lu) FAILED!!!!", sizeof(struct urb)); return NULL; } -- cgit v1.1 From 322716a1d1eb33a71067ba0eb1c5346fb2dd6b34 Mon Sep 17 00:00:00 2001 From: Anatolij Gustschin Date: Sat, 12 Jul 2008 17:31:36 +0200 Subject: Fix bug in Lime video driver We need to wait while drawing engine clears frame buffer before any further software accesses to frame buffer will be initiated. Otherwise software drawn parts could be partially destroyed by the drawing engine or even GDC chip freeze could occur (as observed on socrates board). Signed-off-by: Anatolij Gustschin --- drivers/video/mb862xx.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers') diff --git a/drivers/video/mb862xx.c b/drivers/video/mb862xx.c index 9684cf3..733d9a2 100644 --- a/drivers/video/mb862xx.c +++ b/drivers/video/mb862xx.c @@ -173,6 +173,8 @@ static void de_init (void) DE_WR_FIFO (0x09410000); DE_WR_FIFO (0x00000000); DE_WR_FIFO (pGD->winSizeY<<16 | pGD->winSizeX); + /* sync with SW access to framebuffer */ + de_wait (); } #if defined(CONFIG_VIDEO_CORALP) -- cgit v1.1 From d5996dd555edf52721b7691a4c59de016251ed39 Mon Sep 17 00:00:00 2001 From: Wolfgang Denk Date: Sun, 13 Jul 2008 19:51:00 +0200 Subject: Fix some more printf() format problems. Signed-off-by: Wolfgang Denk --- drivers/usb/usbdcore.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'drivers') diff --git a/drivers/usb/usbdcore.c b/drivers/usb/usbdcore.c index 58e710f..808da9f 100644 --- a/drivers/usb/usbdcore.c +++ b/drivers/usb/usbdcore.c @@ -546,21 +546,23 @@ void urb_append (urb_link * hd, struct urb *urb) * * NOTE: endpoint_address MUST contain a direction flag. */ -struct urb *usbd_alloc_urb (struct usb_device_instance *device, struct usb_endpoint_instance *endpoint) +struct urb *usbd_alloc_urb (struct usb_device_instance *device, + struct usb_endpoint_instance *endpoint) { struct urb *urb; - if( !(urb = (struct urb*)malloc(sizeof(struct urb))) ) { - usberr(" F A T A L: malloc(%lu) FAILED!!!!", sizeof(struct urb)); - return NULL; + if (!(urb = (struct urb *) malloc (sizeof (struct urb)))) { + usberr (" F A T A L: malloc(%u) FAILED!!!!", + sizeof (struct urb)); + return NULL; } /* Fill in known fields */ - memset(urb, 0, sizeof(struct urb)); + memset (urb, 0, sizeof (struct urb)); urb->endpoint = endpoint; urb->device = device; - urb->buffer = (u8*)urb->buffer_data; - urb->buffer_length = sizeof(urb->buffer_data); + urb->buffer = (u8 *) urb->buffer_data; + urb->buffer_length = sizeof (urb->buffer_data); urb_link_init (&urb->link); -- cgit v1.1 From b64f190b7a34224df09b559ca111eb1b733f00ad Mon Sep 17 00:00:00 2001 From: Wolfgang Denk Date: Mon, 14 Jul 2008 15:06:35 +0200 Subject: Fix printf() format issues with sizeof_t types by using %zu Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD Signed-off-by: Wolfgang Denk --- drivers/serial/usbtty.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/serial/usbtty.c b/drivers/serial/usbtty.c index cc2bdac..2bc5c3c 100644 --- a/drivers/serial/usbtty.c +++ b/drivers/serial/usbtty.c @@ -529,8 +529,8 @@ int drv_usbtty_init (void) } snlen = strlen(sn); if (snlen > sizeof(serial_number) - 1) { - printf ("Warning: serial number %s is too long (%d > %d)\n", - sn, snlen, sizeof(serial_number) - 1); + printf ("Warning: serial number %s is too long (%d > %lu)\n", + sn, snlen, (ulong)(sizeof(serial_number) - 1)); snlen = sizeof(serial_number) - 1; } memcpy (serial_number, sn, snlen); -- cgit v1.1 From d0ff51ba5d0309dbe9e25ea54f8a0285a6d5db90 Mon Sep 17 00:00:00 2001 From: Wolfgang Denk Date: Mon, 14 Jul 2008 15:19:07 +0200 Subject: Code cleanup: fix old style assignment ambiguities like "=-" etc. Signed-off-by: Wolfgang Denk --- drivers/block/sym53c8xx.c | 2 +- drivers/input/pc_keyb.c | 2 +- drivers/pci/fsl_pci_init.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/block/sym53c8xx.c b/drivers/block/sym53c8xx.c index 87b63b7..b880435 100644 --- a/drivers/block/sym53c8xx.c +++ b/drivers/block/sym53c8xx.c @@ -784,7 +784,7 @@ retry: pccb->msgout[0]=SCSI_IDENTIFY; transbytes=pccb->trans_bytes; tmpptr=pccb->pdata; - pccb->pdata=&pccb->sense_buf[0]; + pccb->pdata = &pccb->sense_buf[0]; datalen=pccb->datalen; pccb->datalen=14; tmpstat=pccb->status; diff --git a/drivers/input/pc_keyb.c b/drivers/input/pc_keyb.c index 81d3e98..33e7c5f 100644 --- a/drivers/input/pc_keyb.c +++ b/drivers/input/pc_keyb.c @@ -64,7 +64,7 @@ static int kbd_read_data(void) int val; unsigned char status; - val=-1; + val = -1; status = kbd_read_status(); if (status & KBD_STAT_OBF) { val = kbd_read_input(); diff --git a/drivers/pci/fsl_pci_init.c b/drivers/pci/fsl_pci_init.c index 7dc33be..a7afa90 100644 --- a/drivers/pci/fsl_pci_init.c +++ b/drivers/pci/fsl_pci_init.c @@ -59,8 +59,8 @@ fsl_pci_init(struct pci_controller *hose) pci_dev_t dev = PCI_BDF(busno,0,0); /* Initialize ATMU registers based on hose regions and flags */ - volatile pot_t *po=&pci->pot[1]; /* skip 0 */ - volatile pit_t *pi=&pci->pit[0]; /* ranges from: 3 to 1 */ + volatile pot_t *po = &pci->pot[1]; /* skip 0 */ + volatile pit_t *pi = &pci->pit[0]; /* ranges from: 3 to 1 */ #ifdef DEBUG int neg_link_w; -- cgit v1.1 From d85f46a25ccb33ed9b295de3c2cfe1ce270ece9a Mon Sep 17 00:00:00 2001 From: Nobuhiro Iwamatsu Date: Fri, 11 Jul 2008 17:22:43 +0900 Subject: pci: sh: Add pci_skip_dev and pci_print_dev function Add function of new PCI, pci_skip_dev and pci_print_dev. Signed-off-by: Nobuhiro Iwamatsu Signed-off-by: Nobuhiro Iwamatsu --- drivers/pci/pci_sh4.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'drivers') diff --git a/drivers/pci/pci_sh4.c b/drivers/pci/pci_sh4.c index 1290c0a..057b6dd 100644 --- a/drivers/pci/pci_sh4.c +++ b/drivers/pci/pci_sh4.c @@ -74,3 +74,15 @@ int pci_sh4_init(struct pci_controller *hose) hose->last_busno = pci_hose_scan(hose); return 0; } + +int pci_skip_dev(struct pci_controller *hose, pci_dev_t dev) +{ + return 0; +} + +#ifdef CONFIG_PCI_SCAN_SHOW +int pci_print_dev(struct pci_controller *hose, pci_dev_t dev) +{ + return 1; +} +#endif /* CONFIG_PCI_SCAN_SHOW */ -- cgit v1.1 From 7288f972fcaee14a9741cb08c8688a23874b4a2e Mon Sep 17 00:00:00 2001 From: Sebastian Siewior Date: Tue, 15 Jul 2008 13:35:23 +0200 Subject: cfi_flash: make the command u32 only This got changed by commit 93c56f212c [cfi_flash: support of long cmd in U-boot.] Long is the wrong type because it will behave differently on 64bit machines in a way that is probably not expected. u32 should be enough. Cc: Alexey Korolev Cc: Vasiliy Leonenko Signed-off-by: Sebastian Siewior --- drivers/mtd/cfi_flash.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c index c0ea97b..4340b1b 100644 --- a/drivers/mtd/cfi_flash.c +++ b/drivers/mtd/cfi_flash.c @@ -301,7 +301,7 @@ static inline void flash_unmap(flash_info_t *info, flash_sect_t sect, /*----------------------------------------------------------------------- * make a proper sized command based on the port and chip widths */ -static void flash_make_cmd (flash_info_t * info, ulong cmd, void *cmdbuf) +static void flash_make_cmd(flash_info_t *info, u32 cmd, void *cmdbuf) { int i; int cword_offset; @@ -316,9 +316,9 @@ static void flash_make_cmd (flash_info_t * info, ulong cmd, void *cmdbuf) val = *((uchar*)&cmd + cword_offset); #else cp_offset = i - 1; - val = *((uchar*)&cmd + sizeof(ulong) - cword_offset - 1); + val = *((uchar*)&cmd + sizeof(u32) - cword_offset - 1); #endif - cp[cp_offset] = (cword_offset >= sizeof(ulong)) ? 0x00 : val; + cp[cp_offset] = (cword_offset >= sizeof(u32)) ? 0x00 : val; } } @@ -433,7 +433,7 @@ static ulong flash_read_long (flash_info_t * info, flash_sect_t sect, * Write a proper sized command to the correct address */ static void flash_write_cmd (flash_info_t * info, flash_sect_t sect, - uint offset, ulong cmd) + uint offset, u32 cmd) { void *addr; -- cgit v1.1 From bcab74baa6b1b1c969038ab6f64a186239180405 Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Tue, 15 Jul 2008 11:23:02 -0400 Subject: Round the serial port clock divisor value returned by calc_divisor() Round the serial port clock divisor value returned by calc_divisor() Signed-off-by: Hugo Villeneuve Acked-by: Gerald Van Baren --- drivers/serial/serial.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'drivers') diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c index 4ccaee2..8bbfcf9 100644 --- a/drivers/serial/serial.c +++ b/drivers/serial/serial.c @@ -124,8 +124,6 @@ static NS16550_t serial_ports[4] = { static int calc_divisor (NS16550_t port) { - uint32_t clk_divisor; - #ifdef CONFIG_OMAP1510 /* If can't cleanly clock 115200 set div to 1 */ if ((CFG_NS16550_CLK == 12000000) && (gd->baudrate == 115200)) { @@ -149,15 +147,11 @@ static int calc_divisor (NS16550_t port) /* Compute divisor value. Normally, we should simply return: * CFG_NS16550_CLK) / MODE_X_DIV / gd->baudrate - * but we need to round that value by adding 0.5 (2/4). + * but we need to round that value by adding 0.5. * Rounding is especially important at high baud rates. */ - clk_divisor = (((4 * CFG_NS16550_CLK) / - (MODE_X_DIV * gd->baudrate)) + 2) / 4; - - debug("NS16550 clock divisor = %d\n", clk_divisor); - - return clk_divisor; + return (CFG_NS16550_CLK + (gd->baudrate * (MODE_X_DIV / 2))) / + (MODE_X_DIV * gd->baudrate); } #if !defined(CONFIG_SERIAL_MULTI) -- cgit v1.1 From 340ccb260f21516be360745d5c5e3bd0657698df Mon Sep 17 00:00:00 2001 From: Sebastian Siewior Date: Wed, 16 Jul 2008 20:04:49 +0200 Subject: cfi_flash: fix flash on BE machines with CFG_WRITE_SWAPPED_DATA This got broken by commits 93c56f212c [cfi_flash: support of long cmd in U-boot.] That command needs to be in little endian format on BE machines with CFG_WRITE_SWAPPED_DATA. Without this patch, the command 0xf0 gets saved on stack as 0x00 00 00 f0 and 0x00 gets written into the cmdbuf in case portwidth = chipwidth = 8bit. Cc: Alexey Korolev Cc: Vasiliy Leonenko Signed-off-by: Sebastian Siewior --- drivers/mtd/cfi_flash.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c index 4340b1b..12647ef 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); -- cgit v1.1 From f13f64cf42d5abec3e0f920233f6a7a61e7ae494 Mon Sep 17 00:00:00 2001 From: Ricardo Ribalda Delgado Date: Wed, 16 Jul 2008 16:22:32 +0200 Subject: serial_xuartlite.c: fix compiler warnings Signed-off-by: Ricardo Ribalda Delgado Acked-by: Grant Likely --- drivers/serial/serial_xuartlite.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers') diff --git a/drivers/serial/serial_xuartlite.c b/drivers/serial/serial_xuartlite.c index 5c41a1c..74546ce 100644 --- a/drivers/serial/serial_xuartlite.c +++ b/drivers/serial/serial_xuartlite.c @@ -56,8 +56,8 @@ void serial_putc(const char c) { if (c == '\n') serial_putc('\r'); - while (in_be32(UARTLITE_STATUS) & SR_TX_FIFO_FULL); - out_be32(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)); } void serial_puts(const char * s) @@ -69,13 +69,13 @@ void serial_puts(const char * s) int serial_getc(void) { - while (!(in_be32(UARTLITE_STATUS) & SR_RX_FIFO_VALID_DATA)); - return in_be32(UARTLITE_RX_FIFO) & 0xff; + while (!(in_be32((u32 *) UARTLITE_STATUS) & SR_RX_FIFO_VALID_DATA)); + return in_be32((u32 *) UARTLITE_RX_FIFO) & 0xff; } int serial_tstc(void) { - return (in_be32(UARTLITE_STATUS) & SR_RX_FIFO_VALID_DATA); + return (in_be32((u32 *) UARTLITE_STATUS) & SR_RX_FIFO_VALID_DATA); } #endif /* CONFIG_MICROBLZE */ -- cgit v1.1