Merge branch 'master' of git://git.denx.de/u-boot-mpc85xx
diff --git a/board/BuS/EB+MCF-EV123/EB+MCF-EV123.c b/board/BuS/EB+MCF-EV123/EB+MCF-EV123.c
index fad9c40..39c97b1 100644
--- a/board/BuS/EB+MCF-EV123/EB+MCF-EV123.c
+++ b/board/BuS/EB+MCF-EV123/EB+MCF-EV123.c
@@ -41,51 +41,51 @@
 
 phys_size_t initdram (int board_type)
 {
-	int size,i;
+	int size, i;
 
 	size = 0;
-	MCFSDRAMC_DCR =	MCFSDRAMC_DCR_RTIM_6
-			| MCFSDRAMC_DCR_RC((15 * CFG_CLK)>>4);
-	#ifdef CFG_SDRAM_BASE0
+	MCFSDRAMC_DCR = MCFSDRAMC_DCR_RTIM_6
+			| MCFSDRAMC_DCR_RC ((15 * CFG_CLK) >> 4);
+#ifdef CFG_SDRAM_BASE0
 
-		MCFSDRAMC_DACR0 =	MCFSDRAMC_DACR_BASE(CFG_SDRAM_BASE0)
-					| MCFSDRAMC_DACR_CASL(1)
-					| MCFSDRAMC_DACR_CBM(3)
-					| MCFSDRAMC_DACR_PS_16);
+	MCFSDRAMC_DACR0 = MCFSDRAMC_DACR_BASE (CFG_SDRAM_BASE0)
+			| MCFSDRAMC_DACR_CASL (1)
+			| MCFSDRAMC_DACR_CBM (3)
+			| MCFSDRAMC_DACR_PS_16;
 
-		MCFSDRAMC_DMR0 =	MCFSDRAMC_DMR_BAM_16M
-					| MCFSDRAMC_DMR_V;
+	MCFSDRAMC_DMR0 = MCFSDRAMC_DMR_BAM_16M | MCFSDRAMC_DMR_V;
 
-		MCFSDRAMC_DACR0 |=	MCFSDRAMC_DACR_IP;
+	MCFSDRAMC_DACR0 |= MCFSDRAMC_DACR_IP;
 
-		*(unsigned short *)(CFG_SDRAM_BASE0) = 0xA5A5;
-		MCFSDRAMC_DACR0 |=	MCFSDRAMC_DACR_RE;
-		for (i=0; i < 2000; i++)
-			asm(" nop");
-		mbar_writeLong(MCFSDRAMC_DACR0, mbar_readLong(MCFSDRAMC_DACR0)
-								    | MCFSDRAMC_DACR_IMRS);
-		*(unsigned int *)(CFG_SDRAM_BASE0 + 0x220) = 0xA5A5;
-		size += CFG_SDRAM_SIZE * 1024 * 1024;
-	#endif
-	#ifdef CFG_SDRAM_BASE1
-		MCFSDRAMC_DACR1 =	MCFSDRAMC_DACR_BASE(CFG_SDRAM_BASE1)
-					| MCFSDRAMC_DACR_CASL(1)
-					| MCFSDRAMC_DACR_CBM(3)
-					| MCFSDRAMC_DACR_PS_16;
+	*(unsigned short *) (CFG_SDRAM_BASE0) = 0xA5A5;
+	MCFSDRAMC_DACR0 |= MCFSDRAMC_DACR_RE;
+	for (i = 0; i < 2000; i++)
+		asm (" nop");
+	mbar_writeLong (MCFSDRAMC_DACR0,
+			mbar_readLong (MCFSDRAMC_DACR0) | MCFSDRAMC_DACR_IMRS);
+	*(unsigned int *) (CFG_SDRAM_BASE0 + 0x220) = 0xA5A5;
+	size += CFG_SDRAM_SIZE * 1024 * 1024;
+#endif
+#ifdef CFG_SDRAM_BASE1
+	MCFSDRAMC_DACR1 = MCFSDRAMC_DACR_BASE (CFG_SDRAM_BASE1)
+			| MCFSDRAMC_DACR_CASL (1)
+			| MCFSDRAMC_DACR_CBM (3)
+			| MCFSDRAMC_DACR_PS_16;
 
-		MCFSDRAMC_DMR1 =	MCFSDRAMC_DMR_BAM_16M
-					| MCFSDRAMC_DMR_V;
+	MCFSDRAMC_DMR1 = MCFSDRAMC_DMR_BAM_16M | MCFSDRAMC_DMR_V;
 
-		MCFSDRAMC_DACR1 |=	MCFSDRAMC_DACR_IP;
+	MCFSDRAMC_DACR1 |= MCFSDRAMC_DACR_IP;
 
-		*(unsigned short *)(CFG_SDRAM_BASE1) = 0xA5A5;
-		MCFSDRAMC_DACR1 |=	MCFSDRAMC_DACR_RE;
-		for (i=0; i < 2000; i++)
-			asm(" nop");
-		MCFSDRAMC_DACR1 |=	MCFSDRAMC_DACR_IMRS;
-		*(unsigned int *)(CFG_SDRAM_BASE1 + 0x220) = 0xA5A5;
-		size += CFG_SDRAM_SIZE1 * 1024 * 1024;
-	#endif
+	*(unsigned short *) (CFG_SDRAM_BASE1) = 0xA5A5;
+	MCFSDRAMC_DACR1 |= MCFSDRAMC_DACR_RE;
+
+	for (i = 0; i < 2000; i++)
+		asm (" nop");
+
+	MCFSDRAMC_DACR1 |= MCFSDRAMC_DACR_IMRS;
+	*(unsigned int *) (CFG_SDRAM_BASE1 + 0x220) = 0xA5A5;
+	size += CFG_SDRAM_SIZE1 * 1024 * 1024;
+#endif
 	return size;
 }
 
