[U-Boot-Users] [PATCH 00/17] x86: Fix warning: type qualifiers ignored on function return type

by sync asm/byteorder.h with linux
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com --- include/asm-i386/byteorder.h | 125 +++++++++++++++++++++++++++-------------- 1 files changed, 82 insertions(+), 43 deletions(-) rewrite include/asm-i386/byteorder.h (65%)
diff --git a/include/asm-i386/byteorder.h b/include/asm-i386/byteorder.h dissimilarity index 65% index a9c69d5..545ff75 100644 --- a/include/asm-i386/byteorder.h +++ b/include/asm-i386/byteorder.h @@ -1,43 +1,82 @@ -#ifndef _I386_BYTEORDER_H -#define _I386_BYTEORDER_H - -#include <asm/types.h> - -#ifdef __GNUC__ - - -static __inline__ __const__ __u32 ___arch__swab32(__u32 x) -{ -#ifdef CONFIG_X86_BSWAP - __asm__("bswap %0" : "=r" (x) : "0" (x)); -#else - __asm__("xchgb %b0,%h0\n\t" /* swap lower bytes */ - "rorl $16,%0\n\t" /* swap words */ - "xchgb %b0,%h0" /* swap higher bytes */ - :"=q" (x) - : "0" (x)); -#endif - return x; -} - -static __inline__ __const__ __u16 ___arch__swab16(__u16 x) -{ - __asm__("xchgb %b0,%h0" /* swap bytes */ \ - : "=q" (x) \ - : "0" (x)); \ - return x; -} - -#define __arch__swab32(x) ___arch__swab32(x) -#define __arch__swab16(x) ___arch__swab16(x) - -#if !defined(__STRICT_ANSI__) || defined(__KERNEL__) -# define __BYTEORDER_HAS_U64__ -# define __SWAB_64_THRU_32__ -#endif - -#endif /* __GNUC__ */ - -#include <linux/byteorder/little_endian.h> - -#endif /* _I386_BYTEORDER_H */ +#ifndef _I386_BYTEORDER_H +#define _I386_BYTEORDER_H + +#include <asm/types.h> + +#ifdef __GNUC__ + +#define __attribute_const__ __attribute__((__const__)) + +#ifdef __i386__ + +static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 x) +{ +#ifdef CONFIG_X86_BSWAP + asm("bswap %0" : "=r" (x) : "0" (x)); +#else + asm("xchgb %b0,%h0\n\t" /* swap lower bytes */ + "rorl $16,%0\n\t" /* swap words */ + "xchgb %b0,%h0" /* swap higher bytes */ + : "=q" (x) + : "0" (x)); +#endif + return x; +} + +static __inline__ __attribute_const__ __u64 ___arch__swab64(__u64 val) +{ + union { + struct { + __u32 a; + __u32 b; + } s; + __u64 u; + } v; + v.u = val; +#ifdef CONFIG_X86_BSWAP + asm("bswapl %0 ; bswapl %1 ; xchgl %0,%1" + : "=r" (v.s.a), "=r" (v.s.b) + : "0" (v.s.a), "1" (v.s.b)); +#else + v.s.a = ___arch__swab32(v.s.a); + v.s.b = ___arch__swab32(v.s.b); + asm("xchgl %0,%1" + : "=r" (v.s.a), "=r" (v.s.b) + : "0" (v.s.a), "1" (v.s.b)); +#endif + return v.u; +} + +#else /* __i386__ */ + +static inline __attribute_const__ __u64 ___arch__swab64(__u64 x) +{ + asm("bswapq %0" + : "=r" (x) + : "0" (x)); + return x; +} + +static inline __attribute_const__ __u32 ___arch__swab32(__u32 x) +{ + asm("bswapl %0" + : "=r" (x) + : "0" (x)); + return x; +} + +#endif + +/* Do not define swab16. Gcc is smart enough to recognize "C" version and + convert it into rotation or exhange. */ + +#define __arch__swab64(x) ___arch__swab64(x) +#define __arch__swab32(x) ___arch__swab32(x) + +#define __BYTEORDER_HAS_U64__ + +#endif /* __GNUC__ */ + +#include <linux/byteorder/little_endian.h> + +#endif /* _I386_BYTEORDER_H */

include/image.h: In function 'image_set_name': include/image.h:374: warning: implicit declaration of function 'strncpy' 82559_eeprom.c: In function 'memcpy': 82559_eeprom.c:57: error: lvalue required as increment operand 82559_eeprom.c:57: error: lvalue required as increment operand 82559_eeprom.c: In function 'main': 82559_eeprom.c:318: warning: pointer targets in passing argument 2 of 'gethwaddr' differ in signedness
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com --- examples/82559_eeprom.c | 22 +++++++++++++--------- include/asm-i386/string.h | 2 ++ 2 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/examples/82559_eeprom.c b/examples/82559_eeprom.c index 1a121d4..587b6a4 100644 --- a/examples/82559_eeprom.c +++ b/examples/82559_eeprom.c @@ -18,14 +18,13 @@ * and release the resulting code under the GPL. */
-#define _PPC_STRING_H_ /* avoid unnecessary str/mem functions */ -#define _LINUX_STRING_H_ /* avoid unnecessary str/mem functions */ +#define __HAVE_ARCH_MEMCPY 1 /* avoid unnecessary memcpy function */ +#define _PPC_STRING_H_ 1 /* avoid unnecessary str/mem functions */
#include <common.h> #include <exports.h> #include <asm/io.h>
- /* Default EEPROM for i82559 */ static unsigned short default_eeprom[64] = { 0x0100, 0x0302, 0x0504, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, @@ -50,12 +49,16 @@ static inline unsigned short swap16(unsigned short x) return (((x & 0xff) << 8) | ((x & 0xff00) >> 8)); }
- -static inline void *memcpy(void *dst, const void *src, unsigned int len) +inline void *memcpy(void *dst, const void *src, unsigned int len) { - void * ret = dst; - while (len-- > 0) *((char *)dst)++ = *((char *)src)++; - return ret; + char *ret = dst; + + while (len-- > 0) { + *ret++ = *((char *)src); + src++; + } + + return (void *)dst; }
/* The EEPROM commands include the alway-set leading bit. */ @@ -80,6 +83,7 @@ static inline void *memcpy(void *dst, const void *src, unsigned int len) static int eeprom_busy_poll(long ee_ioaddr) { int i; + outw(EE_ENB, ee_ioaddr); for (i = 0; i < 10000; i++) /* Typical 2000 ticks */ if (inw(ee_ioaddr) & EE_DATA_READ) @@ -305,7 +309,7 @@ write_config_word(int bus, int dev, int func, int reg, u16 data) int main (int argc, char *argv[]) { unsigned char *eth_addr; - char buf[6]; + unsigned char buf[6]; int instance;
app_startup(argv); diff --git a/include/asm-i386/string.h b/include/asm-i386/string.h index 91a23f9..3b838b4 100644 --- a/include/asm-i386/string.h +++ b/include/asm-i386/string.h @@ -5,6 +5,8 @@ * We don't do inline string functions, since the * optimised inline asm versions are not small. */ +#undef __HAVE_ARCH_STRNCPY +extern char *strncpy(char *dest, const char *src, size_t count);
#undef __HAVE_ARCH_STRRCHR extern char * strrchr(const char * s, int c);

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com --- examples/eepro100_eeprom.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/examples/eepro100_eeprom.c b/examples/eepro100_eeprom.c index 2b15d05..5f4eb78 100644 --- a/examples/eepro100_eeprom.c +++ b/examples/eepro100_eeprom.c @@ -80,11 +80,13 @@ static inline short inw(long addr) static inline void *memcpy(void *dst, const void *src, unsigned int len) { char *ret = dst; + while (len-- > 0) { *ret++ = *((char *)src); src++; } - return (void *)ret; + + return (void *)dst; }
/* The EEPROM commands include the alway-set leading bit. */ @@ -109,6 +111,7 @@ static inline void *memcpy(void *dst, const void *src, unsigned int len) static int eeprom_busy_poll(long ee_ioaddr) { int i; + outw(EE_ENB, ee_ioaddr); for (i = 0; i < 10000; i++) /* Typical 2000 ticks */ if (inw(ee_ioaddr) & EE_DATA_READ)

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com --- examples/.gitignore | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/examples/.gitignore b/examples/.gitignore index 059b096..806425f 100644 --- a/examples/.gitignore +++ b/examples/.gitignore @@ -1,5 +1,9 @@ +/82559_eeprom /hello_world /interrupt +/mem_to_mem_idma2intr +/test_burst +/timer /sched /smc91111_eeprom *.bin

Fix a warning type in lib_i386/board.c
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com --- include/asm-i386/global_data.h | 4 +--- lib_i386/board.c | 11 +++++------ 2 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/include/asm-i386/global_data.h b/include/asm-i386/global_data.h index 68a9ad6..9b3f7c1 100644 --- a/include/asm-i386/global_data.h +++ b/include/asm-i386/global_data.h @@ -56,8 +56,6 @@ typedef struct { #define GD_FLG_SILENT 0x00004 /* Silent mode */ #define GD_FLG_POSTFAIL 0x00008 /* Critical POST test failed */
-extern gd_t *global_data; - -#define DECLARE_GLOBAL_DATA_PTR gd_t *gd = global_data +#define DECLARE_GLOBAL_DATA_PTR extern gd_t *gd
#endif /* __ASM_GBL_DATA_H */ diff --git a/lib_i386/board.c b/lib_i386/board.c index 22191e6..e73f697 100644 --- a/lib_i386/board.c +++ b/lib_i386/board.c @@ -38,6 +38,9 @@ #include <ide.h> #include <asm/u-boot-i386.h>
+gd_t gd_data; +gd_t *gd; + DECLARE_GLOBAL_DATA_PTR;
extern long _i386boot_start; @@ -68,7 +71,6 @@ ulong i386boot_realmode_size = (ulong)&_i386boot_realmode_size; /* size of realm ulong i386boot_bios = (ulong)&_i386boot_bios; /* start of BIOS emulation code */ ulong i386boot_bios_size = (ulong)&_i386boot_bios_size; /* size of BIOS emulation code */
- const char version_string[] = U_BOOT_VERSION" (" __DATE__ " - " __TIME__ ")";
@@ -226,20 +228,17 @@ init_fnc_t *init_sequence[] = { NULL, };
-gd_t *global_data; - void start_i386boot (void) { char *s; int i; ulong size; - static gd_t gd_data; static bd_t bd_data; init_fnc_t **init_fnc_ptr;
show_boot_progress(0x21);
- gd = global_data = &gd_data; + gd = &gd_data; /* compiler optimization barrier needed for GCC >= 3.4 */ __asm__ __volatile__("": : :"memory");
@@ -279,7 +278,7 @@ void start_i386boot (void) int i; ulong reg; char *s, *e; - uchar tmp[64]; + char tmp[64];
i = getenv_r ("ethaddr", tmp, sizeof (tmp)); s = (i > 0) ? tmp : NULL;

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com --- lib_i386/bootm.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/lib_i386/bootm.c b/lib_i386/bootm.c index 107ebaa..d959107 100644 --- a/lib_i386/bootm.c +++ b/lib_i386/bootm.c @@ -37,7 +37,6 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], void *base_ptr; ulong os_data, os_len; ulong initrd_start, initrd_end; - ulong ep; image_header_t *hdr; int ret; #if defined(CONFIG_FIT)

ds1722.c:6:17: error: ssi.h: No such file or directory ds1722.c:6:17: error: ssi.h: No such file or directory cc1: warnings being treated as errors ds1722.c: In function 'ds1722_select': ds1722.c:10: warning: implicit declaration of function 'ssi_set_interface' ds1722.c:11: warning: implicit declaration of function 'ssi_chip_select' ds1722.c: In function 'ds1722_read': ds1722.c:24: warning: implicit declaration of function 'ssi_tx_byte' ds1722.c:25: warning: implicit declaration of function 'ssi_rx_byte' ds1722.c: In function 'ds1722_probe': ds1722.c:137: error: 'DS1722_RESOLUTION_12BIT' undeclared (first use in this function) ds1722.c:137: error: (Each undeclared identifier is reported only once ds1722.c:137: error: for each function it appears in.)
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com --- drivers/hwmon/ds1722.c | 1 + include/configs/sc520_cdp.h | 1 + include/configs/sc520_spunk.h | 1 + include/ds1722.h | 32 ++++++++++++++++++++++++++++++++ include/ssi.h | 29 +++++++++++++++++++++++++++++ 5 files changed, 64 insertions(+), 0 deletions(-) create mode 100644 include/ds1722.h create mode 100644 include/ssi.h
diff --git a/drivers/hwmon/ds1722.c b/drivers/hwmon/ds1722.c index c19ee01..1033a47 100644 --- a/drivers/hwmon/ds1722.c +++ b/drivers/hwmon/ds1722.c @@ -4,6 +4,7 @@ #ifdef CONFIG_DS1722
#include <ssi.h> +#include <ds1722.h>
static void ds1722_select(int dev) { diff --git a/include/configs/sc520_cdp.h b/include/configs/sc520_cdp.h index 4df461d..a810d72 100644 --- a/include/configs/sc520_cdp.h +++ b/include/configs/sc520_cdp.h @@ -36,6 +36,7 @@ #define CONFIG_X86 1 /* This is a X86 CPU */ #define CONFIG_SC520 1 /* Include support for AMD SC520 */ #define CONFIG_ALI152X 1 /* Include support for Ali 152x SIO */ +#define CONFIG_SC520_SSI 1
#define CFG_SDRAM_PRECHARGE_DELAY 6 /* 6T */ #define CFG_SDRAM_REFRESH_RATE 78 /* 7.8uS (choices are 7.8, 15.6, 31.2 or 62.5uS) */ diff --git a/include/configs/sc520_spunk.h b/include/configs/sc520_spunk.h index c6f7f15..cbb3863 100644 --- a/include/configs/sc520_spunk.h +++ b/include/configs/sc520_spunk.h @@ -35,6 +35,7 @@
#define CONFIG_X86 1 /* This is a X86 CPU */ #define CONFIG_SC520 1 /* Include support for AMD SC520 */ +#define CONFIG_SC520_SSI 1
#define CFG_SDRAM_PRECHARGE_DELAY 6 /* 6T */ #define CFG_SDRAM_REFRESH_RATE 78 /* 7.8uS (choices are 7.8, 15.6, 31.2 or 62.5uS) */ diff --git a/include/ds1722.h b/include/ds1722.h new file mode 100644 index 0000000..44f0830 --- /dev/null +++ b/include/ds1722.h @@ -0,0 +1,32 @@ +/* + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * 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 + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#ifndef _DS1722_H_ +#define _DS1722_H_ + +#define DS1722_RESOLUTION_8BIT 0x0 +#define DS1722_RESOLUTION_9BIT 0x1 +#define DS1722_RESOLUTION_10BIT 0x2 +#define DS1722_RESOLUTION_11BIT 0x3 +#define DS1722_RESOLUTION_12BIT 0x4 + +int ds1722_probe(int dev); + +#endif /* _DS1722_H_ */ diff --git a/include/ssi.h b/include/ssi.h new file mode 100644 index 0000000..ec3912b --- /dev/null +++ b/include/ssi.h @@ -0,0 +1,29 @@ +/* + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * 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 + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#ifdef CONFIG_SC520_SSI + +int ssi_set_interface(int freq, int lsb_first, int inv_clock, int inv_phase); +u8 ssi_txrx_byte(u8 data); +void ssi_tx_byte(u8 data); +u8 ssi_rx_byte(void); +void ssi_chip_select(int dev); + +#endif

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com --- drivers/pcmcia/Makefile | 1 + drivers/pcmcia/i82365.c | 4 ---- 2 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile index bba1ab8..53a485d 100644 --- a/drivers/pcmcia/Makefile +++ b/drivers/pcmcia/Makefile @@ -25,6 +25,7 @@ include $(TOPDIR)/config.mk
LIB := $(obj)libpcmcia.a
+COBJS-$(CONFIG_I82365) += i82365.o COBJS-y += mpc8xx_pcmcia.o COBJS-y += pxa_pcmcia.o COBJS-y += rpx_pcmcia.o diff --git a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c index a40fcf4..1e2431e 100644 --- a/drivers/pcmcia/i82365.c +++ b/drivers/pcmcia/i82365.c @@ -31,8 +31,6 @@
#include <common.h>
-#ifdef CONFIG_I82365 - #include <command.h> #include <pci.h> #include <pcmcia.h> @@ -1010,5 +1008,3 @@ static void i82365_dump_regions (pci_dev_t dev) ide[4], ide[5], ide[6], ide[7]); } #endif /* DEBUG */ - -#endif /* CONFIG_I82365 */

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com --- drivers/pcmcia/Makefile | 2 +- drivers/pcmcia/marubun_pcmcia.c | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile index 53a485d..59be49c 100644 --- a/drivers/pcmcia/Makefile +++ b/drivers/pcmcia/Makefile @@ -31,7 +31,7 @@ COBJS-y += pxa_pcmcia.o COBJS-y += rpx_pcmcia.o COBJS-y += ti_pci1410a.o COBJS-y += tqm8xx_pcmcia.o -COBJS-y += marubun_pcmcia.o +COBJS-$(CONFIG_MARUBUN_PCCARD) += marubun_pcmcia.o
COBJS := $(COBJS-y) SRCS := $(COBJS:.o=.c) diff --git a/drivers/pcmcia/marubun_pcmcia.c b/drivers/pcmcia/marubun_pcmcia.c index 2479a66..ab5030c 100644 --- a/drivers/pcmcia/marubun_pcmcia.c +++ b/drivers/pcmcia/marubun_pcmcia.c @@ -31,12 +31,11 @@ #define CONFIG_PCMCIA #endif
-#if defined(CONFIG_CMD_IDE) +#if defined(CONFIG_CMD_IDE) #define CONFIG_PCMCIA #endif
-#if defined(CONFIG_PCMCIA) \ - && (defined(CONFIG_MARUBUN_PCCARD)) +#if defined(CONFIG_PCMCIA)
/* MR-SHPC-01 register */ #define MRSHPC_MODE (CFG_MARUBUN_MRSHPC + 4) @@ -112,4 +111,4 @@ int pcmcia_off (void) return 0; }
-#endif /* CONFIG_MARUBUN_PCCARD */ +#endif /* CONFIG_PCMCIA */

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com --- drivers/pcmcia/Makefile | 2 +- drivers/pcmcia/pxa_pcmcia.c | 4 ---- 2 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile index 59be49c..439f839 100644 --- a/drivers/pcmcia/Makefile +++ b/drivers/pcmcia/Makefile @@ -27,7 +27,7 @@ LIB := $(obj)libpcmcia.a
COBJS-$(CONFIG_I82365) += i82365.o COBJS-y += mpc8xx_pcmcia.o -COBJS-y += pxa_pcmcia.o +COBJS-$(CONFIG_PXA_PCMCIA) += pxa_pcmcia.o COBJS-y += rpx_pcmcia.o COBJS-y += ti_pci1410a.o COBJS-y += tqm8xx_pcmcia.o diff --git a/drivers/pcmcia/pxa_pcmcia.c b/drivers/pcmcia/pxa_pcmcia.c index 65427ef..11d8590 100644 --- a/drivers/pcmcia/pxa_pcmcia.c +++ b/drivers/pcmcia/pxa_pcmcia.c @@ -1,8 +1,6 @@ #include <common.h> #include <config.h>
-#ifdef CONFIG_PXA_PCMCIA - #include <pcmcia.h> #include <asm/arch/pxa-regs.h> #include <asm/io.h> @@ -93,5 +91,3 @@ int pcmcia_off (void) return 0; } #endif - -#endif /* CONFIG_PXA_PCMCIA */

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com --- drivers/pcmcia/Makefile | 2 +- drivers/pcmcia/ti_pci1410a.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile index 439f839..a5270f7 100644 --- a/drivers/pcmcia/Makefile +++ b/drivers/pcmcia/Makefile @@ -29,7 +29,7 @@ COBJS-$(CONFIG_I82365) += i82365.o COBJS-y += mpc8xx_pcmcia.o COBJS-$(CONFIG_PXA_PCMCIA) += pxa_pcmcia.o COBJS-y += rpx_pcmcia.o -COBJS-y += ti_pci1410a.o +COBJS-$(CONFIG_IDE_TI_CARDBUS) += ti_pci1410a.o COBJS-y += tqm8xx_pcmcia.o COBJS-$(CONFIG_MARUBUN_PCCARD) += marubun_pcmcia.o
diff --git a/drivers/pcmcia/ti_pci1410a.c b/drivers/pcmcia/ti_pci1410a.c index 208ca50..c876d0c 100644 --- a/drivers/pcmcia/ti_pci1410a.c +++ b/drivers/pcmcia/ti_pci1410a.c @@ -64,7 +64,7 @@
#include <pcmcia.h>
-#if defined(CONFIG_CMD_PCMCIA) && defined(CONFIG_IDE_TI_CARDBUS) +#if defined(CONFIG_CMD_PCMCIA)
int pcmcia_on(int ide_base_bus);
@@ -662,4 +662,4 @@ static int identify(volatile uchar *p) return 0; /* don't know */ }
-#endif /* CONFIG_IDE_TI_CARDBUS */ +#endif /* CONFIG_CMD_PCMCIA */

to avoid the following errors :
include/pcmcia.h:72:3: error: #error "PCMCIA Slot not configured" include/pcmcia.h:79:2: error: #error Neither CONFIG_PCMCIA_SLOT_A nor CONFIG_PCMCIA_SLOT_B configured
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com --- drivers/pcmcia/mpc8xx_pcmcia.c | 2 +- drivers/pcmcia/rpx_pcmcia.c | 2 +- drivers/pcmcia/tqm8xx_pcmcia.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/pcmcia/mpc8xx_pcmcia.c b/drivers/pcmcia/mpc8xx_pcmcia.c index 8a34cd3..a4533eb 100644 --- a/drivers/pcmcia/mpc8xx_pcmcia.c +++ b/drivers/pcmcia/mpc8xx_pcmcia.c @@ -2,7 +2,6 @@ #if defined(CONFIG_8xx) #include <mpc8xx.h> #endif -#include <pcmcia.h>
#undef CONFIG_PCMCIA
@@ -15,6 +14,7 @@ #endif
#if defined(CONFIG_8xx) && defined(CONFIG_PCMCIA) +#include <pcmcia.h>
#if defined(CONFIG_IDE_8xx_PCCARD) extern int check_ide_device (int slot); diff --git a/drivers/pcmcia/rpx_pcmcia.c b/drivers/pcmcia/rpx_pcmcia.c index c7c425b..11c6a13 100644 --- a/drivers/pcmcia/rpx_pcmcia.c +++ b/drivers/pcmcia/rpx_pcmcia.c @@ -5,7 +5,6 @@ #ifdef CONFIG_8xx #include <mpc8xx.h> #endif -#include <pcmcia.h>
#undef CONFIG_PCMCIA
@@ -19,6 +18,7 @@
#if defined(CONFIG_PCMCIA) \ && (defined(CONFIG_RPXCLASSIC) || defined(CONFIG_RPXLITE)) +#include <pcmcia.h>
#define PCMCIA_BOARD_MSG "RPX CLASSIC or RPX LITE"
diff --git a/drivers/pcmcia/tqm8xx_pcmcia.c b/drivers/pcmcia/tqm8xx_pcmcia.c index 132c7a5..4b2fb2f 100644 --- a/drivers/pcmcia/tqm8xx_pcmcia.c +++ b/drivers/pcmcia/tqm8xx_pcmcia.c @@ -6,7 +6,6 @@ #ifdef CONFIG_8xx #include <mpc8xx.h> #endif -#include <pcmcia.h>
#undef CONFIG_PCMCIA
@@ -20,6 +19,7 @@
#if defined(CONFIG_PCMCIA) \ && (defined(CONFIG_TQM8xxL) || defined(CONFIG_SVM_SC8xx)) +#include <pcmcia.h>
#if defined(CONFIG_VIRTLAB2) #define PCMCIA_BOARD_MSG "Virtlab2"

ti_pci1410a.c: In function 'voltage_set': ti_pci1410a.c:421: error: label at end of compound statement ti_pci1410a.c:435: error: label at end of compound statement cc1: warnings being treated as errors ti_pci1410a.c: At top level: ti_pci1410a.c:609: warning: pointer targets in initialization differ in signedness ti_pci1410a.c: In function 'identify': ti_pci1410a.c:651: warning: pointer targets in passing argument 1 of 'puts' differ in signedness ti_pci1410a.c:656: warning: pointer targets in passing argument 1 of 'strcmp' differ in signedness ti_pci1410a.c:656: warning: pointer targets in passing argument 2 of 'strcmp' differ in signedness
remove do_pinit allready implement in cmd_pcmcia.c Fix pcmcia_{on,off} protoptype and add it in definition to pcmcia.h
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com --- drivers/pcmcia/ti_pci1410a.c | 61 +++++++++-------------------------------- include/pcmcia.h | 2 + 2 files changed, 16 insertions(+), 47 deletions(-)
diff --git a/drivers/pcmcia/ti_pci1410a.c b/drivers/pcmcia/ti_pci1410a.c index c876d0c..d37e5a8 100644 --- a/drivers/pcmcia/ti_pci1410a.c +++ b/drivers/pcmcia/ti_pci1410a.c @@ -62,13 +62,10 @@ #include <pci.h> #include <asm/io.h>
-#include <pcmcia.h> - #if defined(CONFIG_CMD_PCMCIA)
-int pcmcia_on(int ide_base_bus); +#include <pcmcia.h>
-static int pcmcia_off(void); static int hardware_disable(int slot); static int hardware_enable(int slot); static int voltage_set(int slot, int vcc, int vpp); @@ -77,42 +74,13 @@ static void print_fixed(volatile uchar *p); static int identify(volatile uchar *p); static int check_ide_device(int slot, int ide_base_bus);
- /* ------------------------------------------------------------------------- */
- const char *indent = "\t ";
/* ------------------------------------------------------------------------- */
-int do_pinit(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) -{ -#ifndef CFG_FIRST_PCMCIA_BUS -# define CFG_FIRST_PCMCIA_BUS 0 -#endif - - int rcode = 0; - - if (argc != 2) { - printf ("Usage: pinit {on | off}\n"); - return 1; - } - if (strcmp(argv[1],"on") == 0) { - rcode = pcmcia_on(CFG_FIRST_PCMCIA_BUS); - } else if (strcmp(argv[1],"off") == 0) { - rcode = pcmcia_off(); - } else { - printf ("Usage: pinit {on | off}\n"); - return 1; - } - - return rcode; -} - -/* ------------------------------------------------------------------------- */ - - static struct pci_device_id supported[] = { { PCI_VENDOR_ID_TI, 0xac50 }, /* Ti PCI1410A */ { PCI_VENDOR_ID_TI, 0xac56 }, /* Ti PCI1510 */ @@ -123,15 +91,18 @@ static pci_dev_t devbusfn; static u32 socket_base; static u32 pcmcia_cis_ptr;
-int pcmcia_on(int ide_base_bus) +int pcmcia_on(void) { +#ifndef CFG_FIRST_PCMCIA_BUS +# define CFG_FIRST_PCMCIA_BUS 0 +#endif u16 dev_id; u32 socket_status; int slot = 0; int cis_len; u16 io_base; u16 io_len; - + int ide_base_bus = CFG_FIRST_PCMCIA_BUS; /* * Find the CardBus PCI device(s). */ @@ -244,8 +215,7 @@ int pcmcia_on(int ide_base_bus)
/* ------------------------------------------------------------------------- */
- -static int pcmcia_off (void) +int pcmcia_off (void) { int slot = 0;
@@ -285,10 +255,8 @@ static int pcmcia_off (void) return 0; }
- /* ------------------------------------------------------------------------- */
- #define MAX_TUPEL_SZ 512 #define MAX_FEATURES 4 int ide_devices_found; @@ -392,7 +360,6 @@ static int check_ide_device(int slot, int ide_base_bus) return 0; }
- static int voltage_set(int slot, int vcc, int vpp) { u32 socket_control; @@ -418,6 +385,7 @@ static int voltage_set(int slot, int vcc, int vpp) break; case 0: default: + break; }
switch (vpp) { @@ -432,6 +400,7 @@ static int voltage_set(int slot, int vcc, int vpp) break; case 0: default: + break; }
writel(socket_control, reg); @@ -443,7 +412,6 @@ static int voltage_set(int slot, int vcc, int vpp) return 0; }
- static int hardware_enable(int slot) { u32 socket_status; @@ -490,7 +458,6 @@ static int hardware_enable(int slot) return ((readb(socket_base+0x801)&0x6c)==0x6c)?0:1; }
- static int hardware_disable(int slot) { voltage_set(slot, 0, 0); @@ -605,17 +572,17 @@ static void print_fixed(volatile uchar *p) #define MAX_IDENT_CHARS 64 #define MAX_IDENT_FIELDS 4
-static uchar *known_cards[] = { +static char *known_cards[] = { "ARGOSY PnPIDE D5", NULL };
static int identify(volatile uchar *p) { - uchar id_str[MAX_IDENT_CHARS]; + char id_str[MAX_IDENT_CHARS]; uchar data; - uchar *t; - uchar **card; + char *t; + char **card; int i, done;
if (p == NULL) @@ -648,7 +615,7 @@ static int identify(volatile uchar *p) break; } } - puts(id_str); + puts((char*)id_str); putc('\n');
for (card=known_cards; *card; ++card) { diff --git a/include/pcmcia.h b/include/pcmcia.h index 7305805..cc4c78c 100644 --- a/include/pcmcia.h +++ b/include/pcmcia.h @@ -318,4 +318,6 @@ extern u_int *pcmcia_pgcrx[]; extern int check_ide_device(int slot); #endif
+int pcmcia_off(void); +int pcmcia_on(void); #endif /* _PCMCIA_H */

sc520_spunk.c: In function 'pci_sc520_spunk_fixup_irq': sc520_spunk.c:117: warning: pointer targets in passing argument 4 of 'pci_hose_read_config_byte' differ in signedness sc520_spunk.c: In function 'last_stage_init': sc520_spunk.c:580: warning: implicit declaration of function 'ds1722_probe' sc520_spunk.c: In function 'spi_init_f': sc520_spunk.c:643: warning: implicit declaration of function 'spi_eeprom_probe' sc520_spunk.c:644: warning: implicit declaration of function 'mw_eeprom_probe' sc520_spunk.c: In function 'spi_read': sc520_spunk.c:660: warning: implicit declaration of function 'spi_eeprom_read' sc520_spunk.c:661: warning: implicit declaration of function 'mw_eeprom_read' sc520_spunk.c: In function 'spi_write': sc520_spunk.c:676: warning: implicit declaration of function 'spi_eeprom_write' sc520_spunk.c:677: warning: implicit declaration of function 'mw_eeprom_write'
adding mw_eeprom header
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com --- board/sc520_spunk/sc520_spunk.c | 17 ++++++++++++++++- include/mw_eeprom.h | 27 +++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletions(-) create mode 100644 include/mw_eeprom.h
diff --git a/board/sc520_spunk/sc520_spunk.c b/board/sc520_spunk/sc520_spunk.c index d119a7d..6f5e636 100644 --- a/board/sc520_spunk/sc520_spunk.c +++ b/board/sc520_spunk/sc520_spunk.c @@ -28,6 +28,8 @@ #include <asm/io.h> #include <asm/pci.h> #include <asm/ic/sc520.h> +#include <ds1722.h> +#include <mw_eeprom.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -111,7 +113,7 @@ static void pci_sc520_spunk_fixup_irq(struct pci_controller *hose, pci_dev_t dev }; static int next_irq_index=0;
- char tmp_pin; + u8 tmp_pin; int pin;
pci_hose_read_config_byte(hose, dev, PCI_INTERRUPT_PIN, &tmp_pin); @@ -636,6 +638,19 @@ void ssi_chip_select(int dev) } }
+void spi_eeprom_probe(int x) +{ +} + +int spi_eeprom_read(int x, int offset, uchar *buffer, int len) +{ + return 0; +} + +int spi_eeprom_write(int x, int offset, uchar *buffer, int len) +{ + return 0; +}
void spi_init_f(void) { diff --git a/include/mw_eeprom.h b/include/mw_eeprom.h new file mode 100644 index 0000000..9ddd266 --- /dev/null +++ b/include/mw_eeprom.h @@ -0,0 +1,27 @@ +/* + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * 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 + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#ifndef _MW_EEPROM_H_ +#define _MW_EEPROM_H_ + +int mw_eeprom_probe(int dev); +int mw_eeprom_write(int dev, int addr, u8 *buffer, int len); +int mw_eeprom_read(int dev, int addr, u8 *buffer, int len); +#endif /* _MW_EEPROM_H_ */

flash.c:593: warning: dereferencing type-punned pointer will break strict-aliasing rules flash.c:398: error: label at end of compound statement
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com --- board/sc520_spunk/flash.c | 30 ++++++------------------------ 1 files changed, 6 insertions(+), 24 deletions(-)
diff --git a/board/sc520_spunk/flash.c b/board/sc520_spunk/flash.c index 4942e59..0b4bf68 100644 --- a/board/sc520_spunk/flash.c +++ b/board/sc520_spunk/flash.c @@ -33,7 +33,6 @@ #define PROBE_BUFFER_SIZE 1024 static unsigned char buffer[PROBE_BUFFER_SIZE];
- #define SC520_MAX_FLASH_BANKS 1 #define SC520_FLASH_BANK0_BASE 0x38000000 /* BOOTCS */ #define SC520_FLASH_BANKSIZE 0x8000000 @@ -62,7 +61,6 @@ flash_info_t flash_info[SC520_MAX_FLASH_BANKS]; /*----------------------------------------------------------------------- */
- static u32 _probe_flash(u32 addr, u32 bw, int il) { u32 result=0; @@ -180,7 +178,6 @@ static u32 _probe_flash(u32 addr, u32 bw, int il) break; }
- return result; }
@@ -215,11 +212,9 @@ static int identify_flash(unsigned address, int width) enable_interrupts(); }
- vendor = res >> 16; device = res & 0xffff;
- return res; }
@@ -385,7 +380,6 @@ void flash_print_info(flash_info_t *info) break; }
- printf(" Size: %ld MB in %d Sectors\n", info->size >> 20, info->sector_count);
@@ -399,13 +393,13 @@ void flash_print_info(flash_info_t *info) } printf ("\n");
- done: +done: + return; }
/*----------------------------------------------------------------------- */
- static u32 _amd_erase_flash(u32 addr, u32 sector) { unsigned elapsed; @@ -467,7 +461,6 @@ static u32 _intel_erase_flash(u32 addr, u32 sector) *(volatile u16*)(addr + sector) = 0x0020; /* erase setup */ *(volatile u16*)(addr + sector) = 0x00D0; /* erase confirm */
- /* Wait at least 80us - let's wait 1 ms */ __udelay(1000);
@@ -486,7 +479,6 @@ static u32 _intel_erase_flash(u32 addr, u32 sector) return 0; }
- extern int _intel_erase_flash_end; asm ("_intel_erase_flash_end:\n" ".long 0\n"); @@ -548,7 +540,6 @@ int flash_erase(flash_info_t *info, int s_first, int s_last) printf ("\n"); }
- /* Start erase on unprotected sectors */ for (sect = s_first; sect<=s_last; sect++) {
@@ -566,7 +557,6 @@ int flash_erase(flash_info_t *info, int s_first, int s_last) enable_interrupts(); }
- if (res) { printf("Erase timed out, sector %d\n", sect); return res; @@ -576,7 +566,6 @@ int flash_erase(flash_info_t *info, int s_first, int s_last) } }
- return 0; }
@@ -586,11 +575,11 @@ int flash_erase(flash_info_t *info, int s_first, int s_last) * 1 - write timeout * 2 - Flash not erased */ -static int _amd_write_word(unsigned start, unsigned dest, unsigned data) +static int _amd_write_word(unsigned start, unsigned dest, u16 data) { - volatile u16 *addr2 = (u16*)start; - volatile u16 *dest2 = (u16*)dest; - volatile u16 *data2 = (u16*)&data; + volatile u16 *addr2 = (volatile u16*)start; + volatile u16 *dest2 = (volatile u16*)dest; + volatile u16 *data2 = (volatile u16*)&data; int i; unsigned elapsed;
@@ -601,7 +590,6 @@ static int _amd_write_word(unsigned start, unsigned dest, unsigned data)
for (i = 0; i < 2; i++) {
- addr2[0x5555] = 0x00AA; addr2[0x2aaa] = 0x0055; addr2[0x5555] = 0x00A0; @@ -630,7 +618,6 @@ extern int _amd_write_word_end; asm ("_amd_write_word_end:\n" ".long 0\n");
- static int _intel_write_word(unsigned start, unsigned dest, unsigned data) { int i; @@ -663,14 +650,12 @@ static int _intel_write_word(unsigned start, unsigned dest, unsigned data)
return 0; - }
extern int _intel_write_word_end; asm ("_intel_write_word_end:\n" ".long 0\n");
- /*----------------------------------------------------------------------- * Copy memory to flash, returns: * 0 - OK @@ -715,10 +700,8 @@ int write_buff(flash_info_t *info, uchar *src, ulong addr, ulong cnt) return 3; }
- wp = (addr & ~3); /* get lower word aligned address */
- /* * handle unaligned start bytes */ @@ -805,5 +788,4 @@ int write_buff(flash_info_t *info, uchar *src, ulong addr, ulong cnt) }
return rc; - }

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com --- board/sc520_spunk/Makefile | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/board/sc520_spunk/Makefile b/board/sc520_spunk/Makefile index bfb77e8..226c756 100644 --- a/board/sc520_spunk/Makefile +++ b/board/sc520_spunk/Makefile @@ -36,7 +36,7 @@ OBJS := $(addprefix $(obj),$(COBJS)) SOBJS := $(addprefix $(obj),$(SOBJS))
$(LIB): $(obj).depend $(OBJS) $(SOBJS) - $(AR) $(ARFLAGS) $@ $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
clean: rm -f $(SOBJS) $(OBJS)

board/sc520_spunk/libsc520_spunk.a(sc520_spunk_asm.o): In function '__show_boot_progress': board/sc520_spunk/sc520_spunk_asm.S:78: multiple definition of '__show_boot_progress' common/libcommon.a(main.o):common/main.c:50: first defined here
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com --- board/sc520_cdp/sc520_cdp_asm.S | 4 ++-- board/sc520_spunk/sc520_spunk_asm.S | 4 ++-- cpu/i386/start.S | 20 ++++++++++---------- 3 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/board/sc520_cdp/sc520_cdp_asm.S b/board/sc520_cdp/sc520_cdp_asm.S index be7b2bb..7f70d65 100644 --- a/board/sc520_cdp/sc520_cdp_asm.S +++ b/board/sc520_cdp/sc520_cdp_asm.S @@ -76,8 +76,8 @@ done: movb $0x88, %al jmp *%ebp /* return to caller */
-.globl __show_boot_progress -__show_boot_progress: +.globl show_boot_progress +show_boot_progress: out %al, $0x80 xchg %al, %ah movw $0x680, %dx diff --git a/board/sc520_spunk/sc520_spunk_asm.S b/board/sc520_spunk/sc520_spunk_asm.S index 8b34103..0127076 100644 --- a/board/sc520_spunk/sc520_spunk_asm.S +++ b/board/sc520_spunk/sc520_spunk_asm.S @@ -73,8 +73,8 @@ done: movl $0xfffefc32,%edx jmp *%ebp /* return to caller */
-.globl __show_boot_progress -__show_boot_progress: +.globl show_boot_progress +show_boot_progress: movl $0xfffefc32,%edx xorw $0xffff, %ax movw %ax,(%edx) diff --git a/cpu/i386/start.S b/cpu/i386/start.S index 1a54dd1..51a27aa 100644 --- a/cpu/i386/start.S +++ b/cpu/i386/start.S @@ -55,7 +55,7 @@ early_board_init_ret: /* so we try to indicate progress */ movw $0x01, %ax movl $.progress0, %ebp - jmp __show_boot_progress + jmp show_boot_progress .progress0:
/* size memory */ @@ -74,7 +74,7 @@ mem_init_ret: /* indicate (lack of) progress */ movw $0x81, %ax movl $.progress0a, %ebp - jmp __show_boot_progress + jmp show_boot_progress .progress0a: jmp die mem_ok: @@ -82,7 +82,7 @@ mem_ok: /* indicate progress */ movw $0x02, %ax movl $.progress1, %ebp - jmp __show_boot_progress + jmp show_boot_progress .progress1:
/* create a stack after the bss */ @@ -104,7 +104,7 @@ no_stack: /* indicate (lack of) progress */ movw $0x82, %ax movl $.progress1a, %ebp - jmp __show_boot_progress + jmp show_boot_progress .progress1a: jmp die
@@ -113,7 +113,7 @@ stack_ok: /* indicate progress */ movw $0x03, %ax movl $.progress2, %ebp - jmp __show_boot_progress + jmp show_boot_progress .progress2:
/* copy data section to ram, size must be 4-byte aligned */ @@ -136,7 +136,7 @@ data_fail: /* indicate (lack of) progress */ movw $0x83, %ax movl $.progress2a, %ebp - jmp __show_boot_progress + jmp show_boot_progress .progress2a: jmp die
@@ -145,7 +145,7 @@ data_ok: /* indicate progress */ movw $0x04, %ax movl $.progress3, %ebp - jmp __show_boot_progress + jmp show_boot_progress .progress3:
/* clear bss section in ram, size must be 4-byte aligned */ @@ -168,7 +168,7 @@ bss_fail: /* indicate (lack of) progress */ movw $0x84, %ax movl $.progress3a, %ebp - jmp __show_boot_progress + jmp show_boot_progress .progress3a: jmp die
@@ -180,7 +180,7 @@ bss_ok: /* indicate progress */ movw $0x05, %ax movl $.progress4, %ebp - jmp __show_boot_progress + jmp show_boot_progress .progress4:
call start_i386boot /* Enter, U-boot! */ @@ -188,7 +188,7 @@ bss_ok: /* indicate (lack of) progress */ movw $0x85, %ax movl $.progress4a, %ebp - jmp __show_boot_progress + jmp show_boot_progress .progress4a:
die: hlt

