1 /* SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) Guangzhou FriendlyARM Computer Tech. Co., Ltd.
4 * (http://www.friendlyarm.com)
6 * (C) Copyright 2016 Nexell
7 * Hyejung Kwon <cjscld15@nexell.co.kr>
9 * Copyright (C) 2019 Stefan Bosch <stefan_b@posteo.net>
15 #include <linux/sizes.h>
16 #include <asm/arch/nexell.h>
18 /*-----------------------------------------------------------------------
19 * System memory Configuration
21 #define CONFIG_SYS_INIT_SP_ADDR CONFIG_SYS_TEXT_BASE
22 #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE
23 #define CONFIG_SYS_MEM_SIZE 0x40000000
24 #define CONFIG_SYS_SDRAM_BASE 0x71000000
27 * "(CONFIG_SYS_MEM_SIZE - CONFIG_SYS_RESERVE_MEM_SIZE)" has been used in
28 * u-boot nanopi2-v2016.01.
29 * This is not working anymore because boot_fdt_add_mem_rsv_regions() in
30 * common/image-fdt.c has been extended:
31 * Also reserved-memory sections are marked as unusable.
33 * In friendlyArm Ubuntu 16.04 source arch/arm/boot/dts/s5p4418.dtsi:
35 * #address-cells = <1>;
39 * secure_memory@b0000000 {
40 * reg = <0xB0000000 0x1000000>;
45 * arch_lmb_reserve() of arch/arm/lib/bootm.c:
46 * "Allocate space for command line and board info - ... below the current
48 * --> Memory allocated would overlap with "secure_memory@b0000000"
49 * --> lmb_add_region(rgn, base==0xb0000000, size==0x1000000) fails,
52 * Kernel image @ 0x71080000 [ 0x000000 - 0x60e628 ]
53 * ## Flattened Device Tree blob at 7a000000
54 * Booting using the fdt blob at 0x7a000000
55 * ERROR: reserving fdt memory region failed (addr=b0000000 size=1000000)
56 * Using Device Tree in place at 7a000000, end 7a00fbf0
61 #define CONFIG_SYS_SDRAM_SIZE (0xb0000000 - CONFIG_SYS_SDRAM_BASE)
63 #define BMP_LOAD_ADDR 0x78000000
65 /* kernel load address */
66 #define INITRD_START 0x79000000
67 #define KERNEL_DTB_ADDR 0x7A000000
69 /*-----------------------------------------------------------------------
70 * High Level System Configuration
72 /* Not used: not need IRQ/FIQ stuff */
74 /* decrementer freq: 1ms ticks */
75 #define CONFIG_SYS_HZ 1000
77 /*-----------------------------------------------------------------------
78 * System initialize options (board_init_f)
80 /* board_init_f->init_sequence, call arch_cpu_init */
81 #define CONFIG_ARCH_CPU_INIT
83 /*-----------------------------------------------------------------------
84 * Miscellaneous configurable options
86 #ifdef CONFIG_SYS_PROMPT
87 #undef CONFIG_SYS_PROMPT
88 /* Monitor Command Prompt */
89 #define CONFIG_SYS_PROMPT "nanopi2# "
92 /* Console I/O Buffer Size */
93 #define CONFIG_SYS_CBSIZE 1024
94 /* Print Buffer Size */
95 #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \
96 sizeof(CONFIG_SYS_PROMPT) + 16)
97 /* max number of command args */
98 #define CONFIG_SYS_MAXARGS 16
99 /* Boot Argument Buffer Size */
100 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
102 /*-----------------------------------------------------------------------
103 * Etc Command definition
105 #undef CONFIG_BOOTM_NETBSD
106 #undef CONFIG_BOOTM_RTEMS
108 /*-----------------------------------------------------------------------
109 * serial console configuration
111 #define CONFIG_PL011_CLOCK 50000000
112 #define CONFIG_PL01x_PORTS {(void *)PHY_BASEADDR_UART0, \
113 (void *)PHY_BASEADDR_UART1, \
114 (void *)PHY_BASEADDR_UART2, \
115 (void *)PHY_BASEADDR_UART3}
116 #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
118 /*-----------------------------------------------------------------------
121 #define CONFIG_SYS_PLLFIN 24000000UL
123 /*-----------------------------------------------------------------------
126 #define CONFIG_TIMER_SYS_TICK_CH 0
128 /*-----------------------------------------------------------------------
131 #ifndef CONFIG_S5P4418_ONEWIRE
133 /* fallback to pwm */
134 #define BACKLIGHT_CH 0
135 #define BACKLIGHT_DIV 0
136 #define BACKLIGHT_INV 0
137 #define BACKLIGHT_DUTY 50
138 #define BACKLIGHT_HZ 1000
142 /*-----------------------------------------------------------------------
146 #define CONFIG_VIDEO_LOGO
148 #ifdef CONFIG_VIDEO_LOGO
149 #ifdef CONFIG_SPLASH_SCREEN
150 #define SPLASH_FILE logo.bmp
155 /*-----------------------------------------------------------------------
158 #define BLOADER_MMC \
159 "ext4load mmc ${rootdev}:${bootpart} "
161 #ifdef CONFIG_OF_BOARD_SETUP
162 #define EXTRA_ENV_DTB_RESERVE \
164 "if test -n \"$dtb_addr\"; then fdt addr $dtb_addr; fi\0"
166 #define EXTRA_ENV_DTB_RESERVE \
168 "if test -n \"$fb_addr\"; then " \
169 "fdt addr $dtb_addr;" \
171 "fdt mk /reserved-memory display_reserved;" \
172 "fdt set /reserved-memory/display_reserved " \
173 "reg <$fb_addr 0x800000>;" \
177 #ifdef CONFIG_SPLASH_SCREEN
178 #define EXTRA_ENV_BOOT_LOGO \
179 "splashimage=" __stringify(BMP_LOAD_ADDR)"\0" \
180 "splashfile=" __stringify(SPLASH_FILE)"\0" \
183 EXTRA_ENV_DTB_RESERVE
185 #define EXTRA_ENV_BOOT_LOGO EXTRA_ENV_DTB_RESERVE
188 #define CONFIG_EXTRA_ENV_SETTINGS \
189 "fdt_high=0xffffffff\0" \
190 "initrd_high=0xffffffff\0" \
191 "rootdev=" __stringify(CONFIG_ROOT_DEV) "\0" \
192 "rootpart=" __stringify(CONFIG_ROOT_PART) "\0" \
193 "bootpart=" __stringify(CONFIG_BOOT_PART) "\0" \
195 "loadaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
196 "dtb_name=s5p4418-nanopi2-rev01.dtb\0" \
197 "dtb_addr=" __stringify(KERNEL_DTB_ADDR) "\0" \
198 "initrd_name=ramdisk.img\0" \
199 "initrd_addr=" __stringify(INITRD_START) "\0" \
200 "initrd_size=0x600000\0" \
202 BLOADER_MMC "${dtb_addr} ${dtb_name}; " \
203 "run dtb_reserve\0" \
205 BLOADER_MMC "${loadaddr} ${kernel}\0" \
207 BLOADER_MMC "${initrd_addr} ${initrd_name}; " \
208 "setenv initrd_size 0x${filesize}\0" \
210 "run load_kernel; run load_initrd; run load_dtb; " \
211 "bootz ${loadaddr} ${initrd_addr}:${initrd_size} " \
213 "bootcmd=run mmcboot\0" \
216 #endif /* __CONFIG_H__ */