summaryrefslogtreecommitdiff
path: root/board/oxc
diff options
context:
space:
mode:
Diffstat (limited to 'board/oxc')
-rw-r--r--board/oxc/flash.c26
-rw-r--r--board/oxc/oxc.c36
2 files changed, 34 insertions, 28 deletions
diff --git a/board/oxc/flash.c b/board/oxc/flash.c
index 296c01d..36e0fca 100644
--- a/board/oxc/flash.c
+++ b/board/oxc/flash.c
@@ -31,7 +31,7 @@
#include <common.h>
#include <mpc8xx.h>
-flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
+flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS]; /* info for FLASH chips */
/*-----------------------------------------------------------------------
* Functions
@@ -49,7 +49,7 @@ unsigned long flash_init (void)
int i;
/* Init: no FLASHes known */
- for (i=0; i<CFG_MAX_FLASH_BANKS; ++i) {
+ for (i=0; i<CONFIG_SYS_MAX_FLASH_BANKS; ++i) {
flash_info[i].flash_id = FLASH_UNKNOWN;
}
@@ -59,27 +59,27 @@ unsigned long flash_init (void)
* and the size of flash using 0xFF800000 as the base address,
* and then call flash_get_size() again to fill flash_info.
*/
- size = flash_get_size((vu_char *)CFG_FLASH_PRELIMBASE, &flash_info[0]);
+ size = flash_get_size((vu_char *)CONFIG_SYS_FLASH_PRELIMBASE, &flash_info[0]);
if (size)
{
flash_get_size((vu_char *)(-size), &flash_info[0]);
}
-#if (CFG_MONITOR_BASE >= CFG_FLASH_PRELIMBASE)
+#if (CONFIG_SYS_MONITOR_BASE >= CONFIG_SYS_FLASH_PRELIMBASE)
/* monitor protection ON by default */
flash_protect(FLAG_PROTECT_SET,
- CFG_MONITOR_BASE,
- CFG_MONITOR_BASE+monitor_flash_len-1,
+ CONFIG_SYS_MONITOR_BASE,
+ CONFIG_SYS_MONITOR_BASE+monitor_flash_len-1,
&flash_info[0]);
#endif
-#if (CFG_ENV_IS_IN_FLASH == 1) && defined(CFG_ENV_ADDR)
-# ifndef CFG_ENV_SIZE
-# define CFG_ENV_SIZE CFG_ENV_SECT_SIZE
+#if defined(CONFIG_ENV_IS_IN_FLASH) && defined(CONFIG_ENV_ADDR)
+# ifndef CONFIG_ENV_SIZE
+# define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE
# endif
flash_protect(FLAG_PROTECT_SET,
- CFG_ENV_ADDR,
- CFG_ENV_ADDR + CFG_ENV_SIZE - 1,
+ CONFIG_ENV_ADDR,
+ CONFIG_ENV_ADDR + CONFIG_ENV_SIZE - 1,
&flash_info[0]);
#endif
@@ -286,7 +286,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
last = start;
addr = (vu_char *)(info->start[l_sect]);
while ((addr[0] & 0x80) != 0x80) {
- if ((now = get_timer(start)) > CFG_FLASH_ERASE_TOUT) {
+ if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -361,7 +361,7 @@ static int write_byte (flash_info_t *info, ulong dest, uchar data)
/* data polling for D7 */
start = get_timer (0);
while ((*((vu_char *)dest) & 0x80) != (data & 0x80)) {
- if (get_timer(start) > CFG_FLASH_WRITE_TOUT) {
+ if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/oxc/oxc.c b/board/oxc/oxc.c
index b61d399..1a2bdf4 100644
--- a/board/oxc/oxc.c
+++ b/board/oxc/oxc.c
@@ -25,6 +25,7 @@
#include <mpc824x.h>
#include <pci.h>
#include <i2c.h>
+#include <netdev.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -36,13 +37,13 @@ int checkboard (void)
phys_size_t initdram (int board_type)
{
-#ifndef CFG_RAMBOOT
+#ifndef CONFIG_SYS_RAMBOOT
long size;
long new_bank0_end;
long mear1;
long emear1;
- size = get_ram_size(CFG_SDRAM_BASE, CFG_MAX_RAM_SIZE);
+ size = get_ram_size(CONFIG_SYS_SDRAM_BASE, CONFIG_SYS_MAX_RAM_SIZE);
new_bank0_end = size - 1;
mear1 = mpc824x_mpc107_getreg(MEAR1);
@@ -91,14 +92,14 @@ void pci_init_board (void)
int board_early_init_f (void)
{
- *(volatile unsigned char *)(CFG_CPLD_RESET) = 0x89;
+ *(volatile unsigned char *)(CONFIG_SYS_CPLD_RESET) = 0x89;
return 0;
}
#ifdef CONFIG_WATCHDOG
void oxc_wdt_reset(void)
{
- *(volatile unsigned char *)(CFG_CPLD_WATCHDOG) = 0xff;
+ *(volatile unsigned char *)(CONFIG_SYS_CPLD_WATCHDOG) = 0xff;
}
void watchdog_reset(void)
@@ -134,7 +135,7 @@ void oxc_toggle_activeled(void)
void board_show_activity (ulong timestamp)
{
- if ((timestamp % (CFG_HZ / 10)) == 0)
+ if ((timestamp % (CONFIG_SYS_HZ / 10)) == 0)
oxc_toggle_activeled ();
}
@@ -147,9 +148,9 @@ void show_activity(int arg)
if ((ledtoggle > (2 * arg)) && ledstatus) {
led ^= 0x80;
- oxc_get_expander(CFG_I2C_EXPANDER0_ADDR, &val);
+ oxc_get_expander(CONFIG_SYS_I2C_EXPANDER0_ADDR, &val);
udelay(200);
- oxc_set_expander(CFG_I2C_EXPANDER0_ADDR, (val & 0x7F) | led);
+ oxc_set_expander(CONFIG_SYS_I2C_EXPANDER0_ADDR, (val & 0x7F) | led);
ledtoggle = 0;
}
}
@@ -164,13 +165,13 @@ void show_boot_progress(int arg)
if (arg > 0 && ledstatus) {
ledstatus = 0;
- oxc_get_expander(CFG_I2C_EXPANDER0_ADDR, &val);
+ oxc_get_expander(CONFIG_SYS_I2C_EXPANDER0_ADDR, &val);
udelay(200);
- oxc_set_expander(CFG_I2C_EXPANDER0_ADDR, val | 0x80);
+ oxc_set_expander(CONFIG_SYS_I2C_EXPANDER0_ADDR, val | 0x80);
} else if (arg < 0) {
- oxc_get_expander(CFG_I2C_EXPANDER0_ADDR, &val);
+ oxc_get_expander(CONFIG_SYS_I2C_EXPANDER0_ADDR, &val);
udelay(200);
- oxc_set_expander(CFG_I2C_EXPANDER0_ADDR, val & 0x7F);
+ oxc_set_expander(CONFIG_SYS_I2C_EXPANDER0_ADDR, val & 0x7F);
ledstatus = 1;
}
}
@@ -179,21 +180,21 @@ void show_boot_progress(int arg)
int misc_init_r (void)
{
/* check whether the i2c expander #0 is accessible */
- if (!oxc_set_expander(CFG_I2C_EXPANDER0_ADDR, 0x7F)) {
+ if (!oxc_set_expander(CONFIG_SYS_I2C_EXPANDER0_ADDR, 0x7F)) {
udelay(200);
expander0alive = 1;
}
-#ifdef CFG_OXC_GENERATE_IP
+#ifdef CONFIG_SYS_OXC_GENERATE_IP
{
char str[32];
- unsigned long ip = CFG_OXC_IPMASK;
+ unsigned long ip = CONFIG_SYS_OXC_IPMASK;
bd_t *bd = gd->bd;
if (expander0alive) {
unsigned char val;
- if (!oxc_get_expander(CFG_I2C_EXPANDER0_ADDR, &val)) {
+ if (!oxc_get_expander(CONFIG_SYS_I2C_EXPANDER0_ADDR, &val)) {
ip = (ip & 0xffffff00) | ((val & 0x7c) >> 2);
}
}
@@ -215,3 +216,8 @@ int misc_init_r (void)
#endif
return (0);
}
+
+int board_eth_init(bd_t *bis)
+{
+ return pci_eth_init(bis);
+}