sc520_cdp.c: In function 'pci_sc520_cdp_fixup_irq': sc520_cdp.c:134: warning: pointer targets in passing argument 4 of 'pci_hose_read_config_byte' differ in signedness sc520_cdp.c: In function 'spi_read': sc520_cdp.c:598: warning: pointer targets in passing argument 3 of 'spi_eeprom_read' differ in signedness sc520_cdp.c: In function 'spi_write': sc520_cdp.c:622: warning: pointer targets in passing argument 3 of 'spi_eeprom_write' differ in signedness
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com --- board/sc520_cdp/sc520_cdp.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/board/sc520_cdp/sc520_cdp.c b/board/sc520_cdp/sc520_cdp.c index f6f0e72..9828024 100644 --- a/board/sc520_cdp/sc520_cdp.c +++ b/board/sc520_cdp/sc520_cdp.c @@ -128,7 +128,7 @@ static void pci_sc520_cdp_fixup_irq(struct pci_controller *hose, pci_dev_t dev) }; static int next_irq_index=0;
- char tmp_pin; + u8 tmp_pin; int pin;
pci_hose_read_config_byte(hose, dev, PCI_INTERRUPT_PIN, &tmp_pin); @@ -562,14 +562,14 @@ void spi_eeprom_probe(int x) { }
-int spi_eeprom_read(int x, int offset, char *buffer, int len) +int spi_eeprom_read(int x, int offset, uchar *buffer, int len) { - return 0; + return 0; }
-int spi_eeprom_write(int x, int offset, char *buffer, int len) +int spi_eeprom_write(int x, int offset, uchar *buffer, int len) { - return 0; + return 0; }
void spi_init_f(void)

