2 * Copyright (C) 2019 Samsung Electronics
4 * Configuration settings for the Tizen Amlogic board.
6 * SPDX-License-Identifier: GPL-2.0+
9 #ifndef __CONFIG_TIZEN_AMLOGIC_H
10 #define __CONFIG_TIZEN_AMLOGIC_H
13 /* ATAGs support for bootm/bootz */
14 #define CONFIG_SETUP_MEMORY_TAGS
15 #define CONFIG_CMDLINE_TAG
16 #define CONFIG_INITRD_TAG
18 #define CONFIG_SYS_MEM_TOP_HIDE 0x08000000
21 #define DFU_ALT_SYSTEM \
22 "Image.gz fat -1 1;" \
23 "meson64_odroidn2.dtb fat -1 1;" \
24 "meson64_odroidn2_plus.dtb fat -1 1;" \
25 "meson64_odroidc4.dtb fat -1 1;" \
26 "meson64_odroidhc4.dtb fat -1 1;" \
27 "kvim3_linux.dtb fat -1 1;" \
28 "kvim3l_linux.dtb fat -1 1;" \
29 "meson-g12b-odroid-n2.dtb fat -1 1;" \
30 "meson-g12b-odroid-n2_plus.dtb fat -1 1;" \
31 "meson-sm1-odroid-c4.dtb fat -1 1;" \
32 "meson-sm1-odroid-hc4.dtb fat -1 1;" \
33 "meson-g12b-a311d-khadas-vim3.dtb fat -1 1;" \
34 "meson-sm1-khadas-vim3l.dtb fat -1 1;" \
35 "boot.scr.uimg fat -1 1;" \
36 "params-c4.bin fat -1 1;" \
37 "params-n2.bin fat -1 1;" \
38 "params-vim3.bin fat -1 1;" \
39 "params-vim3l.bin fat -1 1;" \
40 "tizen_logo.bmp.gz fat -1 1;" \
41 "kvim/Image.gz fat -1 1;" \
42 "odroid/Image.gz fat -1 1;" \
43 "boot.img part -1 1;" \
45 "system-data part -1 3;" \
48 "ramdisk.img part -1 7;" \
49 "ramdisk-recovery.img part -1 8;" \
54 * '0-format.cmd' entity is common for all boards, but it has to be
55 * defined in the per-board DFU_ALT_BOOT_* to ensure that it is also
56 * available in the dfu_alt_fallback env
58 #define DFU_ALT_BOOT_ODROID_N2 "u-boot-n2.bin raw 0x1 0x1000;" \
59 "u-boot-c4.bin skip 0 0;" \
60 "u-boot-vim3l.bin skip 0 0;" \
61 "u-boot-vim3.bin skip 0 0;" \
62 "0-format.cmd script 0 0"
63 #define DFU_ALT_BOOT_VIM3 "u-boot-vim3.bin raw 0x1 0x1000;" \
64 "u-boot-c4.bin skip 0 0;" \
65 "u-boot-vim3l.bin skip 0 0;" \
66 "u-boot-n2.bin skip 0 0;" \
67 "0-format.cmd script 0 0"
68 #define DFU_ALT_BOOT_ODROID_C4 "u-boot-c4.bin raw 0x1 0x1000;" \
69 "u-boot-vim3.bin skip 0 0;" \
70 "u-boot-vim3l.bin skip 0 0;" \
71 "u-boot-n2.bin skip 0 0;" \
72 "0-format.cmd script 0 0"
73 #define DFU_ALT_BOOT_VIM3L "u-boot-vim3l.bin raw 0x1 0x1000;" \
74 "u-boot-vim3.bin skip 0 0;" \
75 "u-boot-c4.bin skip 0 0;" \
76 "u-boot-n2.bin skip 0 0;" \
77 "0-format.cmd script 0 0"
79 #define CONFIG_SET_DFU_ALT_BUF_LEN (SZ_1K)
81 #define PARTS_DEFAULT \
82 "name=boot,start=4M,size=128M,bootable,id=0x0e;" \
83 "name=rootfs,size=3072M,id=0x83;" \
84 "name=system-data,size=1344M,id=0x83;" \
85 "name=[ext],size=-,id=0x05;" \
86 "name=user,size=-,id=0x83;" \
87 "name=modules,size=100M,id=0x83;" \
88 "name=ramdisk,size=32M,id=0x83;" \
89 "name=ramdisk-recovery,size=32M,id=0x83;" \
90 "name=reserved0,size=8M,id=0x83;" \
91 "name=hal,size=64M,id=0x83;" \
92 "name=reserved1,size=128M,id=0x83;" \
95 #undef CONFIG_SYS_BOARD
97 #ifdef CONFIG_TIZEN_KHADAS_VIM3
98 #define TIZEN_BOOT_PREFIX "/kvim/ /"
99 #define DFU_ALT_BOOT DFU_ALT_BOOT_VIM3
100 #define DEVICE_TREE_NAME "kvim3_linux.dtb"
101 #define NEXT_DEVICE_TREE_NAME "meson-g12b-a311d-khadas-vim3.dtb"
102 #define BOARD_NAME "khadas-vim3"
103 #define BUTTON_LABEL "Function"
104 #elif CONFIG_TIZEN_KHADAS_VIM3L
105 #define TIZEN_BOOT_PREFIX "/kvim/ /"
106 #define DFU_ALT_BOOT DFU_ALT_BOOT_VIM3L
107 #define DEVICE_TREE_NAME "kvim3l_linux.dtb"
108 #define NEXT_DEVICE_TREE_NAME "meson-sm1-khadas-vim3l.dtb"
109 #define BOARD_NAME "khadas-vim3l"
110 #define BUTTON_LABEL "Function"
111 #elif CONFIG_TIZEN_ODROID_N2
112 #define TIZEN_BOOT_PREFIX "/odroid/ /"
113 #define DFU_ALT_BOOT DFU_ALT_BOOT_ODROID_N2
114 #define DEVICE_TREE_NAME "meson64_odroidn2.dtb"
115 #define NEXT_DEVICE_TREE_NAME "meson-g12b-odroid-n2.dtb"
116 #define BOARD_NAME "odrond-n2"
117 #define BUTTON_LABEL "Nothing"
118 #elif CONFIG_TIZEN_ODROID_C4
119 #define TIZEN_BOOT_PREFIX "/odroid/ /"
120 #define DFU_ALT_BOOT DFU_ALT_BOOT_ODROID_C4
121 #define DEVICE_TREE_NAME "meson64_odroidc4.dtb"
122 #define NEXT_DEVICE_TREE_NAME "meson-sm1-odroid-c4.dtb"
123 #define BOARD_NAME "odroid-c4"
124 #define BUTTON_LABEL "PowerKey"
126 #define TIZEN_BOOT_PREFIX "/ /boot/"
127 #define DFU_ALT_BOOT "u-boot.bin skip 0 0"
128 #define DEVICE_TREE_NAME CONFIG_DEFAULT_DEVICE_TREE
129 #define BUTTON_LABEL "Nothing"
133 "env default mbr_parts; " \
134 "if mbr verify ${dfu_interface} ${dfu_device}; " \
136 "echo \"MBR layout does not match flashed bootloader!\"; " \
137 "echo \"Please flash complete Tizen image or Ctrl-C to continue.\"; " \
138 "env default dfu_alt_fallback; " \
139 "setenv dfu_alt_info \"${dfu_alt_fallback}\"; " \
143 #define REBOOT_CHECK \
144 "sm reboot_reason reason; " \
145 "echo \"Reboot reason: ${reason}\"; " \
146 "if test ${reason} = download; then " \
150 #define BUTTON_CHECK \
151 "echo -n \"Checking ${button_label} button state (for THOR download mode): \"; " \
153 "if button ${button_label}; then " \
157 #define TIZEN_ENV_SETTING \
161 "ramdisksize=800000\0" \
162 "bootmode=ramdisk\0" \
164 "dfu_alt_info=" DFU_ALT_SYSTEM ";" DFU_ALT_BOOT "\0"\
165 "dfu_alt_fallback=" DFU_ALT_BOOT "\0" \
166 "fdt_high=0x20000000\0" \
167 "initrd_high=0x3d800000\0" \
168 "opts=loglevel=7\0" \
170 "dfu_interface=mmc\0" \
171 "fdtfile=" DEVICE_TREE_NAME "\0" \
172 "fdtfile2=" NEXT_DEVICE_TREE_NAME "\0" \
173 "board_name=" BOARD_NAME "\0" \
174 "boot_prefixes=" TIZEN_BOOT_PREFIX "\0" \
175 "mbr_parts=" PARTS_DEFAULT "\0" \
176 "mbr_check=" MBR_CHECK "\0" \
177 "button_check=" BUTTON_CHECK "\0" \
178 "button_label=" BUTTON_LABEL "\0" \
179 "reboot_check=" REBOOT_CHECK "\0" \
180 "splashimage=0x2000000\0" \
181 "splashsource=mmc_fs\0" \
182 "splashfile=tizen_logo.bmp.gz\0" \
184 "hdmimode=1080p60hz\0"
188 /* limit boot to mmc0 and mmc1 */
189 #undef BOOT_TARGET_DEVICES
190 #define BOOT_TARGET_DEVICES(func) \
195 #define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (1920 * 1200 * 4 + 54)
196 #define CONFIG_VIDEO_BMP_GZIP
198 #endif /* __CONFIG_TIZEN_AMLOGIC_H */