X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=board%2Fw7o%2Fw7o.c;h=22cdfcd7d756b5c553fa158c23430a5ec0c4eac7;hb=5ba1ef507402bc5e344dc374203792a40f222e8a;hp=924a449eb8866f7da3a7305607e07f8f5817608f;hpb=c83bf6a2d00ef846c1fb2b0c60540f03ef203125;p=u-boot diff --git a/board/w7o/w7o.c b/board/w7o/w7o.c index 924a449eb8..22cdfcd7d7 100644 --- a/board/w7o/w7o.c +++ b/board/w7o/w7o.c @@ -31,6 +31,7 @@ #include unsigned long get_dram_size (void); +void sdram_init(void); /* * Macros to transform values @@ -41,15 +42,15 @@ unsigned long get_dram_size (void); /* ------------------------------------------------------------------------- */ -int board_pre_init (void) +int board_early_init_f (void) { #if defined(CONFIG_W7OLMG) /* * Setup GPIO pins - reset devices. */ - out32 (IBM405GP_GPIO0_ODR, 0x10000000); /* one open drain pin */ - out32 (IBM405GP_GPIO0_OR, 0x3E000000); /* set output pins to default */ - out32 (IBM405GP_GPIO0_TCR, 0x7f800000); /* setup for output */ + out32 (PPC405GP_GPIO0_ODR, 0x10000000); /* one open drain pin */ + out32 (PPC405GP_GPIO0_OR, 0x3E000000); /* set output pins to default */ + out32 (PPC405GP_GPIO0_TCR, 0x7f800000); /* setup for output */ /* * IRQ 0-15 405GP internally generated; active high; level sensitive @@ -78,9 +79,9 @@ int board_pre_init (void) /* * Setup GPIO pins */ - out32 (IBM405GP_GPIO0_ODR, 0x01800000); /* XCV Done Open Drain */ - out32 (IBM405GP_GPIO0_OR, 0x03800000); /* set out pins to default */ - out32 (IBM405GP_GPIO0_TCR, 0x66C00000); /* setup for output */ + out32 (PPC405GP_GPIO0_ODR, 0x01800000); /* XCV Done Open Drain */ + out32 (PPC405GP_GPIO0_OR, 0x03800000); /* set out pins to default */ + out32 (PPC405GP_GPIO0_TCR, 0x66C00000); /* setup for output */ /* * IRQ 0-15 405GP internally generated; active high; level sensitive @@ -131,7 +132,7 @@ int checkboard (void) puts ("Board: "); /* VPD data present in I2C EEPROM */ - if (vpd_get_data (CFG_DEF_EEPROM_ADDR, &vpd) == 0) { + if (vpd_get_data (CONFIG_SYS_DEF_EEPROM_ADDR, &vpd) == 0) { /* * Known board type. */ @@ -151,8 +152,15 @@ int checkboard (void) /* ------------------------------------------------------------------------- */ -long int initdram (int board_type) +phys_size_t initdram (int board_type) { + /* + * ToDo: Move the asm init routine sdram_init() to this C file, + * or even better use some common ppc4xx code available + * in cpu/ppc4xx + */ + sdram_init(); + return get_dram_size (); } @@ -196,7 +204,7 @@ static void w7o_env_init (VPD * vpd) /* * Read VPD */ - if (vpd_get_data (CFG_DEF_EEPROM_ADDR, vpd) != 0) + if (vpd_get_data (CONFIG_SYS_DEF_EEPROM_ADDR, vpd) != 0) return; /* @@ -207,8 +215,8 @@ static void w7o_env_init (VPD * vpd) (strncmp (vpd->productId, "CMM", 3) == 0))) { char buf[30]; char *eth; - unsigned char *serial = getenv ("serial#"); - unsigned char *ethaddr = getenv ("ethaddr"); + char *serial = getenv ("serial#"); + char *ethaddr = getenv ("ethaddr"); /* Set 'serial#' envvar if serial# isn't set */ if (!serial) { @@ -218,7 +226,7 @@ static void w7o_env_init (VPD * vpd) } /* Set 'ethaddr' envvar if 'ethaddr' envvar is the default */ - eth = vpd->ethAddrs[0]; + eth = (char *)(vpd->ethAddrs[0]); if (ethaddr && (strcmp (ethaddr, MK_STR (CONFIG_ETHADDR)) == 0)) { /* Now setup ethaddr */ @@ -238,14 +246,14 @@ int misc_init_r (void) #if defined(CONFIG_W7OLMG) unsigned long greg; /* GPIO Register */ - greg = in32 (IBM405GP_GPIO0_OR); + greg = in32 (PPC405GP_GPIO0_OR); /* * XXX - Unreset devices - this should be moved into VxWorks driver code */ greg |= 0x41800000L; /* SAM, PHY, Galileo */ - out32 (IBM405GP_GPIO0_OR, greg); /* set output pins to default */ + out32 (PPC405GP_GPIO0_OR, greg); /* set output pins to default */ #endif /* CONFIG_W7OLMG */ /*