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_drm.dtb fat -1 1;" \
24 "meson64_odroidn2.dtb fat -1 1;" \
25 "meson64_odroidc4.dtb fat -1 1;" \
26 "kvim3_linux.dtb fat -1 1;" \
27 "kvim3l_linux.dtb fat -1 1;" \
28 "boot.scr.uimg fat -1 1;" \
29 "params-c4.bin fat -1 1;" \
30 "params-n2.bin fat -1 1;" \
31 "params-vim3.bin fat -1 1;" \
32 "params-vim3l.bin fat -1 1;" \
33 "tizen_logo.bmp.gz fat -1 1;" \
34 "kvim/Image.gz fat -1 1;" \
35 "odroid/Image.gz fat -1 1;" \
36 "boot.img part -1 1;" \
38 "system-data part -1 3;" \
41 "ramdisk.img part -1 7;" \
42 "ramdisk-recovery.img part -1 8"
45 * '0-format.cmd' entity is common for all boards, but it has to be
46 * defined in the per-board DFU_ALT_BOOT_* to ensure that it is also
47 * available in the dfu_alt_fallback env
49 #define DFU_ALT_BOOT_ODROID_N2 "u-boot-n2.bin raw 0x1 0x1000;" \
50 "u-boot-c4.bin skip 0 0;" \
51 "u-boot-vim3l.bin skip 0 0;" \
52 "u-boot-vim3.bin skip 0 0;" \
53 "0-format.cmd script 0 0"
54 #define DFU_ALT_BOOT_VIM3 "u-boot-vim3.bin raw 0x1 0x1000;" \
55 "u-boot-c4.bin skip 0 0;" \
56 "u-boot-vim3l.bin skip 0 0;" \
57 "u-boot-n2.bin skip 0 0;" \
58 "0-format.cmd script 0 0"
59 #define DFU_ALT_BOOT_ODROID_C4 "u-boot-c4.bin raw 0x1 0x1000;" \
60 "u-boot-vim3.bin skip 0 0;" \
61 "u-boot-vim3l.bin skip 0 0;" \
62 "u-boot-n2.bin skip 0 0;" \
63 "0-format.cmd script 0 0"
64 #define DFU_ALT_BOOT_VIM3L "u-boot-vim3l.bin raw 0x1 0x1000;" \
65 "u-boot-vim3.bin skip 0 0;" \
66 "u-boot-c4.bin skip 0 0;" \
67 "u-boot-n2.bin skip 0 0;" \
68 "0-format.cmd script 0 0"
70 #define CONFIG_SET_DFU_ALT_BUF_LEN (SZ_1K)
72 #define PARTS_DEFAULT \
73 "name=boot,start=4M,size=128M,bootable,id=0x0e;" \
74 "name=rootfs,size=3072M,id=0x83;" \
75 "name=system-data,size=512M,id=0x83;" \
76 "name=[ext],size=-,id=0x05;" \
77 "name=user,size=-,id=0x83;" \
78 "name=modules,size=100M,id=0x83;" \
79 "name=ramdisk,size=8M,id=0x83;" \
80 "name=ramdisk-recovery,size=32M,id=0x83;" \
81 "name=reserved0,size=8M,id=0x83;" \
82 "name=reserved1,size=64M,id=0x83;" \
83 "name=reserved2,size=128M,id=0x83;" \
86 /* DFU over USB/UDC */
87 #if defined(CONFIG_CMD_DFU) || defined(CONFIG_CMD_THOR)
88 #define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_1M
89 #define CONFIG_SYS_DFU_MAX_FILE_SIZE SZ_2M
92 #undef CONFIG_SYS_BOARD
94 #ifdef CONFIG_TIZEN_KHADAS_VIM3
95 #define TIZEN_BOOT_PREFIX "/kvim/ /"
96 #define DFU_ALT_BOOT DFU_ALT_BOOT_VIM3
97 #define DEVICE_TREE_NAME "kvim3_linux.dtb"
98 #define BOARD_NAME "khadas-vim3"
99 #define BUTTON_LABEL "Function"
100 #elif CONFIG_TIZEN_KHADAS_VIM3L
101 #define TIZEN_BOOT_PREFIX "/kvim/ /"
102 #define DFU_ALT_BOOT DFU_ALT_BOOT_VIM3L
103 #define DEVICE_TREE_NAME "kvim3l_linux.dtb"
104 #define BOARD_NAME "khadas-vim3l"
105 #define BUTTON_LABEL "Function"
106 #elif CONFIG_TIZEN_ODROID_N2
107 #define TIZEN_BOOT_PREFIX "/odroid/ /"
108 #define DFU_ALT_BOOT DFU_ALT_BOOT_ODROID_N2
109 #define DEVICE_TREE_NAME "meson64_odroidn2_drm.dtb"
110 #define BOARD_NAME "odrond-n2"
111 #define BUTTON_LABEL "Nothing"
112 #elif CONFIG_TIZEN_ODROID_C4
113 #define TIZEN_BOOT_PREFIX "/odroid/ /"
114 #define DFU_ALT_BOOT DFU_ALT_BOOT_ODROID_C4
115 #define DEVICE_TREE_NAME "meson64_odroidc4.dtb"
116 #define BOARD_NAME "odroid-c4"
117 #define BUTTON_LABEL "PowerKey"
119 #define TIZEN_BOOT_PREFIX "/ /boot/"
120 #define DFU_ALT_BOOT "u-boot.bin skip 0 0"
121 #define DEVICE_TREE_NAME CONFIG_DEFAULT_DEVICE_TREE
122 #define BUTTON_LABEL "Nothing"
126 "env default mbr_parts; " \
127 "if mbr verify ${dfu_interface} ${dfu_device}; " \
129 "echo \"MBR layout does not match flashed bootloader!\"; " \
130 "echo \"Please flash complete Tizen image or Ctrl-C to continue.\"; " \
131 "env default dfu_alt_fallback; " \
132 "setenv dfu_alt_info \"${dfu_alt_fallback}\"; " \
136 #define REBOOT_CHECK \
137 "sm reboot_reason reason; " \
138 "echo \"reboot ${reason}\"; " \
139 "if test ${reason} = download; then " \
143 #define BUTTON_CHECK \
144 "echo Checking Func button state (for THOR download mode): \\\\\\\\c; " \
146 "if button ${button_label}; then " \
150 #define TIZEN_ENV_SETTING \
154 "ramdisksize=800000\0" \
155 "bootmode=ramdisk\0" \
157 "dfu_alt_info=" DFU_ALT_SYSTEM ";" DFU_ALT_BOOT "\0"\
158 "dfu_alt_fallback=" DFU_ALT_BOOT "\0" \
159 "fdt_high=0x20000000\0" \
160 "initrd_high=0x3d800000\0" \
161 "opts=loglevel=7\0" \
163 "dfu_interface=mmc\0" \
164 "fdtfile=" DEVICE_TREE_NAME "\0" \
165 "board_name=" BOARD_NAME "\0" \
166 "boot_prefixes=" TIZEN_BOOT_PREFIX "\0" \
167 "mbr_parts=" PARTS_DEFAULT "\0" \
168 "mbr_check=" MBR_CHECK "\0" \
169 "button_check=" BUTTON_CHECK "\0" \
170 "button_label=" BUTTON_LABEL "\0" \
171 "reboot_check=" REBOOT_CHECK "\0" \
172 "splashimage=0x2000000\0" \
173 "splashsource=mmc_fs\0" \
174 "splashfile=tizen_logo.bmp.gz\0" \
176 "hdmimode=1080p60hz\0"
180 /* limit boot to mmc0 and mmc1 */
181 #undef BOOT_TARGET_DEVICES
182 #define BOOT_TARGET_DEVICES(func) \
187 #define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (1920 * 1200 * 4 + 54)
188 #define CONFIG_VIDEO_BMP_GZIP
190 #endif /* __CONFIG_TIZEN_AMLOGIC_H */