diff --git a/board/BuS/EB+MCF-EV123/cfm_flash.c b/board/BuS/EB+MCF-EV123/cfm_flash.c
index b326384..98e563f 100644
--- a/board/BuS/EB+MCF-EV123/cfm_flash.c
+++ b/board/BuS/EB+MCF-EV123/cfm_flash.c
@@ -173,7 +173,7 @@
 	dest = cmf_backdoor_address(addr);
 	while ((cnt>=4) && (rc == ERR_OK))
 	{
-		data =*((volatile u32 *) src);
+		data = *((volatile u32 *) src);
 		*(volatile u32*) dest = data;
 		MCFCFM_CMD = MCFCFM_CMD_PGM;
 		MCFCFM_USTAT = MCFCFM_USTAT_CBEIF;
diff --git a/board/BuS/EB+MCF-EV123/flash.c b/board/BuS/EB+MCF-EV123/flash.c
index 5e2647d..c2a1b6f 100644
--- a/board/BuS/EB+MCF-EV123/flash.c
+++ b/board/BuS/EB+MCF-EV123/flash.c
@@ -348,7 +348,7 @@
 	dest = addr;
 	while ((cnt>=2) && (rc == ERR_OK))
 	{
-		data =*((volatile u16 *) src);
+		data = *((volatile u16 *) src);
 		rc=amd_write_word (info,dest,data);
 		src +=2;
 		dest +=2;
diff --git a/board/MAI/AmigaOneG3SE/ps2kbd.c b/board/MAI/AmigaOneG3SE/ps2kbd.c
index 39d8149..724a44d 100644
--- a/board/MAI/AmigaOneG3SE/ps2kbd.c
+++ b/board/MAI/AmigaOneG3SE/ps2kbd.c
@@ -229,7 +229,7 @@
 	device_t kbddev ;
 	char *stdinname  = getenv ("stdin");
 
-	if(isa_kbd_init()==-1)
+	if(isa_kbd_init() == -1)
 		return -1;
 	memset (&kbddev, 0, sizeof(kbddev));
 	strcpy(kbddev.name, DEVNAME);
@@ -515,7 +515,7 @@
 	int val;
 	unsigned char status;
 
-	val=-1;
+	val = -1;
 	status = kbd_read_status();
 	if (status & KBD_STAT_OBF) {
 		val = kbd_read_input();
diff --git a/board/MAI/AmigaOneG3SE/usb_uhci.c b/board/MAI/AmigaOneG3SE/usb_uhci.c
index 479beed..26cdcdf 100644
--- a/board/MAI/AmigaOneG3SE/usb_uhci.c
+++ b/board/MAI/AmigaOneG3SE/usb_uhci.c
@@ -518,7 +518,7 @@
 	uhci_td_t *td,*prevtd;
 
 	for(i=0;i<8;i++) {
-		prevtd=&td_int[i]; /* the first previous td is the skeleton td */
+		prevtd = &td_int[i]; /* the first previous td is the skeleton td */
 		link=swap_32(td_int[i].link) & 0xfffffff0; /* next in chain */
 		td=(uhci_td_t *)link; /* assign it */
 		/* all interrupt TDs are finally linked to the td_int[0].
@@ -595,7 +595,7 @@
 
 
 	busdevfunc=pci_find_device(USB_UHCI_VEND_ID,USB_UHCI_DEV_ID,0); /* get PCI Device ID */
-	if(busdevfunc==-1) {
+	if(busdevfunc == -1) {
 		printf("Error USB UHCI (%04X,%04X) not found\n",USB_UHCI_VEND_ID,USB_UHCI_DEV_ID);
 		return -1;
 	}
@@ -642,12 +642,12 @@
  */
 int usb_lowlevel_stop(void)
 {
-	if(irqvec==-1)
+	if(irqvec == -1)
 		return 1;
 	irq_free_handler(irqvec);
 	irq_free_handler(0);
 	reset_hc();
-	irqvec=-1;
+	irqvec = -1;
 	return 0;
 }
 
diff --git a/board/MAI/menu/menu.c b/board/MAI/menu/menu.c
deleted file mode 100644
index c0c63a8..0000000
--- a/board/MAI/menu/menu.c
+++ /dev/null
@@ -1,66 +0,0 @@
-#include "menu.h"
-
-#define SINGLE_BOX 0
-#define DOUBLE_BOX 1
-
-void video_draw_box(int style, int attr, char *title, int separate, int x, int y, int w, int h);
-void video_draw_text(int x, int y, int attr, char *text);
-void video_save_rect(int x, int y, int w, int h, void *save_area, int clearchar, int clearattr);
-void video_restore_rect(int x, int y, int w, int h, void *save_area);
-int  video_rows(void);
-int  video_cols(void);
-
-#define MAX_MENU_OPTIONS 200
-
-typedef struct
-{
-    int used;                  /* flag if this entry is used */
-    int entry_x;               /* Character column of the menu entry */
-    int entry_y;               /* Character line of the entry */
-    int option_x;              /* Character colum of the option (entry is same) */
-} option_data_t;
-
-option_data_t odata[MAX_MENU_OPTIONS];
-
-int normal_attr = 0x0F;
-int select_attr = 0x2F;
-int disabled_attr = 0x07;
-
-menu_t *root_menu;
-
-int menu_init (menu_t *root)
-{
-    char *s;
-    int i;
-
-    s = getenv("menu_normal");
-    if (s) normal_attr = atoi(s);
-
-    s = getenv("menu_select");
-    if (s) select_attr = atoi(s);
-
-    s = getenv("menu_disabled");
-    if (s) disabled_attr = atoi(s);
-
-    for (i=0; i<MAX_MENU_OPTIONS; i++) odata[i].used = 0;
-
-    root_menu = root;
-}
-
-option_data_t *menu_alloc_odata(void)
-{
-    int i;
-    for (int i=0; i<MAX_MENU_OPTIONS; i++)
-    {
-	if (odata[i].used == 0) return &odata[i];
-    }
-    return NULL;
-}
-
-void menu_free_odata(option_data_t *odata)
-{
-    odata->used = 0;
-}
-
-void menu_layout (menu_t *menu)
-{
diff --git a/board/MAI/menu/menu.h b/board/MAI/menu/menu.h
deleted file mode 100644
index 23d89a7..0000000
--- a/board/MAI/menu/menu.h
+++ /dev/null
@@ -1,162 +0,0 @@
-#ifndef MENU_H
-#define MENU_H
-
-/* A single menu */
-typedef void (*menu_finish_callback)(struct menu_s *menu);
-
-typedef struct menu_s {
-	char *name;		/* Menu name */
-	int num_options;	/* Number of options in this menu */
-	int flags;		/* Various flags - see below */
-	int option_align;	/* Aligns options to a field width of this much characters if != 0 */
-
-	struct menu_option_s **options;	/* Pointer to this menu's options */
-	menu_finish_callback callback;	/* Called when the menu closes */
-} menu_t;
-
-/*
- * type: Type of the option (see below)
- * name: Name to display for this option
- * help: Optional help string
- * id  : optional id number
- * sys : pointer for system-specific data, init to NULL and don't touch
- */
-
-#define OPTION_PREAMBLE		\
-	int type;		\
-	char *name;		\
-	char *help;		\
-	int id;			\
-	void *sys;
-
-/*
- * Menu option types.
- * There are a number of different layouts for menu options depending
- * on their types. Currently there are the following possibilities:
- *
- * Submenu:
- *   This entry links to a new menu.
- *
- * Boolean:
- *   A simple on/off toggle entry. Booleans can be either yes/no, 0/1 or on/off.
- *   Optionally, this entry can enable/disable a set of other options. An example would
- *   be to enable/disable on-board USB, and if enabled give access to further options like
- *   irq settings, base address etc.
- *
- * Text:
- *   A single line/limited number of characters text entry box. Text can be restricted
- *   to a certain charset (digits/hex digits/all/custom). Result is also available as an
- *   int if numeric.
- *
- * Selection:
- *   One-of-many type of selection entry. User may choose on of a set of strings, which
- *   maps to a specific value for the variable.
- *
- * Routine:
- *   Selecting this calls an entry-specific routine. This can be used for saving contents etc.
- *
- * Custom:
- *   Display and behaviour of this entry is defined by a set of callbacks.
- */
-
-#define MENU_SUBMENU_TYPE 0
-typedef struct menu_submenu_s
-{
-    OPTION_PREAMBLE
-
-    menu_t *   submenu;            /* Pointer to the submenu */
-} menu_submenu_t;
-
-#define MENU_BOOLEAN_TYPE 1
-typedef struct menu_boolean_s
-{
-    OPTION_PREAMBLE
-
-    char *variable;                /* Name of the variable to getenv()/setenv() */
-    int subtype;                   /* Subtype (on/off, 0/1, yes/no, enable/disable), see below */
-    int mutex;                     /* Bit mask of options to enable/disable. Bit 0 is the option
-				      immediately following this one, bit 1 is the next one etc.
-				      bit 7 = 0 means to disable when this option is off,
-				      bit 7 = 1 means to disable when this option is on.
-				      An option is disabled when the type field's upper bit is set */
-} menu_boolean_t;
-
-/* BOOLEAN Menu flags */
-#define MENU_BOOLEAN_ONOFF         0x01
-#define MENU_BOOLEAN_01            0x02
-#define MENU_BOOLEAN_YESNO         0x03
-#define MENU_BOOLEAN_ENDIS         0x04
-#define MENU_BOOLEAN_TYPE_MASK     0x07
-
-
-#define MENU_TEXT_TYPE 2
-typedef struct menu_text_s
-{
-    OPTION_PREAMBLE
-
-    char *variable;                /* Name of the variable to getenv()/setenv() */
-    int maxchars;                  /* Max number of characters */
-    char *charset;                 /* Optional charset to use */
-    int flags;                     /* Flags - see below */
-} menu_text_t;
-
-/* TEXT entry menu flags */
-#define MENU_TEXT_NUMERIC         0x01
-#define MENU_TEXT_HEXADECIMAL     0x02
-#define MENU_TEXT_FREE            0x03
-#define MENU_TEXT_TYPE_MASK       0x07
-
-
-#define MENU_SELECTION_TYPE 3
-typedef struct menu_select_option_s {
-	char *map_from;		/* Map this variable contents ... */
-	char *map_to;		/* ... to this menu text and vice versa */
-} menu_select_option_t;
-
-typedef struct menu_select_s {
-	OPTION_PREAMBLE int num_options;	/* Number of mappings */
-	menu_select_option_t **options;
-	/* Option list array */
-} menu_select_t;
-
-
-#define MENU_ROUTINE_TYPE 4
-typedef void (*menu_routine_callback) (struct menu_routine_s *);
-
-typedef struct menu_routine_s {
-	OPTION_PREAMBLE menu_routine_callback callback;
-	/* routine to be called */
-	void *user_data;	/* User data, don't care for system */
-} menu_routine_t;
-
-
-#define MENU_CUSTOM_TYPE 5
-typedef void (*menu_custom_draw) (struct menu_custom_s *);
-typedef void (*menu_custom_key) (struct menu_custom_s *, int);
-
-typedef struct menu_custom_s {
-	OPTION_PREAMBLE menu_custom_draw drawfunc;
-	menu_custom_key keyfunc;
-	void *user_data;
-} menu_custom_t;
-
-/*
- * The menu option superstructure
- */
-typedef struct menu_option_s {
-	union {
-		menu_submenu_t m_sub_menu;
-		menu_boolean_t m_boolean;
-		menu_text_t m_text;
-		menu_select_t m_select;
-		menu_routine_t m_routine;
-	};
-} menu_option_t;
-
-/* Init the menu system. Returns <0 on error */
-int menu_init(menu_t *root);
-
-/* Execute a single menu. Returns <0 on error */
-int menu_do(menu_t *menu);
-
-#endif
diff --git a/board/davinci/dv-evm/dv_board.c b/board/davinci/dv-evm/dv_board.c
index 88b1e57..834eb68 100644
--- a/board/davinci/dv-evm/dv_board.c
+++ b/board/davinci/dv-evm/dv_board.c
@@ -29,14 +29,10 @@
 #include <asm/arch/hardware.h>
 #include <asm/arch/emac_defs.h>
 
-#define MACH_TYPE_DAVINCI_EVM		901
-
 DECLARE_GLOBAL_DATA_PTR;
 
-extern void	i2c_init(int speed, int slaveaddr);
 extern void	timer_init(void);
 extern int	eth_hw_init(void);
-extern phy_t	phy;
 
 
 /* Works on Always On power domain only (no PD argument) */
@@ -187,11 +183,8 @@
 		}
 	}
 
-	if (!eth_hw_init()) {
+	if (!eth_hw_init())
 		printf("ethernet init failed!\n");
-	} else {
-		printf("ETH PHY   : %s\n", phy.name);
-	}
 
 	i2c_read (0x39, 0x00, 1, (u_int8_t *)&i, 1);
 
diff --git a/board/davinci/schmoogie/dv_board.c b/board/davinci/schmoogie/dv_board.c
index 13d2195..3017546 100644
--- a/board/davinci/schmoogie/dv_board.c
+++ b/board/davinci/schmoogie/dv_board.c
@@ -29,14 +29,10 @@
 #include <asm/arch/hardware.h>
 #include <asm/arch/emac_defs.h>
 
-#define MACH_TYPE_SCHMOOGIE		1255
-
 DECLARE_GLOBAL_DATA_PTR;
 
-extern void	i2c_init(int speed, int slaveaddr);
 extern void	timer_init(void);
 extern int	eth_hw_init(void);
-extern phy_t	phy;
 
 
 /* Works on Always On power domain only (no PD argument) */
@@ -233,11 +229,8 @@
 		forceenv("serial#", (char *)&tmp[0]);
 	}
 
-	if (!eth_hw_init()) {
+	if (!eth_hw_init())
 		printf("ethernet init failed!\n");
-	} else {
-		printf("ETH PHY   : %s\n", phy.name);
-	}
 
 	return(0);
 }
diff --git a/board/davinci/sffsdr/sffsdr.c b/board/davinci/sffsdr/sffsdr.c
index b73484a..f41081f 100644
--- a/board/davinci/sffsdr/sffsdr.c
+++ b/board/davinci/sffsdr/sffsdr.c
@@ -43,7 +43,6 @@
 
 extern void timer_init(void);
 extern int eth_hw_init(void);
-extern phy_t phy;
 
 
 /* Works on Always On power domain only (no PD argument) */
@@ -288,11 +287,8 @@
 		}
 	}
 
