Commit 64542f4616c484142b90534f9f174a632d7d1904

Authored by Bin Meng
Committed by Simon Glass
1 parent 996467172e

x86: Make ROM_SIZE configurable in Kconfig

Currently the ROM_SIZE is hardcoded to 8MB in arch/x86/Kconfig. This
will not be the case when adding additional board support. Hence we
make ROM_SIZE configurable (512KB/1MB/2MB/4MB/8MB/16MB) and have the
board Kconfig file select the default ROM_SIZE.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

Showing 2 changed files with 78 additions and 1 deletions Side-by-side Diff

... ... @@ -61,9 +61,85 @@
61 61 config SMM_TSEG_SIZE
62 62 hex
63 63  
  64 +config BOARD_ROMSIZE_KB_512
  65 + bool
  66 +config BOARD_ROMSIZE_KB_1024
  67 + bool
  68 +config BOARD_ROMSIZE_KB_2048
  69 + bool
  70 +config BOARD_ROMSIZE_KB_4096
  71 + bool
  72 +config BOARD_ROMSIZE_KB_8192
  73 + bool
  74 +config BOARD_ROMSIZE_KB_16384
  75 + bool
  76 +
  77 +choice
  78 + prompt "ROM chip size"
  79 + default UBOOT_ROMSIZE_KB_512 if BOARD_ROMSIZE_KB_512
  80 + default UBOOT_ROMSIZE_KB_1024 if BOARD_ROMSIZE_KB_1024
  81 + default UBOOT_ROMSIZE_KB_2048 if BOARD_ROMSIZE_KB_2048
  82 + default UBOOT_ROMSIZE_KB_4096 if BOARD_ROMSIZE_KB_4096
  83 + default UBOOT_ROMSIZE_KB_8192 if BOARD_ROMSIZE_KB_8192
  84 + default UBOOT_ROMSIZE_KB_16384 if BOARD_ROMSIZE_KB_16384
  85 + help
  86 + Select the size of the ROM chip you intend to flash U-Boot on.
  87 +
  88 + The build system will take care of creating a u-boot.rom file
  89 + of the matching size.
  90 +
  91 +config UBOOT_ROMSIZE_KB_512
  92 + bool "512 KB"
  93 + help
  94 + Choose this option if you have a 512 KB ROM chip.
  95 +
  96 +config UBOOT_ROMSIZE_KB_1024
  97 + bool "1024 KB (1 MB)"
  98 + help
  99 + Choose this option if you have a 1024 KB (1 MB) ROM chip.
  100 +
  101 +config UBOOT_ROMSIZE_KB_2048
  102 + bool "2048 KB (2 MB)"
  103 + help
  104 + Choose this option if you have a 2048 KB (2 MB) ROM chip.
  105 +
  106 +config UBOOT_ROMSIZE_KB_4096
  107 + bool "4096 KB (4 MB)"
  108 + help
  109 + Choose this option if you have a 4096 KB (4 MB) ROM chip.
  110 +
  111 +config UBOOT_ROMSIZE_KB_8192
  112 + bool "8192 KB (8 MB)"
  113 + help
  114 + Choose this option if you have a 8192 KB (8 MB) ROM chip.
  115 +
  116 +config UBOOT_ROMSIZE_KB_16384
  117 + bool "16384 KB (16 MB)"
  118 + help
  119 + Choose this option if you have a 16384 KB (16 MB) ROM chip.
  120 +
  121 +endchoice
  122 +
  123 +# Map the config names to an integer (KB).
  124 +config UBOOT_ROMSIZE_KB
  125 + int
  126 + default 512 if UBOOT_ROMSIZE_KB_512
  127 + default 1024 if UBOOT_ROMSIZE_KB_1024
  128 + default 2048 if UBOOT_ROMSIZE_KB_2048
  129 + default 4096 if UBOOT_ROMSIZE_KB_4096
  130 + default 8192 if UBOOT_ROMSIZE_KB_8192
  131 + default 16384 if UBOOT_ROMSIZE_KB_16384
  132 +
  133 +# Map the config names to a hex value (bytes).
64 134 config ROM_SIZE
65 135 hex
66   - default 0x800000
  136 + default 0x80000 if UBOOT_ROMSIZE_KB_512
  137 + default 0x100000 if UBOOT_ROMSIZE_KB_1024
  138 + default 0x200000 if UBOOT_ROMSIZE_KB_2048
  139 + default 0x400000 if UBOOT_ROMSIZE_KB_4096
  140 + default 0x800000 if UBOOT_ROMSIZE_KB_8192
  141 + default 0xc00000 if UBOOT_ROMSIZE_KB_12288
  142 + default 0x1000000 if UBOOT_ROMSIZE_KB_16384
67 143  
68 144 config HAVE_INTEL_ME
69 145 bool "Platform requires Intel Management Engine"
board/google/chromebook_link/Kconfig
... ... @@ -19,6 +19,7 @@
19 19 select SOUTHBRIDGE_INTEL_C216
20 20 select HAVE_ACPI_RESUME
21 21 select MARK_GRAPHICS_MEM_WRCOMB
  22 + select BOARD_ROMSIZE_KB_8192
22 23  
23 24 config MMCONF_BASE_ADDRESS
24 25 hex