In message 1211130599-28289-18-git-send-email-plagnioj@jcrosoft.com you wrote:
sc520_cdp.c: In function 'pci_sc520_cdp_fixup_irq': sc520_cdp.c:134: warning: pointer targets in passing argument 4 of 'pci_hose_read_config_byte' differ in signedness sc520_cdp.c: In function 'spi_read': sc520_cdp.c:598: warning: pointer targets in passing argument 3 of 'spi_eeprom_read' differ in signedness sc520_cdp.c: In function 'spi_write': sc520_cdp.c:622: warning: pointer targets in passing argument 3 of 'spi_eeprom_write' differ in signedness
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com
board/sc520_cdp/sc520_cdp.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/board/sc520_cdp/sc520_cdp.c b/board/sc520_cdp/sc520_cdp.c index f6f0e72..9828024 100644 --- a/board/sc520_cdp/sc520_cdp.c +++ b/board/sc520_cdp/sc520_cdp.c @@ -128,7 +128,7 @@ static void pci_sc520_cdp_fixup_irq(struct pci_controller *hose, pci_dev_t dev) }; static int next_irq_index=0;
- char tmp_pin;
- u8 tmp_pin;
Please use uchar here, too. Thanks.
Best regards,
Wolfgang Denk

In message 1211130599-28289-17-git-send-email-plagnioj@jcrosoft.com you wrote:
board/sc520_spunk/libsc520_spunk.a(sc520_spunk_asm.o): In function '__show_boot_progress': board/sc520_spunk/sc520_spunk_asm.S:78: multiple definition of '__show_boot_progress' common/libcommon.a(main.o):common/main.c:50: first defined here
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com
board/sc520_cdp/sc520_cdp_asm.S | 4 ++-- board/sc520_spunk/sc520_spunk_asm.S | 4 ++-- cpu/i386/start.S | 20 ++++++++++---------- 3 files changed, 14 insertions(+), 14 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

