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