Patchwork [U-Boot,v3,01/10] bootstage: Introduce sub-IDs for use with image loading

login
register
mail settings
Submitter Simon Glass
Date May 16, 2013, 11:53 p.m.
Message ID <1368748408-31893-2-git-send-email-sjg@chromium.org>
Download mbox | patch
Permalink /patch/244435/
State Accepted, archived
Delegated to: Tom Rini
Headers show

Comments

Simon Glass - May 16, 2013, 11:53 p.m.
Loading a ramdisk, kernel or FDT goes through similar stages. Create
a block of IDs for each task, and define a consistent numbering within
the block. This will allow use of common code for image loading.

Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v3: None
Changes in v2: None

 include/bootstage.h | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

Patch

diff --git a/include/bootstage.h b/include/bootstage.h
index 6dc0422..e29e9ee 100644
--- a/include/bootstage.h
+++ b/include/bootstage.h
@@ -37,6 +37,24 @@  enum bootstage_flags {
 	BOOTSTAGEF_ALLOC	= 1 << 1,	/* Allocate an id */
 };
 
+/* bootstate sub-IDs used for kernel and ramdisk ranges */
+enum {
+	BOOTSTAGE_SUB_FORMAT,
+	BOOTSTAGE_SUB_FORMAT_OK,
+	BOOTSTAGE_SUB_NO_UNIT_NAME,
+	BOOTSTAGE_SUB_UNIT_NAME,
+	BOOTSTAGE_SUB_SUBNODE,
+
+	BOOTSTAGE_SUB_CHECK,
+	BOOTSTAGE_SUB_HASH = 5,
+	BOOTSTAGE_SUB_CHECK_ARCH = 5,
+	BOOTSTAGE_SUB_CHECK_ALL,
+	BOOTSTAGE_SUB_GET_DATA,
+	BOOTSTAGE_SUB_CHECK_ALL_OK = 7,
+	BOOTSTAGE_SUB_GET_DATA_OK,
+	BOOTSTAGE_SUB_LOAD,
+};
+
 /*
  * A list of boot stages that we know about. Each of these indicates the
  * state that we are at, and the action that we are about to perform. For
@@ -137,10 +155,12 @@  enum bootstage_id {
 	BOOTSTAGE_ID_NET_DONE_ERR,
 	BOOTSTAGE_ID_NET_DONE,
 
+	BOOTSTAGE_ID_FIT_FDT_START = 90,
 	/*
 	 * Boot stages related to loading a FIT image. Some of these are a
 	 * bit wonky.
 	 */
+	BOOTSTAGE_ID_FIT_KERNEL_START = 100,
 	BOOTSTAGE_ID_FIT_FORMAT = 100,
 	BOOTSTAGE_ID_FIT_NO_UNIT_NAME,
 	BOOTSTAGE_ID_FIT_UNIT_NAME,
@@ -161,6 +181,8 @@  enum bootstage_id {
 	BOOTSTAGE_ID_FIT_LOADADDR,
 	BOOTSTAGE_ID_OVERWRITTEN,
 
+	/* Next 10 IDs used by BOOTSTAGE_SUB_... */
+	BOOTSTAGE_ID_FIT_RD_START = 120,	/* Ramdisk stages */
 	BOOTSTAGE_ID_FIT_RD_FORMAT = 120,
 	BOOTSTAGE_ID_FIT_RD_FORMAT_OK,
 	BOOTSTAGE_ID_FIT_RD_NO_UNIT_NAME,