In message 1211130599-28289-16-git-send-email-plagnioj@jcrosoft.com you wrote:
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com
board/sc520_spunk/Makefile | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

In message 1211130599-28289-15-git-send-email-plagnioj@jcrosoft.com you wrote:
flash.c:593: warning: dereferencing type-punned pointer will break strict-aliasing rules flash.c:398: error: label at end of compound statement
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com
board/sc520_spunk/flash.c | 30 ++++++------------------------ 1 files changed, 6 insertions(+), 24 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

In message 1211130599-28289-14-git-send-email-plagnioj@jcrosoft.com you wrote:
sc520_spunk.c: In function 'pci_sc520_spunk_fixup_irq': sc520_spunk.c:117: warning: pointer targets in passing argument 4 of 'pci_hose_read_config_byte' differ in signedness sc520_spunk.c: In function 'last_stage_init': sc520_spunk.c:580: warning: implicit declaration of function 'ds1722_probe' sc520_spunk.c: In function 'spi_init_f': sc520_spunk.c:643: warning: implicit declaration of function 'spi_eeprom_probe' sc520_spunk.c:644: warning: implicit declaration of function 'mw_eeprom_probe' sc520_spunk.c: In function 'spi_read': sc520_spunk.c:660: warning: implicit declaration of function 'spi_eeprom_read' sc520_spunk.c:661: warning: implicit declaration of function 'mw_eeprom_read' sc520_spunk.c: In function 'spi_write': sc520_spunk.c:676: warning: implicit declaration of function 'spi_eeprom_write' sc520_spunk.c:677: warning: implicit declaration of function 'mw_eeprom_write'
adding mw_eeprom header
Frankly, such a commit message is useless. What is it supposed to tell me?
- char tmp_pin;
- u8 tmp_pin;
Please use uchar if you really want an unsigned character type.
+void spi_eeprom_probe(int x) +{ +}
+int spi_eeprom_read(int x, int offset, uchar *buffer, int len) +{
- return 0;
+}
+int spi_eeprom_write(int x, int offset, uchar *buffer, int len) +{
- return 0;
+}
Is this supposed to be working code?
Why is this needed, then?
--- /dev/null +++ b/include/mw_eeprom.h @@ -0,0 +1,27 @@ +/*
- See file CREDITS for list of people who contributed to this
- project.
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2 of
- the License, or (at your option) any later version.
- 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
- GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- MA 02111-1307 USA
- */
Copyright entry missing.
Best regards,
Wolfgang Denk

