summaryrefslogtreecommitdiff
path: root/board/zeus/zeus.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/zeus/zeus.c')
-rw-r--r--board/zeus/zeus.c79
1 files changed, 28 insertions, 51 deletions
diff --git a/board/zeus/zeus.c b/board/zeus/zeus.c
index 33d971a..974bdf2 100644
--- a/board/zeus/zeus.c
+++ b/board/zeus/zeus.c
@@ -38,7 +38,7 @@ DECLARE_GLOBAL_DATA_PTR;
#define REBOOT_NOP 0x00000000
#define REBOOT_DO_POST 0x00000001
-extern flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
+extern flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS]; /* info for FLASH chips */
extern env_t *env_ptr;
extern uchar default_environment[];
@@ -73,8 +73,8 @@ int misc_init_r(void)
u32 post_magic;
u32 post_val;
- post_magic = in_be32((void *)CFG_POST_MAGIC);
- post_val = in_be32((void *)CFG_POST_VAL);
+ post_magic = in_be32((void *)CONFIG_SYS_POST_MAGIC);
+ post_val = in_be32((void *)CONFIG_SYS_POST_VAL);
if ((post_magic == REBOOT_MAGIC) && (post_val == REBOOT_DO_POST)) {
/*
* Set special bootline bootparameter to pass this POST boot
@@ -87,7 +87,7 @@ int misc_init_r(void)
* via the sw-reset button. So disable further tests
* upon next bootup here.
*/
- out_be32((void *)CFG_POST_VAL, REBOOT_NOP);
+ out_be32((void *)CONFIG_SYS_POST_VAL, REBOOT_NOP);
} else {
/*
* Only run POST when initiated via the sw-reset button mechanism
@@ -144,14 +144,14 @@ int misc_init_r(void)
/* Monitor protection ON by default */
(void)flash_protect(FLAG_PROTECT_SET,
- -CFG_MONITOR_LEN,
+ -CONFIG_SYS_MONITOR_LEN,
0xffffffff,
&flash_info[0]);
/* Env protection ON by default */
(void)flash_protect(FLAG_PROTECT_SET,
- CFG_ENV_ADDR_REDUND,
- CFG_ENV_ADDR_REDUND + 2*CFG_ENV_SECT_SIZE - 1,
+ CONFIG_ENV_ADDR_REDUND,
+ CONFIG_ENV_ADDR_REDUND + 2*CONFIG_ENV_SECT_SIZE - 1,
&flash_info[0]);
return 0;
@@ -166,7 +166,7 @@ int checkboard(void)
puts("Board: Zeus-");
- if (in_be32((void *)GPIO0_IR) & GPIO_VAL(CFG_GPIO_ZEUS_PE))
+ if (in_be32((void *)GPIO0_IR) & GPIO_VAL(CONFIG_SYS_GPIO_ZEUS_PE))
puts("PE");
else
puts("CE");
@@ -180,39 +180,16 @@ int checkboard(void)
putc('\n');
/* both LED's off */
- gpio_write_bit(CFG_GPIO_LED_RED, 0);
- gpio_write_bit(CFG_GPIO_LED_GREEN, 0);
+ gpio_write_bit(CONFIG_SYS_GPIO_LED_RED, 0);
+ gpio_write_bit(CONFIG_SYS_GPIO_LED_GREEN, 0);
udelay(10000);
/* and on again */
- gpio_write_bit(CFG_GPIO_LED_RED, 1);
- gpio_write_bit(CFG_GPIO_LED_GREEN, 1);
+ gpio_write_bit(CONFIG_SYS_GPIO_LED_RED, 1);
+ gpio_write_bit(CONFIG_SYS_GPIO_LED_GREEN, 1);
return (0);
}
-static u32 detect_sdram_size(void)
-{
- u32 val;
- u32 size;
-
- mfsdram(mem_mb0cf, val);
- size = (4 << 20) << ((val & 0x000e0000) >> 17);
-
- /*
- * Check if 2nd bank is enabled too
- */
- mfsdram(mem_mb1cf, val);
- if (val & 1)
- size += (4 << 20) << ((val & 0x000e0000) >> 17);
-
- return size;
-}
-
-phys_size_t initdram (int board_type)
-{
- return detect_sdram_size();
-}
-
static int default_env_var(char *buf, char *var)
{
char *ptr;
@@ -249,12 +226,12 @@ static int restore_default(void)
* Unprotect and erase environment area
*/
flash_protect(FLAG_PROTECT_CLEAR,
- CFG_ENV_ADDR_REDUND,
- CFG_ENV_ADDR_REDUND + 2*CFG_ENV_SECT_SIZE - 1,
+ CONFIG_ENV_ADDR_REDUND,
+ CONFIG_ENV_ADDR_REDUND + 2*CONFIG_ENV_SECT_SIZE - 1,
&flash_info[0]);
- flash_sect_erase(CFG_ENV_ADDR_REDUND,
- CFG_ENV_ADDR_REDUND + 2*CFG_ENV_SECT_SIZE - 1);
+ flash_sect_erase(CONFIG_ENV_ADDR_REDUND,
+ CONFIG_ENV_ADDR_REDUND + 2*CONFIG_ENV_SECT_SIZE - 1);
/*
* Now restore default environment from U-Boot image
@@ -262,7 +239,7 @@ static int restore_default(void)
*/
memset(env_ptr, 0, sizeof(env_t));
memcpy(env_ptr->data, default_environment, ENV_SIZE);
-#ifdef CFG_REDUNDAND_ENVIRONMENT
+#ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT
env_ptr->flags = 0xFF;
#endif
env_crc_update();
@@ -356,7 +333,7 @@ U_BOOT_CMD(
static inline int sw_reset_pressed(void)
{
- return !(in_be32((void *)GPIO0_IR) & GPIO_VAL(CFG_GPIO_SW_RESET));
+ return !(in_be32((void *)GPIO0_IR) & GPIO_VAL(CONFIG_SYS_GPIO_SW_RESET));
}
int do_chkreset(cmd_tbl_t* cmdtp, int flag, int argc, char* argv[])
@@ -379,16 +356,16 @@ int do_chkreset(cmd_tbl_t* cmdtp, int flag, int argc, char* argv[])
if (!sw_reset_pressed())
break;
- if ((delta > CFG_TIME_POST) && !post) {
+ if ((delta > CONFIG_SYS_TIME_POST) && !post) {
printf("\nWhen released now, POST tests will be started.");
- gpio_write_bit(CFG_GPIO_LED_GREEN, 0);
+ gpio_write_bit(CONFIG_SYS_GPIO_LED_GREEN, 0);
post = 1;
}
- if ((delta > CFG_TIME_FACTORY_RESET) && !factory_reset) {
+ if ((delta > CONFIG_SYS_TIME_FACTORY_RESET) && !factory_reset) {
printf("\nWhen released now, factory default values"
" will be restored.");
- gpio_write_bit(CFG_GPIO_LED_RED, 0);
+ gpio_write_bit(CONFIG_SYS_GPIO_LED_RED, 0);
factory_reset = 1;
}
@@ -400,7 +377,7 @@ int do_chkreset(cmd_tbl_t* cmdtp, int flag, int argc, char* argv[])
printf("\nSW-Reset Button released after %d milli-seconds!\n", delta);
- if (delta > CFG_TIME_FACTORY_RESET) {
+ if (delta > CONFIG_SYS_TIME_FACTORY_RESET) {
printf("Starting factory reset value restoration...\n");
/*
@@ -416,14 +393,14 @@ int do_chkreset(cmd_tbl_t* cmdtp, int flag, int argc, char* argv[])
return 0;
}
- if (delta > CFG_TIME_POST) {
+ if (delta > CONFIG_SYS_TIME_POST) {
printf("Starting POST configuration...\n");
/*
* Enable POST upon next bootup
*/
- out_be32((void *)CFG_POST_MAGIC, REBOOT_MAGIC);
- out_be32((void *)CFG_POST_VAL, REBOOT_DO_POST);
+ out_be32((void *)CONFIG_SYS_POST_MAGIC, REBOOT_MAGIC);
+ out_be32((void *)CONFIG_SYS_POST_VAL, REBOOT_DO_POST);
post_bootmode_init();
/*
@@ -455,8 +432,8 @@ int post_hotkeys_pressed(void)
u32 post_magic;
u32 post_val;
- post_magic = in_be32((void *)CFG_POST_MAGIC);
- post_val = in_be32((void *)CFG_POST_VAL);
+ post_magic = in_be32((void *)CONFIG_SYS_POST_MAGIC);
+ post_val = in_be32((void *)CONFIG_SYS_POST_VAL);
if ((post_magic == REBOOT_MAGIC) && (post_val == REBOOT_DO_POST))
return 1;