bootstage: Convert net progress numbers to enums
authorSimon Glass <sjg@chromium.org>
Sat, 14 Jan 2012 15:24:52 +0000 (15:24 +0000)
committerWolfgang Denk <wd@denx.de>
Sun, 18 Mar 2012 20:33:05 +0000 (21:33 +0100)
This changes over the network-related progress numbers to use enums
from bootstage.h.

Signed-off-by: Simon Glass <sjg@chromium.org>
board/Seagate/dockstar/dockstar.c
board/matrix_vision/mvbc_p/mvbc_p.c
board/pcs440ep/pcs440ep.c
common/cmd_net.c
common/env_common.c
include/bootstage.h
net/eth.c

index 8cbfb02b1560b766047f4cc071827bdbed1e8461..38473e580883c598315de86591f4c0471766a941 100644 (file)
@@ -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:
index 7e06d6c4a801fbde5531efd91b9ccf669db2f5ca..4b48a3cab830aec71d4e82d17dbf0270e9c31107 100644 (file)
@@ -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:
index f67eeddeb7d03c7568628419b7aa6c52650f5862..746a54c5e3405d8007529f401d15e943fb1a6c59 100644 (file)
@@ -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
index c9f2a0864ae02e67f0beffbeee7152aef5a9042a..897b6f63177f4b12c6146ad5160683fdbf226f5a 100644 (file)
@@ -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;
 }
 
index 49b55f1eefc501823e72ecec344030cf0f51fc8b..41e2f260dbc64b3de76e642d6c4dffb51a3c0373 100644 (file)
@@ -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 {
index d58c46b893e8010c8511d7f3791f25ea9bc36573..35e11b8dcc83229a1cb71704c892f009188f69a7 100644 (file)
@@ -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,
 
index 5cefe4c8be04ab91249964f055358d7ceb457fb4..77045ebeac1ab4851e1217f52b355db588c0864c 100644 (file)
--- 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 (", ");