In message 1211130599-28289-13-git-send-email-plagnioj@jcrosoft.com you wrote:
ti_pci1410a.c: In function 'voltage_set': ti_pci1410a.c:421: error: label at end of compound statement ti_pci1410a.c:435: error: label at end of compound statement cc1: warnings being treated as errors ti_pci1410a.c: At top level: ti_pci1410a.c:609: warning: pointer targets in initialization differ in signedness ti_pci1410a.c: In function 'identify': ti_pci1410a.c:651: warning: pointer targets in passing argument 1 of 'puts' differ in signedness ti_pci1410a.c:656: warning: pointer targets in passing argument 1 of 'strcmp' differ in signedness ti_pci1410a.c:656: warning: pointer targets in passing argument 2 of 'strcmp' differ in signedness
Please do not include long lists of error messages. It would be more helpful if you described what you change, or why.
static int identify(volatile uchar *p) {
- uchar id_str[MAX_IDENT_CHARS];
- char id_str[MAX_IDENT_CHARS];
This code is also already present in common/cmd_pcmcia.c; you probably want to remove it here, too.
--- a/include/pcmcia.h +++ b/include/pcmcia.h @@ -318,4 +318,6 @@ extern u_int *pcmcia_pgcrx[]; extern int check_ide_device(int slot); #endif
+int pcmcia_off(void); +int pcmcia_on(void); #endif /* _PCMCIA_H */
Then please also get rid of the lots of "extern" declarations in misc source files which become unnecessary by that. Thanks.
Best regards,
Wolfgang Denk

In message 1211130599-28289-12-git-send-email-plagnioj@jcrosoft.com you wrote:
to avoid the following errors :
include/pcmcia.h:72:3: error: #error "PCMCIA Slot not configured" include/pcmcia.h:79:2: error: #error Neither CONFIG_PCMCIA_SLOT_A nor CONFIG_PCMCIA_SLOT_B configured
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com
Which board is showing such errors?
Best regards,
Wolfgang Denk

In message 1211130599-28289-11-git-send-email-plagnioj@jcrosoft.com you wrote:
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com
drivers/pcmcia/Makefile | 2 +- drivers/pcmcia/ti_pci1410a.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
Applied, thanke.
Best regards,
Wolfgang Denk

In message 1211130599-28289-10-git-send-email-plagnioj@jcrosoft.com you wrote:
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com
drivers/pcmcia/Makefile | 2 +- drivers/pcmcia/pxa_pcmcia.c | 4 ---- 2 files changed, 1 insertions(+), 5 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

In message 1211130599-28289-9-git-send-email-plagnioj@jcrosoft.com you wrote:
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com
drivers/pcmcia/Makefile | 2 +- drivers/pcmcia/marubun_pcmcia.c | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-)
Note:
this patch, as well as
[PATCH 09/17] pxa_pcmcia: Move compile condition to the Makefile [PATCH 10/17] pcmcia/ti_pci1410a: Move compile condition to the Makefile
are not considered bug fixes, so they will go in when the next merge window is open.
Best regards,
Wolfgang Denk

In message 1211130599-28289-9-git-send-email-plagnioj@jcrosoft.com you wrote:
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com
drivers/pcmcia/Makefile | 2 +- drivers/pcmcia/marubun_pcmcia.c | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

In message 1211130599-28289-8-git-send-email-plagnioj@jcrosoft.com you wrote:
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com
drivers/pcmcia/Makefile | 1 + drivers/pcmcia/i82365.c | 4 ---- 2 files changed, 1 insertions(+), 4 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

In message 1211130599-28289-7-git-send-email-plagnioj@jcrosoft.com you wrote:
ds1722.c:6:17: error: ssi.h: No such file or directory ds1722.c:6:17: error: ssi.h: No such file or directory cc1: warnings being treated as errors ds1722.c: In function 'ds1722_select': ds1722.c:10: warning: implicit declaration of function 'ssi_set_interface' ds1722.c:11: warning: implicit declaration of function 'ssi_chip_select' ds1722.c: In function 'ds1722_read': ds1722.c:24: warning: implicit declaration of function 'ssi_tx_byte' ds1722.c:25: warning: implicit declaration of function 'ssi_rx_byte' ds1722.c: In function 'ds1722_probe': ds1722.c:137: error: 'DS1722_RESOLUTION_12BIT' undeclared (first use in this function) ds1722.c:137: error: (Each undeclared identifier is reported only once ds1722.c:137: error: for each function it appears in.)
Please do NOT include such long lists of error messages into the commit message. Thanks.
--- /dev/null +++ b/include/ds1722.h @@ -0,0 +1,32 @@ +/*
- See file CREDITS for list of people who contributed to this
- project.
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2 of
- the License, or (at your option) any later version.
- 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
- GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- MA 02111-1307 USA
Copyright entry missing.
--- /dev/null +++ b/include/ssi.h @@ -0,0 +1,29 @@ +/*
- See file CREDITS for list of people who contributed to this
- project.
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2 of
- the License, or (at your option) any later version.
- 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
- GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- MA 02111-1307 USA
- */
Copyright entry missing.
Best regards,
Wolfgang Denk

In message 1211130599-28289-6-git-send-email-plagnioj@jcrosoft.com you wrote:
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com
lib_i386/bootm.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

In message 1211130599-28289-5-git-send-email-plagnioj@jcrosoft.com you wrote:
Fix a warning type in lib_i386/board.c
Um... you not only fix a warning; you change the code pretty heavily.
--- a/lib_i386/board.c +++ b/lib_i386/board.c @@ -38,6 +38,9 @@ #include <ide.h> #include <asm/u-boot-i386.h>
+gd_t gd_data; +gd_t *gd;
Please do not name this 'gd_data'; stick with the 'global_data' name.
Also be aware that this is dangerous - this way it ends up in the BSS segment which most probably is uninitialized when you acess this data, and gets overwritten with zeroes some time later.
Is this really working code?
Best regards,
Wolfgang Denk

In message 1211130599-28289-4-git-send-email-plagnioj@jcrosoft.com you wrote:
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com
examples/.gitignore | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
Applied. Thanks.
Best regards,
Wolfgang Denk

