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 CFG_SYS_SDRAM_BASE 0x71000000
24 * "(0x40000000 - CONFIG_SYS_RESERVE_MEM_SIZE)" has been used in
25 * u-boot nanopi2-v2016.01.
26 * This is not working anymore because boot_fdt_add_mem_rsv_regions() in
27 * common/image-fdt.c has been extended:
28 * Also reserved-memory sections are marked as unusable.
30 * In friendlyArm Ubuntu 16.04 source arch/arm/boot/dts/s5p4418.dtsi:
32 * #address-cells = <1>;
36 * secure_memory@b0000000 {
37 * reg = <0xB0000000 0x1000000>;
42 * arch_lmb_reserve() of arch/arm/lib/bootm.c:
43 * "Allocate space for command line and board info - ... below the current
45 * --> Memory allocated would overlap with "secure_memory@b0000000"
46 * --> lmb_add_region(rgn, base==0xb0000000, size==0x1000000) fails,
49 * Kernel image @ 0x71080000 [ 0x000000 - 0x60e628 ]
50 * ## Flattened Device Tree blob at 7a000000
51 * Booting using the fdt blob at 0x7a000000
52 * ERROR: reserving fdt memory region failed (addr=b0000000 size=1000000)
53 * Using Device Tree in place at 7a000000, end 7a00fbf0
58 #define CFG_SYS_SDRAM_SIZE (0xb0000000 - CFG_SYS_SDRAM_BASE)
60 #define BMP_LOAD_ADDR 0x78000000
62 /* kernel load address */
63 #define INITRD_START 0x79000000
64 #define KERNEL_DTB_ADDR 0x7A000000
66 /*-----------------------------------------------------------------------
67 * High Level System Configuration
69 /* decrementer freq: 1ms ticks */
71 /*-----------------------------------------------------------------------
72 * System initialize options (board_init_f)
74 /* board_init_f->init_sequence, call arch_cpu_init */
76 /*-----------------------------------------------------------------------
77 * serial console configuration
80 /* 150MHz is the clock rate set by SPL (uart0) */
81 #define CFG_PL011_CLOCK 150000000
83 /*-----------------------------------------------------------------------
86 #ifndef CONFIG_S5P4418_ONEWIRE
89 #define BACKLIGHT_CH 0
90 #define BACKLIGHT_DIV 0
91 #define BACKLIGHT_INV 0
92 #define BACKLIGHT_DUTY 50
93 #define BACKLIGHT_HZ 1000
97 /*-----------------------------------------------------------------------
101 #ifdef CONFIG_VIDEO_LOGO
102 #ifdef CONFIG_SPLASH_SCREEN
103 #define SPLASH_FILE logo.bmp
108 /*-----------------------------------------------------------------------
111 #define BLOADER_MMC \
112 "ext4load mmc ${rootdev}:${bootpart} "
114 #ifdef CONFIG_OF_BOARD_SETUP
115 #define EXTRA_ENV_DTB_RESERVE \
117 "if test -n \"$dtb_addr\"; then fdt addr $dtb_addr; fi\0"
119 #define EXTRA_ENV_DTB_RESERVE \
121 "if test -n \"$fb_addr\"; then " \
122 "fdt addr $dtb_addr;" \
124 "fdt mk /reserved-memory display_reserved;" \
125 "fdt set /reserved-memory/display_reserved " \
126 "reg <$fb_addr 0x800000>;" \
130 #ifdef CONFIG_SPLASH_SCREEN
131 #define EXTRA_ENV_BOOT_LOGO \
132 "splashimage=" __stringify(BMP_LOAD_ADDR)"\0" \
133 "splashfile=" __stringify(SPLASH_FILE)"\0" \
136 EXTRA_ENV_DTB_RESERVE
138 #define EXTRA_ENV_BOOT_LOGO EXTRA_ENV_DTB_RESERVE
141 #define CFG_EXTRA_ENV_SETTINGS \
142 "fdt_high=0xffffffff\0" \
143 "initrd_high=0xffffffff\0" \
144 "rootdev=" __stringify(CONFIG_ROOT_DEV) "\0" \
145 "rootpart=" __stringify(CONFIG_ROOT_PART) "\0" \
146 "bootpart=" __stringify(CONFIG_BOOT_PART) "\0" \
148 "loadaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
149 "dtb_name=s5p4418-nanopi2-rev01.dtb\0" \
150 "dtb_addr=" __stringify(KERNEL_DTB_ADDR) "\0" \
151 "initrd_name=ramdisk.img\0" \
152 "initrd_addr=" __stringify(INITRD_START) "\0" \
153 "initrd_size=0x600000\0" \
155 BLOADER_MMC "${dtb_addr} ${dtb_name}; " \
156 "run dtb_reserve\0" \
158 BLOADER_MMC "${loadaddr} ${kernel}\0" \
160 BLOADER_MMC "${initrd_addr} ${initrd_name}; " \
161 "setenv initrd_size 0x${filesize}\0" \
163 "run load_kernel; run load_initrd; run load_dtb; " \
164 "bootz ${loadaddr} ${initrd_addr}:${initrd_size} " \
166 "bootcmd=run mmcboot\0" \
169 #endif /* __CONFIG_H__ */