-	if (!eth_hw_init()) {
+	if (!eth_hw_init())
 		printf("Ethernet init failed\n");
-	} else {
-		printf("ETH PHY: %s\n", phy.name);
-	}
 
 	/* On this platform, U-Boot is copied in RAM by the UBL,
 	 * so we are always in the relocated state. */
diff --git a/board/davinci/sonata/dv_board.c b/board/davinci/sonata/dv_board.c
index e8665e5..a6f9bc7 100644
--- a/board/davinci/sonata/dv_board.c
+++ b/board/davinci/sonata/dv_board.c
@@ -29,14 +29,10 @@
 #include <asm/arch/hardware.h>
 #include <asm/arch/emac_defs.h>
 
-#define MACH_TYPE_SONATA		1254
-
 DECLARE_GLOBAL_DATA_PTR;
 
-extern void	i2c_init(int speed, int slaveaddr);
 extern void	timer_init(void);
 extern int	eth_hw_init(void);
-extern phy_t	phy;
 
 
 /* Works on Always On power domain only (no PD argument) */
@@ -188,11 +184,8 @@
 		}
 	}
 
-	if (!eth_hw_init()) {
+	if (!eth_hw_init())
 		printf("ethernet init failed!\n");
-	} else {
-		printf("ETH PHY   : %s\n", phy.name);
-	}
 
 	return(0);
 }
diff --git a/board/eltec/elppc/eepro100_srom.c b/board/eltec/elppc/eepro100_srom.c
index f021c50..4a9da54 100644
--- a/board/eltec/elppc/eepro100_srom.c
+++ b/board/eltec/elppc/eepro100_srom.c
@@ -31,82 +31,83 @@
 #include <net.h>
 #include "srom.h"
 
-extern int eepro100_write_eeprom (struct eth_device* dev,
-		    int location, int addr_len, unsigned short data);
+extern int eepro100_write_eeprom (struct eth_device *dev,
+				  int location, int addr_len,
+				  unsigned short data);
 
 /*----------------------------------------------------------------------------*/
 
 unsigned short eepro100_srom_checksum (unsigned short *sromdata)
 {
-    unsigned short sum = 0;
-    unsigned int i;
+	unsigned short sum = 0;
+	unsigned int i;
 
-    for (i = 0; i < (EE_SIZE-1); i++)
-    {
-	sum += sromdata[i];
-    }
-    return (EE_CHECKSUM - sum);
+	for (i = 0; i < (EE_SIZE - 1); i++) {
+		sum += sromdata[i];
+	}
+	return (EE_CHECKSUM - sum);
 }
 
 /*----------------------------------------------------------------------------*/
 
 int eepro100_srom_store (unsigned short *source)
 {
-    int count;
-    struct eth_device onboard_dev;
+	int count;
+	struct eth_device onboard_dev;
 
-    /* get onboard network iobase */
-    pci_read_config_dword(PCI_BDF(0,0x10,0), PCI_BASE_ADDRESS_0,
-		 (unsigned int *)&onboard_dev.iobase);
-    onboard_dev.iobase &= ~0xf;
+	/* get onboard network iobase */
+	pci_read_config_dword (PCI_BDF (0, 0x10, 0), PCI_BASE_ADDRESS_0,
+			       (unsigned int *) &onboard_dev.iobase);
+	onboard_dev.iobase &= ~0xf;
 
-    source[63] = eepro100_srom_checksum (source);
+	source[63] = eepro100_srom_checksum (source);
 
-    for (count=0; count < EE_SIZE; count++)
-    {
-    if ( eepro100_write_eeprom ((struct eth_device*)&onboard_dev,
-	     count, EE_ADDR_BITS, SROM_SHORT(source)) == -1 )
-	return -1;
-    source++;
-    }
-    return 0;
+	for (count = 0; count < EE_SIZE; count++) {
+		if (eepro100_write_eeprom ((struct eth_device *) &onboard_dev,
+					   count, EE_ADDR_BITS,
+					   SROM_SHORT (source)) == -1) {
+			return -1;
+		}
+		source++;
+	}
+	return 0;
 }
 
 /*----------------------------------------------------------------------------*/
 
 #ifdef EEPRO100_SROM_CHECK
 
