All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Rigby <john.rigby@linaro.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 5/7] boot: change some arch ifdefs to feature ifdefs
Date: Wed, 13 Oct 2010 13:57:35 -0600	[thread overview]
Message-ID: <1286999857-13790-6-git-send-email-john.rigby@linaro.org> (raw)
In-Reply-To: <1285775292-15060-1-git-send-email-john.rigby@linaro.org>

The routines boot_ramdisk_high, boot_get_cmdline and boot_get_kbd
are currently enabled by various combinations of CONFIG_M68K,
CONFIG_POWERPC and CONFIG_SPARC.

Use CONFIG_SYS_BOOT_<FEATURE> defines instead.

CONFIG_SYS_BOOT_RAMDISK_HIGH
CONFIG_SYS_BOOT_GET_CMDLINE
CONFIG_SYS_BOOT_GET_KBD

Define these as appropriate in arch/include/asm/config.h files.

Signed-off-by: John Rigby <john.rigby@linaro.org>
---
 README                            |   13 +++++++++++++
 arch/m68k/include/asm/config.h    |    3 +++
 arch/powerpc/include/asm/config.h |    3 +++
 arch/sparc/include/asm/config.h   |    1 +
 common/cmd_bootm.c                |    4 ++--
 common/image.c                    |   10 ++++++----
 include/image.h                   |    9 ++++++---
 7 files changed, 34 insertions(+), 9 deletions(-)

diff --git a/README b/README
index 197804e..686c6b7 100644
--- a/README
+++ b/README
@@ -2275,6 +2275,19 @@ Configuration Settings:
 		all data for the Linux kernel must be between "bootm_low"
 		and "bootm_low" + CONFIG_SYS_BOOTMAPSZ.
 
+- CONFIG_SYS_BOOT_RAMDISK_HIGH:
+		Enable initrd_high functionality.  If defined then the
+		initrd_high feature is enabled and the bootm ramdisk subcommand
+		is enabled.
+
+- CONFIG_SYS_BOOT_GET_CMDLINE:
+		Enables allocating and saving kernel cmdline in space between
+		"bootm_low" and "bootm_low" + BOOTMAPSZ.
+
+- CONFIG_SYS_BOOT_GET_KBD:
+		Enables allocating and saving a kernel copy of the bd_info in
+		space between "bootm_low" and "bootm_low" + BOOTMAPSZ.
+
 - CONFIG_SYS_MAX_FLASH_BANKS:
 		Max number of Flash memory banks
 
diff --git a/arch/m68k/include/asm/config.h b/arch/m68k/include/asm/config.h
index 36438be..ec2cc16 100644
--- a/arch/m68k/include/asm/config.h
+++ b/arch/m68k/include/asm/config.h
@@ -22,5 +22,8 @@
 #define _ASM_CONFIG_H_
 
 #define CONFIG_LMB
+#define CONFIG_SYS_BOOT_RAMDISK_HIGH
+#define CONFIG_SYS_BOOT_GET_CMDLINE
+#define CONFIG_SYS_BOOT_GET_KBD
 
 #endif
diff --git a/arch/powerpc/include/asm/config.h b/arch/powerpc/include/asm/config.h
index d098657..a1942ca 100644
--- a/arch/powerpc/include/asm/config.h
+++ b/arch/powerpc/include/asm/config.h
@@ -22,6 +22,9 @@
 #define _ASM_CONFIG_H_
 
 #define CONFIG_LMB
+#define CONFIG_SYS_BOOT_RAMDISK_HIGH
+#define CONFIG_SYS_BOOT_GET_CMDLINE
+#define CONFIG_SYS_BOOT_GET_KBD
 
 #ifndef CONFIG_MAX_MEM_MAPPED
 #if defined(CONFIG_4xx) || defined(CONFIG_E500) || defined(CONFIG_MPC86xx)
diff --git a/arch/sparc/include/asm/config.h b/arch/sparc/include/asm/config.h
index 36438be..6ddc349 100644
--- a/arch/sparc/include/asm/config.h
+++ b/arch/sparc/include/asm/config.h
@@ -22,5 +22,6 @@
 #define _ASM_CONFIG_H_
 
 #define CONFIG_LMB
+#define CONFIG_SYS_BOOT_RAMDISK_HIGH
 
 #endif
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 25bc39c..ce3c77c 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -472,7 +472,7 @@ static int bootm_start_standalone(ulong iflag, int argc, char * const argv[])
 static cmd_tbl_t cmd_bootm_sub[] = {
 	U_BOOT_CMD_MKENT(start, 0, 1, (void *)BOOTM_STATE_START, "", ""),
 	U_BOOT_CMD_MKENT(loados, 0, 1, (void *)BOOTM_STATE_LOADOS, "", ""),
-#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_SPARC)
+#ifdef CONFIG_SYS_BOOT_RAMDISK_HIGH
 	U_BOOT_CMD_MKENT(ramdisk, 0, 1, (void *)BOOTM_STATE_RAMDISK, "", ""),
 #endif
 #ifdef CONFIG_OF_LIBFDT
@@ -528,7 +528,7 @@ int do_bootm_subcommand (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv
 			lmb_reserve(&images.lmb, images.os.load,
 					(load_end - images.os.load));
 			break;
-#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_SPARC)
+#ifdef CONFIG_SYS_BOOT_RAMDISK_HIGH
 		case BOOTM_STATE_RAMDISK:
 		{
 			ulong rd_len = images.rd_end - images.rd_start;
diff --git a/common/image.c b/common/image.c
index dda3025..385464d 100644
--- a/common/image.c
+++ b/common/image.c
@@ -992,7 +992,7 @@ int boot_get_ramdisk (int argc, char * const argv[], bootm_headers_t *images,
 	return 0;
 }
 
-#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_SPARC)
+#ifdef CONFIG_SYS_BOOT_RAMDISK_HIGH
 /**
  * boot_ramdisk_high - relocate init ramdisk
  * @lmb: pointer to lmb handle, will be used for memory mgmt
@@ -1081,7 +1081,7 @@ int boot_ramdisk_high (struct lmb *lmb, ulong rd_data, ulong rd_len,
 error:
 	return -1;
 }
-#endif /* defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_SPARC) */
+#endif /* CONFIG_SYS_BOOT_RAMDISK_HIGH */
 
 #ifdef CONFIG_OF_LIBFDT
 static void fdt_error (const char *msg)
@@ -1588,7 +1588,7 @@ error:
 }
 #endif /* CONFIG_OF_LIBFDT */
 
-#if defined(CONFIG_PPC) || defined(CONFIG_M68K)
+#ifdef CONFIG_SYS_BOOT_GET_CMDLINE
 /**
  * boot_get_cmdline - allocate and initialize kernel cmdline
  * @lmb: pointer to lmb handle, will be used for memory mgmt
@@ -1630,7 +1630,9 @@ int boot_get_cmdline (struct lmb *lmb, ulong *cmd_start, ulong *cmd_end,
 
 	return 0;
 }
+#endif /* CONFIG_SYS_BOOT_GET_CMDLINE */
 
+#ifdef CONFIG_SYS_BOOT_GET_KBD
 /**
  * boot_get_kbd - allocate and initialize kernel copy of board info
  * @lmb: pointer to lmb handle, will be used for memory mgmt
@@ -1663,7 +1665,7 @@ int boot_get_kbd (struct lmb *lmb, bd_t **kbd, ulong bootmap_base)
 
 	return 0;
 }
-#endif /* CONFIG_PPC || CONFIG_M68K */
+#endif /* CONFIG_SYS_BOOT_GET_KBD */
 #endif /* !USE_HOSTCC */
 
 #if defined(CONFIG_FIT)
diff --git a/include/image.h b/include/image.h
index 18a9f0e..49d6280 100644
--- a/include/image.h
+++ b/include/image.h
@@ -340,14 +340,17 @@ int boot_relocate_fdt (struct lmb *lmb, ulong bootmap_base,
 		char **of_flat_tree, ulong *of_size);
 #endif
 
-#if defined(CONFIG_PPC) || defined(CONFIG_M68K)
+#ifdef CONFIG_SYS_BOOT_RAMDISK_HIGH
 int boot_ramdisk_high (struct lmb *lmb, ulong rd_data, ulong rd_len,
 		  ulong *initrd_start, ulong *initrd_end);
-
+#endif /* CONFIG_SYS_BOOT_RAMDISK_HIGH */
+#ifdef CONFIG_SYS_BOOT_GET_CMDLINE
 int boot_get_cmdline (struct lmb *lmb, ulong *cmd_start, ulong *cmd_end,
 			ulong bootmap_base);
+#endif /* CONFIG_SYS_BOOT_GET_CMDLINE */
+#ifdef CONFIG_SYS_BOOT_GET_KBD
 int boot_get_kbd (struct lmb *lmb, bd_t **kbd, ulong bootmap_base);
-#endif /* CONFIG_PPC || CONFIG_M68K */
+#endif /* CONFIG_SYS_BOOT_GET_KBD */
 #endif /* !USE_HOSTCC */
 
 /*******************************************************************/
-- 
1.7.1

  parent reply	other threads:[~2010-10-13 19:57 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-29 15:48 [U-Boot] [PATCH v2 0/6] Add ARM flat device tree support John Rigby
2010-09-29 15:48 ` [U-Boot] [PATCH v2 1/6] fdt_relocate: fix fdt size and endian bugs John Rigby
2010-10-12 21:20   ` Wolfgang Denk
2010-10-12 21:57     ` John Rigby
2010-10-13  5:55       ` Wolfgang Denk
2010-09-29 15:48 ` [U-Boot] [PATCH v2 2/6] FDT: Add fixup support for multiple banks of memory John Rigby
2010-10-12 21:21   ` Wolfgang Denk
2010-09-29 15:48 ` [U-Boot] [PATCH v2 3/6] FDT: only call boot_get_fdt from generic code John Rigby
2010-10-12 21:24   ` Wolfgang Denk
2010-10-12 21:33     ` John Rigby
2010-10-12 21:40       ` Wolfgang Denk
2010-09-29 15:48 ` [U-Boot] [PATCH v2 4/6] boot: change some arch ifdefs to feature ifdefs John Rigby
2010-10-12 21:27   ` Wolfgang Denk
2010-10-12 21:41     ` John Rigby
2010-09-29 15:48 ` [U-Boot] [PATCH v2 5/6] ARM: add flat device tree support John Rigby
2010-10-07 14:56   ` John Rigby
2010-10-12 21:29   ` Wolfgang Denk
2010-10-12 21:39     ` John Rigby
2010-10-13  5:52       ` Wolfgang Denk
2010-09-29 15:48 ` [U-Boot] [PATCH v2 6/6] ARM: enable device tree for beagle John Rigby
2010-10-07 16:11 ` [U-Boot] [PATCH v2 0/6] Add ARM flat device tree support John Rigby
2010-10-07 16:14   ` John Rigby
2010-10-07 17:45   ` Wolfgang Denk
2010-10-13 19:57 ` [U-Boot] [PATCH v3 0/7] " John Rigby
2010-10-13 20:41   ` Wolfgang Denk
2010-10-13 21:20     ` John Rigby
2010-10-17  1:59     ` Gerald Van Baren
2010-10-13 19:57 ` [U-Boot] [PATCH v3 1/7] common/image.c fix length calculation in boot_relocate_fdt John Rigby
2010-10-18 20:50   ` Wolfgang Denk
2010-10-13 19:57 ` [U-Boot] [PATCH v3 2/7] common/image.c remove extra calls to be32_to_cpu in boot_get_fdt John Rigby
2010-10-18 20:50   ` Wolfgang Denk
2010-10-13 19:57 ` [U-Boot] [PATCH v3 3/7] FDT: Add fixup support for multiple banks of memory John Rigby
2010-10-18 20:51   ` Wolfgang Denk
2010-10-20  7:02   ` [U-Boot] [PATCH] common/fdt_support.c: Fix compile warnings Wolfgang Denk
2010-10-13 19:57 ` [U-Boot] [PATCH v3 4/7] FDT: only call boot_get_fdt from generic code John Rigby
2010-10-14  3:07   ` Michal Simek
2010-10-18  6:38   ` Thomas Chou
2010-10-18 20:52   ` Wolfgang Denk
2010-10-13 19:57 ` John Rigby [this message]
2010-10-18 20:53   ` [U-Boot] [PATCH v3 5/7] boot: change some arch ifdefs to feature ifdefs Wolfgang Denk
2010-10-13 19:57 ` [U-Boot] [PATCH v3 6/7] ARM: add flat device tree support John Rigby
2010-10-18 20:54   ` Wolfgang Denk
2010-10-13 19:57 ` [U-Boot] [PATCH v3 7/7] ARM: enable device tree for beagle John Rigby
2010-10-18 20:54   ` Wolfgang Denk

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=1286999857-13790-6-git-send-email-john.rigby@linaro.org \
    --to=john.rigby@linaro.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.