]>
Commit | Line | Data |
---|---|---|
b39cacc2 SB |
1 | /* SPDX-License-Identifier: GPL-2.0+ |
2 | * | |
3 | * Copyright (C) Guangzhou FriendlyARM Computer Tech. Co., Ltd. | |
4 | * (http://www.friendlyarm.com) | |
5 | * | |
6 | * (C) Copyright 2016 Nexell | |
7 | * Hyejung Kwon <[email protected]> | |
8 | * | |
9 | * Copyright (C) 2019 Stefan Bosch <[email protected]> | |
10 | */ | |
11 | ||
12 | #ifndef __CONFIG_H__ | |
13 | #define __CONFIG_H__ | |
14 | ||
15 | #include <linux/sizes.h> | |
16 | #include <asm/arch/nexell.h> | |
17 | ||
18 | /*----------------------------------------------------------------------- | |
19 | * System memory Configuration | |
20 | */ | |
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 | |
25 | ||
26 | /* | |
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. | |
32 | * | |
33 | * In friendlyArm Ubuntu 16.04 source arch/arm/boot/dts/s5p4418.dtsi: | |
34 | * reserved-memory { | |
35 | * #address-cells = <1>; | |
36 | * #size-cells = <1>; | |
37 | * ranges; | |
38 | * | |
39 | * secure_memory@b0000000 { | |
40 | * reg = <0xB0000000 0x1000000>; | |
41 | * nop-map; | |
42 | * }; | |
43 | * }; | |
44 | * | |
45 | * arch_lmb_reserve() of arch/arm/lib/bootm.c: | |
46 | * "Allocate space for command line and board info - ... below the current | |
47 | * stack pointer." | |
48 | * --> Memory allocated would overlap with "secure_memory@b0000000" | |
49 | * --> lmb_add_region(rgn, base==0xb0000000, size==0x1000000) fails, | |
50 | * boot output: | |
51 | * ... | |
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 | |
57 | * | |
58 | * Starting kernel ... | |
59 | * ... | |
60 | */ | |
61 | #define CONFIG_SYS_SDRAM_SIZE (0xb0000000 - CONFIG_SYS_SDRAM_BASE) | |
62 | ||
b39cacc2 SB |
63 | #define BMP_LOAD_ADDR 0x78000000 |
64 | ||
65 | /* kernel load address */ | |
b39cacc2 SB |
66 | #define INITRD_START 0x79000000 |
67 | #define KERNEL_DTB_ADDR 0x7A000000 | |
68 | ||
69 | /*----------------------------------------------------------------------- | |
70 | * High Level System Configuration | |
71 | */ | |
72 | /* Not used: not need IRQ/FIQ stuff */ | |
73 | #undef CONFIG_USE_IRQ | |
74 | /* decrementer freq: 1ms ticks */ | |
b39cacc2 SB |
75 | |
76 | /*----------------------------------------------------------------------- | |
77 | * System initialize options (board_init_f) | |
78 | */ | |
79 | /* board_init_f->init_sequence, call arch_cpu_init */ | |
b39cacc2 | 80 | |
b39cacc2 SB |
81 | /* Console I/O Buffer Size */ |
82 | #define CONFIG_SYS_CBSIZE 1024 | |
83 | /* Print Buffer Size */ | |
84 | #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \ | |
85 | sizeof(CONFIG_SYS_PROMPT) + 16) | |
86 | /* max number of command args */ | |
87 | #define CONFIG_SYS_MAXARGS 16 | |
88 | /* Boot Argument Buffer Size */ | |
89 | #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE | |
90 | ||
b39cacc2 SB |
91 | /*----------------------------------------------------------------------- |
92 | * Etc Command definition | |
93 | */ | |
94 | #undef CONFIG_BOOTM_NETBSD | |
95 | #undef CONFIG_BOOTM_RTEMS | |
96 | ||
97 | /*----------------------------------------------------------------------- | |
98 | * serial console configuration | |
99 | */ | |
100 | #define CONFIG_PL011_CLOCK 50000000 | |
101 | #define CONFIG_PL01x_PORTS {(void *)PHY_BASEADDR_UART0, \ | |
102 | (void *)PHY_BASEADDR_UART1, \ | |
103 | (void *)PHY_BASEADDR_UART2, \ | |
104 | (void *)PHY_BASEADDR_UART3} | |
b39cacc2 | 105 | |
b39cacc2 SB |
106 | /*----------------------------------------------------------------------- |
107 | * BACKLIGHT | |
108 | */ | |
109 | #ifndef CONFIG_S5P4418_ONEWIRE | |
110 | #ifdef CONFIG_PWM_NX | |
111 | /* fallback to pwm */ | |
112 | #define BACKLIGHT_CH 0 | |
113 | #define BACKLIGHT_DIV 0 | |
114 | #define BACKLIGHT_INV 0 | |
115 | #define BACKLIGHT_DUTY 50 | |
116 | #define BACKLIGHT_HZ 1000 | |
117 | #endif | |
118 | #endif | |
119 | ||
b39cacc2 SB |
120 | /*----------------------------------------------------------------------- |
121 | * VIDEO | |
122 | */ | |
123 | ||
124 | #define CONFIG_VIDEO_LOGO | |
125 | ||
b39cacc2 | 126 | #ifdef CONFIG_VIDEO_LOGO |
b39cacc2 | 127 | #ifdef CONFIG_SPLASH_SCREEN |
b39cacc2 SB |
128 | #define SPLASH_FILE logo.bmp |
129 | #endif | |
130 | ||
131 | #endif | |
132 | ||
133 | /*----------------------------------------------------------------------- | |
134 | * ENV | |
135 | */ | |
136 | #define BLOADER_MMC \ | |
137 | "ext4load mmc ${rootdev}:${bootpart} " | |
138 | ||
139 | #ifdef CONFIG_OF_BOARD_SETUP | |
140 | #define EXTRA_ENV_DTB_RESERVE \ | |
141 | "dtb_reserve=" \ | |
142 | "if test -n \"$dtb_addr\"; then fdt addr $dtb_addr; fi\0" | |
143 | #else | |
144 | #define EXTRA_ENV_DTB_RESERVE \ | |
145 | "dtb_reserve=" \ | |
146 | "if test -n \"$fb_addr\"; then " \ | |
147 | "fdt addr $dtb_addr;" \ | |
148 | "fdt resize;" \ | |
149 | "fdt mk /reserved-memory display_reserved;" \ | |
150 | "fdt set /reserved-memory/display_reserved " \ | |
151 | "reg <$fb_addr 0x800000>;" \ | |
152 | "fi;\0" | |
153 | #endif | |
154 | ||
155 | #ifdef CONFIG_SPLASH_SCREEN | |
156 | #define EXTRA_ENV_BOOT_LOGO \ | |
157 | "splashimage=" __stringify(BMP_LOAD_ADDR)"\0" \ | |
158 | "splashfile=" __stringify(SPLASH_FILE)"\0" \ | |
159 | "splashpos=m,m\0" \ | |
160 | "fb_addr=\0" \ | |
161 | EXTRA_ENV_DTB_RESERVE | |
162 | #else | |
163 | #define EXTRA_ENV_BOOT_LOGO EXTRA_ENV_DTB_RESERVE | |
164 | #endif | |
165 | ||
166 | #define CONFIG_EXTRA_ENV_SETTINGS \ | |
167 | "fdt_high=0xffffffff\0" \ | |
168 | "initrd_high=0xffffffff\0" \ | |
169 | "rootdev=" __stringify(CONFIG_ROOT_DEV) "\0" \ | |
170 | "rootpart=" __stringify(CONFIG_ROOT_PART) "\0" \ | |
171 | "bootpart=" __stringify(CONFIG_BOOT_PART) "\0" \ | |
172 | "kernel=zImage\0" \ | |
173 | "loadaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \ | |
174 | "dtb_name=s5p4418-nanopi2-rev01.dtb\0" \ | |
175 | "dtb_addr=" __stringify(KERNEL_DTB_ADDR) "\0" \ | |
176 | "initrd_name=ramdisk.img\0" \ | |
177 | "initrd_addr=" __stringify(INITRD_START) "\0" \ | |
178 | "initrd_size=0x600000\0" \ | |
179 | "load_dtb=" \ | |
180 | BLOADER_MMC "${dtb_addr} ${dtb_name}; " \ | |
181 | "run dtb_reserve\0" \ | |
182 | "load_kernel=" \ | |
183 | BLOADER_MMC "${loadaddr} ${kernel}\0" \ | |
184 | "load_initrd=" \ | |
185 | BLOADER_MMC "${initrd_addr} ${initrd_name}; " \ | |
186 | "setenv initrd_size 0x${filesize}\0" \ | |
187 | "mmcboot=" \ | |
188 | "run load_kernel; run load_initrd; run load_dtb; " \ | |
189 | "bootz ${loadaddr} ${initrd_addr}:${initrd_size} " \ | |
190 | "${dtb_addr}\0" \ | |
191 | "bootcmd=run mmcboot\0" \ | |
192 | EXTRA_ENV_BOOT_LOGO | |
193 | ||
194 | #endif /* __CONFIG_H__ */ |