[PATCH] misc vme8349 fixes
Kim Phillips
kim.phillips at freescale.com
Wed Dec 23 02:24:13 CET 2009
changed to use mkconfig -t option instead, plus misc codingstyle fixes.
Signed-off-by: Kim Phillips <kim.phillips at freescale.com>
---
Makefile | 7 +------
board/esd/vme8349/vme8349.c | 23 +++++++++--------------
include/configs/vme8349.h | 14 ++++++++++----
3 files changed, 20 insertions(+), 24 deletions(-)
diff --git a/Makefile b/Makefile
index b91026a..1abe64a 100644
--- a/Makefile
+++ b/Makefile
@@ -2402,12 +2402,7 @@ TQM834x_config: unconfig
caddy2_config \
vme8349_config: unconfig
- @mkdir -p $(obj)include
- @if [ "$(findstring caddy2,$@)" ] ; then \
- $(XECHO) -n "...for VME-Caddy/2..." ; \
- echo "#define VME_CADDY2" >> $(obj)include/config.h ; \
- fi ;
- @$(MKCONFIG) -a vme8349 ppc mpc83xx vme8349 esd
+ @$(MKCONFIG) -t $(@:_config=) vme8349 ppc mpc83xx vme8349 esd
#########################################################################
## MPC85xx Systems
diff --git a/board/esd/vme8349/vme8349.c b/board/esd/vme8349/vme8349.c
index c31761d..b0ebad7 100644
--- a/board/esd/vme8349/vme8349.c
+++ b/board/esd/vme8349/vme8349.c
@@ -86,7 +86,7 @@ int checkboard(void)
#ifdef VME_CADDY2
int board_eth_init(bd_t *bis)
{
- return pci_eth_init(bis);
+ return pci_eth_init(bis);
}
#endif
@@ -101,7 +101,7 @@ void ft_board_setup(void *blob, bd_t *bd)
}
#endif
-int misc_init_r ()
+int misc_init_r()
{
immap_t *im = (immap_t *)CONFIG_SYS_IMMR;
@@ -122,7 +122,7 @@ int misc_init_r ()
#define LARGE_RAM 0xff
#endif
-#define SPD_VAL(a, b) ((a) & SMALL_RAM) | ((b) & LARGE_RAM)
+#define SPD_VAL(a, b) (((a) & SMALL_RAM) | ((b) & LARGE_RAM))
static spd_eeprom_t default_spd_eeprom = {
SPD_VAL(0x80, 0x80), /* 00 use 128 Bytes */
@@ -186,37 +186,32 @@ static spd_eeprom_t default_spd_eeprom = {
int vme8349_read_spd(uchar chip, uint addr, int alen, uchar *buffer, int len)
{
- int old_bus;
- int valid;
+ int old_bus = I2C_GET_BUS();
unsigned int l, sum;
+ int valid = 0;
- valid = 0;
- old_bus = I2C_GET_BUS();
I2C_SET_BUS(0);
- if (i2c_read(chip, addr, alen, buffer, len) == 0) {
+ if (i2c_read(chip, addr, alen, buffer, len) == 0)
if (memcmp(&buffer[64], &default_spd_eeprom.mid[0], 8) == 0) {
sum = 0;
for (l = 0; l < 63; l++)
sum = (sum + buffer[l]) & 0xff;
- if (sum == buffer[63]) {
+ if (sum == buffer[63])
valid = 1;
- } else {
+ else
printf("Invalid checksum in EEPROM %02x %02x\n",
sum, buffer[63]);
- }
}
- }
if (valid == 0) {
memcpy(buffer, (void *)&default_spd_eeprom, len);
sum = 0;
for (l = 0; l < 63; l++)
sum = (sum + buffer[l]) & 0xff;
- if (sum != buffer[63]) {
+ if (sum != buffer[63])
printf("Invalid checksum in FLASH %02x %02x\n",
sum, buffer[63]);
- }
buffer[63] = sum;
}
diff --git a/include/configs/vme8349.h b/include/configs/vme8349.h
index 7de5f65..dbc15b2 100644
--- a/include/configs/vme8349.h
+++ b/include/configs/vme8349.h
@@ -35,6 +35,13 @@
#define __CONFIG_H
/*
+ * Top level Makefile configuration choices
+ */
+#ifdef CONFIG_MK_caddy2
+#define VME_CADDY2
+#endif
+
+/*
* High Level Configuration Options
*/
#define CONFIG_E300 1 /* E300 Family */
@@ -147,7 +154,7 @@
#if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE)
#define CONFIG_SYS_RAMBOOT
#else
-#undef CONFIG_SYS_RAMBOOT
+#undef CONFIG_SYS_RAMBOOT
#endif
#define CONFIG_SYS_INIT_RAM_LOCK 1
@@ -257,11 +264,10 @@
#undef PCI_ONE_PCI1
#endif
-#ifndef VME_CADDY2
+#ifndef VME_CADDY2
#define CONFIG_NET_MULTI
#endif
#define CONFIG_PCI_PNP /* do pci plug-and-play */
-#define CONFIG_83XX_GENERIC_PCI
#undef CONFIG_EEPRO100
#undef CONFIG_TULIP
@@ -280,7 +286,7 @@
/*
* TSEC configuration
*/
-#ifdef VME_CADDY2
+#ifdef VME_CADDY2
#define CONFIG_E1000
#else
#define CONFIG_TSEC_ENET /* TSEC ethernet support */
--
1.6.6
More information about the U-Boot
mailing list