In message 1211130599-28289-3-git-send-email-plagnioj@jcrosoft.com you wrote:
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com
examples/eepro100_eeprom.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/examples/eepro100_eeprom.c b/examples/eepro100_eeprom.c index 2b15d05..5f4eb78 100644 --- a/examples/eepro100_eeprom.c +++ b/examples/eepro100_eeprom.c @@ -80,11 +80,13 @@ static inline short inw(long addr) static inline void *memcpy(void *dst, const void *src, unsigned int len) { char *ret = dst;
- while (len-- > 0) { *ret++ = *((char *)src); src++; }
- return (void *)ret;
- return (void *)dst;
While technically correct, this is bogus. We have a variable ret, but we don't return it. And we have a variable dst, but we don't use it as destination pointer.
Please change the *ret++ = *((char *)src); into *dst++ = *((char *)src); and leave all the rest.
Best regards,
Wolfgang Denk

On 00:28 Mon 19 May , Wolfgang Denk wrote:
In message 1211130599-28289-3-git-send-email-plagnioj@jcrosoft.com you wrote:
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com
examples/eepro100_eeprom.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/examples/eepro100_eeprom.c b/examples/eepro100_eeprom.c index 2b15d05..5f4eb78 100644 --- a/examples/eepro100_eeprom.c +++ b/examples/eepro100_eeprom.c @@ -80,11 +80,13 @@ static inline short inw(long addr) static inline void *memcpy(void *dst, const void *src, unsigned int len) { char *ret = dst;
- while (len-- > 0) { *ret++ = *((char *)src); src++; }
- return (void *)ret;
- return (void *)dst;
While technically correct, this is bogus. We have a variable ret, but we don't return it. And we have a variable dst, but we don't use it as destination pointer.
Please change the *ret++ = *((char *)src); into *dst++ = *((char *)src); and leave all the rest.
You can not do this because dst is a void
we can do this
char *tmp = dst;
while (len-- > 0) { *tmp++ = *((char *)src); src++; }
return (void *)dst;
Best Regards, J.

In message 20080518222019.GC19480@game.jcrosoft.org you wrote:
static inline void *memcpy(void *dst, const void *src, unsigned int len) { char *ret = dst;
- while (len-- > 0) { *ret++ = *((char *)src); src++; }
- return (void *)ret;
- return (void *)dst;
While technically correct, this is bogus. We have a variable ret, but we don't return it. And we have a variable dst, but we don't use it as destination pointer.
Please change the *ret++ = *((char *)src); into *dst++ = *((char *)src); and leave all the rest.
You can not do this because dst is a void
Why not? src is void, too.
we can do this
char *tmp = dst;
while (len-- > 0) { *tmp++ = *((char *)src); src++; }
return (void *)dst;
This is not a bit better.
Best regards,
Wolfgang Denk

On 01:03 Mon 19 May , Wolfgang Denk wrote:
In message 20080518222019.GC19480@game.jcrosoft.org you wrote:
static inline void *memcpy(void *dst, const void *src, unsigned int len) { char *ret = dst;
- while (len-- > 0) { *ret++ = *((char *)src); src++; }
- return (void *)ret;
- return (void *)dst;
While technically correct, this is bogus. We have a variable ret, but we don't return it. And we have a variable dst, but we don't use it as destination pointer.
Please change the *ret++ = *((char *)src); into *dst++ = *((char *)src); and leave all the rest.
You can not do this because dst is a void
Why not? src is void, too.
gcc will claim about the cast.
we can do this void *ret = dst; char *d = dst; const char *s = src;
while (len-- > 0) *d++ = *s++;
return ret;
Best Regards, J.

Jean-Christophe PLAGNIOL-VILLARD wrote:
On 01:03 Mon 19 May , Wolfgang Denk wrote:
In message 20080518222019.GC19480@game.jcrosoft.org you wrote:
static inline void *memcpy(void *dst, const void *src, unsigned int len) { char *ret = dst;
- while (len-- > 0) { *ret++ = *((char *)src); src++; }
- return (void *)ret;
- return (void *)dst;
While technically correct, this is bogus. We have a variable ret, but we don't return it. And we have a variable dst, but we don't use it as destination pointer.
Please change the *ret++ = *((char *)src); into *dst++ = *((char *)src); and leave all the rest.
You can not do this because dst is a void
Why not? src is void, too.
gcc will claim about the cast.
we can do this void *ret = dst; char *d = dst; const char *s = src;
while (len-- > 0) *d++ = *s++; return ret;
Best Regards, J.
YES! YES! YES! This gets my vote. I marked the start of this thread meaning to suggest using temp variables of the right type and get rid of the complex casting crap, exactly what you did here.
Thanks, gvb

Jerry Van Baren gvb.uboot@gmail.com writes:
YES! YES! YES! This gets my vote. I marked the start of this thread meaning to suggest using temp variables of the right type and get rid of the complex casting crap, exactly what you did here.
Ack, but BTW ....
...whats wrong with the generic memcpy, e.g. from lib_generic/string.c? Maybe this should be exported and used instead of duplicating generic code again and again?
Best regards
Markus Klotzbuecher
-- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office@denx.de

In message 1211130599-28289-2-git-send-email-plagnioj@jcrosoft.com you wrote:
include/image.h: In function 'image_set_name': include/image.h:374: warning: implicit declaration of function 'strncpy' 82559_eeprom.c: In function 'memcpy': 82559_eeprom.c:57: error: lvalue required as increment operand 82559_eeprom.c:57: error: lvalue required as increment operand 82559_eeprom.c: In function 'main': 82559_eeprom.c:318: warning: pointer targets in passing argument 2 of 'gethwaddr' differ in signedness
...
-#define _PPC_STRING_H_ /* avoid unnecessary str/mem functions */ -#define _LINUX_STRING_H_ /* avoid unnecessary str/mem functions */ +#define __HAVE_ARCH_MEMCPY 1 /* avoid unnecessary memcpy function */ +#define _PPC_STRING_H_ 1 /* avoid unnecessary str/mem functions */
Why these changes?
-static inline void *memcpy(void *dst, const void *src, unsigned int len) +inline void *memcpy(void *dst, const void *src, unsigned int len)
If we define __HAVE_ARCH_MEMCPY, should we not delete the whole memcpy() part then?
--- a/include/asm-i386/string.h +++ b/include/asm-i386/string.h @@ -5,6 +5,8 @@
- We don't do inline string functions, since the
- optimised inline asm versions are not small.
*/ +#undef __HAVE_ARCH_STRNCPY +extern char *strncpy(char *dest, const char *src, size_t count);
#undef __HAVE_ARCH_STRRCHR
This makes no sense to me. If the implementation has strrchr(), I bet a case of beer it will also have strncpy().
Best regards,
Wolfgang Denk

In message 1211130599-28289-1-git-send-email-plagnioj@jcrosoft.com you wrote:
by sync asm/byteorder.h with linux
...
+static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 x)
...
+static __inline__ __attribute_const__ __u64 ___arch__swab64(__u64 val)
etc.
Current Linux uses "inline" instead of "__inline__" - why the difference?
Best regards,
Wolfgang Denk

On 00:18 Mon 19 May , Wolfgang Denk wrote:
In message 1211130599-28289-1-git-send-email-plagnioj@jcrosoft.com you wrote:
by sync asm/byteorder.h with linux
...
+static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 x)
...
+static __inline__ __attribute_const__ __u64 ___arch__swab64(__u64 val)
etc.
Current Linux uses "inline" instead of "__inline__" - why the difference?
In Linux inline is redefined as strict inline and we use __inline__ in all other u-boot definition
I will change it, when I'll importer the compiler header from linux.
Best Regards J.

In message 20080518221047.GB19480@game.jcrosoft.org you wrote:
I will change it, when I'll importer the compiler header from linux.
Please do NOT import headers which we do not really, really need.
Best regards,
Wolfgang Denk
participants (4)
-
Jean-Christophe PLAGNIOL-VILLARD
-
Jerry Van Baren
-
Markus Klotzbücher
-
Wolfgang Denk