Commit fca43cc8018327cbe13e943932fbf75772275192

Authored by John Rigby
Committed by Wolfgang Denk
1 parent 5a75e12107

boot: change some arch ifdefs to feature ifdefs

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>
Acked-by: Wolfgang Denk <wd@denx.de>

Showing 7 changed files with 34 additions and 9 deletions Side-by-side Diff

... ... @@ -2275,6 +2275,19 @@
2275 2275 all data for the Linux kernel must be between "bootm_low"
2276 2276 and "bootm_low" + CONFIG_SYS_BOOTMAPSZ.
2277 2277  
  2278 +- CONFIG_SYS_BOOT_RAMDISK_HIGH:
  2279 + Enable initrd_high functionality. If defined then the
  2280 + initrd_high feature is enabled and the bootm ramdisk subcommand
  2281 + is enabled.
  2282 +
  2283 +- CONFIG_SYS_BOOT_GET_CMDLINE:
  2284 + Enables allocating and saving kernel cmdline in space between
  2285 + "bootm_low" and "bootm_low" + BOOTMAPSZ.
  2286 +
  2287 +- CONFIG_SYS_BOOT_GET_KBD:
  2288 + Enables allocating and saving a kernel copy of the bd_info in
  2289 + space between "bootm_low" and "bootm_low" + BOOTMAPSZ.
  2290 +
2278 2291 - CONFIG_SYS_MAX_FLASH_BANKS:
2279 2292 Max number of Flash memory banks
2280 2293  
arch/m68k/include/asm/config.h
... ... @@ -22,6 +22,9 @@
22 22 #define _ASM_CONFIG_H_
23 23  
24 24 #define CONFIG_LMB
  25 +#define CONFIG_SYS_BOOT_RAMDISK_HIGH
  26 +#define CONFIG_SYS_BOOT_GET_CMDLINE
  27 +#define CONFIG_SYS_BOOT_GET_KBD
25 28  
26 29 #endif
arch/powerpc/include/asm/config.h
... ... @@ -22,6 +22,9 @@
22 22 #define _ASM_CONFIG_H_
23 23  
24 24 #define CONFIG_LMB
  25 +#define CONFIG_SYS_BOOT_RAMDISK_HIGH
  26 +#define CONFIG_SYS_BOOT_GET_CMDLINE
  27 +#define CONFIG_SYS_BOOT_GET_KBD
25 28  
26 29 #ifndef CONFIG_MAX_MEM_MAPPED
27 30 #if defined(CONFIG_4xx) || defined(CONFIG_E500) || defined(CONFIG_MPC86xx)
arch/sparc/include/asm/config.h
... ... @@ -22,6 +22,7 @@
22 22 #define _ASM_CONFIG_H_
23 23  
24 24 #define CONFIG_LMB
  25 +#define CONFIG_SYS_BOOT_RAMDISK_HIGH
25 26  
26 27 #endif
... ... @@ -472,7 +472,7 @@
472 472 static cmd_tbl_t cmd_bootm_sub[] = {
473 473 U_BOOT_CMD_MKENT(start, 0, 1, (void *)BOOTM_STATE_START, "", ""),
474 474 U_BOOT_CMD_MKENT(loados, 0, 1, (void *)BOOTM_STATE_LOADOS, "", ""),
475   -#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_SPARC)
  475 +#ifdef CONFIG_SYS_BOOT_RAMDISK_HIGH
476 476 U_BOOT_CMD_MKENT(ramdisk, 0, 1, (void *)BOOTM_STATE_RAMDISK, "", ""),
477 477 #endif
478 478 #ifdef CONFIG_OF_LIBFDT
... ... @@ -528,7 +528,7 @@
528 528 lmb_reserve(&images.lmb, images.os.load,
529 529 (load_end - images.os.load));
530 530 break;
531   -#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_SPARC)
  531 +#ifdef CONFIG_SYS_BOOT_RAMDISK_HIGH
532 532 case BOOTM_STATE_RAMDISK:
533 533 {
534 534 ulong rd_len = images.rd_end - images.rd_start;
... ... @@ -992,7 +992,7 @@
992 992 return 0;
993 993 }
994 994  
995   -#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_SPARC)
  995 +#ifdef CONFIG_SYS_BOOT_RAMDISK_HIGH
996 996 /**
997 997 * boot_ramdisk_high - relocate init ramdisk
998 998 * @lmb: pointer to lmb handle, will be used for memory mgmt
... ... @@ -1081,7 +1081,7 @@
1081 1081 error:
1082 1082 return -1;
1083 1083 }
1084   -#endif /* defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_SPARC) */
  1084 +#endif /* CONFIG_SYS_BOOT_RAMDISK_HIGH */
1085 1085  
1086 1086 #ifdef CONFIG_OF_LIBFDT
1087 1087 static void fdt_error (const char *msg)
... ... @@ -1588,7 +1588,7 @@
1588 1588 }
1589 1589 #endif /* CONFIG_OF_LIBFDT */
1590 1590  
1591   -#if defined(CONFIG_PPC) || defined(CONFIG_M68K)
  1591 +#ifdef CONFIG_SYS_BOOT_GET_CMDLINE
1592 1592 /**
1593 1593 * boot_get_cmdline - allocate and initialize kernel cmdline
1594 1594 * @lmb: pointer to lmb handle, will be used for memory mgmt
1595 1595  
... ... @@ -1630,7 +1630,9 @@
1630 1630  
1631 1631 return 0;
1632 1632 }
  1633 +#endif /* CONFIG_SYS_BOOT_GET_CMDLINE */
1633 1634  
  1635 +#ifdef CONFIG_SYS_BOOT_GET_KBD
1634 1636 /**
1635 1637 * boot_get_kbd - allocate and initialize kernel copy of board info
1636 1638 * @lmb: pointer to lmb handle, will be used for memory mgmt
... ... @@ -1663,7 +1665,7 @@
1663 1665  
1664 1666 return 0;
1665 1667 }
1666   -#endif /* CONFIG_PPC || CONFIG_M68K */
  1668 +#endif /* CONFIG_SYS_BOOT_GET_KBD */
1667 1669 #endif /* !USE_HOSTCC */
1668 1670  
1669 1671 #if defined(CONFIG_FIT)
... ... @@ -340,14 +340,17 @@
340 340 char **of_flat_tree, ulong *of_size);
341 341 #endif
342 342  
343   -#if defined(CONFIG_PPC) || defined(CONFIG_M68K)
  343 +#ifdef CONFIG_SYS_BOOT_RAMDISK_HIGH
344 344 int boot_ramdisk_high (struct lmb *lmb, ulong rd_data, ulong rd_len,
345 345 ulong *initrd_start, ulong *initrd_end);
346   -
  346 +#endif /* CONFIG_SYS_BOOT_RAMDISK_HIGH */
  347 +#ifdef CONFIG_SYS_BOOT_GET_CMDLINE
347 348 int boot_get_cmdline (struct lmb *lmb, ulong *cmd_start, ulong *cmd_end,
348 349 ulong bootmap_base);
  350 +#endif /* CONFIG_SYS_BOOT_GET_CMDLINE */
  351 +#ifdef CONFIG_SYS_BOOT_GET_KBD
349 352 int boot_get_kbd (struct lmb *lmb, bd_t **kbd, ulong bootmap_base);
350   -#endif /* CONFIG_PPC || CONFIG_M68K */
  353 +#endif /* CONFIG_SYS_BOOT_GET_KBD */
351 354 #endif /* !USE_HOSTCC */
352 355  
353 356 /*******************************************************************/