All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC PATCH v2 09/15] bootstage: Convert net progress numbers to enums
Date: Sat, 10 Dec 2011 13:08:01 -0800	[thread overview]
Message-ID: <1323551287-5351-10-git-send-email-sjg@chromium.org> (raw)
In-Reply-To: <1323551287-5351-1-git-send-email-sjg@chromium.org>

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   |    2 +-
 board/matrix_vision/mvbc_p/mvbc_p.c |    2 +-
 board/pcs440ep/pcs440ep.c           |   24 ++++++++++++------------
 common/cmd_net.c                    |   16 ++++++++--------
 common/env_common.c                 |    2 +-
 include/bootstage.h                 |   11 +++++++++++
 net/eth.c                           |    6 +++---
 7 files changed, 37 insertions(+), 26 deletions(-)

diff --git a/board/Seagate/dockstar/dockstar.c b/board/Seagate/dockstar/dockstar.c
index 8cbfb02..38473e5 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 7e06d6c..4b48a3c 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 f67eedd..746a54c 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 6798b89..72595fd 100644
--- a/common/cmd_net.c
+++ b/common/cmd_net.c
@@ -227,36 +227,36 @@ 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_usage(cmdtp);
 	}
 
-	show_boot_progress (80);
+	show_boot_progress(BOOTSTAGE_ID_NET_START);
 	if ((size = NetLoop(proto)) < 0) {
-		show_boot_error(81);
+		show_boot_error(BOOTSTAGE_ID_NET_NETLOOP_OK);
 		return 1;
 	}
 
-	show_boot_progress (81);
+	show_boot_progress(BOOTSTAGE_ID_NET_NETLOOP_OK);
 	/* 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 4060c63..bb33220 100644
--- a/common/env_common.c
+++ b/common/env_common.c
@@ -221,7 +221,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 6e0cb39..474de21 100644
--- a/include/bootstage.h
+++ b/include/bootstage.h
@@ -117,6 +117,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 e9a0f46..07e7534 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -244,7 +244,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
@@ -274,12 +274,12 @@ int eth_initialize(bd_t *bis)
 #endif
 	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 (eth_number)
 				puts (", ");
-- 
1.7.3.1

  parent reply	other threads:[~2011-12-10 21:08 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-10 21:07 [U-Boot] [RFC PATCH v2 0/15] bootstage: record and publish boot progress timing Simon Glass
2011-12-10 21:07 ` [U-Boot] [RFC PATCH v2 01/15] bootstage: Create an initial header for boot progress integers Simon Glass
2012-01-08  8:26   ` Mike Frysinger
2012-01-08 17:22     ` Simon Glass
2012-01-08 19:46       ` Mike Frysinger
2012-01-08 23:43         ` Simon Glass
2011-12-10 21:07 ` [U-Boot] [RFC PATCH v2 02/15] bootstage: Make use of BOOTSTAGE_ID_RUN_OS in show_boot_progress() Simon Glass
2012-01-08  8:26   ` Mike Frysinger
2011-12-10 21:07 ` [U-Boot] [RFC PATCH v2 03/15] bootstage: Use show_boot_error() for -ve progress numbers Simon Glass
2012-01-08  8:27   ` Mike Frysinger
2011-12-10 21:07 ` [U-Boot] [RFC PATCH v2 04/15] bootstage: Convert progress numbers 1-9 into enums Simon Glass
2012-01-08  8:27   ` Mike Frysinger
2012-01-08 17:27     ` Simon Glass
2011-12-10 21:07 ` [U-Boot] [RFC PATCH v2 05/15] bootstage: Convert progress numbers 10-19 to enums Simon Glass
2012-01-08  8:28   ` Mike Frysinger
2012-01-08 17:29     ` Simon Glass
2011-12-10 21:07 ` [U-Boot] [RFC PATCH v2 06/15] bootstage: Convert progress numbers 20-41 " Simon Glass
2011-12-10 21:07 ` [U-Boot] [RFC PATCH v2 07/15] bootstage: Convert IDE progress numbers " Simon Glass
2011-12-10 21:08 ` [U-Boot] [RFC PATCH v2 08/15] bootstage: Convert NAND " Simon Glass
2011-12-10 21:08 ` Simon Glass [this message]
2011-12-10 21:08 ` [U-Boot] [RFC PATCH v2 10/15] bootstage: Convert FIT " Simon Glass
2011-12-10 21:08 ` [U-Boot] [RFC PATCH v2 11/15] bootstage: Define an optional microsecond timer Simon Glass
2012-01-08  8:30   ` Mike Frysinger
2012-01-08 17:33     ` Simon Glass
2012-01-08 19:57       ` Mike Frysinger
2012-01-08 23:49         ` Simon Glass
2011-12-10 21:08 ` [U-Boot] [RFC PATCH v2 12/15] bootstage: Replace show_boot_progress/error() with bootstage_...() Simon Glass
2011-12-10 21:08 ` [U-Boot] [RFC PATCH v2 13/15] bootstage: Add microsecond boot time measurement Simon Glass
2012-01-08  8:35   ` Mike Frysinger
2012-01-08 17:42     ` Simon Glass
2012-01-09 17:33       ` Mike Frysinger
2012-01-12  5:41         ` Simon Glass
2012-01-15  1:09           ` Mike Frysinger
2012-01-15  1:16             ` Simon Glass
2012-01-15  1:22               ` Mike Frysinger
2012-01-15  1:27                 ` Simon Glass
2012-02-13 23:27                   ` Simon Glass
2011-12-10 21:08 ` [U-Boot] [RFC PATCH v2 14/15] bootstage: Plumb in bootstage calls for basic operations Simon Glass
2011-12-10 21:08 ` [U-Boot] [RFC PATCH v2 15/15] bootstage: arm: Add bootstage calls in board and bootm Simon Glass
2012-01-08  8:36   ` Mike Frysinger
2012-01-08 17:43     ` Simon Glass
2012-01-08 19:58       ` Mike Frysinger
2012-01-08 23:48         ` Simon Glass
2012-01-09 17:31           ` Mike Frysinger
2012-01-12  5:38             ` Simon Glass
2012-01-03 22:33 ` [U-Boot] [RFC PATCH v2 0/15] bootstage: record and publish boot progress timing Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1323551287-5351-10-git-send-email-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.