Skip to content

Commit

Permalink
image: Expand kernel buffer size to 512MB
Browse files Browse the repository at this point in the history
This patch expands the kernel buffer to 512MB (or to 128MB on arm32
devices where that's the Linux ABI limit anyway, or to less on some
older specialty platforms where it otherwise wouldn't fit). The kernel
partition size on disk has traditionally only been 16MB, and we don't
plan on changing that... however, on a recovery USB stick we can make
the partition as large as we want, and we may need to do that if we want
to add more stuff to the recovery initramfs. Unfortunately we'll be
stuck with the exisiting limits on old platforms since recovery firmware
is not updateable, but this CL is meant to ensure that we'll at least
have lots of headroom to grow on future platforms.

Some memory layouts had to be adjusted to fit the new buffer. Also
document the individual arch-dependent constraints for placing various
regions in the Kconfig help (some of these only apply to older Linux
versions, but since we don't update our kernels it's better to mention
everything that might apply... boards can still violate them after they
made sure that they're unaffected).

BRANCH=None
BUG=chromium:873135
TEST=Booted Cheza (not feasible to test *every* platform, I've
double-checked everything manually as best as I could).

Change-Id: I23f1a2c78f4e82c1f1e4a16d823ab36d2e90ef1d
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1179122
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
  • Loading branch information
jwerner-chromium authored and chrome-bot committed Aug 18, 2018
1 parent 160674e commit 45f2be2
Show file tree
Hide file tree
Showing 18 changed files with 62 additions and 42 deletions.
6 changes: 3 additions & 3 deletions board/bob/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ CONFIG_BOARD="bob"
CONFIG_BOARD_DIR="gru"

# Image
CONFIG_BASE_ADDRESS=0x18000000
CONFIG_BASE_ADDRESS=0x40000000
CONFIG_HEAP_SIZE=0x01000000
CONFIG_KERNEL_START=0x15000000
CONFIG_KERNEL_START=0x20000000

# Vboot
CONFIG_TPM2_MODE=y
Expand All @@ -22,7 +22,7 @@ CONFIG_NV_STORAGE_FLASH=y

# Kernel format
CONFIG_KERNEL_FIT=y
CONFIG_KERNEL_FIT_FDT_ADDR=0x6400000
CONFIG_KERNEL_FIT_FDT_ADDR=0x1f800000

# Drivers
CONFIG_DRIVER_BUS_I2S_ROCKCHIP=y
Expand Down
4 changes: 2 additions & 2 deletions board/foster/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CONFIG_BOARD="foster"
# Image
CONFIG_BASE_ADDRESS=0xd4000000
CONFIG_HEAP_SIZE=0x04000000
CONFIG_KERNEL_START=0x85000000
CONFIG_KERNEL_START=0xa0000000

# Vboot
CONFIG_VIRTUAL_DEV_SWITCH=y
Expand All @@ -17,7 +17,7 @@ CONFIG_NV_STORAGE_FLASH=y

# Kernel format
CONFIG_KERNEL_FIT=y
CONFIG_KERNEL_FIT_FDT_ADDR=0x9ff00000
CONFIG_KERNEL_FIT_FDT_ADDR=0x9f800000

# Drivers
CONFIG_DRIVER_BUS_I2C_TEGRA=y
Expand Down
1 change: 1 addition & 0 deletions board/gale/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ CONFIG_BOARD="gale"
CONFIG_BASE_ADDRESS=0x88000000
CONFIG_HEAP_SIZE=0x01200000
CONFIG_KERNEL_START=0x80208000
CONFIG_KERNEL_SIZE=0x05000000

# Vboot
CONFIG_VIRTUAL_DEV_SWITCH=y
Expand Down
6 changes: 3 additions & 3 deletions board/gru/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ CONFIG_ARCH_ARM_V8=y
CONFIG_BOARD="gru"

# Image
CONFIG_BASE_ADDRESS=0x18000000
CONFIG_BASE_ADDRESS=0x40000000
CONFIG_HEAP_SIZE=0x01000000
CONFIG_KERNEL_START=0x15000000
CONFIG_KERNEL_START=0x20000000

# Vboot
CONFIG_TPM2_MODE=y
Expand All @@ -21,7 +21,7 @@ CONFIG_NV_STORAGE_FLASH=y

# Kernel format
CONFIG_KERNEL_FIT=y
CONFIG_KERNEL_FIT_FDT_ADDR=0x6400000
CONFIG_KERNEL_FIT_FDT_ADDR=0x1f800000

# Drivers
CONFIG_DRIVER_BUS_I2C_ROCKCHIP=y
Expand Down
6 changes: 3 additions & 3 deletions board/kevin/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ CONFIG_BOARD="kevin"
CONFIG_BOARD_DIR="gru"

# Image
CONFIG_BASE_ADDRESS=0x18000000
CONFIG_BASE_ADDRESS=0x40000000
CONFIG_HEAP_SIZE=0x01000000
CONFIG_KERNEL_START=0x15000000
CONFIG_KERNEL_START=0x20000000

# Vboot
CONFIG_EC_SOFTWARE_SYNC=y
Expand All @@ -20,7 +20,7 @@ CONFIG_NV_STORAGE_FLASH=y

# Kernel format
CONFIG_KERNEL_FIT=y
CONFIG_KERNEL_FIT_FDT_ADDR=0x6400000
CONFIG_KERNEL_FIT_FDT_ADDR=0x1f800000

# Drivers
CONFIG_DRIVER_BUS_I2C_ROCKCHIP=y
Expand Down
6 changes: 3 additions & 3 deletions board/rainier/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ CONFIG_BOARD="rainier"
CONFIG_BOARD_DIR="gru"

# Image
CONFIG_BASE_ADDRESS=0x18000000
CONFIG_BASE_ADDRESS=0x40000000
CONFIG_HEAP_SIZE=0x01000000
CONFIG_KERNEL_START=0x15000000
CONFIG_KERNEL_START=0x20000000

# Vboot
CONFIG_TPM2_MODE=y
Expand All @@ -21,7 +21,7 @@ CONFIG_NV_STORAGE_FLASH=y

# Kernel format
CONFIG_KERNEL_FIT=y
CONFIG_KERNEL_FIT_FDT_ADDR=0x6400000
CONFIG_KERNEL_FIT_FDT_ADDR=0x1f800000

# Drivers
CONFIG_DRIVER_BUS_I2S_ROCKCHIP=y
Expand Down
6 changes: 3 additions & 3 deletions board/scarlet/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ CONFIG_BOARD="scarlet"
CONFIG_BOARD_DIR="gru"

# Image
CONFIG_BASE_ADDRESS=0x18000000
CONFIG_BASE_ADDRESS=0x40000000
CONFIG_HEAP_SIZE=0x01000000
CONFIG_KERNEL_START=0x15000000
CONFIG_KERNEL_START=0x20000000

# Vboot
CONFIG_TPM2_MODE=y
Expand All @@ -22,7 +22,7 @@ CONFIG_NV_STORAGE_FLASH=y

# Kernel format
CONFIG_KERNEL_FIT=y
CONFIG_KERNEL_FIT_FDT_ADDR=0x6400000
CONFIG_KERNEL_FIT_FDT_ADDR=0x1f800000

# Drivers
CONFIG_DRIVER_BUS_I2S_ROCKCHIP=y
Expand Down
4 changes: 2 additions & 2 deletions board/smaug/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ CONFIG_ANDROID_DT_FIXUP=y
# Image
CONFIG_BASE_ADDRESS=0xd4000000
CONFIG_HEAP_SIZE=0x04000000
CONFIG_KERNEL_START=0x85000000
CONFIG_KERNEL_START=0xa0000000

# Vboot
CONFIG_EC_SOFTWARE_SYNC=y
Expand All @@ -21,7 +21,7 @@ CONFIG_NV_STORAGE_FLASH=y

# Kernel format
CONFIG_KERNEL_FIT=y
CONFIG_KERNEL_FIT_FDT_ADDR=0x9ff00000
CONFIG_KERNEL_FIT_FDT_ADDR=0x9f800000

# Drivers
CONFIG_DRIVER_BUS_I2C_TEGRA=y
Expand Down
1 change: 1 addition & 0 deletions board/urara/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ CONFIG_HEAP_SIZE=0x00800000
CONFIG_KERNEL_FIT=y
CONFIG_KERNEL_FIT_FDT_ADDR=0x00ff0000
CONFIG_KERNEL_START=0x01000000
CONFIG_KERNEL_SIZE=0x0E000000
CONFIG_LDSCRIPT_ARCH=y
CONFIG_NV_STORAGE_FLASH=y
4 changes: 2 additions & 2 deletions board/veyron_jaq/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CONFIG_BOARD_DIR="veyron"
# Image
CONFIG_BASE_ADDRESS=0x43000000
CONFIG_HEAP_SIZE=0x01000000
CONFIG_KERNEL_START=0x2000000
CONFIG_KERNEL_START=0x02000000

# Vboot
CONFIG_EC_SOFTWARE_SYNC=y
Expand All @@ -22,7 +22,7 @@ CONFIG_NV_STORAGE_CROS_EC=y

# Kernel format
CONFIG_KERNEL_FIT=y
CONFIG_KERNEL_FIT_FDT_ADDR=0x6400000
CONFIG_KERNEL_FIT_FDT_ADDR=0x1f800000

# Drivers
CONFIG_DRIVER_GPIO_RK3288=y
Expand Down
4 changes: 2 additions & 2 deletions board/veyron_jerry/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CONFIG_BOARD_DIR="veyron"
# Image
CONFIG_BASE_ADDRESS=0x43000000
CONFIG_HEAP_SIZE=0x01000000
CONFIG_KERNEL_START=0x2000000
CONFIG_KERNEL_START=0x02000000

# Vboot
CONFIG_EC_SOFTWARE_SYNC=y
Expand All @@ -22,7 +22,7 @@ CONFIG_NV_STORAGE_CROS_EC=y

# Kernel format
CONFIG_KERNEL_FIT=y
CONFIG_KERNEL_FIT_FDT_ADDR=0x6400000
CONFIG_KERNEL_FIT_FDT_ADDR=0x1f800000

# Drivers
CONFIG_DRIVER_GPIO_RK3288=y
Expand Down
4 changes: 2 additions & 2 deletions board/veyron_mickey/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ CONFIG_BOARD="veyron_mickey"
# Image
CONFIG_BASE_ADDRESS=0x43000000
CONFIG_HEAP_SIZE=0x01000000
CONFIG_KERNEL_START=0x2000000
CONFIG_KERNEL_START=0x02000000

# Vboot
CONFIG_VIRTUAL_DEV_SWITCH=y
Expand All @@ -20,7 +20,7 @@ CONFIG_NV_STORAGE_FLASH=y

# Kernel format
CONFIG_KERNEL_FIT=y
CONFIG_KERNEL_FIT_FDT_ADDR=0x6400000
CONFIG_KERNEL_FIT_FDT_ADDR=0x1f800000

# Drivers
CONFIG_DRIVER_GPIO_RK3288=y
Expand Down
4 changes: 2 additions & 2 deletions board/veyron_mighty/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CONFIG_BOARD_DIR="veyron"
# Image
CONFIG_BASE_ADDRESS=0x43000000
CONFIG_HEAP_SIZE=0x01000000
CONFIG_KERNEL_START=0x2000000
CONFIG_KERNEL_START=0x02000000

# Vboot
CONFIG_EC_SOFTWARE_SYNC=y
Expand All @@ -22,7 +22,7 @@ CONFIG_NV_STORAGE_CROS_EC=y

# Kernel format
CONFIG_KERNEL_FIT=y
CONFIG_KERNEL_FIT_FDT_ADDR=0x6400000
CONFIG_KERNEL_FIT_FDT_ADDR=0x1f800000

# Drivers
CONFIG_DRIVER_GPIO_RK3288=y
Expand Down
4 changes: 2 additions & 2 deletions board/veyron_minnie/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CONFIG_BOARD_DIR="veyron"
# Image
CONFIG_BASE_ADDRESS=0x43000000
CONFIG_HEAP_SIZE=0x01000000
CONFIG_KERNEL_START=0x2000000
CONFIG_KERNEL_START=0x02000000

# Vboot
CONFIG_EC_SOFTWARE_SYNC=y
Expand All @@ -22,7 +22,7 @@ CONFIG_NV_STORAGE_CROS_EC=y

# Kernel format
CONFIG_KERNEL_FIT=y
CONFIG_KERNEL_FIT_FDT_ADDR=0x6400000
CONFIG_KERNEL_FIT_FDT_ADDR=0x1f800000

# Drivers
CONFIG_DRIVER_GPIO_RK3288=y
Expand Down
4 changes: 2 additions & 2 deletions board/veyron_rialto/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ CONFIG_BOARD="veyron_rialto"
# Image
CONFIG_BASE_ADDRESS=0x23000000
CONFIG_HEAP_SIZE=0x01000000
CONFIG_KERNEL_START=0x2000000
CONFIG_KERNEL_START=0x02000000

# Vboot
CONFIG_CUSTOM_MUSIC=y
Expand All @@ -23,7 +23,7 @@ CONFIG_HEADLESS=y

# Kernel format
CONFIG_KERNEL_FIT=y
CONFIG_KERNEL_FIT_FDT_ADDR=0x6400000
CONFIG_KERNEL_FIT_FDT_ADDR=0x1f800000

# Drivers
CONFIG_DRIVER_GPIO_RK3288=y
Expand Down
4 changes: 2 additions & 2 deletions board/veyron_speedy/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CONFIG_BOARD_DIR="veyron"
# Image
CONFIG_BASE_ADDRESS=0x43000000
CONFIG_HEAP_SIZE=0x01000000
CONFIG_KERNEL_START=0x2000000
CONFIG_KERNEL_START=0x02000000

# Vboot
CONFIG_EC_SOFTWARE_SYNC=y
Expand All @@ -22,7 +22,7 @@ CONFIG_NV_STORAGE_CROS_EC=y

# Kernel format
CONFIG_KERNEL_FIT=y
CONFIG_KERNEL_FIT_FDT_ADDR=0x6400000
CONFIG_KERNEL_FIT_FDT_ADDR=0x1f800000

# Drivers
CONFIG_DRIVER_GPIO_RK3288=y
Expand Down
9 changes: 8 additions & 1 deletion src/boot/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,14 @@ config KERNEL_FIT_FDT_ADDR
hex "FIT device tree load address."
default 0x0
help
Where to put the updated device tree when booting a FIT image.
Where to put the updated device tree when booting a FIT image. The
area reserved by this is 8MB.

==== Placement guide (also see kernel/Documentation/<arch>/boot*) ====
arm32: Somewhere between 128MB and 512MB from the start of RAM. Do not
overlap DMA_COHERENT area (from coreboot memlayout)!
arm64: Within the first 512MB of RAM, but as far away from the start
of RAM as possible (i.e. ideally at 504MB).

config ANDROID_DT_FIXUP
bool "Fixup device tree with properties for Android"
Expand Down
27 changes: 19 additions & 8 deletions src/image/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,32 @@ config KERNEL_START
a wrapper around the actual kernel code (e.g. FIT) and may or may not
require further decompression or relocation.

==== Placement guide (also see kernel/Documentation/<arch>/boot*) ====
arm32: Within first 128MB of RAM. Ideally at exactly 32MB. Do not
overlap DMA_COHERENT area (from coreboot memlayout)!
arm64: Anywhere, but leave as much space as possible empty from the
start of RAM (ideally up to 512MB, see KERNEL_FIT_FDT_ADDR help).
x86: Do not change, defaults should work fine.

config KERNEL_SIZE
hex "The size of the region the kernel image is loaded into"
default 0x10000000 if FASTBOOT_MODE
default 0x2000000
default 0x08000000 if ARCH_ARM_V7 # kernel ABI limitation
default 0x20000000
help
The size of the memory region described in KERNEL_START.
The size of the memory region described in KERNEL_START. Note that we
want this to be very generous, to have the option of loading recovery
kernels with large attached initramfs in the future. While the kernel
partition size on the fixed disk is usually much smaller anyway, we
can make the partition on the recovery USB stick as big as we want
later on. Since recovery firmware cannot be updated, this limit needs
to be made sufficiently large in advance.
(NOTE: Pre-2018 devices have significantly smaller limits here.)

config BASE_ADDRESS
hex "The address depthcharge is linked to run at"
default 0x2000000
default 0x30000000
help
The address that the main part of depthcharge runs at. That includes
everything except the code which pivots between the read only and
read/write firmware which is linked to run from the region of memory
the kernel is eventually loaded into.
The address that the the depthcharge code and data is linked to.

config HEAP_SIZE
hex "The size of the heap in bytes"
Expand Down

0 comments on commit 45f2be2

Please sign in to comment.