summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2012-01-14 15:24:52 +0000
committerWolfgang Denk <wd@denx.de>2012-03-18 21:33:05 +0100
commitc8e66db7893532f2222334e7c36ee841da34ef4c (patch)
treed06eaa23d0da3abe470b3b1df1748697afb1157c
parentcd24a6bf2183ac24080e0348e193ba627711fcbc (diff)
bootstage: Convert net progress numbers to enums
This changes over the network-related progress numbers to use enums from bootstage.h. Signed-off-by: Simon Glass <sjg@chromium.org>
-rw-r--r--board/Seagate/dockstar/dockstar.c2
-rw-r--r--board/matrix_vision/mvbc_p/mvbc_p.c2
-rw-r--r--board/pcs440ep/pcs440ep.c24
-rw-r--r--common/cmd_net.c17
-rw-r--r--common/env_common.c2
-rw-r--r--include/bootstage.h11
-rw-r--r--net/eth.c6
7 files changed, 38 insertions, 26 deletions
diff --git a/board/Seagate/dockstar/dockstar.c b/board/Seagate/dockstar/dockstar.c
index 8cbfb02b156..38473e58088 100644
--- a/board/Seagate/dockstar/dockstar.c
+++ b/board/Seagate/dockstar/dockstar.c
@@ -172,7 +172,7 @@ void show_boot_progress(int val)
case BOOTSTAGE_ID_RUN_OS: /* booting Linux */
set_leds(BOTH_LEDS, NEITHER_LED);
break;
- case 64: /* Ethernet initialization */
+ case BOOTSTAGE_ID_NET_ETH_START: /* Ethernet initialization */
set_leds(GREEN_LED, GREEN_LED);
break;
default:
diff --git a/board/matrix_vision/mvbc_p/mvbc_p.c b/board/matrix_vision/mvbc_p/mvbc_p.c
index 7e06d6c4a80..4b48a3cab83 100644
--- a/board/matrix_vision/mvbc_p/mvbc_p.c
+++ b/board/matrix_vision/mvbc_p/mvbc_p.c
@@ -244,7 +244,7 @@ void show_boot_progress(int val)
case BOOTSTAGE_ID_START: /* FPGA ok */
setbits_be32(&gpio->simple_dvo, LED_G0);
break;
- case 65:
+ case BOOTSTAGE_ID_NET_ETH_INIT:
setbits_be32(&gpio->simple_dvo, LED_G1);
break;
case BOOTSTAGE_ID_COPY_RAMDISK:
diff --git a/board/pcs440ep/pcs440ep.c b/board/pcs440ep/pcs440ep.c
index f67eeddeb7d..746a54c5e34 100644
--- a/board/pcs440ep/pcs440ep.c
+++ b/board/pcs440ep/pcs440ep.c
@@ -117,19 +117,19 @@ void show_boot_progress (int val)
status_led_set(2, STATUS_LED_ON);
break;
#if 0
- case 64:
- /* starting Ethernet configuration */
- status_led_set (0, STATUS_LED_OFF);
- status_led_set (1, STATUS_LED_OFF);
- status_led_set (2, STATUS_LED_ON);
- break;
+ case BOOTSTAGE_ID_NET_ETH_START:
+ /* starting Ethernet configuration */
+ status_led_set(0, STATUS_LED_OFF);
+ status_led_set(1, STATUS_LED_OFF);
+ status_led_set(2, STATUS_LED_ON);
+ break;
#endif
- case 80:
- /* loading Image */
- status_led_set (0, STATUS_LED_ON);
- status_led_set (1, STATUS_LED_OFF);
- status_led_set (2, STATUS_LED_ON);
- break;
+ case BOOTSTAGE_ID_NET_START:
+ /* loading Image */
+ status_led_set(0, STATUS_LED_ON);
+ status_led_set(1, STATUS_LED_OFF);
+ status_led_set(2, STATUS_LED_ON);
+ break;
}
}
#endif
diff --git a/common/cmd_net.c b/common/cmd_net.c
index c9f2a0864ae..897b6f63177 100644
--- a/common/cmd_net.c
+++ b/common/cmd_net.c
@@ -230,36 +230,37 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc,
break;
#endif
default:
- show_boot_error(80);
+ show_boot_error(BOOTSTAGE_ID_NET_START);
return CMD_RET_USAGE;
}
+ show_boot_progress(BOOTSTAGE_ID_NET_START);
- show_boot_progress(80);
if ((size = NetLoop(proto)) < 0) {
- show_boot_error(81);
+ show_boot_error(BOOTSTAGE_ID_NET_NETLOOP_OK);
return 1;
}
+ show_boot_progress(BOOTSTAGE_ID_NET_NETLOOP_OK);
- show_boot_progress(81);
/* NetLoop ok, update environment */
netboot_update_env();
/* done if no file was loaded (no errors though) */
if (size == 0) {
- show_boot_error(82);
+ show_boot_error(BOOTSTAGE_ID_NET_LOADED);
return 0;
}
/* flush cache */
flush_cache(load_addr, size);
- show_boot_progress(82);
+ show_boot_progress(BOOTSTAGE_ID_NET_LOADED);
+
rcode = bootm_maybe_autostart(cmdtp, argv[0]);
if (rcode < 0)
- show_boot_error(83);
+ show_boot_error(BOOTSTAGE_ID_NET_DONE_ERR);
else
- show_boot_progress(84);
+ show_boot_progress(BOOTSTAGE_ID_NET_DONE);
return rcode;
}
diff --git a/common/env_common.c b/common/env_common.c
index 49b55f1eefc..41e2f260dbc 100644
--- a/common/env_common.c
+++ b/common/env_common.c
@@ -228,7 +228,7 @@ void env_relocate(void)
#if defined(CONFIG_ENV_IS_NOWHERE) /* Environment not changable */
set_default_env(NULL);
#else
- show_boot_error(60);
+ show_boot_error(BOOTSTAGE_ID_NET_CHECKSUM);
set_default_env("!bad CRC");
#endif
} else {
diff --git a/include/bootstage.h b/include/bootstage.h
index d58c46b893e..35e11b8dcc8 100644
--- a/include/bootstage.h
+++ b/include/bootstage.h
@@ -115,6 +115,17 @@ enum bootstage_id {
BOOTSTAGE_ID_NAND_TYPE = 57,
BOOTSTAGE_ID_NAND_READ,
+ /* Boot stages related to loading a kernel from an network device */
+ BOOTSTAGE_ID_NET_CHECKSUM = 60,
+ BOOTSTAGE_ID_NET_ETH_START = 64,
+ BOOTSTAGE_ID_NET_ETH_INIT,
+
+ BOOTSTAGE_ID_NET_START = 80,
+ BOOTSTAGE_ID_NET_NETLOOP_OK,
+ BOOTSTAGE_ID_NET_LOADED,
+ BOOTSTAGE_ID_NET_DONE_ERR,
+ BOOTSTAGE_ID_NET_DONE,
+
BOOTSTAGE_ID_IDE_FIT_READ = 140,
BOOTSTAGE_ID_IDE_FIT_READ_OK,
diff --git a/net/eth.c b/net/eth.c
index 5cefe4c8be0..77045ebeac1 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -256,7 +256,7 @@ int eth_initialize(bd_t *bis)
eth_devices = NULL;
eth_current = NULL;
- show_boot_progress (64);
+ show_boot_progress(BOOTSTAGE_ID_NET_ETH_START);
#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
miiphy_init();
#endif
@@ -280,12 +280,12 @@ int eth_initialize(bd_t *bis)
if (!eth_devices) {
puts ("No ethernet found.\n");
- show_boot_error(64);
+ show_boot_error(BOOTSTAGE_ID_NET_ETH_START);
} else {
struct eth_device *dev = eth_devices;
char *ethprime = getenv ("ethprime");
- show_boot_progress (65);
+ show_boot_progress(BOOTSTAGE_ID_NET_ETH_INIT);
do {
if (dev->index)
puts (", ");