-extern int read_eeprom (struct eth_device* dev, int location, int addr_len);
+extern int read_eeprom (struct eth_device *dev, int location, int addr_len);
 
 void eepro100_srom_load (unsigned short *destination)
 {
-    int count;
-    struct eth_device onboard_dev;
+	int count;
+	struct eth_device onboard_dev;
+
 #ifdef DEBUG
-    int lr = 0;
-    printf ("eepro100_srom_download:\n");
+	int lr = 0;
+
+	printf ("eepro100_srom_download:\n");
 #endif
 
-    /* get onboard network iobase */
-    pci_read_config_dword(PCI_BDF(0,0x10,0), PCI_BASE_ADDRESS_0,
-		 &onboard_dev.iobase);
-    onboard_dev.iobase &= ~0xf;
+	/* get onboard network iobase */
+	pci_read_config_dword (PCI_BDF (0, 0x10, 0), PCI_BASE_ADDRESS_0,
+			       &onboard_dev.iobase);
+	onboard_dev.iobase &= ~0xf;
 
-    memset (destination, 0x65, 128);
+	memset (destination, 0x65, 128);
 
-    for (count=0; count < 0x40; count++)
-    {
-	*destination++ = read_eeprom (struct eth_device*)&onboard_dev,
-		 count, EE_ADDR_BITS);
+	for (count = 0; count < 0x40; count++) {
+		*destination++ = read_eeprom ((struct eth_device *) &onboard_dev,
+					      count, EE_ADDR_BITS);
 #ifdef DEBUG
-	printf ("%04x ", *(destination - 1));
-	if (lr++ == 7)
-	{
-	    printf("\n");
-	    lr = 0;
+		printf ("%04x ", *(destination - 1));
+		if (lr++ == 7) {
+			printf ("\n");
+			lr = 0;
+		}
+#endif
 	}
-#endif
-    }
 }
 #endif /* EEPRO100_SROM_CHECK */
 
diff --git a/board/esd/cpci750/sdram_init.c b/board/esd/cpci750/sdram_init.c
index a479f0f..0291937 100644
--- a/board/esd/cpci750/sdram_init.c
+++ b/board/esd/cpci750/sdram_init.c
@@ -1570,8 +1570,8 @@
     for (cnt = STARTVAL/sizeof(long); cnt < maxsize/sizeof(long); cnt <<= 1) {
 	    addr = base + cnt;	/* pointer arith! */
 
-	    save1=*addr;		/* save contents of addr */
-	    save2=*b;		/* save contents of base */
+	    save1 = *addr;		/* save contents of addr */
+	    save2 = *b;		/* save contents of base */
 
 	    *addr=cnt;		/* write cnt to addr */
 	    *b=0;			/* put null at base */
diff --git a/board/evb64260/eth.c b/board/evb64260/eth.c
index 618af6f..fa5b6d4 100644
--- a/board/evb64260/eth.c
+++ b/board/evb64260/eth.c
@@ -163,7 +163,7 @@
 	int eth_len=0;
 	char *eth_data;
 
-	eth0_rx_desc_single *rx=&p->eth_rx_desc[(p->rdn)];
+	eth0_rx_desc_single *rx = &p->eth_rx_desc[(p->rdn)];
 
 	INVALIDATE_DCACHE((unsigned int)rx,(unsigned int)(rx+1));
 
@@ -252,7 +252,7 @@
 #ifdef DEBUG
 	unsigned int old_command_stat,old_psr;
 #endif
-	eth0_tx_desc_single *tx=&dev->eth_tx_desc[dev->tdn];
+	eth0_tx_desc_single *tx = &dev->eth_tx_desc[dev->tdn];
 
 	/* wait for tx to be ready */
 	INVALIDATE_DCACHE((unsigned int)tx,(unsigned int)(tx+1));
diff --git a/board/evb64260/mpsc.c b/board/evb64260/mpsc.c
index 9e8bfe0..3b338c7 100644
--- a/board/evb64260/mpsc.c
+++ b/board/evb64260/mpsc.c
@@ -259,7 +259,7 @@
 int
 mpsc_test_char(void)
 {
-	volatile unsigned int *p=&rx_desc_base[rx_desc_index*8];
+	volatile unsigned int *p = &rx_desc_base[rx_desc_index*8];
 
 	INVALIDATE_DCACHE(&p[1], &p[2]);
 
diff --git a/board/ml2/flash.c b/board/ml2/flash.c
index 87cb1ff..ad0f075 100644
--- a/board/ml2/flash.c
+++ b/board/ml2/flash.c
@@ -222,7 +222,7 @@
 	unsigned long long result;
 	int rc = ERR_OK;
 
-	result=*addr;
+	result = *addr;
 	if ((result & data) != data)
 		return ERR_NOT_ERASED;
 
@@ -234,7 +234,7 @@
 	eieio();
 
 	do {
-		result=*addr;
+		result = *addr;
 	} while(~result & BIT_BUSY);
 
 	*addr=CMD_READ_ARRAY;
@@ -275,7 +275,7 @@
 	}
 
 	while(cnt>=8) {
-		data=*((unsigned long long *)src);
+		data = *((unsigned long long *)src);
 		if ((rc = write_word(info, wp, data)) != 0)
 			return rc;
 		src+=8;
diff --git a/board/mpl/common/common_util.c b/board/mpl/common/common_util.c
index 11d4345..24ce807 100644
--- a/board/mpl/common/common_util.c
+++ b/board/mpl/common/common_util.c
@@ -357,8 +357,8 @@
 	unsigned off;
 	uchar *name, *value;
 
-	name=&name_buf[0];
-	value=&value_buf[0];
+	name = &name_buf[0];
+	value = &value_buf[0];
 	len=size;
 	off = sizeof(long);
 	while (len > off) {
@@ -377,8 +377,8 @@
 				if(c == '\0')
 					break;
 			} while(len > off);
-			name=&name_buf[0];
-			value=&value_buf[0];
+			name = &name_buf[0];
+			value = &value_buf[0];
 			if(strncmp((char *)name,"baudrate",8)!=0) {
 				setenv((char *)name,(char *)value);
 			}
@@ -636,12 +636,12 @@
 					++s;
 					break;
 				}
-				buf[i++]=*s;
+				buf[i++] = *s;
 			}
 			sprintf(&buf[i]," SN ");
 			i+=4;
 			for (; s < e; ++s) {
-				buf[i++]=*s;
+				buf[i++] = *s;
 			}
 			buf[i++]=0;
 		}
diff --git a/board/mpl/common/flash.c b/board/mpl/common/flash.c
index a437dab..eb2702b 100644
--- a/board/mpl/common/flash.c
+++ b/board/mpl/common/flash.c
@@ -160,7 +160,7 @@
 	unsigned long size_b1,flashcr,size_reg;
 	int mode;
 	extern char version_string;
-	char *p=&version_string;
+	char *p = &version_string;
 
 	/* Since we are relocated, we can set-up the CS finally */
 	setup_cs_reloc();
diff --git a/board/mpl/common/kbd.c b/board/mpl/common/kbd.c
index 931ed43..b20b953 100644
--- a/board/mpl/common/kbd.c
+++ b/board/mpl/common/kbd.c
@@ -475,7 +475,7 @@
 	int val;
 	unsigned char status;
 
