blob: ba5eb7a4a8aa724627af87c78eb9b446c7347b1a [file] [log] [blame]
Thomas Fitzsimmons894c3ad2018-06-08 17:59:45 -04001/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * (C) Copyright 2018 Cisco Systems, Inc.
4 *
5 * Author: Thomas Fitzsimmons <fitzsim@fitzsim.org>
6 *
7 * Configuration settings for the Broadcom BCMSTB SoC family.
8 */
9
10#ifndef __BCMSTB_H
11#define __BCMSTB_H
12
13#include "version.h"
14#include <linux/sizes.h>
Thomas Fitzsimmonsdc7685e2018-07-26 22:55:37 -040015
16#ifndef __ASSEMBLY__
17
18#include <linux/types.h>
19
20struct bcmstb_boot_parameters {
21 u32 r0;
22 u32 r1;
23 u32 r2;
24 u32 r3;
25 u32 sp;
26 u32 lr;
27};
28
29extern struct bcmstb_boot_parameters bcmstb_boot_parameters;
30
31extern phys_addr_t prior_stage_fdt_address;
32
33#endif /* __ASSEMBLY__ */
Thomas Fitzsimmons894c3ad2018-06-08 17:59:45 -040034
35/*
Thomas Fitzsimmons894c3ad2018-06-08 17:59:45 -040036 * CPU configuration.
37 */
38#define CONFIG_SKIP_LOWLEVEL_INIT
39
40/*
41 * Memory configuration.
42 *
43 * The prior stage BOLT bootloader sets up memory for us.
44 *
45 * An example boot memory layout after loading everything is:
46 *
47 * 0x0000 8000 vmlinux.bin.gz
48 * : [~31 MiB uncompressed max]
49 * 0x01ef f000 FIT containing signed public key
50 * : [~2 KiB in size]
51 * 0x01f0 0000 DTB copied from prior-stage-provided region
52 * : [~1 MiB max]
53 * 0x0200 0000 FIT containing ramdisk and device tree
54 * : initramfs.cpio.gz
55 * : [~208 MiB uncompressed max, to CMA/bmem low address]
56 * : [~80 MiB compressed max, to PSB low address]
57 * : device tree binary
58 * : [~60 KiB]
59 * 0x0700 0000 Prior stage bootloader (PSB)
60 * :
61 * 0x0761 7000 Prior-stage-provided device tree binary (DTB)
62 * : [~40 KiB in size]
63 * 0x0f00 0000 Contiguous memory allocator (CMA/bmem) low address
64 * :
65 * 0x8010 0000 U-Boot code at ELF load address
66 * : [~500 KiB in size, stripped]
67 * 0xc000 0000 Top of RAM
68 *
69 * Setting gd->relocaddr to CONFIG_SYS_TEXT_BASE in dram_init_banksize
70 * prevents U-Boot from relocating itself when it is run as an ELF
71 * program by the prior stage bootloader.
72 *
73 * We want to keep the ramdisk and FDT in the FIT image in-place, to
74 * accommodate stblinux's bmem and CMA regions. To accomplish this,
75 * we set initrd_high and fdt_high to 0xffffffff, and the load and
76 * entry addresses of the FIT ramdisk entry to 0x0.
77 *
78 * Overwriting the prior stage bootloader causes memory instability,
79 * so the compressed initramfs needs to fit between the load address
80 * and the PSB low address. In BOLT's default configuration this
81 * limits the compressed size of the initramfs to approximately 80
82 * MiB. However, BOLT can be configured to allow loading larger
83 * initramfs images, in which case this limitation is eliminated.
84 */
Thomas Fitzsimmons894c3ad2018-06-08 17:59:45 -040085#define CONFIG_SYS_SDRAM_BASE 0x00000000
Thomas Fitzsimmons894c3ad2018-06-08 17:59:45 -040086#define CONFIG_SYS_INIT_RAM_SIZE 0x100000
87#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \
88 CONFIG_SYS_INIT_RAM_SIZE - \
89 GENERATED_GBL_DATA_SIZE)
Thomas Fitzsimmons894c3ad2018-06-08 17:59:45 -040090#define CONFIG_SYS_LOAD_ADDR 0x2000000
91
92/*
93 * CONFIG_SYS_LOAD_ADDR - 1 MiB.
94 */
95#define CONFIG_SYS_FDT_SAVE_ADDRESS 0x1f00000
96#define CONFIG_SYS_CBSIZE 512
97#define CONFIG_SYS_MAXARGS 32
98
99/*
100 * Large kernel image bootm configuration.
101 */
102#define CONFIG_SYS_BOOTM_LEN SZ_64M
103
104/*
105 * NS16550 configuration.
106 */
107#define V_NS16550_CLK 81000000
108
109#define CONFIG_SYS_NS16550
110#define CONFIG_SYS_NS16550_SERIAL
111#define CONFIG_SYS_NS16550_REG_SIZE (-4)
112#define CONFIG_SYS_NS16550_CLK V_NS16550_CLK
113
114/*
115 * Serial console configuration.
116 */
Thomas Fitzsimmons894c3ad2018-06-08 17:59:45 -0400117#define CONFIG_BAUDRATE 115200
118#define CONFIG_SYS_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600, \
119 115200}
120
121/*
122 * Informational display configuration.
123 */
124#define CONFIG_REVISION_TAG
125
126/*
127 * Command configuration.
128 */
129#define CONFIG_CMD_ASKENV
130#define CONFIG_CMD_CACHE
131#define CONFIG_CMD_EXT2
Thomas Fitzsimmons894c3ad2018-06-08 17:59:45 -0400132#define CONFIG_CMD_MMC
133
134/*
135 * Flash configuration.
136 */
137#define CONFIG_ST_SMI
138#define CONFIG_SPI_FLASH_STMICRO
139#define CONFIG_SPI_FLASH_MACRONIX
140
141/*
142 * Filesystem configuration.
143 */
144#define CONFIG_DOS_PARTITION
145#define CONFIG_CMD_EXT4
146#define CONFIG_FS_EXT4
147#define CONFIG_CMD_FS_GENERIC
148
149/*
150 * Environment configuration.
151 */
Thomas Fitzsimmons894c3ad2018-06-08 17:59:45 -0400152#define CONFIG_ENV_OVERWRITE
153
154/*
155 * Save the prior stage provided DTB.
156 */
Thomas Fitzsimmons894c3ad2018-06-08 17:59:45 -0400157/*
158 * Enable in-place RFS with this initrd_high setting.
159 */
160#define CONFIG_EXTRA_ENV_SETTINGS \
161 "fdtsaveaddr=" __stringify(CONFIG_SYS_FDT_SAVE_ADDRESS) "\0" \
162 "initrd_high=0xffffffff\0" \
163 "fdt_high=0xffffffff\0"
164
165/*
166 * Set fdtaddr to prior stage-provided DTB in board_late_init, when
167 * writeable environment is available.
168 */
169#define CONFIG_BOARD_LATE_INIT
170
Thomas Fitzsimmons894c3ad2018-06-08 17:59:45 -0400171#endif /* __BCMSTB_H */