1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * (C) Copyright 2018 Cisco Systems, Inc.
5 * Author: Thomas Fitzsimmons <fitzsim@fitzsim.org>
7 * Configuration settings for the Broadcom BCMSTB SoC family.
13 #include <linux/sizes.h>
17 #include <linux/stringify.h>
18 #include <linux/types.h>
20 struct bcmstb_boot_parameters {
29 extern struct bcmstb_boot_parameters bcmstb_boot_parameters;
31 extern phys_addr_t prior_stage_fdt_address;
33 #endif /* __ASSEMBLY__ */
40 * Memory configuration.
42 * The prior stage BOLT bootloader sets up memory for us.
44 * An example boot memory layout after loading everything is:
46 * 0x0000 8000 vmlinux.bin.gz
47 * : [~31 MiB uncompressed max]
48 * 0x01ef f000 FIT containing signed public key
50 * 0x01f0 0000 DTB copied from prior-stage-provided region
52 * 0x0200 0000 FIT containing ramdisk and device tree
54 * : [~208 MiB uncompressed max, to CMA/bmem low address]
55 * : [~80 MiB compressed max, to PSB low address]
56 * : device tree binary
58 * 0x0700 0000 Prior stage bootloader (PSB)
60 * 0x0761 7000 Prior-stage-provided device tree binary (DTB)
62 * 0x0f00 0000 Contiguous memory allocator (CMA/bmem) low address
64 * 0x8010 0000 U-Boot code at ELF load address
65 * : [~500 KiB in size, stripped]
66 * 0xc000 0000 Top of RAM
68 * Setting gd->relocaddr to CONFIG_SYS_TEXT_BASE in dram_init_banksize
69 * prevents U-Boot from relocating itself when it is run as an ELF
70 * program by the prior stage bootloader.
72 * We want to keep the ramdisk and FDT in the FIT image in-place, to
73 * accommodate stblinux's bmem and CMA regions. To accomplish this,
74 * we set initrd_high and fdt_high to 0xffffffff, and the load and
75 * entry addresses of the FIT ramdisk entry to 0x0.
77 * Overwriting the prior stage bootloader causes memory instability,
78 * so the compressed initramfs needs to fit between the load address
79 * and the PSB low address. In BOLT's default configuration this
80 * limits the compressed size of the initramfs to approximately 80
81 * MiB. However, BOLT can be configured to allow loading larger
82 * initramfs images, in which case this limitation is eliminated.
84 #define CONFIG_SYS_SDRAM_BASE 0x00000000
85 #define CONFIG_SYS_INIT_RAM_SIZE 0x100000
86 #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \
87 CONFIG_SYS_INIT_RAM_SIZE - \
88 GENERATED_GBL_DATA_SIZE)
91 * CONFIG_SYS_LOAD_ADDR - 1 MiB.
93 #define CONFIG_SYS_CBSIZE 512
94 #define CONFIG_SYS_MAXARGS 32
97 * Large kernel image bootm configuration.
99 #define CONFIG_SYS_BOOTM_LEN SZ_64M
102 * NS16550 configuration.
104 #define V_NS16550_CLK 81000000
106 #define CONFIG_SYS_NS16550_SERIAL
107 #define CONFIG_SYS_NS16550_REG_SIZE (-4)
108 #define CONFIG_SYS_NS16550_CLK V_NS16550_CLK
111 * Serial console configuration.
113 #define CONFIG_SYS_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600, \
117 * Informational display configuration.
121 * Command configuration.
125 * Flash configuration.
129 * Filesystem configuration.
133 * Environment configuration.
137 * Save the prior stage provided DTB.
140 * Enable in-place RFS with this initrd_high setting.
142 #define CONFIG_EXTRA_ENV_SETTINGS \
143 "fdtsaveaddr=" __stringify(CONFIG_SYS_FDT_SAVE_ADDRESS) "\0" \
144 "initrd_high=0xffffffff\0" \
145 "fdt_high=0xffffffff\0"
148 * Set fdtaddr to prior stage-provided DTB in board_late_init, when
149 * writeable environment is available.
152 #endif /* __BCMSTB_H */