-	val=-1;
+	val = -1;
 	status = kbd_read_status();
 	if (status & KBD_STAT_OBF) {
 		val = kbd_read_input();
diff --git a/board/mpl/common/usb_uhci.c b/board/mpl/common/usb_uhci.c
index 6778e40..666b999 100644
--- a/board/mpl/common/usb_uhci.c
+++ b/board/mpl/common/usb_uhci.c
@@ -536,7 +536,7 @@
 	uhci_td_t *td,*prevtd;
 
 	for(i=0;i<8;i++) {
-		prevtd=&td_int[i]; /* the first previous td is the skeleton td */
+		prevtd = &td_int[i]; /* the first previous td is the skeleton td */
 		link=swap_32(td_int[i].link) & 0xfffffff0; /* next in chain */
 		td=(uhci_td_t *)link; /* assign it */
 		/* all interrupt TDs are finally linked to the td_int[0].
@@ -638,7 +638,7 @@
 		return 1;
 	irq_free_handler(irqvec);
 	reset_hc();
-	irqvec=-1;
+	irqvec = -1;
 	return 0;
 }
 
diff --git a/board/snmc/qs850/qs850.c b/board/snmc/qs850/qs850.c
index ba5a8fb..2fbe8ae 100644
--- a/board/snmc/qs850/qs850.c
+++ b/board/snmc/qs850/qs850.c
@@ -86,6 +86,13 @@
  *
  * Always return 1
  */
+#if defined(CONFIG_QS850)
+#define BOARD_IDENTITY	"QS850"
+#elif defined(CONFIG_QS823)
+#define BOARD_IDENTITY	"QS823"
+#else
+#define	BOARD_IDENTITY	"QS???"
+#endif
 
 int checkboard (void)
 {
@@ -96,14 +103,8 @@
 	i = getenv_r("serial#", buf, sizeof(buf));
 	s = (i>0) ? buf : NULL;
 
-#ifdef CONFIG_QS850
-	if (!s || strncmp(s, "QS850", 5)) {
-		puts ("### No HW ID - assuming QS850");
-#endif
-#ifdef CONFIG_QS823
-	if (!s || strncmp(s, "QS823", 5)) {
-		puts ("### No HW ID - assuming QS823");
-#endif
+	if (!s || strncmp(s, BOARD_IDENTITY, 5)) {
+		puts ("### No HW ID - assuming " BOARD_IDENTITY);
 	} else {
 		for (e=s; *e; ++e) {
 		if (*e == ' ')
diff --git a/board/tqc/tqm5200/cmd_stk52xx.c b/board/tqc/tqm5200/cmd_stk52xx.c
index 58039d4..fd1e68b 100644
--- a/board/tqc/tqm5200/cmd_stk52xx.c
+++ b/board/tqc/tqm5200/cmd_stk52xx.c
@@ -192,10 +192,10 @@
 	psc->command = (PSC_RX_ENABLE | PSC_TX_ENABLE);
 
 	for(i = 0;i < (len / 4); i++) {
-		swapped[3]=*wave_file++;
-		swapped[2]=*wave_file++;
-		swapped[1]=*wave_file++;
-		swapped[0]=*wave_file++;
+		swapped[3] = *wave_file++;
+		swapped[2] = *wave_file++;
+		swapped[1] = *wave_file++;
+		swapped[0] = *wave_file++;
 		psc->psc_buffer_32 =  *((unsigned long*)swapped);
 		while (psc->tfnum > 400) {
 			if(ctrlc())
diff --git a/common/cmd_fdc.c b/common/cmd_fdc.c
index e4fbf29..8493def 100644
--- a/common/cmd_fdc.c
+++ b/common/cmd_fdc.c
@@ -512,7 +512,7 @@
 	if(readblk>blocks) /* is end within 1st track */
 		readblk=blocks; /* yes, correct it */
 	PRINTF("we read %ld blocks start %ld\n",readblk,pCMD->blnr);
-	bufferw=&buffer[0]; /* setup working buffer */
+	bufferw = &buffer[0]; /* setup working buffer */
 	do {
 retryrw:
 		len=sect_size * readblk;
@@ -566,7 +566,7 @@
 		 * we need to get the results */
 		fdc_terminate(pCMD);
 		offset+=(sect_size*readblk); /* set up buffer pointer */
-		bufferw=&buffer[offset];
+		bufferw = &buffer[offset];
 		pCMD->blnr+=readblk; /* update current block nr */
 		blocks-=readblk; /* update blocks */
 		if(blocks==0)
diff --git a/common/cmd_flash.c b/common/cmd_flash.c
index 9bd8074..a7f66dd 100644
--- a/common/cmd_flash.c
+++ b/common/cmd_flash.c
@@ -210,7 +210,7 @@
 		s_last [bank] = -1;	/* last  sector to erase	*/
 	}
 
-	for (bank=0,info=&flash_info[0];
+	for (bank=0,info = &flash_info[0];
 	     (bank < CFG_MAX_FLASH_BANKS) && (addr_first <= addr_last);
 	     ++bank, ++info) {
 		ulong b_end;
@@ -427,7 +427,7 @@
 					s_first, s_last, &planned );
 
 	if (planned && (rcode == 0)) {
-		for (bank=0,info=&flash_info[0];
+		for (bank=0,info = &flash_info[0];
 		     (bank < CFG_MAX_FLASH_BANKS) && (rcode == 0);
 		     ++bank, ++info) {
 			if (s_first[bank]>=0) {
@@ -651,7 +651,7 @@
 	protected = 0;
 
 	if (planned && (rcode == 0)) {
-		for (bank=0,info=&flash_info[0]; bank < CFG_MAX_FLASH_BANKS; ++bank, ++info) {
+		for (bank=0,info = &flash_info[0]; bank < CFG_MAX_FLASH_BANKS; ++bank, ++info) {
 			if (info->flash_id == FLASH_UNKNOWN) {
 				continue;
 			}
diff --git a/common/cmd_fpga.c b/common/cmd_fpga.c
index 9141dcc..dcbbc99 100644
--- a/common/cmd_fpga.c
+++ b/common/cmd_fpga.c
@@ -85,7 +85,7 @@
 	length = (*dataptr << 8) + *(dataptr+1);
 	dataptr+=2;
 	for(i=0;i<length;i++)
-		buffer[i]=*dataptr++;
+		buffer[i] = *dataptr++;
 
 	printf("  design filename = \"%s\"\n", buffer);
 
@@ -99,7 +99,7 @@
 	length = (*dataptr << 8) + *(dataptr+1);
 	dataptr+=2;
 	for(i=0;i<length;i++)
-		buffer[i]=*dataptr++;
+		buffer[i] = *dataptr++;
 	printf("  part number = \"%s\"\n", buffer);
 
 	/* get date (identifier, length, string) */
@@ -112,7 +112,7 @@
 	length = (*dataptr << 8) + *(dataptr+1);
 	dataptr+=2;
 	for(i=0;i<length;i++)
-		buffer[i]=*dataptr++;
+		buffer[i] = *dataptr++;
 	printf("  date = \"%s\"\n", buffer);
 
 	/* get time (identifier, length, string) */
@@ -124,7 +124,7 @@
 	length = (*dataptr << 8) + *(dataptr+1);
 	dataptr+=2;
 	for(i=0;i<length;i++)
-		buffer[i]=*dataptr++;
+		buffer[i] = *dataptr++;
 	printf("  time = \"%s\"\n", buffer);
 
 	/* get fpga data length (identifier, length) */
diff --git a/common/cmd_mp.c b/common/cmd_mp.c
index 26a57c5..b2a397c 100644
--- a/common/cmd_mp.c
+++ b/common/cmd_mp.c
@@ -35,7 +35,7 @@
 
 	cpuid = simple_strtoul(argv[1], NULL, 10);
 	if (cpuid >= CONFIG_NR_CPUS) {
-		printf ("Core num: %d is out of range[0..%d]\n",
+		printf ("Core num: %lu is out of range[0..%d]\n",
 				cpuid, CONFIG_NR_CPUS - 1);
 		return 1;
 	}
diff --git a/common/cmd_scsi.c b/common/cmd_scsi.c
index e648f7d..f357465 100644
--- a/common/cmd_scsi.c
+++ b/common/cmd_scsi.c
@@ -171,7 +171,7 @@
 	if(scsi_max_devs>0)
 		scsi_curr_dev=0;
 	else
-		scsi_curr_dev=-1;
+		scsi_curr_dev = -1;
 }
 
 
diff --git a/common/cmd_usb.c b/common/cmd_usb.c
index 30caa98..c62ca97 100644
--- a/common/cmd_usb.c
+++ b/common/cmd_usb.c
@@ -32,7 +32,7 @@
 #include <usb.h>
 
 #ifdef CONFIG_USB_STORAGE
-static int usb_stor_curr_dev=-1; /* current device */
+static int usb_stor_curr_dev = -1; /* current device */
 #endif
 
 /* some display routines (info command) */
diff --git a/common/devices.c b/common/devices.c
index ddf8f8e..9cc963a 100644
--- a/common/devices.c
+++ b/common/devices.c
@@ -125,7 +125,7 @@
 	device_t *dev = NULL;
 	char temp_names[3][8];
 
-	dev_index=-1;
+	dev_index = -1;
 	for (i=1; i<=ListNumItems(devlist); i++) {
 		dev = ListGetPtrToItem (devlist, i);
 		if(strcmp(dev->name,devname)==0) {
diff --git a/common/flash.c b/common/flash.c
index 888ff9c..fe39d55 100644
--- a/common/flash.c
+++ b/common/flash.c
@@ -104,7 +104,7 @@
 	flash_info_t *info;
 	int i;
 
-	for (i=0, info=&flash_info[0]; i<CFG_MAX_FLASH_BANKS; ++i, ++info) {
+	for (i=0, info = &flash_info[0]; i<CFG_MAX_FLASH_BANKS; ++i, ++info) {
 		if (info->flash_id != FLASH_UNKNOWN &&
 		    addr >= info->start[0] &&
 		    /* WARNING - The '- 1' is needed if the flash
diff --git a/common/hush.c b/common/hush.c
index b43f618..75c18ce 100644
--- a/common/hush.c
+++ b/common/hush.c
@@ -953,7 +953,7 @@
 
 static int static_get(struct in_str *i)
 {
-	int ch=*i->p++;
+	int ch = *i->p++;
 	if (ch=='\0') return EOF;
 	return ch;
 }
@@ -1104,7 +1104,7 @@
 	ch = 0;
 	/* If there is data waiting, eat it up */
 	if (i->p && *i->p) {
-		ch=*i->p++;
+		ch = *i->p++;
 	} else {
 		/* need to double check i->file because we might be doing something
 		 * more complicated by now, like sourcing or substituting. */
@@ -1121,7 +1121,7 @@
 			i->__promptme = 0;
 #endif
 			if (i->p && *i->p) {
-				ch=*i->p++;
+				ch = *i->p++;
 			}
 #ifndef __U_BOOT__
 		} else {
diff --git a/common/lcd.c b/common/lcd.c
index ebf377a..eec1f53 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -539,7 +539,7 @@
 
 	debug ("Logo: width %d  height %d  colors %d  cmap %d\n",
 		BMP_LOGO_WIDTH, BMP_LOGO_HEIGHT, BMP_LOGO_COLORS,
-		sizeof(bmp_logo_palette)/(sizeof(ushort)));
+		(int)(sizeof(bmp_logo_palette)/(sizeof(ushort))));
 
 	bmap = &bmp_logo_bitmap[0];
 	fb   = (uchar *)(lcd_base + y * lcd_line_length + x);
@@ -728,7 +728,7 @@
 		WATCHDOG_RESET();
 		for (j = 0; j < width ; j++)
 #if defined(CONFIG_PXA250)
-			*(fb++)=*(bmap++);
+			*(fb++) = *(bmap++);
 #elif defined(CONFIG_MPC823) || defined(CONFIG_MCC200)
 			*(fb++)=255-*(bmap++);
 #endif
diff --git a/common/usb.c b/common/usb.c
index a0107dc..a45d113 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -252,7 +252,7 @@
 
 	for(i=0; i<dev->config.bNumInterfaces;i++) {
 		for(ii=0; ii<dev->config.if_desc[i].bNumEndpoints; ii++) {
-			ep=&dev->config.if_desc[i].ep_desc[ii];
+			ep = &dev->config.if_desc[i].ep_desc[ii];
 			b=ep->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
 
 			if((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK)==USB_ENDPOINT_XFER_CONTROL) {	/* Control => bidirectional */
@@ -627,7 +627,7 @@
 	if (size <= 0 || !buf || !index)
 		return -1;
 	buf[0] = 0;
-	tbuf=&mybuf[0];
+	tbuf = &mybuf[0];
 
 	/* get langid for strings if it's not yet known */
 	if (!dev->have_langid) {
@@ -857,7 +857,7 @@
 	/* first make all devices unknown */
 	for(i=0;i<USB_MAX_DEVICE;i++) {
 		memset(&usb_dev[i],0,sizeof(struct usb_device));
-		usb_dev[i].devnum=-1;
+		usb_dev[i].devnum = -1;
 	}
 	dev_index=0;
 	/* device 0 is always present (root hub, so let it analyze) */
diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index 1e79208..c876495 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -730,8 +730,8 @@
 		return -1;
 	}
 	printf(" report descriptor (size %u, read %d)\n", len, index);
-	start=&buffer[0];
-	end=&buffer[len];
+	start = &buffer[0];
+	end = &buffer[len];
 	i=0;
 	do {
 		index=fetch_item(start,end,&item);
diff --git a/common/usb_storage.c b/common/usb_storage.c
index 3e113b4..d8fbb69 100644
--- a/common/usb_storage.c
+++ b/common/usb_storage.c
@@ -731,7 +731,7 @@
 	ccb reqsrb;
 	int retry,notready;
 
-	psrb=&reqsrb;
+	psrb = &reqsrb;
 	status=USB_STOR_TRANSPORT_GOOD;
 	retry=0;
 	notready=0;
@@ -776,7 +776,7 @@
 	psrb->cmd[1]=srb->lun<<5;
 	psrb->cmd[4]=18;
 	psrb->datalen=18;
-	psrb->pdata=&srb->sense_buf[0];
+	psrb->pdata = &srb->sense_buf[0];
 	psrb->cmdlen=12;
 	/* issue the command */
 	result=usb_stor_CB_comdat(psrb,us);
@@ -858,7 +858,7 @@
 	srb->cmd[1]=srb->lun<<5;
 	srb->cmd[4]=18;
 	srb->datalen=18;
-	srb->pdata=&srb->sense_buf[0];
+	srb->pdata = &srb->sense_buf[0];
 	srb->cmdlen=12;
 	ss->transport(srb,ss);
 	USB_STOR_PRINTF("Request Sense returned %02X %02X %02X\n",srb->sense_buf[2],srb->sense_buf[12],srb->sense_buf[13]);
diff --git a/cpu/arm926ejs/davinci/ether.c b/cpu/arm926ejs/davinci/ether.c
index d286ec0..5ae035b 100644
--- a/cpu/arm926ejs/davinci/ether.c
+++ b/cpu/arm926ejs/davinci/ether.c
@@ -357,6 +357,8 @@
 			phy.auto_negotiate = gen_auto_negotiate;
 	}
 
+	printf("Ethernet PHY: %s\n", phy.name);
+
 	return(1);
 }
 
diff --git a/cpu/i386/serial.c b/cpu/i386/serial.c
index baf35e5..8b5f8fa 100644
--- a/cpu/i386/serial.c
+++ b/cpu/i386/serial.c
@@ -413,8 +413,8 @@
 	 * Init onboard 16550 UART
 	 */
 	outb(0x80, UART1_BASE + UART_LCR);	/* set DLAB bit */
-	outb(bdiv & 0xff), UART1_BASE + UART_DLL);	/* set divisor for 9600 baud */
-	outb(bdiv >> 8), UART1_BASE + UART_DLM);	/* set divisor for 9600 baud */
+	outb((bdiv & 0xff), UART1_BASE + UART_DLL);	/* set divisor for 9600 baud */
+	outb((bdiv >> 8  ), UART1_BASE + UART_DLM);	/* set divisor for 9600 baud */
 	outb(0x03, UART1_BASE + UART_LCR);	/* line control 8 bits no parity */
 	outb(0x00, UART1_BASE + UART_FCR);	/* disable FIFO */
 	outb(0x00, UART1_BASE + UART_MCR);	/* no modem control DTR RTS */
diff --git a/cpu/ixp/npe/npe.c b/cpu/ixp/npe/npe.c
index a33b956..892096b 100644
--- a/cpu/ixp/npe/npe.c
+++ b/cpu/ixp/npe/npe.c
@@ -67,7 +67,7 @@
 		p = npe_alloc_free;
 		npe_alloc_free += size;
 	} else {
-		printf("%s: failed (count=%d, size=%d)!\n", count, size);
+		printf("npe_alloc: failed (count=%d, size=%d)!\n", count, size);
 	}
 	return p;
 }
diff --git a/cpu/mpc85xx/mp.c b/cpu/mpc85xx/mp.c
index a527cf3..554830f 100644
--- a/cpu/mpc85xx/mp.c
+++ b/cpu/mpc85xx/mp.c
@@ -50,12 +50,12 @@
 
 	if (nr == id) {
 		table = (u32 *)get_spin_addr();
-		printf("table base @ 0x%08x\n", table);
+		printf("table base @ 0x%p\n", table);
 	} else {
 		table = (u32 *)get_spin_addr() + nr * NUM_BOOT_ENTRY;
 		printf("Running on cpu %d\n", id);
 		printf("\n");
-		printf("table @ 0x%08x:\n", table);
+		printf("table @ 0x%p\n", table);
 		printf("   addr - 0x%08x\n", table[BOOT_ENTRY_ADDR_LOWER]);
 		printf("   pir  - 0x%08x\n", table[BOOT_ENTRY_PIR]);
 		printf("   r3   - 0x%08x\n", table[BOOT_ENTRY_R3_LOWER]);
diff --git a/cpu/mpc8xx/video.c b/cpu/mpc8xx/video.c
index 8bf8e46..ef91165 100644
--- a/cpu/mpc8xx/video.c
+++ b/cpu/mpc8xx/video.c
@@ -833,10 +833,10 @@
 
 		puts ("[VIDEO ENCODER] Configuring the encoder...\n");
 
-		printf ("Sending %d bytes (@ %08lX) to I2C 0x%X:\n   ",
+		printf ("Sending %zu bytes (@ %08lX) to I2C 0x%lX:\n   ",
 			sizeof(video_encoder_data),
 			(ulong)video_encoder_data,
-			VIDEO_I2C_ADDR);
+			(ulong)VIDEO_I2C_ADDR);
 		for (i=0; i<sizeof(video_encoder_data); ++i) {
 			printf(" %02X", video_encoder_data[i]);
 		}
diff --git a/cpu/ppc4xx/40x_spd_sdram.c b/cpu/ppc4xx/40x_spd_sdram.c
index 42fd7fb..b21b13e 100644
--- a/cpu/ppc4xx/40x_spd_sdram.c
+++ b/cpu/ppc4xx/40x_spd_sdram.c
@@ -126,9 +126,9 @@
 
 	int sdram0_pmit=0x07c00000;
 #ifndef CONFIG_405EP /* not on PPC405EP */
-	int sdram0_besr0=-1;
-	int sdram0_besr1=-1;
-	int sdram0_eccesr=-1;
+	int sdram0_besr0 = -1;
+	int sdram0_besr1 = -1;
+	int sdram0_eccesr = -1;
 #endif
 	int sdram0_ecccfg;
 
diff --git a/drivers/block/sym53c8xx.c b/drivers/block/sym53c8xx.c
index 87b63b7..b880435 100644
--- a/drivers/block/sym53c8xx.c
+++ b/drivers/block/sym53c8xx.c
@@ -784,7 +784,7 @@
 		pccb->msgout[0]=SCSI_IDENTIFY;
 		transbytes=pccb->trans_bytes;
 		tmpptr=pccb->pdata;
-		pccb->pdata=&pccb->sense_buf[0];
+		pccb->pdata = &pccb->sense_buf[0];
 		datalen=pccb->datalen;
 		pccb->datalen=14;
 		tmpstat=pccb->status;
diff --git a/drivers/input/pc_keyb.c b/drivers/input/pc_keyb.c
index 81d3e98..33e7c5f 100644
--- a/drivers/input/pc_keyb.c
+++ b/drivers/input/pc_keyb.c
@@ -64,7 +64,7 @@
 	int val;
 	unsigned char status;
 
-	val=-1;
+	val = -1;
 	status = kbd_read_status();
 	if (status & KBD_STAT_OBF) {
 		val = kbd_read_input();
diff --git a/drivers/pci/fsl_pci_init.c b/drivers/pci/fsl_pci_init.c
index 7dc33be..a7afa90 100644
--- a/drivers/pci/fsl_pci_init.c
+++ b/drivers/pci/fsl_pci_init.c
@@ -59,8 +59,8 @@
 	pci_dev_t dev = PCI_BDF(busno,0,0);
 
 	/* Initialize ATMU registers based on hose regions and flags */
-	volatile pot_t *po=&pci->pot[1];	/* skip 0 */
-	volatile pit_t *pi=&pci->pit[0];	/* ranges from: 3 to 1 */
+	volatile pot_t *po = &pci->pot[1];	/* skip 0 */
+	volatile pit_t *pi = &pci->pit[0];	/* ranges from: 3 to 1 */
 
 #ifdef DEBUG
 	int neg_link_w;
diff --git a/drivers/serial/usbtty.c b/drivers/serial/usbtty.c
index cc2bdac..2bc5c3c 100644
--- a/drivers/serial/usbtty.c
+++ b/drivers/serial/usbtty.c
@@ -529,8 +529,8 @@
 	}
 	snlen = strlen(sn);
 	if (snlen > sizeof(serial_number) - 1) {
-		printf ("Warning: serial number %s is too long (%d > %d)\n",
-			sn, snlen, sizeof(serial_number) - 1);
+		printf ("Warning: serial number %s is too long (%d > %lu)\n",
+			sn, snlen, (ulong)(sizeof(serial_number) - 1));
 		snlen = sizeof(serial_number) - 1;
 	}
 	memcpy (serial_number, sn, snlen);
diff --git a/fs/jffs2/jffs2_1pass.c b/fs/jffs2/jffs2_1pass.c
index 5c1d265..8a06777 100644
--- a/fs/jffs2/jffs2_1pass.c
+++ b/fs/jffs2/jffs2_1pass.c
@@ -1213,16 +1213,18 @@
 			} else if (node->nodetype == JFFS2_NODETYPE_CLEANMARKER) {
 				if (node->totlen != sizeof(struct jffs2_unknown_node))
 					printf("OOPS Cleanmarker has bad size "
-						"%d != %u\n", node->totlen,
+						"%d != %zu\n",
+						node->totlen,
 						sizeof(struct jffs2_unknown_node));
 			} else if (node->nodetype == JFFS2_NODETYPE_PADDING) {
 				if (node->totlen < sizeof(struct jffs2_unknown_node))
 					printf("OOPS Padding has bad size "
-						"%d < %u\n", node->totlen,
+						"%d < %zu\n",
+						node->totlen,
 						sizeof(struct jffs2_unknown_node));
 			} else {
-				printf("Unknown node type: %x len %d "
-					"offset 0x%x\n", node->nodetype,
+				printf("Unknown node type: %x len %d offset 0x%x\n",
+					node->nodetype,
 					node->totlen, offset);
 			}
 			offset += ((node->totlen + 3) & ~3);
diff --git a/fs/jffs2/jffs2_nand_1pass.c b/fs/jffs2/jffs2_nand_1pass.c
index d95f551..3ce9c98 100644
--- a/fs/jffs2/jffs2_nand_1pass.c
+++ b/fs/jffs2/jffs2_nand_1pass.c
@@ -864,16 +864,18 @@
 			} else if (node->nodetype == JFFS2_NODETYPE_CLEANMARKER) {
 				if (node->totlen != sizeof(struct jffs2_unknown_node))
 					printf("OOPS Cleanmarker has bad size "
-						"%d != %d\n", node->totlen,
+						"%d != %zu\n",
+						node->totlen,
 						sizeof(struct jffs2_unknown_node));
 			} else if (node->nodetype == JFFS2_NODETYPE_PADDING) {
 				if (node->totlen < sizeof(struct jffs2_unknown_node))
 					printf("OOPS Padding has bad size "
-						"%d < %d\n", node->totlen,
+						"%d < %zu\n",
+						node->totlen,
 						sizeof(struct jffs2_unknown_node));
 			} else {
-				printf("Unknown node type: %x len %d "
-					"offset 0x%x\n", node->nodetype,
+				printf("Unknown node type: %x len %d offset 0x%x\n",
+					node->nodetype,
 					node->totlen, offset);
 			}
 			offset += ((node->totlen + 3) & ~3);
diff --git a/include/configs/pxa255_idp.h b/include/configs/pxa255_idp.h
index b7ea1a9..a2f3650 100644
--- a/include/configs/pxa255_idp.h
+++ b/include/configs/pxa255_idp.h
@@ -126,7 +126,10 @@
 #define CONFIG_BOOTDELAY	3
 #define CONFIG_BOOTCOMMAND	"bootm 40000"
 #define CONFIG_BOOTARGS		"root=/dev/mtdblock2 rootfstype=cramfs console=ttyS0,115200"
-#define CONFIG_CMDLINE_TAG
+
+#define CONFIG_CMDLINE_TAG		1	/* enable passing of ATAGs */
+#define CONFIG_SETUP_MEMORY_TAGS	1
+/* #define CONFIG_INITRD_TAG		1 */
 
 /*
  * Current memory map for Vibren supplied Linux images:
@@ -208,10 +211,6 @@
 /*			"protect off"	*/
 
 
-#define CONFIG_CMDLINE_TAG		1	/* enable passing of ATAGs */
-#define CONFIG_SETUP_MEMORY_TAGS	1
-/* #define CONFIG_INITRD_TAG		1 */
-
 #if defined(CONFIG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE	115200		/* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX	2		/* which serial port to use */
diff --git a/lib_generic/vsprintf.c b/lib_generic/vsprintf.c
index 3db6c3f..7c9cfe1 100644
--- a/lib_generic/vsprintf.c
+++ b/lib_generic/vsprintf.c
@@ -262,7 +262,9 @@
 
 		/* get the conversion qualifier */
 		qualifier = -1;
-		if (*fmt == 'h' || *fmt == 'l' || *fmt == 'q') {
+		if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' ||
+		    *fmt == 'Z' || *fmt == 'z' || *fmt == 't' ||
+		    *fmt == 'q' ) {
 			qualifier = *fmt;
 			if (qualifier == 'l' && *(fmt+1) == 'l') {
 				qualifier = 'q';
@@ -355,9 +357,13 @@
 			num = va_arg(args, unsigned long long);
 		else
 #endif
-		if (qualifier == 'l')
+		if (qualifier == 'l') {
 			num = va_arg(args, unsigned long);
-		else if (qualifier == 'h') {
+		} else if (qualifier == 'Z' || qualifier == 'z') {
+			num = va_arg(args, size_t);
+		} else if (qualifier == 't') {
+			num = va_arg(args, ptrdiff_t);
+		} else if (qualifier == 'h') {
 			num = (unsigned short) va_arg(args, int);
 			if (flags & SIGN)
 				num = (short) num;
diff --git a/lib_m68k/board.c b/lib_m68k/board.c
index d27c89c..a13ea26 100644
--- a/lib_m68k/board.c
+++ b/lib_m68k/board.c
@@ -347,11 +347,11 @@
 	addr_sp -= sizeof (bd_t);
 	bd = (bd_t *) addr_sp;
 	gd->bd = bd;
-	debug ("Reserving %d Bytes for Board Info at: %08lx\n",
+	debug ("Reserving %zu Bytes for Board Info at: %08lx\n",
 			sizeof (bd_t), addr_sp);
 	addr_sp -= sizeof (gd_t);
 	id = (gd_t *) addr_sp;
-	debug ("Reserving %d Bytes for Global Data at: %08lx\n",
+	debug ("Reserving %zu Bytes for Global Data at: %08lx\n",
 			sizeof (gd_t), addr_sp);
 
 	/* Reserve memory for boot params. */
diff --git a/lib_mips/board.c b/lib_mips/board.c
index 532550b..09b8b3b 100644
--- a/lib_mips/board.c
+++ b/lib_mips/board.c
@@ -242,12 +242,12 @@
 	addr_sp -= sizeof(bd_t);
 	bd = (bd_t *)addr_sp;
 	gd->bd = bd;
-	debug ("Reserving %d Bytes for Board Info at: %08lx\n",
+	debug ("Reserving %zu Bytes for Board Info at: %08lx\n",
 			sizeof(bd_t), addr_sp);
 
 	addr_sp -= sizeof(gd_t);
 	id = (gd_t *)addr_sp;
-	debug ("Reserving %d Bytes for Global Data at: %08lx\n",
+	debug ("Reserving %zu Bytes for Global Data at: %08lx\n",
 			sizeof (gd_t), addr_sp);
 
 	/* Reserve memory for boot params.
diff --git a/lib_mips/bootm.c b/lib_mips/bootm.c
index 8fe3782..5c46a5a 100644
--- a/lib_mips/bootm.c
+++ b/lib_mips/bootm.c
@@ -54,7 +54,7 @@
 	char	*commandline = getenv ("bootargs");
 	char	env_buf[12];
 	int	ret;
-	const char *cp;
+	char	*cp;
 
 	/* find kernel entry point */
 	if (images->legacy_hdr_valid) {
@@ -89,15 +89,11 @@
 	linux_params_init (UNCACHED_SDRAM (gd->bd->bi_boot_params), commandline);
 
 #ifdef CONFIG_MEMSIZE_IN_BYTES
-	sprintf (env_buf, "%lu", gd->ram_size);
-#ifdef DEBUG
-	printf ("## Giving linux memsize in bytes, %lu\n", gd->ram_size);
-#endif
+	sprintf (env_buf, "%lu", (ulong)gd->ram_size);
+	debug ("## Giving linux memsize in bytes, %lu\n", (ulong)gd->ram_size);
 #else
-	sprintf (env_buf, "%lu", gd->ram_size >> 20);
-#ifdef DEBUG
-	printf ("## Giving linux memsize in MB, %lu\n", gd->ram_size >> 20);
-#endif
+	sprintf (env_buf, "%lu", (ulong)(gd->ram_size >> 20));
+	debug ("## Giving linux memsize in MB, %lu\n", (ulong)(gd->ram_size >> 20));
 #endif /* CONFIG_MEMSIZE_IN_BYTES */
 
 	linux_env_set ("memsize", env_buf);
diff --git a/lib_ppc/board.c b/lib_ppc/board.c
index 1bc2f46..71a70db 100644
--- a/lib_ppc/board.c
+++ b/lib_ppc/board.c
@@ -524,11 +524,11 @@
 	addr_sp -= sizeof (bd_t);
 	bd = (bd_t *) addr_sp;
 	gd->bd = bd;
-	debug ("Reserving %d Bytes for Board Info at: %08lx\n",
+	debug ("Reserving %zu Bytes for Board Info at: %08lx\n",
 			sizeof (bd_t), addr_sp);
 	addr_sp -= sizeof (gd_t);
 	id = (gd_t *) addr_sp;
-	debug ("Reserving %d Bytes for Global Data at: %08lx\n",
+	debug ("Reserving %zu Bytes for Global Data at: %08lx\n",
 			sizeof (gd_t), addr_sp);
 
 	/*
diff --git a/net/bootp.c b/net/bootp.c
index 3c0614c..f48744a 100644
--- a/net/bootp.c
+++ b/net/bootp.c
@@ -313,7 +313,7 @@
 	Bootp_t *bp;
 	char	*s;
 
-	debug ("got BOOTP packet (src=%d, dst=%d, len=%d want_len=%d)\n",
+	debug ("got BOOTP packet (src=%d, dst=%d, len=%d want_len=%zu)\n",
 		src, dest, len, sizeof (Bootp_t));
 
 	bp = (Bootp_t *)pkt;
diff --git a/net/eth.c b/net/eth.c
index 7fc9aee..38979aa 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -627,7 +627,7 @@
 #if defined(CONFIG_MCF52x2)
 	mcf52x2_miiphy_initialize(bis);
 #endif
-#if defined(CONFIG_NETARM)
+#if defined(CONFIG_DRIVER_NS7520_ETHERNET)
 	ns7520_miiphy_initialize(bis);
 #endif
 #if defined(CONFIG_DRIVER_TI_EMAC)
diff --git a/net/net.c b/net/net.c
index c96f566..313d5d8 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1390,7 +1390,7 @@
 		puts ("Got IP\n");
 #endif
 		if (len < IP_HDR_SIZE) {
-			debug ("len bad %d < %ld\n", len, IP_HDR_SIZE);
+			debug ("len bad %d < %lu\n", len, (ulong)IP_HDR_SIZE);
 			return;
 		}
 		if (len < ntohs(ip->ip_len)) {
diff --git a/tools/updater/cmd_flash.c b/tools/updater/cmd_flash.c
index a976e0d..0f6f62b 100644
--- a/tools/updater/cmd_flash.c
+++ b/tools/updater/cmd_flash.c
@@ -187,7 +187,7 @@
 
 	erased = 0;
 
-	for (bank=0,info=&flash_info[0]; bank < CFG_MAX_FLASH_BANKS; ++bank, ++info) {
+	for (bank=0,info = &flash_info[0]; bank < CFG_MAX_FLASH_BANKS; ++bank, ++info) {
 		ulong b_end;
 		int sect;
 
@@ -366,7 +366,7 @@
 
 	protected = 0;
 
-	for (bank=0,info=&flash_info[0]; bank < CFG_MAX_FLASH_BANKS; ++bank, ++info) {
+	for (bank=0,info = &flash_info[0]; bank < CFG_MAX_FLASH_BANKS; ++bank, ++info) {
 		ulong b_end;
 		int sect;
 
diff --git a/tools/updater/flash.c b/tools/updater/flash.c
index 1ed77b1..a73159f 100644
--- a/tools/updater/flash.c
+++ b/tools/updater/flash.c
@@ -93,7 +93,7 @@
 	flash_info_t *info;
 	int i;
 
-	for (i=0, info=&flash_info[0]; i<CFG_MAX_FLASH_BANKS; ++i, ++info) {
+	for (i=0, info = &flash_info[0]; i<CFG_MAX_FLASH_BANKS; ++i, ++info) {
 		if (info->flash_id != FLASH_UNKNOWN &&
 		    addr >= info->start[0] &&
 		    /* WARNING - The '- 1' is needed if the flash