* [U-Boot] [PATCH 1/2] Update i386 code (sc520_cdp)
@ 2008-09-06 21:55 Graeme Russ
2008-09-06 23:35 ` Wolfgang Denk
0 siblings, 1 reply; 15+ messages in thread
From: Graeme Russ @ 2008-09-06 21:55 UTC (permalink / raw)
To: u-boot
Attempt to bring i386 / sc520 inline with master
Lesson learnt - do not cut and paste into gmail
Eclipse seems to have an issue with the o-umlaut. I've had a search
through the editor preferences but cannot find a way to stop Eclipse
from mangling it. I have completely removed the copyright lines from the
patch as they are, in reality, completely unmodified. I have applied
this patch to a clean pull of master followed by a make sc520_cdp_config
and make all with no patch or compile errors reported.
Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
diff --git a/board/sc520_cdp/sc520_cdp.c b/board/sc520_cdp/sc520_cdp.c
index f21c730..bfb473e 100644
--- a/board/sc520_cdp/sc520_cdp.c
+++ b/board/sc520_cdp/sc520_cdp.c
@@ -114,7 +114,7 @@ static void irq_init(void)
}
-
+#ifdef CONFIG_PCI
/* PCI stuff */
static void pci_sc520_cdp_fixup_irq(struct pci_controller *hose,
pci_dev_t dev)
{
@@ -129,7 +129,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;
+ uchar tmp_pin;
int pin;
pci_hose_read_config_byte(hose, dev, PCI_INTERRUPT_PIN,
&tmp_pin);
@@ -193,7 +193,7 @@ void pci_init_board(void)
{
pci_sc520_init(&sc520_cdp_hose);
}
-
+#endif
static void silence_uart(int port)
{
@@ -563,12 +563,12 @@ 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;
}
-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;
}
diff --git a/drivers/mtd/mw_eeprom.c b/drivers/mtd/mw_eeprom.c
index f32ced4..f7791b5 100644
--- a/drivers/mtd/mw_eeprom.c
+++ b/drivers/mtd/mw_eeprom.c
@@ -1,7 +1,7 @@
/* Three-wire (MicroWire) serial eeprom driver (for 93C46 and
compatibles) */
#include <common.h>
-#include <ssi.h>
+#include <asm/ic/ssi.h>
/*
* Serial EEPROM opcodes, including start bit
diff --git a/examples/82559_eeprom.c b/examples/82559_eeprom.c
index 1a121d4..d99af26 100644
--- a/examples/82559_eeprom.c
+++ b/examples/82559_eeprom.c
@@ -51,13 +51,17 @@ static inline unsigned short swap16(unsigned short
x)
}
-static inline void *memcpy(void *dst, const void *src, unsigned int
len)
+void * memcpy(void * dest,const void *src,size_t count)
{
- void * ret = dst;
- while (len-- > 0) *((char *)dst)++ = *((char *)src)++;
- return ret;
+ char *tmp = (char *) dest, *s = (char *) src;
+
+ while (count--)
+ *tmp++ = *s++;
+
+ return dest;
}
+
/* The EEPROM commands include the alway-set leading bit. */
#define EE_WRITE_CMD (5)
#define EE_READ_CMD (6)
@@ -156,7 +160,7 @@ static int reset_eeprom(unsigned long ioaddr,
unsigned char *hwaddr)
int size_test;
int i;
- printf("Resetting i82559 EEPROM @ 0x%08x ... ", ioaddr);
+ printf("Resetting i82559 EEPROM @ 0x%08lx ... ", ioaddr);
size_test = do_eeprom_cmd(ioaddr, (EE_READ_CMD << 8) << 16, 27);
eeprom_addr_size = (size_test & 0xffe0000) == 0xffe0000 ? 8 : 6;
@@ -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];
+ uchar buf[6];
int instance;
app_startup(argv);
diff --git a/include/asm-i386/byteorder.h b/include/asm-i386/byteorder.h
index a9c69d5..7dfeb8b 100644
--- a/include/asm-i386/byteorder.h
+++ b/include/asm-i386/byteorder.h
@@ -6,7 +6,7 @@
#ifdef __GNUC__
-static __inline__ __const__ __u32 ___arch__swab32(__u32 x)
+static __inline__ __u32 ___arch__swab32(__u32 x)
{
#ifdef CONFIG_X86_BSWAP
__asm__("bswap %0" : "=r" (x) : "0" (x));
@@ -20,7 +20,7 @@ static __inline__ __const__ __u32
___arch__swab32(__u32 x)
return x;
}
-static __inline__ __const__ __u16 ___arch__swab16(__u16 x)
+static __inline__ __u16 ___arch__swab16(__u16 x)
{
__asm__("xchgb %b0,%h0" /* swap bytes */ \
: "=q" (x) \
diff --git a/include/asm-i386/global_data.h
b/include/asm-i386/global_data.h
index 5dfb595..f31bac6 100644
--- a/include/asm-i386/global_data.h
+++ b/include/asm-i386/global_data.h
@@ -58,8 +58,8 @@ typedef struct {
#define GD_FLG_POSTSTOP 0x00010 /* POST seqeunce
aborted */
#define GD_FLG_LOGINIT 0x00020 /* Log Buffer has been
initialized */
-extern gd_t *global_data;
+extern gd_t *gd;
-#define DECLARE_GLOBAL_DATA_PTR gd_t *gd = global_data
+#define DECLARE_GLOBAL_DATA_PTR
#endif /* __ASM_GBL_DATA_H */
diff --git a/include/asm-i386/ic/ssi.h b/include/asm-i386/ic/ssi.h
new file mode 100644
index 0000000..bd48eab
--- /dev/null
+++ b/include/asm-i386/ic/ssi.h
@@ -0,0 +1,34 @@
+/*
+ * (C) Copyright 2008
+ * Graeme Russ <graeme.russ@gmail.com>.
+ *
+ * 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 _ASM_IC_SSI_H_
+#define _ASM_IC_SSI_H_ 1
+
+int ssi_set_interface(int, int, int, int);
+void ssi_chip_select(int);
+u8 ssi_txrx_byte(u8);
+void ssi_tx_byte(u8);
+u8 ssi_rx_byte(void);
+
+
+#endif
diff --git a/include/asm-i386/pci.h b/include/asm-i386/pci.h
index bde9550..85f60d7 100644
--- a/include/asm-i386/pci.h
+++ b/include/asm-i386/pci.h
@@ -31,5 +31,4 @@ int pci_enable_legacy_video_ports(struct
pci_controller* hose);
int pci_shadow_rom(pci_dev_t dev, unsigned char *dest);
void pci_remove_rom_window(struct pci_controller* hose, u32 addr);
u32 pci_get_rom_window(struct pci_controller* hose, int size);
-
#endif
diff --git a/include/asm-i386/string.h b/include/asm-i386/string.h
index 91a23f9..3643a79 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,
__kernel_size_t __n);
#undef __HAVE_ARCH_STRRCHR
extern char * strrchr(const char * s, int c);
diff --git a/include/configs/sc520_cdp.h b/include/configs/sc520_cdp.h
index e29655e..6a73c90 100644
--- a/include/configs/sc520_cdp.h
+++ b/include/configs/sc520_cdp.h
@@ -28,6 +28,7 @@
#ifndef __CONFIG_H
#define __CONFIG_H
+#define GRUSS_TESTING
/*
* High Level Configuration Options
* (easy to change)
@@ -81,7 +82,11 @@
#include <config_cmd_default.h>
#define CONFIG_CMD_PCI
+#ifndef GRUSS_TESTING
#define CONFIG_CMD_SATA
+#else
+#undef CONFIG_CMD_SATA
+#endif
#define CONFIG_CMD_JFFS2
#define CONFIG_CMD_NET
#define CONFIG_CMD_EEPROM
@@ -175,10 +180,18 @@
/************************************************************
*SATA/Native Stuff
************************************************************/
+#ifndef GRUSS_TESTING
#define CFG_SATA_MAXBUS 2 /*Max Sata buses supported */
#define CFG_SATA_DEVS_PER_BUS 2 /*Max no. of devices per
bus/port */
#define CFG_SATA_MAX_DEVICE (CFG_SATA_MAXBUS*
CFG_SATA_DEVS_PER_BUS)
#define CONFIG_ATA_PIIX 1 /*Supports ata_piix
driver */
+#else
+#undef CFG_SATA_MAXBUS
+#undef CFG_SATA_DEVS_PER_BUS
+#undef CFG_SATA_MAX_DEVICE
+#undef CONFIG_ATA_PIIX
+#endif
+
/************************************************************
* DISK Partition support
@@ -190,7 +203,11 @@
/************************************************************
* Video/Keyboard support
************************************************************/
+#ifndef GRUSS_TESTING
#define CONFIG_VIDEO /* To enable video controller
support */
+#else
+#undef CONFIG_VIDEO
+#endif
#define CONFIG_I8042_KBD
#define CFG_ISA_IO 0
@@ -203,6 +220,7 @@
/*
* PCI stuff
*/
+#ifndef GRUSS_TESTING
#define CONFIG_PCI /* include pci
support */
#define CONFIG_PCI_PNP /* pci plug-and-play
*/
#define CONFIG_PCI_SCAN_SHOW
@@ -211,5 +229,11 @@
#define CFG_SECOND_PCI_IRQ 9
#define CFG_THIRD_PCI_IRQ 11
#define CFG_FORTH_PCI_IRQ 15
+#else
+#undef CONFIG_PCI
+#undef CONFIG_PCI_PNP
+#undef CONFIG_PCI_SCAN_SHOW
+#endif
+
#endif /* __CONFIG_H */
diff --git a/include/image.h b/include/image.h
index 9be806e..e095a32 100644
--- a/include/image.h
+++ b/include/image.h
@@ -40,7 +40,7 @@
#include <lmb.h>
#include <linux/string.h>
#include <asm/u-boot.h>
-
+#include <asm/string.h>
#else
/* new uImage format support enabled on host */
diff --git a/lib_i386/bios_setup.c b/lib_i386/bios_setup.c
index 75f04a0..2018425 100644
--- a/lib_i386/bios_setup.c
+++ b/lib_i386/bios_setup.c
@@ -140,8 +140,9 @@ int bios_setup(void)
{
static int done=0;
int vector;
+#ifdef CONFIG_PCI
struct pci_controller *pri_hose;
-
+#endif
if (done) {
return 0;
}
@@ -223,12 +224,13 @@ int bios_setup(void)
* (This, ofcause break on multi hose systems,
* but our PCI BIOS only support one hose anyway)
*/
+#ifdef CONFIG_PCI
pri_hose = pci_bus_to_hose(0);
if (NULL != pri_hose) {
/* fill in last pci bus number for use by the realmode
* PCI BIOS */
RELOC_16_BYTE(0xf000, pci_last_bus) =
pri_hose->last_busno;
}
-
+#endif
return 0;
}
diff --git a/lib_i386/board.c b/lib_i386/board.c
index 55fa42a..8103211 100644
--- a/lib_i386/board.c
+++ b/lib_i386/board.c
@@ -213,7 +213,7 @@ init_fnc_t *init_sequence[] = {
NULL,
};
-gd_t *global_data;
+gd_t *gd;
void start_i386boot (void)
{
@@ -226,7 +226,7 @@ void start_i386boot (void)
show_boot_progress(0x21);
- gd = global_data = &gd_data;
+ gd = &gd_data;
/* compiler optimization barrier needed for GCC >= 3.4 */
__asm__ __volatile__("": : :"memory");
@@ -266,7 +266,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;
@@ -412,7 +412,10 @@ void hang (void)
unsigned long do_go_exec (ulong (*entry)(int, char *[]), int argc, char
*argv[])
{
/*
- * Nios function pointers are address >> 1
+ * TODO: Test this function - changed to fix compiler error.
+ * Original code was:
+ * return (entry >> 1) (argc, argv);
+ * with a comment about Nios function pointers are address >> 1
*/
- return (entry >> 1) (argc, argv);
+ return (entry) (argc, argv);
}
diff --git a/lib_i386/bootm.c b/lib_i386/bootm.c
index 522d7ad..613e339 100644
--- a/lib_i386/bootm.c
+++ b/lib_i386/bootm.c
@@ -34,7 +34,7 @@ int do_bootm_linux(int flag, int argc, char *argv[],
bootm_headers_t *images)
void *base_ptr;
ulong os_data, os_len;
image_header_t *hdr;
- int ret;
+
#if defined(CONFIG_FIT)
const void *data;
size_t len;
diff --git a/lib_i386/video_bios.c b/lib_i386/video_bios.c
index 45f78e2..02c2166 100644
--- a/lib_i386/video_bios.c
+++ b/lib_i386/video_bios.c
@@ -136,6 +136,8 @@ static u32 probe_pci_video(void)
#endif
+#ifdef CONFIG_VIDEO
+
static int probe_isa_video(void)
{
u32 ptr;
@@ -217,3 +219,4 @@ int video_bios_init(void)
return 1;
}
+#endif
^ permalink raw reply related [flat|nested] 15+ messages in thread* [U-Boot] [PATCH 1/2] Update i386 code (sc520_cdp)
2008-09-06 21:55 [U-Boot] [PATCH 1/2] Update i386 code (sc520_cdp) Graeme Russ
@ 2008-09-06 23:35 ` Wolfgang Denk
2008-09-07 0:01 ` Graeme Russ
0 siblings, 1 reply; 15+ messages in thread
From: Wolfgang Denk @ 2008-09-06 23:35 UTC (permalink / raw)
To: u-boot
Dear Graeme Russ,
In message <1220738100.6322.10.camel@devel> you wrote:
> Attempt to bring i386 / sc520 inline with master
>
> Lesson learnt - do not cut and paste into gmail
Indeed. And make sure your mailer doesn't wrap long lines...
Ideally, use git-send-email to send the messages.
> --- a/board/sc520_cdp/sc520_cdp.c
> +++ b/board/sc520_cdp/sc520_cdp.c
> @@ -114,7 +114,7 @@ static void irq_init(void)
>
> }
>
> -
> +#ifdef CONFIG_PCI
> /* PCI stuff */
> static void pci_sc520_cdp_fixup_irq(struct pci_controller *hose,
> pci_dev_t dev)
^^^^^^^^^^^^^^^^
Line wrapped.
> {
> @@ -129,7 +129,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;
> + uchar tmp_pin;
> int pin;
>
> pci_hose_read_config_byte(hose, dev, PCI_INTERRUPT_PIN,
> &tmp_pin);
^^^^^^^^^^^^
Line wrapped.
etc. etc.
Sorry, patch is corrupted again.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I have made mistakes, but have never made the mistake of claiming I
never made one. - James G. Bennet
^ permalink raw reply [flat|nested] 15+ messages in thread* [U-Boot] [PATCH 1/2] Update i386 code (sc520_cdp)
2008-09-06 23:35 ` Wolfgang Denk
@ 2008-09-07 0:01 ` Graeme Russ
2008-09-07 0:05 ` Wolfgang Denk
2008-09-08 12:28 ` JerryVanBaren
0 siblings, 2 replies; 15+ messages in thread
From: Graeme Russ @ 2008-09-07 0:01 UTC (permalink / raw)
To: u-boot
Third time lucky maybe - ditched Evolution (can't adjust line wrap width) for Thunderbird. I don't have git-send-email installed - will investigate
Attempt to bring i386 / sc520 inline with master
Signed-off-by: Graeme Russ <graeme.russ@gmail.com <http://lists.denx.de/mailman/listinfo/u-boot>>
diff --git a/board/sc520_cdp/sc520_cdp.c b/board/sc520_cdp/sc520_cdp.c
index f21c730..bfb473e 100644
--- a/board/sc520_cdp/sc520_cdp.c
+++ b/board/sc520_cdp/sc520_cdp.c
@@ -114,7 +114,7 @@ static void irq_init(void)
}
-
+#ifdef CONFIG_PCI
/* PCI stuff */
static void pci_sc520_cdp_fixup_irq(struct pci_controller *hose,
pci_dev_t dev)
{
@@ -129,7 +129,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;
+ uchar tmp_pin;
int pin;
pci_hose_read_config_byte(hose, dev, PCI_INTERRUPT_PIN, &tmp_pin);
@@ -193,7 +193,7 @@ void pci_init_board(void)
{
pci_sc520_init(&sc520_cdp_hose);
}
-
+#endif
static void silence_uart(int port)
{
@@ -563,12 +563,12 @@ 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;
}
-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;
}
diff --git a/drivers/mtd/mw_eeprom.c b/drivers/mtd/mw_eeprom.c
index f32ced4..f7791b5 100644
--- a/drivers/mtd/mw_eeprom.c
+++ b/drivers/mtd/mw_eeprom.c
@@ -1,7 +1,7 @@
/* Three-wire (MicroWire) serial eeprom driver (for 93C46 and
compatibles) */
#include <common.h>
-#include <ssi.h>
+#include <asm/ic/ssi.h>
/*
* Serial EEPROM opcodes, including start bit
diff --git a/examples/82559_eeprom.c b/examples/82559_eeprom.c
index 1a121d4..d99af26 100644
--- a/examples/82559_eeprom.c
+++ b/examples/82559_eeprom.c
@@ -51,13 +51,17 @@ static inline unsigned short swap16(unsigned short x)
}
-static inline void *memcpy(void *dst, const void *src, unsigned int len)
+void * memcpy(void * dest,const void *src,size_t count)
{
- void * ret = dst;
- while (len-- > 0) *((char *)dst)++ = *((char *)src)++;
- return ret;
+ char *tmp = (char *) dest, *s = (char *) src;
+
+ while (count--)
+ *tmp++ = *s++;
+
+ return dest;
}
+
/* The EEPROM commands include the alway-set leading bit. */
#define EE_WRITE_CMD (5)
#define EE_READ_CMD (6)
@@ -156,7 +160,7 @@ static int reset_eeprom(unsigned long ioaddr,
unsigned char *hwaddr)
int size_test;
int i;
- printf("Resetting i82559 EEPROM @ 0x%08x ... ", ioaddr);
+ printf("Resetting i82559 EEPROM @ 0x%08lx ... ", ioaddr);
size_test = do_eeprom_cmd(ioaddr, (EE_READ_CMD << 8) << 16, 27);
eeprom_addr_size = (size_test & 0xffe0000) == 0xffe0000 ? 8 : 6;
@@ -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];
+ uchar buf[6];
int instance;
app_startup(argv);
diff --git a/include/asm-i386/byteorder.h b/include/asm-i386/byteorder.h
index a9c69d5..7dfeb8b 100644
--- a/include/asm-i386/byteorder.h
+++ b/include/asm-i386/byteorder.h
@@ -6,7 +6,7 @@
#ifdef __GNUC__
-static __inline__ __const__ __u32 ___arch__swab32(__u32 x)
+static __inline__ __u32 ___arch__swab32(__u32 x)
{
#ifdef CONFIG_X86_BSWAP
__asm__("bswap %0" : "=r" (x) : "0" (x));
@@ -20,7 +20,7 @@ static __inline__ __const__ __u32 ___arch__swab32(__u32 x)
return x;
}
-static __inline__ __const__ __u16 ___arch__swab16(__u16 x)
+static __inline__ __u16 ___arch__swab16(__u16 x)
{
__asm__("xchgb %b0,%h0" /* swap bytes */ \
: "=q" (x) \
diff --git a/include/asm-i386/global_data.h b/include/asm-i386/global_data.h
index 5dfb595..f31bac6 100644
--- a/include/asm-i386/global_data.h
+++ b/include/asm-i386/global_data.h
@@ -58,8 +58,8 @@ typedef struct {
#define GD_FLG_POSTSTOP 0x00010 /* POST seqeunce aborted
*/
#define GD_FLG_LOGINIT 0x00020 /* Log Buffer has been
initialized */
-extern gd_t *global_data;
+extern gd_t *gd;
-#define DECLARE_GLOBAL_DATA_PTR gd_t *gd = global_data
+#define DECLARE_GLOBAL_DATA_PTR
#endif /* __ASM_GBL_DATA_H */
diff --git a/include/asm-i386/ic/ssi.h b/include/asm-i386/ic/ssi.h
new file mode 100644
index 0000000..bd48eab
--- /dev/null
+++ b/include/asm-i386/ic/ssi.h
@@ -0,0 +1,34 @@
+/*
+ * (C) Copyright 2008
+ * Graeme Russ <graeme.russ@gmail.com>.
+ *
+ * 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 _ASM_IC_SSI_H_
+#define _ASM_IC_SSI_H_ 1
+
+int ssi_set_interface(int, int, int, int);
+void ssi_chip_select(int);
+u8 ssi_txrx_byte(u8);
+void ssi_tx_byte(u8);
+u8 ssi_rx_byte(void);
+
+
+#endif
diff --git a/include/asm-i386/pci.h b/include/asm-i386/pci.h
index bde9550..85f60d7 100644
--- a/include/asm-i386/pci.h
+++ b/include/asm-i386/pci.h
@@ -31,5 +31,4 @@ int pci_enable_legacy_video_ports(struct
pci_controller* hose);
int pci_shadow_rom(pci_dev_t dev, unsigned char *dest);
void pci_remove_rom_window(struct pci_controller* hose, u32 addr);
u32 pci_get_rom_window(struct pci_controller* hose, int size);
-
#endif
diff --git a/include/asm-i386/string.h b/include/asm-i386/string.h
index 91a23f9..3643a79 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,
__kernel_size_t __n);
#undef __HAVE_ARCH_STRRCHR
extern char * strrchr(const char * s, int c);
diff --git a/include/configs/sc520_cdp.h b/include/configs/sc520_cdp.h
index e29655e..6a73c90 100644
--- a/include/configs/sc520_cdp.h
+++ b/include/configs/sc520_cdp.h
@@ -28,6 +28,7 @@
#ifndef __CONFIG_H
#define __CONFIG_H
+#define GRUSS_TESTING
/*
* High Level Configuration Options
* (easy to change)
@@ -81,7 +82,11 @@
#include <config_cmd_default.h>
#define CONFIG_CMD_PCI
+#ifndef GRUSS_TESTING
#define CONFIG_CMD_SATA
+#else
+#undef CONFIG_CMD_SATA
+#endif
#define CONFIG_CMD_JFFS2
#define CONFIG_CMD_NET
#define CONFIG_CMD_EEPROM
@@ -175,10 +180,18 @@
/************************************************************
*SATA/Native Stuff
************************************************************/
+#ifndef GRUSS_TESTING
#define CFG_SATA_MAXBUS 2 /*Max Sata buses supported */
#define CFG_SATA_DEVS_PER_BUS 2 /*Max no. of devices per bus/port */
#define CFG_SATA_MAX_DEVICE (CFG_SATA_MAXBUS* CFG_SATA_DEVS_PER_BUS)
#define CONFIG_ATA_PIIX 1 /*Supports ata_piix driver */
+#else
+#undef CFG_SATA_MAXBUS
+#undef CFG_SATA_DEVS_PER_BUS
+#undef CFG_SATA_MAX_DEVICE
+#undef CONFIG_ATA_PIIX
+#endif
+
/************************************************************
* DISK Partition support
@@ -190,7 +203,11 @@
/************************************************************
* Video/Keyboard support
************************************************************/
+#ifndef GRUSS_TESTING
#define CONFIG_VIDEO /* To enable video controller support */
+#else
+#undef CONFIG_VIDEO
+#endif
#define CONFIG_I8042_KBD
#define CFG_ISA_IO 0
@@ -203,6 +220,7 @@
/*
* PCI stuff
*/
+#ifndef GRUSS_TESTING
#define CONFIG_PCI /* include pci support */
#define CONFIG_PCI_PNP /* pci plug-and-play */
#define CONFIG_PCI_SCAN_SHOW
@@ -211,5 +229,11 @@
#define CFG_SECOND_PCI_IRQ 9
#define CFG_THIRD_PCI_IRQ 11
#define CFG_FORTH_PCI_IRQ 15
+#else
+#undef CONFIG_PCI
+#undef CONFIG_PCI_PNP
+#undef CONFIG_PCI_SCAN_SHOW
+#endif
+
#endif /* __CONFIG_H */
diff --git a/include/image.h b/include/image.h
index 9be806e..e095a32 100644
--- a/include/image.h
+++ b/include/image.h
@@ -40,7 +40,7 @@
#include <lmb.h>
#include <linux/string.h>
#include <asm/u-boot.h>
-
+#include <asm/string.h>
#else
/* new uImage format support enabled on host */
diff --git a/lib_i386/bios_setup.c b/lib_i386/bios_setup.c
index 75f04a0..2018425 100644
--- a/lib_i386/bios_setup.c
+++ b/lib_i386/bios_setup.c
@@ -140,8 +140,9 @@ int bios_setup(void)
{
static int done=0;
int vector;
+#ifdef CONFIG_PCI
struct pci_controller *pri_hose;
-
+#endif
if (done) {
return 0;
}
@@ -223,12 +224,13 @@ int bios_setup(void)
* (This, ofcause break on multi hose systems,
* but our PCI BIOS only support one hose anyway)
*/
+#ifdef CONFIG_PCI
pri_hose = pci_bus_to_hose(0);
if (NULL != pri_hose) {
/* fill in last pci bus number for use by the realmode
* PCI BIOS */
RELOC_16_BYTE(0xf000, pci_last_bus) = pri_hose->last_busno;
}
-
+#endif
return 0;
}
diff --git a/lib_i386/board.c b/lib_i386/board.c
index 55fa42a..8103211 100644
--- a/lib_i386/board.c
+++ b/lib_i386/board.c
@@ -213,7 +213,7 @@ init_fnc_t *init_sequence[] = {
NULL,
};
-gd_t *global_data;
+gd_t *gd;
void start_i386boot (void)
{
@@ -226,7 +226,7 @@ void start_i386boot (void)
show_boot_progress(0x21);
- gd = global_data = &gd_data;
+ gd = &gd_data;
/* compiler optimization barrier needed for GCC >= 3.4 */
__asm__ __volatile__("": : :"memory");
@@ -266,7 +266,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;
@@ -412,7 +412,10 @@ void hang (void)
unsigned long do_go_exec (ulong (*entry)(int, char *[]), int argc, char
*argv[])
{
/*
- * Nios function pointers are address >> 1
+ * TODO: Test this function - changed to fix compiler error.
+ * Original code was:
+ * return (entry >> 1) (argc, argv);
+ * with a comment about Nios function pointers are address >> 1
*/
- return (entry >> 1) (argc, argv);
+ return (entry) (argc, argv);
}
diff --git a/lib_i386/bootm.c b/lib_i386/bootm.c
index 522d7ad..613e339 100644
--- a/lib_i386/bootm.c
+++ b/lib_i386/bootm.c
@@ -34,7 +34,7 @@ int do_bootm_linux(int flag, int argc, char *argv[],
bootm_headers_t *images)
void *base_ptr;
ulong os_data, os_len;
image_header_t *hdr;
- int ret;
+
#if defined(CONFIG_FIT)
const void *data;
size_t len;
diff --git a/lib_i386/video_bios.c b/lib_i386/video_bios.c
index 45f78e2..02c2166 100644
--- a/lib_i386/video_bios.c
+++ b/lib_i386/video_bios.c
@@ -136,6 +136,8 @@ static u32 probe_pci_video(void)
#endif
+#ifdef CONFIG_VIDEO
+
static int probe_isa_video(void)
{
u32 ptr;
@@ -217,3 +219,4 @@ int video_bios_init(void)
return 1;
}
+#endif
^ permalink raw reply related [flat|nested] 15+ messages in thread* [U-Boot] [PATCH 1/2] Update i386 code (sc520_cdp)
2008-09-07 0:01 ` Graeme Russ
@ 2008-09-07 0:05 ` Wolfgang Denk
2008-09-08 12:28 ` JerryVanBaren
1 sibling, 0 replies; 15+ messages in thread
From: Wolfgang Denk @ 2008-09-07 0:05 UTC (permalink / raw)
To: u-boot
Dear Graeme Russ,
In message <48C319C1.30402@gmail.com> you wrote:
> Third time lucky maybe - ditched Evolution (can't adjust line wrap width) for Thunderbird. I don't have git-send-email installed - will investigate
This has nothing to do with luck - an this mailing list is not a good
place to try out your mailer.
> +#ifdef CONFIG_PCI
> /* PCI stuff */
> static void pci_sc520_cdp_fixup_irq(struct pci_controller *hose,
> pci_dev_t dev)
^^^^^^^^^^^^^^^^^
Line wrapped again.
> diff --git a/drivers/mtd/mw_eeprom.c b/drivers/mtd/mw_eeprom.c
> index f32ced4..f7791b5 100644
> --- a/drivers/mtd/mw_eeprom.c
> +++ b/drivers/mtd/mw_eeprom.c
> @@ -1,7 +1,7 @@
> /* Three-wire (MicroWire) serial eeprom driver (for 93C46 and
> compatibles) */
^^^^^^^^^^^^^^^^
etc.
Please fix this before you post here again.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
[Doctors and Bartenders], We both get the same two kinds of customers
-- the living and the dying.
-- Dr. Boyce, "The Menagerie" ("The Cage"), stardate unknown
^ permalink raw reply [flat|nested] 15+ messages in thread* [U-Boot] [PATCH 1/2] Update i386 code (sc520_cdp)
2008-09-07 0:01 ` Graeme Russ
2008-09-07 0:05 ` Wolfgang Denk
@ 2008-09-08 12:28 ` JerryVanBaren
1 sibling, 0 replies; 15+ messages in thread
From: JerryVanBaren @ 2008-09-08 12:28 UTC (permalink / raw)
To: u-boot
Graeme Russ wrote:
> Third time lucky maybe - ditched Evolution (can't adjust line wrap
> width) for Thunderbird. I don't have git-send-email installed - will
> investigate
Read the kernel Documentation/email-clients.txt:
<http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/email-clients.txt;h=2ebb94d6ed8e547d5cb84cdc6feeba126388baf3;hb=HEAD>
Evolution and Tbird reportedly can work if you jump the right hoops.
Maybe. It's the clicky-gooey curse.[1]
See also my previous diatribe about letting our tools rule us.
<http://lists.denx.de/pipermail/u-boot/2008-September/040195.html>
Curmudgeonly yours,
gvb
[1] The Hitchhiker's Guide to the Galaxy, in a moment of reasoned
lucidity which is almost unique among its current tally of five million,
nine hundred and seventy-three thousand, five hundred and nine pages,
says of the Sirius Cybernetics Corporation products that "it is very
easy to be blinded to the essential uselessness of them by the sense of
achievement you get from getting them to work at all." In other words, -
and this is the rock-solid principle on which the whole of the
Corporation's Galaxywide success is founded - their fundamental design
flaws are completely hidden by their superficial design flaws.
- The Hitchhiker's Guide to the Galaxy / Douglas Adams (1952 - 2001).
1st American ed. New York : Harmony Books, 1980, c1979
^ permalink raw reply [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH 1/2] Update i386 code (sc520_cdp)
@ 2008-09-07 0:06 Graeme Russ
0 siblings, 0 replies; 15+ messages in thread
From: Graeme Russ @ 2008-09-07 0:06 UTC (permalink / raw)
To: u-boot
OK, last try then I'm completely giving up :(
Attempt to bring i386 / sc520 inline with master
Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
diff --git a/board/sc520_cdp/sc520_cdp.c b/board/sc520_cdp/sc520_cdp.c
index f21c730..bfb473e 100644
--- a/board/sc520_cdp/sc520_cdp.c
+++ b/board/sc520_cdp/sc520_cdp.c
@@ -114,7 +114,7 @@ static void irq_init(void)
}
-
+#ifdef CONFIG_PCI
/* PCI stuff */
static void pci_sc520_cdp_fixup_irq(struct pci_controller *hose,
pci_dev_t dev)
{
@@ -129,7 +129,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;
+ uchar tmp_pin;
int pin;
pci_hose_read_config_byte(hose, dev, PCI_INTERRUPT_PIN, &tmp_pin);
@@ -193,7 +193,7 @@ void pci_init_board(void)
{
pci_sc520_init(&sc520_cdp_hose);
}
-
+#endif
static void silence_uart(int port)
{
@@ -563,12 +563,12 @@ 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;
}
-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;
}
diff --git a/drivers/mtd/mw_eeprom.c b/drivers/mtd/mw_eeprom.c
index f32ced4..f7791b5 100644
--- a/drivers/mtd/mw_eeprom.c
+++ b/drivers/mtd/mw_eeprom.c
@@ -1,7 +1,7 @@
/* Three-wire (MicroWire) serial eeprom driver (for 93C46 and
compatibles) */
#include <common.h>
-#include <ssi.h>
+#include <asm/ic/ssi.h>
/*
* Serial EEPROM opcodes, including start bit
diff --git a/examples/82559_eeprom.c b/examples/82559_eeprom.c
index 1a121d4..d99af26 100644
--- a/examples/82559_eeprom.c
+++ b/examples/82559_eeprom.c
@@ -51,13 +51,17 @@ static inline unsigned short swap16(unsigned short x)
}
-static inline void *memcpy(void *dst, const void *src, unsigned int len)
+void * memcpy(void * dest,const void *src,size_t count)
{
- void * ret = dst;
- while (len-- > 0) *((char *)dst)++ = *((char *)src)++;
- return ret;
+ char *tmp = (char *) dest, *s = (char *) src;
+
+ while (count--)
+ *tmp++ = *s++;
+
+ return dest;
}
+
/* The EEPROM commands include the alway-set leading bit. */
#define EE_WRITE_CMD (5)
#define EE_READ_CMD (6)
@@ -156,7 +160,7 @@ static int reset_eeprom(unsigned long ioaddr,
unsigned char *hwaddr)
int size_test;
int i;
- printf("Resetting i82559 EEPROM @ 0x%08x ... ", ioaddr);
+ printf("Resetting i82559 EEPROM @ 0x%08lx ... ", ioaddr);
size_test = do_eeprom_cmd(ioaddr, (EE_READ_CMD << 8) << 16, 27);
eeprom_addr_size = (size_test & 0xffe0000) == 0xffe0000 ? 8 : 6;
@@ -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];
+ uchar buf[6];
int instance;
app_startup(argv);
diff --git a/include/asm-i386/byteorder.h b/include/asm-i386/byteorder.h
index a9c69d5..7dfeb8b 100644
--- a/include/asm-i386/byteorder.h
+++ b/include/asm-i386/byteorder.h
@@ -6,7 +6,7 @@
#ifdef __GNUC__
-static __inline__ __const__ __u32 ___arch__swab32(__u32 x)
+static __inline__ __u32 ___arch__swab32(__u32 x)
{
#ifdef CONFIG_X86_BSWAP
__asm__("bswap %0" : "=r" (x) : "0" (x));
@@ -20,7 +20,7 @@ static __inline__ __const__ __u32 ___arch__swab32(__u32 x)
return x;
}
-static __inline__ __const__ __u16 ___arch__swab16(__u16 x)
+static __inline__ __u16 ___arch__swab16(__u16 x)
{
__asm__("xchgb %b0,%h0" /* swap bytes */ \
: "=q" (x) \
diff --git a/include/asm-i386/global_data.h b/include/asm-i386/global_data.h
index 5dfb595..f31bac6 100644
--- a/include/asm-i386/global_data.h
+++ b/include/asm-i386/global_data.h
@@ -58,8 +58,8 @@ typedef struct {
#define GD_FLG_POSTSTOP 0x00010 /* POST seqeunce aborted
*/
#define GD_FLG_LOGINIT 0x00020 /* Log Buffer has been
initialized */
-extern gd_t *global_data;
+extern gd_t *gd;
-#define DECLARE_GLOBAL_DATA_PTR gd_t *gd = global_data
+#define DECLARE_GLOBAL_DATA_PTR
#endif /* __ASM_GBL_DATA_H */
diff --git a/include/asm-i386/ic/ssi.h b/include/asm-i386/ic/ssi.h
new file mode 100644
index 0000000..bd48eab
--- /dev/null
+++ b/include/asm-i386/ic/ssi.h
@@ -0,0 +1,34 @@
+/*
+ * (C) Copyright 2008
+ * Graeme Russ <graeme.russ@gmail.com>.
+ *
+ * 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 _ASM_IC_SSI_H_
+#define _ASM_IC_SSI_H_ 1
+
+int ssi_set_interface(int, int, int, int);
+void ssi_chip_select(int);
+u8 ssi_txrx_byte(u8);
+void ssi_tx_byte(u8);
+u8 ssi_rx_byte(void);
+
+
+#endif
diff --git a/include/asm-i386/pci.h b/include/asm-i386/pci.h
index bde9550..85f60d7 100644
--- a/include/asm-i386/pci.h
+++ b/include/asm-i386/pci.h
@@ -31,5 +31,4 @@ int pci_enable_legacy_video_ports(struct
pci_controller* hose);
int pci_shadow_rom(pci_dev_t dev, unsigned char *dest);
void pci_remove_rom_window(struct pci_controller* hose, u32 addr);
u32 pci_get_rom_window(struct pci_controller* hose, int size);
-
#endif
diff --git a/include/asm-i386/string.h b/include/asm-i386/string.h
index 91a23f9..3643a79 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,
__kernel_size_t __n);
#undef __HAVE_ARCH_STRRCHR
extern char * strrchr(const char * s, int c);
diff --git a/include/configs/sc520_cdp.h b/include/configs/sc520_cdp.h
index e29655e..6a73c90 100644
--- a/include/configs/sc520_cdp.h
+++ b/include/configs/sc520_cdp.h
@@ -28,6 +28,7 @@
#ifndef __CONFIG_H
#define __CONFIG_H
+#define GRUSS_TESTING
/*
* High Level Configuration Options
* (easy to change)
@@ -81,7 +82,11 @@
#include <config_cmd_default.h>
#define CONFIG_CMD_PCI
+#ifndef GRUSS_TESTING
#define CONFIG_CMD_SATA
+#else
+#undef CONFIG_CMD_SATA
+#endif
#define CONFIG_CMD_JFFS2
#define CONFIG_CMD_NET
#define CONFIG_CMD_EEPROM
@@ -175,10 +180,18 @@
/************************************************************
*SATA/Native Stuff
************************************************************/
+#ifndef GRUSS_TESTING
#define CFG_SATA_MAXBUS 2 /*Max Sata buses supported */
#define CFG_SATA_DEVS_PER_BUS 2 /*Max no. of devices per bus/port */
#define CFG_SATA_MAX_DEVICE (CFG_SATA_MAXBUS* CFG_SATA_DEVS_PER_BUS)
#define CONFIG_ATA_PIIX 1 /*Supports ata_piix driver */
+#else
+#undef CFG_SATA_MAXBUS
+#undef CFG_SATA_DEVS_PER_BUS
+#undef CFG_SATA_MAX_DEVICE
+#undef CONFIG_ATA_PIIX
+#endif
+
/************************************************************
* DISK Partition support
@@ -190,7 +203,11 @@
/************************************************************
* Video/Keyboard support
************************************************************/
+#ifndef GRUSS_TESTING
#define CONFIG_VIDEO /* To enable video controller support */
+#else
+#undef CONFIG_VIDEO
+#endif
#define CONFIG_I8042_KBD
#define CFG_ISA_IO 0
@@ -203,6 +220,7 @@
/*
* PCI stuff
*/
+#ifndef GRUSS_TESTING
#define CONFIG_PCI /* include pci support */
#define CONFIG_PCI_PNP /* pci plug-and-play */
#define CONFIG_PCI_SCAN_SHOW
@@ -211,5 +229,11 @@
#define CFG_SECOND_PCI_IRQ 9
#define CFG_THIRD_PCI_IRQ 11
#define CFG_FORTH_PCI_IRQ 15
+#else
+#undef CONFIG_PCI
+#undef CONFIG_PCI_PNP
+#undef CONFIG_PCI_SCAN_SHOW
+#endif
+
#endif /* __CONFIG_H */
diff --git a/include/image.h b/include/image.h
index 9be806e..e095a32 100644
--- a/include/image.h
+++ b/include/image.h
@@ -40,7 +40,7 @@
#include <lmb.h>
#include <linux/string.h>
#include <asm/u-boot.h>
-
+#include <asm/string.h>
#else
/* new uImage format support enabled on host */
diff --git a/lib_i386/bios_setup.c b/lib_i386/bios_setup.c
index 75f04a0..2018425 100644
--- a/lib_i386/bios_setup.c
+++ b/lib_i386/bios_setup.c
@@ -140,8 +140,9 @@ int bios_setup(void)
{
static int done=0;
int vector;
+#ifdef CONFIG_PCI
struct pci_controller *pri_hose;
-
+#endif
if (done) {
return 0;
}
@@ -223,12 +224,13 @@ int bios_setup(void)
* (This, ofcause break on multi hose systems,
* but our PCI BIOS only support one hose anyway)
*/
+#ifdef CONFIG_PCI
pri_hose = pci_bus_to_hose(0);
if (NULL != pri_hose) {
/* fill in last pci bus number for use by the realmode
* PCI BIOS */
RELOC_16_BYTE(0xf000, pci_last_bus) = pri_hose->last_busno;
}
-
+#endif
return 0;
}
diff --git a/lib_i386/board.c b/lib_i386/board.c
index 55fa42a..8103211 100644
--- a/lib_i386/board.c
+++ b/lib_i386/board.c
@@ -213,7 +213,7 @@ init_fnc_t *init_sequence[] = {
NULL,
};
-gd_t *global_data;
+gd_t *gd;
void start_i386boot (void)
{
@@ -226,7 +226,7 @@ void start_i386boot (void)
show_boot_progress(0x21);
- gd = global_data = &gd_data;
+ gd = &gd_data;
/* compiler optimization barrier needed for GCC >= 3.4 */
__asm__ __volatile__("": : :"memory");
@@ -266,7 +266,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;
@@ -412,7 +412,10 @@ void hang (void)
unsigned long do_go_exec (ulong (*entry)(int, char *[]), int argc, char
*argv[])
{
/*
- * Nios function pointers are address >> 1
+ * TODO: Test this function - changed to fix compiler error.
+ * Original code was:
+ * return (entry >> 1) (argc, argv);
+ * with a comment about Nios function pointers are address >> 1
*/
- return (entry >> 1) (argc, argv);
+ return (entry) (argc, argv);
}
diff --git a/lib_i386/bootm.c b/lib_i386/bootm.c
index 522d7ad..613e339 100644
--- a/lib_i386/bootm.c
+++ b/lib_i386/bootm.c
@@ -34,7 +34,7 @@ int do_bootm_linux(int flag, int argc, char *argv[],
bootm_headers_t *images)
void *base_ptr;
ulong os_data, os_len;
image_header_t *hdr;
- int ret;
+
#if defined(CONFIG_FIT)
const void *data;
size_t len;
diff --git a/lib_i386/video_bios.c b/lib_i386/video_bios.c
index 45f78e2..02c2166 100644
--- a/lib_i386/video_bios.c
+++ b/lib_i386/video_bios.c
@@ -136,6 +136,8 @@ static u32 probe_pci_video(void)
#endif
+#ifdef CONFIG_VIDEO
+
static int probe_isa_video(void)
{
u32 ptr;
@@ -217,3 +219,4 @@ int video_bios_init(void)
return 1;
}
+#endif
^ permalink raw reply related [flat|nested] 15+ messages in thread* [U-Boot] [PATCH 1/2] Update i386 code (sc520_cdp)
@ 2008-09-06 13:34 Graeme Russ
2008-09-06 15:42 ` Wolfgang Denk
0 siblings, 1 reply; 15+ messages in thread
From: Graeme Russ @ 2008-09-06 13:34 UTC (permalink / raw)
To: u-boot
Attempt to bring i386 / sc520 inline with master
NOTE: Previous patches have been rejected by the mailing list due to
non-ASCII characters in the copyright headers. I have deleted the
offending characters - I hope patch does not complain
Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
diff --git a/board/sc520_cdp/sc520_cdp.c b/board/sc520_cdp/sc520_cdp.c
index f21c730..20284e4 100644
--- a/board/sc520_cdp/sc520_cdp.c
+++ b/board/sc520_cdp/sc520_cdp.c
@@ -1,7 +1,7 @@
/*
*
* (C) Copyright 2002
- * Daniel Engstrm, Omicron Ceti AB <daniel@omicron.se>.
+ * Daniel Engstrm, Omicron Ceti AB <daniel@omicron.se>.
*
* See file CREDITS for list of people who contributed to this
* project.
@@ -114,7 +114,7 @@ static void irq_init(void)
}
-
+#ifdef CONFIG_PCI
/* PCI stuff */
static void pci_sc520_cdp_fixup_irq(struct pci_controller *hose, pci_dev_t dev)
{
@@ -129,7 +129,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;
+ uchar tmp_pin;
int pin;
pci_hose_read_config_byte(hose, dev, PCI_INTERRUPT_PIN, &tmp_pin);
@@ -193,7 +193,7 @@ void pci_init_board(void)
{
pci_sc520_init(&sc520_cdp_hose);
}
-
+#endif
static void silence_uart(int port)
{
@@ -563,12 +563,12 @@ 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;
}
-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;
}
diff --git a/drivers/mtd/mw_eeprom.c b/drivers/mtd/mw_eeprom.c
index f32ced4..f7791b5 100644
--- a/drivers/mtd/mw_eeprom.c
+++ b/drivers/mtd/mw_eeprom.c
@@ -1,7 +1,7 @@
/* Three-wire (MicroWire) serial eeprom driver (for 93C46 and compatibles) */
#include <common.h>
-#include <ssi.h>
+#include <asm/ic/ssi.h>
/*
* Serial EEPROM opcodes, including start bit
diff --git a/examples/82559_eeprom.c b/examples/82559_eeprom.c
index 1a121d4..d99af26 100644
--- a/examples/82559_eeprom.c
+++ b/examples/82559_eeprom.c
@@ -51,13 +51,17 @@ static inline unsigned short swap16(unsigned short x)
}
-static inline void *memcpy(void *dst, const void *src, unsigned int len)
+void * memcpy(void * dest,const void *src,size_t count)
{
- void * ret = dst;
- while (len-- > 0) *((char *)dst)++ = *((char *)src)++;
- return ret;
+ char *tmp = (char *) dest, *s = (char *) src;
+
+ while (count--)
+ *tmp++ = *s++;
+
+ return dest;
}
+
/* The EEPROM commands include the alway-set leading bit. */
#define EE_WRITE_CMD (5)
#define EE_READ_CMD (6)
@@ -156,7 +160,7 @@ static int reset_eeprom(unsigned long ioaddr,
unsigned char *hwaddr)
int size_test;
int i;
- printf("Resetting i82559 EEPROM @ 0x%08x ... ", ioaddr);
+ printf("Resetting i82559 EEPROM @ 0x%08lx ... ", ioaddr);
size_test = do_eeprom_cmd(ioaddr, (EE_READ_CMD << 8) << 16, 27);
eeprom_addr_size = (size_test & 0xffe0000) == 0xffe0000 ? 8 : 6;
@@ -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];
+ uchar buf[6];
int instance;
app_startup(argv);
diff --git a/include/asm-i386/byteorder.h b/include/asm-i386/byteorder.h
index a9c69d5..7dfeb8b 100644
--- a/include/asm-i386/byteorder.h
+++ b/include/asm-i386/byteorder.h
@@ -6,7 +6,7 @@
#ifdef __GNUC__
-static __inline__ __const__ __u32 ___arch__swab32(__u32 x)
+static __inline__ __u32 ___arch__swab32(__u32 x)
{
#ifdef CONFIG_X86_BSWAP
__asm__("bswap %0" : "=r" (x) : "0" (x));
@@ -20,7 +20,7 @@ static __inline__ __const__ __u32 ___arch__swab32(__u32 x)
return x;
}
-static __inline__ __const__ __u16 ___arch__swab16(__u16 x)
+static __inline__ __u16 ___arch__swab16(__u16 x)
{
__asm__("xchgb %b0,%h0" /* swap bytes */ \
: "=q" (x) \
diff --git a/include/asm-i386/global_data.h b/include/asm-i386/global_data.h
index 5dfb595..f31bac6 100644
--- a/include/asm-i386/global_data.h
+++ b/include/asm-i386/global_data.h
@@ -58,8 +58,8 @@ typedef struct {
#define GD_FLG_POSTSTOP 0x00010 /* POST seqeunce aborted */
#define GD_FLG_LOGINIT 0x00020 /* Log Buffer has been initialized */
-extern gd_t *global_data;
+extern gd_t *gd;
-#define DECLARE_GLOBAL_DATA_PTR gd_t *gd = global_data
+#define DECLARE_GLOBAL_DATA_PTR
#endif /* __ASM_GBL_DATA_H */
diff --git a/include/asm-i386/ic/ssi.h b/include/asm-i386/ic/ssi.h
new file mode 100644
index 0000000..bd48eab
--- /dev/null
+++ b/include/asm-i386/ic/ssi.h
@@ -0,0 +1,34 @@
+/*
+ * (C) Copyright 2008
+ * Graeme Russ <graeme.russ@gmail.com>.
+ *
+ * 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 _ASM_IC_SSI_H_
+#define _ASM_IC_SSI_H_ 1
+
+int ssi_set_interface(int, int, int, int);
+void ssi_chip_select(int);
+u8 ssi_txrx_byte(u8);
+void ssi_tx_byte(u8);
+u8 ssi_rx_byte(void);
+
+
+#endif
diff --git a/include/asm-i386/pci.h b/include/asm-i386/pci.h
index bde9550..5a9da98 100644
--- a/include/asm-i386/pci.h
+++ b/include/asm-i386/pci.h
@@ -2,7 +2,7 @@
/*
* (C) Copyright 2002
- * Daniel Engstrm, Omicron Ceti AB, daniel at omicron.se
+ * Daniel Engstrm, Omicron Ceti AB, daniel at omicron.se
*
* See file CREDITS for list of people who contributed to this
* project.
@@ -31,5 +31,4 @@ int pci_enable_legacy_video_ports(struct
pci_controller* hose);
int pci_shadow_rom(pci_dev_t dev, unsigned char *dest);
void pci_remove_rom_window(struct pci_controller* hose, u32 addr);
u32 pci_get_rom_window(struct pci_controller* hose, int size);
-
#endif
diff --git a/include/asm-i386/string.h b/include/asm-i386/string.h
index 91a23f9..3643a79 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, __kernel_size_t __n);
#undef __HAVE_ARCH_STRRCHR
extern char * strrchr(const char * s, int c);
diff --git a/include/configs/sc520_cdp.h b/include/configs/sc520_cdp.h
index e29655e..fe99fec 100644
--- a/include/configs/sc520_cdp.h
+++ b/include/configs/sc520_cdp.h
@@ -1,6 +1,6 @@
/*
* (C) Copyright 2002
- * Daniel Engstrm, Omicron Ceti AB, daniel at omicron.se.
+ * Daniel Engstrm, Omicron Ceti AB, daniel at omicron.se.
*
* See file CREDITS for list of people who contributed to this
* project.
@@ -28,6 +28,7 @@
#ifndef __CONFIG_H
#define __CONFIG_H
+#define GRUSS_TESTING
/*
* High Level Configuration Options
* (easy to change)
@@ -81,7 +82,11 @@
#include <config_cmd_default.h>
#define CONFIG_CMD_PCI
+#ifndef GRUSS_TESTING
#define CONFIG_CMD_SATA
+#else
+#undef CONFIG_CMD_SATA
+#endif
#define CONFIG_CMD_JFFS2
#define CONFIG_CMD_NET
#define CONFIG_CMD_EEPROM
@@ -175,10 +180,18 @@
/************************************************************
*SATA/Native Stuff
************************************************************/
+#ifndef GRUSS_TESTING
#define CFG_SATA_MAXBUS 2 /*Max Sata buses supported */
#define CFG_SATA_DEVS_PER_BUS 2 /*Max no. of devices per bus/port */
#define CFG_SATA_MAX_DEVICE (CFG_SATA_MAXBUS* CFG_SATA_DEVS_PER_BUS)
#define CONFIG_ATA_PIIX 1 /*Supports ata_piix driver */
+#else
+#undef CFG_SATA_MAXBUS
+#undef CFG_SATA_DEVS_PER_BUS
+#undef CFG_SATA_MAX_DEVICE
+#undef CONFIG_ATA_PIIX
+#endif
+
/************************************************************
* DISK Partition support
@@ -190,7 +203,11 @@
/************************************************************
* Video/Keyboard support
************************************************************/
+#ifndef GRUSS_TESTING
#define CONFIG_VIDEO /* To enable video controller support */
+#else
+#undef CONFIG_VIDEO
+#endif
#define CONFIG_I8042_KBD
#define CFG_ISA_IO 0
@@ -203,6 +220,7 @@
/*
* PCI stuff
*/
+#ifndef GRUSS_TESTING
#define CONFIG_PCI /* include pci support */
#define CONFIG_PCI_PNP /* pci plug-and-play */
#define CONFIG_PCI_SCAN_SHOW
@@ -211,5 +229,11 @@
#define CFG_SECOND_PCI_IRQ 9
#define CFG_THIRD_PCI_IRQ 11
#define CFG_FORTH_PCI_IRQ 15
+#else
+#undef CONFIG_PCI
+#undef CONFIG_PCI_PNP
+#undef CONFIG_PCI_SCAN_SHOW
+#endif
+
#endif /* __CONFIG_H */
diff --git a/include/image.h b/include/image.h
index 9be806e..e095a32 100644
--- a/include/image.h
+++ b/include/image.h
@@ -40,7 +40,7 @@
#include <lmb.h>
#include <linux/string.h>
#include <asm/u-boot.h>
-
+#include <asm/string.h>
#else
/* new uImage format support enabled on host */
diff --git a/lib_i386/bios_setup.c b/lib_i386/bios_setup.c
index 75f04a0..f7fd8bf 100644
--- a/lib_i386/bios_setup.c
+++ b/lib_i386/bios_setup.c
@@ -1,6 +1,6 @@
/*
* (C) Copyright 2002
- * Daniel Engstrm, Omicron Ceti AB, daniel at omicron.se
+ * Daniel Engstrm, Omicron Ceti AB, daniel at omicron.se
*
* See file CREDITS for list of people who contributed to this
* project.
@@ -140,8 +140,9 @@ int bios_setup(void)
{
static int done=0;
int vector;
+#ifdef CONFIG_PCI
struct pci_controller *pri_hose;
-
+#endif
if (done) {
return 0;
}
@@ -223,12 +224,13 @@ int bios_setup(void)
* (This, ofcause break on multi hose systems,
* but our PCI BIOS only support one hose anyway)
*/
+#ifdef CONFIG_PCI
pri_hose = pci_bus_to_hose(0);
if (NULL != pri_hose) {
/* fill in last pci bus number for use by the realmode
* PCI BIOS */
RELOC_16_BYTE(0xf000, pci_last_bus) = pri_hose->last_busno;
}
-
+#endif
return 0;
}
diff --git a/lib_i386/board.c b/lib_i386/board.c
index 55fa42a..8b4e4f5 100644
--- a/lib_i386/board.c
+++ b/lib_i386/board.c
@@ -1,6 +1,6 @@
/*
* (C) Copyright 2002
- * Daniel Engstrm, Omicron Ceti AB, daniel at omicron.se
+ * Daniel Engstrm, Omicron Ceti AB, daniel at omicron.se
*
* (C) Copyright 2002
* Wolfgang Denk, DENX Software Engineering, wd at denx.de.
@@ -213,7 +213,7 @@ init_fnc_t *init_sequence[] = {
NULL,
};
-gd_t *global_data;
+gd_t *gd;
void start_i386boot (void)
{
@@ -226,7 +226,7 @@ void start_i386boot (void)
show_boot_progress(0x21);
- gd = global_data = &gd_data;
+ gd = &gd_data;
/* compiler optimization barrier needed for GCC >= 3.4 */
__asm__ __volatile__("": : :"memory");
@@ -266,7 +266,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;
@@ -412,7 +412,10 @@ void hang (void)
unsigned long do_go_exec (ulong (*entry)(int, char *[]), int argc, char *argv[])
{
/*
- * Nios function pointers are address >> 1
+ * TODO: Test this function - changed to fix compiler error.
+ * Original code was:
+ * return (entry) (argc, argv);
+ * with a comment about Nios function pointers are address >> 1
*/
- return (entry >> 1) (argc, argv);
+ return (entry) (argc, argv);
}
diff --git a/lib_i386/bootm.c b/lib_i386/bootm.c
index 522d7ad..613e339 100644
--- a/lib_i386/bootm.c
+++ b/lib_i386/bootm.c
@@ -34,7 +34,7 @@ int do_bootm_linux(int flag, int argc, char *argv[],
bootm_headers_t *images)
void *base_ptr;
ulong os_data, os_len;
image_header_t *hdr;
- int ret;
+
#if defined(CONFIG_FIT)
const void *data;
size_t len;
diff --git a/lib_i386/video_bios.c b/lib_i386/video_bios.c
index 45f78e2..ce9dc0b 100644
--- a/lib_i386/video_bios.c
+++ b/lib_i386/video_bios.c
@@ -1,6 +1,6 @@
/*
* (C) Copyright 2002
- * Daniel Engstrm, Omicron Ceti AB, daniel at omicron.se
+ * Daniel Engstrm, Omicron Ceti AB, daniel at omicron.se
*
* See file CREDITS for list of people who contributed to this
* project.
@@ -136,6 +136,8 @@ static u32 probe_pci_video(void)
#endif
+#ifdef CONFIG_VIDEO
+
static int probe_isa_video(void)
{
u32 ptr;
@@ -217,3 +219,4 @@ int video_bios_init(void)
return 1;
}
+#endif
^ permalink raw reply related [flat|nested] 15+ messages in thread* [U-Boot] [PATCH 1/2] Update i386 code (sc520_cdp)
2008-09-06 13:34 Graeme Russ
@ 2008-09-06 15:42 ` Wolfgang Denk
2008-09-06 21:08 ` Graeme Russ
0 siblings, 1 reply; 15+ messages in thread
From: Wolfgang Denk @ 2008-09-06 15:42 UTC (permalink / raw)
To: u-boot
Dear "Graeme Russ",
In message <d66caabb0809060634w22062fd5gc171c76ed59c889c@mail.gmail.com> you wrote:
> Attempt to bring i386 / sc520 inline with master
>
> NOTE: Previous patches have been rejected by the mailing list due to
> non-ASCII characters in the copyright headers. I have deleted the
> offending characters - I hope patch does not complain
You patch will not apply if you just try and omit such characters.
Also, your patch is severely corrupted. It seems you copy & pasted it
and lost a lot of the original white spaces then.
> Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
>
> diff --git a/board/sc520_cdp/sc520_cdp.c b/board/sc520_cdp/sc520_cdp.c
> index f21c730..20284e4 100644
> --- a/board/sc520_cdp/sc520_cdp.c
> +++ b/board/sc520_cdp/sc520_cdp.c
> @@ -1,7 +1,7 @@
> /*
> *
> * (C) Copyright 2002
> - * Daniel Engstrm, Omicron Ceti AB <daniel@omicron.se>.
> + * Daniel Engstrm, Omicron Ceti AB <daniel@omicron.se>.
Does not apply. The original line is
* Daniel Engstr?m, Omicron Ceti AB <daniel@omicron.se>.
Note there is a character (o-umlaut) between the 'r' and the 'm' in
Engstr?m.
> * Serial EEPROM opcodes, including start bit
> diff --git a/examples/82559_eeprom.c b/examples/82559_eeprom.c
> index 1a121d4..d99af26 100644
> --- a/examples/82559_eeprom.c
> +++ b/examples/82559_eeprom.c
> @@ -51,13 +51,17 @@ static inline unsigned short swap16(unsigned short x)
> }
>
>
> -static inline void *memcpy(void *dst, const void *src, unsigned int len)
> +void * memcpy(void * dest,const void *src,size_t count)
> {
> - void * ret = dst;
> - while (len-- > 0) *((char *)dst)++ = *((char *)src)++;
> - return ret;
> + char *tmp = (char *) dest, *s = (char *) src;
> +
> + while (count--)
> + *tmp++ = *s++;
> +
> + return dest;
> }
Indentation incorrect.
> /* The EEPROM commands include the alway-set leading bit. */
> #define EE_WRITE_CMD (5)
> #define EE_READ_CMD (6)
> @@ -156,7 +160,7 @@ static int reset_eeprom(unsigned long ioaddr,
> unsigned char *hwaddr)
> int size_test;
> int i;
>
> - printf("Resetting i82559 EEPROM @ 0x%08x ... ", ioaddr);
> + printf("Resetting i82559 EEPROM @ 0x%08lx ... ", ioaddr);
Indentation incorrect.
> size_test = do_eeprom_cmd(ioaddr, (EE_READ_CMD << 8) << 16, 27);
> eeprom_addr_size = (size_test & 0xffe0000) == 0xffe0000 ? 8 : 6;
> @@ -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];
> + uchar buf[6];
> int instance;
Indentation incorrect.
> app_startup(argv);
> diff --git a/include/asm-i386/byteorder.h b/include/asm-i386/byteorder.h
> index a9c69d5..7dfeb8b 100644
> --- a/include/asm-i386/byteorder.h
> +++ b/include/asm-i386/byteorder.h
> @@ -6,7 +6,7 @@
> #ifdef __GNUC__
>
>
> -static __inline__ __const__ __u32 ___arch__swab32(__u32 x)
> +static __inline__ __u32 ___arch__swab32(__u32 x)
> {
> #ifdef CONFIG_X86_BSWAP
> __asm__("bswap %0" : "=r" (x) : "0" (x));
> @@ -20,7 +20,7 @@ static __inline__ __const__ __u32 ___arch__swab32(__u32 x)
> return x;
> }
>
> -static __inline__ __const__ __u16 ___arch__swab16(__u16 x)
> +static __inline__ __u16 ___arch__swab16(__u16 x)
> {
> __asm__("xchgb %b0,%h0" /* swap bytes */ \
> : "=q" (x) \
Ditto.
and so on an on.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I must follow the people. Am I not their leader? - Benjamin Disraeli
^ permalink raw reply [flat|nested] 15+ messages in thread* [U-Boot] [PATCH 1/2] Update i386 code (sc520_cdp)
2008-09-06 15:42 ` Wolfgang Denk
@ 2008-09-06 21:08 ` Graeme Russ
2008-09-09 9:49 ` Wolfgang Denk
0 siblings, 1 reply; 15+ messages in thread
From: Graeme Russ @ 2008-09-06 21:08 UTC (permalink / raw)
To: u-boot
Attempt to bring i386 / sc520 inline with master
Lesson learnt - do not cut and paste into gmail
Eclipse seems to have an issue with the o-umlaut. I've had a search
through the editor preferences but cannot find a way to stop Eclipse
from mangling it. I have completely removed the copyright lines from the
patch as they are, in reality, completely unmodified. I have applied
this patch to a clean pull of master followed by a make sc520_cdp_config
and make all with no patch or compile errors reported.
Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
diff --git a/board/sc520_cdp/sc520_cdp.c b/board/sc520_cdp/sc520_cdp.c
index f21c730..bfb473e 100644
--- a/board/sc520_cdp/sc520_cdp.c
+++ b/board/sc520_cdp/sc520_cdp.c
@@ -114,7 +114,7 @@ static void irq_init(void)
}
-
+#ifdef CONFIG_PCI
/* PCI stuff */
static void pci_sc520_cdp_fixup_irq(struct pci_controller *hose,
pci_dev_t dev)
{
@@ -129,7 +129,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;
+ uchar tmp_pin;
int pin;
pci_hose_read_config_byte(hose, dev, PCI_INTERRUPT_PIN, &tmp_pin);
@@ -193,7 +193,7 @@ void pci_init_board(void)
{
pci_sc520_init(&sc520_cdp_hose);
}
-
+#endif
static void silence_uart(int port)
{
@@ -563,12 +563,12 @@ 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;
}
-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;
}
diff --git a/drivers/mtd/mw_eeprom.c b/drivers/mtd/mw_eeprom.c
index f32ced4..f7791b5 100644
--- a/drivers/mtd/mw_eeprom.c
+++ b/drivers/mtd/mw_eeprom.c
@@ -1,7 +1,7 @@
/* Three-wire (MicroWire) serial eeprom driver (for 93C46 and
compatibles) */
#include <common.h>
-#include <ssi.h>
+#include <asm/ic/ssi.h>
/*
* Serial EEPROM opcodes, including start bit
diff --git a/examples/82559_eeprom.c b/examples/82559_eeprom.c
index 1a121d4..d99af26 100644
--- a/examples/82559_eeprom.c
+++ b/examples/82559_eeprom.c
@@ -51,13 +51,17 @@ static inline unsigned short swap16(unsigned short
x)
}
-static inline void *memcpy(void *dst, const void *src, unsigned int
len)
+void * memcpy(void * dest,const void *src,size_t count)
{
- void * ret = dst;
- while (len-- > 0) *((char *)dst)++ = *((char *)src)++;
- return ret;
+ char *tmp = (char *) dest, *s = (char *) src;
+
+ while (count--)
+ *tmp++ = *s++;
+
+ return dest;
}
+
/* The EEPROM commands include the alway-set leading bit. */
#define EE_WRITE_CMD (5)
#define EE_READ_CMD (6)
@@ -156,7 +160,7 @@ static int reset_eeprom(unsigned long ioaddr,
unsigned char *hwaddr)
int size_test;
int i;
- printf("Resetting i82559 EEPROM @ 0x%08x ... ", ioaddr);
+ printf("Resetting i82559 EEPROM @ 0x%08lx ... ", ioaddr);
size_test = do_eeprom_cmd(ioaddr, (EE_READ_CMD << 8) << 16, 27);
eeprom_addr_size = (size_test & 0xffe0000) == 0xffe0000 ? 8 : 6;
@@ -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];
+ uchar buf[6];
int instance;
app_startup(argv);
diff --git a/include/asm-i386/byteorder.h b/include/asm-i386/byteorder.h
index a9c69d5..7dfeb8b 100644
--- a/include/asm-i386/byteorder.h
+++ b/include/asm-i386/byteorder.h
@@ -6,7 +6,7 @@
#ifdef __GNUC__
-static __inline__ __const__ __u32 ___arch__swab32(__u32 x)
+static __inline__ __u32 ___arch__swab32(__u32 x)
{
#ifdef CONFIG_X86_BSWAP
__asm__("bswap %0" : "=r" (x) : "0" (x));
@@ -20,7 +20,7 @@ static __inline__ __const__ __u32
___arch__swab32(__u32 x)
return x;
}
-static __inline__ __const__ __u16 ___arch__swab16(__u16 x)
+static __inline__ __u16 ___arch__swab16(__u16 x)
{
__asm__("xchgb %b0,%h0" /* swap bytes */ \
: "=q" (x) \
diff --git a/include/asm-i386/global_data.h
b/include/asm-i386/global_data.h
index 5dfb595..f31bac6 100644
--- a/include/asm-i386/global_data.h
+++ b/include/asm-i386/global_data.h
@@ -58,8 +58,8 @@ typedef struct {
#define GD_FLG_POSTSTOP 0x00010 /* POST seqeunce aborted */
#define GD_FLG_LOGINIT 0x00020 /* Log Buffer has been initialized */
-extern gd_t *global_data;
+extern gd_t *gd;
-#define DECLARE_GLOBAL_DATA_PTR gd_t *gd = global_data
+#define DECLARE_GLOBAL_DATA_PTR
#endif /* __ASM_GBL_DATA_H */
diff --git a/include/asm-i386/ic/ssi.h b/include/asm-i386/ic/ssi.h
new file mode 100644
index 0000000..bd48eab
--- /dev/null
+++ b/include/asm-i386/ic/ssi.h
@@ -0,0 +1,34 @@
+/*
+ * (C) Copyright 2008
+ * Graeme Russ <graeme.russ@gmail.com>.
+ *
+ * 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 _ASM_IC_SSI_H_
+#define _ASM_IC_SSI_H_ 1
+
+int ssi_set_interface(int, int, int, int);
+void ssi_chip_select(int);
+u8 ssi_txrx_byte(u8);
+void ssi_tx_byte(u8);
+u8 ssi_rx_byte(void);
+
+
+#endif
diff --git a/include/asm-i386/pci.h b/include/asm-i386/pci.h
index bde9550..85f60d7 100644
--- a/include/asm-i386/pci.h
+++ b/include/asm-i386/pci.h
@@ -31,5 +31,4 @@ int pci_enable_legacy_video_ports(struct
pci_controller* hose);
int pci_shadow_rom(pci_dev_t dev, unsigned char *dest);
void pci_remove_rom_window(struct pci_controller* hose, u32 addr);
u32 pci_get_rom_window(struct pci_controller* hose, int size);
-
#endif
diff --git a/include/asm-i386/string.h b/include/asm-i386/string.h
index 91a23f9..3643a79 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,
__kernel_size_t __n);
#undef __HAVE_ARCH_STRRCHR
extern char * strrchr(const char * s, int c);
diff --git a/include/configs/sc520_cdp.h b/include/configs/sc520_cdp.h
index e29655e..6a73c90 100644
--- a/include/configs/sc520_cdp.h
+++ b/include/configs/sc520_cdp.h
@@ -28,6 +28,7 @@
#ifndef __CONFIG_H
#define __CONFIG_H
+#define GRUSS_TESTING
/*
* High Level Configuration Options
* (easy to change)
@@ -81,7 +82,11 @@
#include <config_cmd_default.h>
#define CONFIG_CMD_PCI
+#ifndef GRUSS_TESTING
#define CONFIG_CMD_SATA
+#else
+#undef CONFIG_CMD_SATA
+#endif
#define CONFIG_CMD_JFFS2
#define CONFIG_CMD_NET
#define CONFIG_CMD_EEPROM
@@ -175,10 +180,18 @@
/************************************************************
*SATA/Native Stuff
************************************************************/
+#ifndef GRUSS_TESTING
#define CFG_SATA_MAXBUS 2 /*Max Sata buses supported */
#define CFG_SATA_DEVS_PER_BUS 2 /*Max no. of devices per
bus/port */
#define CFG_SATA_MAX_DEVICE (CFG_SATA_MAXBUS*
CFG_SATA_DEVS_PER_BUS)
#define CONFIG_ATA_PIIX 1 /*Supports ata_piix driver */
+#else
+#undef CFG_SATA_MAXBUS
+#undef CFG_SATA_DEVS_PER_BUS
+#undef CFG_SATA_MAX_DEVICE
+#undef CONFIG_ATA_PIIX
+#endif
+
/************************************************************
* DISK Partition support
@@ -190,7 +203,11 @@
/************************************************************
* Video/Keyboard support
************************************************************/
+#ifndef GRUSS_TESTING
#define CONFIG_VIDEO /* To enable video controller support */
+#else
+#undef CONFIG_VIDEO
+#endif
#define CONFIG_I8042_KBD
#define CFG_ISA_IO 0
@@ -203,6 +220,7 @@
/*
* PCI stuff
*/
+#ifndef GRUSS_TESTING
#define CONFIG_PCI /* include pci
support */
#define CONFIG_PCI_PNP /* pci plug-and-play
*/
#define CONFIG_PCI_SCAN_SHOW
@@ -211,5 +229,11 @@
#define CFG_SECOND_PCI_IRQ 9
#define CFG_THIRD_PCI_IRQ 11
#define CFG_FORTH_PCI_IRQ 15
+#else
+#undef CONFIG_PCI
+#undef CONFIG_PCI_PNP
+#undef CONFIG_PCI_SCAN_SHOW
+#endif
+
#endif /* __CONFIG_H */
diff --git a/include/image.h b/include/image.h
index 9be806e..e095a32 100644
--- a/include/image.h
+++ b/include/image.h
@@ -40,7 +40,7 @@
#include <lmb.h>
#include <linux/string.h>
#include <asm/u-boot.h>
-
+#include <asm/string.h>
#else
/* new uImage format support enabled on host */
diff --git a/lib_i386/bios_setup.c b/lib_i386/bios_setup.c
index 75f04a0..2018425 100644
--- a/lib_i386/bios_setup.c
+++ b/lib_i386/bios_setup.c
@@ -140,8 +140,9 @@ int bios_setup(void)
{
static int done=0;
int vector;
+#ifdef CONFIG_PCI
struct pci_controller *pri_hose;
-
+#endif
if (done) {
return 0;
}
@@ -223,12 +224,13 @@ int bios_setup(void)
* (This, ofcause break on multi hose systems,
* but our PCI BIOS only support one hose anyway)
*/
+#ifdef CONFIG_PCI
pri_hose = pci_bus_to_hose(0);
if (NULL != pri_hose) {
/* fill in last pci bus number for use by the realmode
* PCI BIOS */
RELOC_16_BYTE(0xf000, pci_last_bus) = pri_hose->last_busno;
}
-
+#endif
return 0;
}
diff --git a/lib_i386/board.c b/lib_i386/board.c
index 55fa42a..8103211 100644
--- a/lib_i386/board.c
+++ b/lib_i386/board.c
@@ -213,7 +213,7 @@ init_fnc_t *init_sequence[] = {
NULL,
};
-gd_t *global_data;
+gd_t *gd;
void start_i386boot (void)
{
@@ -226,7 +226,7 @@ void start_i386boot (void)
show_boot_progress(0x21);
- gd = global_data = &gd_data;
+ gd = &gd_data;
/* compiler optimization barrier needed for GCC >= 3.4 */
__asm__ __volatile__("": : :"memory");
@@ -266,7 +266,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;
@@ -412,7 +412,10 @@ void hang (void)
unsigned long do_go_exec (ulong (*entry)(int, char *[]), int argc, char
*argv[])
{
/*
- * Nios function pointers are address >> 1
+ * TODO: Test this function - changed to fix compiler error.
+ * Original code was:
+ * return (entry >> 1) (argc, argv);
+ * with a comment about Nios function pointers are address >> 1
*/
- return (entry >> 1) (argc, argv);
+ return (entry) (argc, argv);
}
diff --git a/lib_i386/bootm.c b/lib_i386/bootm.c
index 522d7ad..613e339 100644
--- a/lib_i386/bootm.c
+++ b/lib_i386/bootm.c
@@ -34,7 +34,7 @@ int do_bootm_linux(int flag, int argc, char *argv[],
bootm_headers_t *images)
void *base_ptr;
ulong os_data, os_len;
image_header_t *hdr;
- int ret;
+
#if defined(CONFIG_FIT)
const void *data;
size_t len;
diff --git a/lib_i386/video_bios.c b/lib_i386/video_bios.c
index 45f78e2..02c2166 100644
--- a/lib_i386/video_bios.c
+++ b/lib_i386/video_bios.c
@@ -136,6 +136,8 @@ static u32 probe_pci_video(void)
#endif
+#ifdef CONFIG_VIDEO
+
static int probe_isa_video(void)
{
u32 ptr;
@@ -217,3 +219,4 @@ int video_bios_init(void)
return 1;
}
+#endif
^ permalink raw reply related [flat|nested] 15+ messages in thread* [U-Boot] [PATCH 1/2] Update i386 code (sc520_cdp)
2008-09-06 21:08 ` Graeme Russ
@ 2008-09-09 9:49 ` Wolfgang Denk
2008-09-09 11:08 ` Graeme Russ
0 siblings, 1 reply; 15+ messages in thread
From: Wolfgang Denk @ 2008-09-09 9:49 UTC (permalink / raw)
To: u-boot
Dear Graeme Russ,
In message <1220735322.6322.8.camel@devel> you wrote:
> Attempt to bring i386 / sc520 inline with master
To make some progress, I manually fixed the wrapped lines (you owe me
a beer for that) and applied most of your patch.
I omitted this part though:
> diff --git a/include/image.h b/include/image.h
> index 9be806e..e095a32 100644
> --- a/include/image.h
> +++ b/include/image.h
> @@ -40,7 +40,7 @@
> #include <lmb.h>
> #include <linux/string.h>
> #include <asm/u-boot.h>
> -
> +#include <asm/string.h>
> #else
Including <asm/string.h> seems bogus to me as this is already done in
<linux/string.h> which is included just two lines above. Please
check.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
panic: kernel trap (ignored)
^ permalink raw reply [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH 1/2] Update i386 code (sc520_cdp)
2008-09-09 9:49 ` Wolfgang Denk
@ 2008-09-09 11:08 ` Graeme Russ
2008-09-09 21:32 ` Wolfgang Denk
0 siblings, 1 reply; 15+ messages in thread
From: Graeme Russ @ 2008-09-09 11:08 UTC (permalink / raw)
To: u-boot
On Tue, Sep 9, 2008 at 7:49 PM, Wolfgang Denk <wd@denx.de> wrote:
> Dear Graeme Russ,
>
> In message <1220735322.6322.8.camel@devel> you wrote:
>> Attempt to bring i386 / sc520 inline with master
>
> To make some progress, I manually fixed the wrapped lines (you owe me
> a beer for that) and applied most of your patch.
Agreed
>
> I omitted this part though:
>
>> diff --git a/include/image.h b/include/image.h
>> index 9be806e..e095a32 100644
>> --- a/include/image.h
>> +++ b/include/image.h
>> @@ -40,7 +40,7 @@
>> #include <lmb.h>
>> #include <linux/string.h>
>> #include <asm/u-boot.h>
>> -
>> +#include <asm/string.h>
>> #else
>
> Including <asm/string.h> seems bogus to me as this is already done in
> <linux/string.h> which is included just two lines above. Please
> check.
I've rechecked, but removing this include results in an implicit
declaration of function 'strncpy' on line 401 of /include/image.h
>
> Best regards,
>
> Wolfgang Denk
>
> --
> DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
> panic: kernel trap (ignored)
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH 1/2] Update i386 code (sc520_cdp)
2008-09-09 11:08 ` Graeme Russ
@ 2008-09-09 21:32 ` Wolfgang Denk
2008-09-10 11:54 ` Graeme Russ
0 siblings, 1 reply; 15+ messages in thread
From: Wolfgang Denk @ 2008-09-09 21:32 UTC (permalink / raw)
To: u-boot
Dear "Graeme Russ",
In message <d66caabb0809090408l32562cfch7672814b944dbede@mail.gmail.com> you wrote:
>
> >> @@ -40,7 +40,7 @@
> >> #include <lmb.h>
> >> #include <linux/string.h>
> >> #include <asm/u-boot.h>
> >> -
> >> +#include <asm/string.h>
> >> #else
> >
> > Including <asm/string.h> seems bogus to me as this is already done in
> > <linux/string.h> which is included just two lines above. Please
> > check.
>
> I've rechecked, but removing this include results in an implicit
> declaration of function 'strncpy' on line 401 of /include/image.h
But this makes no sense to me. That's the relevant code from
"include/linux/string.h":
18 /*
19 * Include machine specific inline routines
20 */
21 #include <asm/string.h>
22
23 #ifndef __HAVE_ARCH_STRCPY
24 extern char * strcpy(char *,const char *);
25 #endif
26 #ifndef __HAVE_ARCH_STRNCPY
27 extern char * strncpy(char *,const char *, __kernel_size_t);
28 #endif
You include <linux/string.h>, which in turn unconditionally includes
<asm/string.h>, so including <asm/string.h> another time in makes no
sense to me.
Can you please dig a bit deeper what's happening there? "gcc -E"
might help...
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Life is a game. Money is how we keep score. - Ted Turner
^ permalink raw reply [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH 1/2] Update i386 code (sc520_cdp)
2008-09-09 21:32 ` Wolfgang Denk
@ 2008-09-10 11:54 ` Graeme Russ
2008-09-10 14:46 ` Jean-Christophe PLAGNIOL-VILLARD
0 siblings, 1 reply; 15+ messages in thread
From: Graeme Russ @ 2008-09-10 11:54 UTC (permalink / raw)
To: u-boot
Dear Wolfgang,
On Wed, Sep 10, 2008 at 7:32 AM, Wolfgang Denk <wd@denx.de> wrote:
> Dear "Graeme Russ",
>
> In message <d66caabb0809090408l32562cfch7672814b944dbede@mail.gmail.com> you wrote:
>>
>> >
>> > Including <asm/string.h> seems bogus to me as this is already done in
>> > <linux/string.h> which is included just two lines above. Please
>> > check.
>>
>> I've rechecked, but removing this include results in an implicit
>> declaration of function 'strncpy' on line 401 of /include/image.h
>
> But this makes no sense to me. That's the relevant code from
> "include/linux/string.h":
>
> 18 /*
> 19 * Include machine specific inline routines
> 20 */
> 21 #include <asm/string.h>
> 22
> 23 #ifndef __HAVE_ARCH_STRCPY
> 24 extern char * strcpy(char *,const char *);
> 25 #endif
> 26 #ifndef __HAVE_ARCH_STRNCPY
> 27 extern char * strncpy(char *,const char *, __kernel_size_t);
> 28 #endif
>
> You include <linux/string.h>, which in turn unconditionally includes
> <asm/string.h>, so including <asm/string.h> another time in makes no
> sense to me.
>
> Can you please dig a bit deeper what's happening there? "gcc -E"
> might help...
>
OK, I've found the source of the confusion...
The warning occurs when compiling /examples/82559_eeprom.c (which is
only built for i386 architectures). This file #defines _PPC_STRING_H_
and _LINUX_STRING_H_. It is the #define _LINUX_STRING_H_ which
prevents the entire /include/linux/string.h from being processed, and
hence the necessity to include /include/asm/string.h
I don't know why _PPC_STRING_H_ is #defined - The only attachment to
_PPC_STRING_H_ is the OXC board (PPC platform) which uses
eepro100_eeprom.c which, according to lines 130-135 of
/examples/Makefile is '# Utility for resetting i82559 EEPROM', BUT,
eepro100_eeprom.c is not built for i386 and 82559_eeprom.c is not
built for PPC
So I guess it gets more confusing, not less
Back to /examples/82559_eeprom.c - If I remove #define
_LINUX_STRING_H_ from 82559_eeprom.c and the extra
/include/asm/string.h from /include/image.h, Make all succeeds with
only an ld warning (cannot find entry symbol 82559_eeprom; defaulting
to 0000000000040000)
Should I re-pull (rebase? - sorry, not up with all the lingo yet) the
master git repository, check the patch (with above changes) applies
cleanly and resubmit (after checking my email client) or does this all
warrant a closer inspection?
Also remember that I have had to disable SATA and PCI for the
sc520_cdp as mentioned previously and my primary interest is not in
the sc520_cdp (I don't own one, so I can't test this build) but rather
another sc520 based product I am trying to port linux to.
Regards,
Graeme
^ permalink raw reply [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH 1/2] Update i386 code (sc520_cdp)
2008-09-10 11:54 ` Graeme Russ
@ 2008-09-10 14:46 ` Jean-Christophe PLAGNIOL-VILLARD
2008-09-10 20:51 ` Wolfgang Denk
0 siblings, 1 reply; 15+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2008-09-10 14:46 UTC (permalink / raw)
To: u-boot
On 21:54 Wed 10 Sep , Graeme Russ wrote:
> Dear Wolfgang,
>
> On Wed, Sep 10, 2008 at 7:32 AM, Wolfgang Denk <wd@denx.de> wrote:
> > Dear "Graeme Russ",
> >
> > In message <d66caabb0809090408l32562cfch7672814b944dbede@mail.gmail.com> you wrote:
> >>
I've work on this in the past and send patch for fix all x86
Could you take a look on it
Best Regards,
J.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH 1/2] Update i386 code (sc520_cdp)
2008-09-10 14:46 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2008-09-10 20:51 ` Wolfgang Denk
0 siblings, 0 replies; 15+ messages in thread
From: Wolfgang Denk @ 2008-09-10 20:51 UTC (permalink / raw)
To: u-boot
Dear Jean-Christophe PLAGNIOL-VILLARD,
In message <20080910144631.GH21499@game.jcrosoft.org> you wrote:
>
> I've work on this in the past and send patch for fix all x86
> Could you take a look on it
Please always provide a link to such messages - which exact patch are
you talking about?
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Can you imagine how life could be improved if we could do away with
jealousy, greed, hate ..."
"It can also be improved by eliminating love, tenderness, sentiment
-- the other side of the coin"
-- Dr. Roger Corby and Kirk, "What are Little Girls Made Of?",
stardate 2712.4
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2008-09-10 20:51 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-06 21:55 [U-Boot] [PATCH 1/2] Update i386 code (sc520_cdp) Graeme Russ
2008-09-06 23:35 ` Wolfgang Denk
2008-09-07 0:01 ` Graeme Russ
2008-09-07 0:05 ` Wolfgang Denk
2008-09-08 12:28 ` JerryVanBaren
-- strict thread matches above, loose matches on Subject: below --
2008-09-07 0:06 Graeme Russ
2008-09-06 13:34 Graeme Russ
2008-09-06 15:42 ` Wolfgang Denk
2008-09-06 21:08 ` Graeme Russ
2008-09-09 9:49 ` Wolfgang Denk
2008-09-09 11:08 ` Graeme Russ
2008-09-09 21:32 ` Wolfgang Denk
2008-09-10 11:54 ` Graeme Russ
2008-09-10 14:46 ` Jean-Christophe PLAGNIOL-VILLARD
2008-09-10 20:51 ` Wolfgang Denk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox