summaryrefslogtreecommitdiff
path: root/include/samsung/tizen_rpi.h
blob: 4f0b139f8d7b3c3f0845e75b0726860407d680ec (plain)
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
/*
 * Copyright (C) 2019 Samsung Electronics
 *
 * Configuration settings for the Tizen RPI board.
 *
 * SPDX-License-Identifier:	GPL-2.0+
 */

#ifndef __CONFIG_TIZEN_RPI_H
#define __CONFIG_TIZEN_RPI_H

/* DFU */
#define DFU_ALT_SYSTEM				\
	"Image fat 0 1;"			\
	"bcm2710-rpi-3-b.dtb fat 0 1;"		\
	"bcm2837-rpi-3-b.dtb fat 0 1;"		\
	"bcm2710-rpi-3-b-plus.dtb fat 0 1;"	\
	"bcm2711-rpi-4-b.dtb fat 0 1;"		\
	"u-boot.bin fat 0 1;"			\
	"uboot.env fat 0 1;"			\
	"boot.scr.uimg fat 0 1;"		\
	"zImage fat 0 1;"			\
	"boot.img part 0 1;"			\
	"rootfs part 0 2;"			\
	"system-data part 0 3;"			\
	"user part 0 5;"			\
	"module part 0 6;"			\
	"ramdisk.img part 0 7;"			\
	"ramdisk-recovery part 0 8;"		\
	"hal.img part 0 10"

#define CONFIG_SET_DFU_ALT_BUF_LEN	(SZ_1K)

#define GPT_PARTS_DEFAULT \
	"uuid_disk=${uuid_gpt_disk};"				\
	"name=boot_a,start=4MiB,uuid=${uuid_gpt_boot_a},size=64MiB,type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B;"	\
	"name=rootfs_a,size=3072MiB,uuid=${uuid_gpt_rootfs_a},type=linux;"	\
	"name=system-data,size=1344MiB,uuid=${uuid_gpt_data},type=linux;"	\
	"name=none,size=36MiB,uuid=${uuid_gpt_none},type=linux;"	\
	"name=user,size=6636MiB,uuid=${uuid_gpt_user},type=linux;"	\
	"name=module_a,size=32MiB,uuid=${uuid_gpt_module_a},type=linux;"	\
	"name=ramdisk_a,size=32MiB,uuid=${uuid_gpt_ramdisk_a},type=linux;"	\
	"name=ramdisk-recovery_a,size=32MiB,uuid=${uuid_gpt_ramdisk-recovery_a},type=linux;"	\
	"name=inform,size=8MiB,uuid=${uuid_gpt_inform},type=linux;"	\
	"name=hal_a,size=256MiB,uuid=${uuid_gpt_hal_a},type=linux;"	\
	"name=boot_b,size=64MiB,uuid=${uuid_gpt_boot_b},type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B;"	\
	"name=rootfs_b,size=3072MiB,uuid=${uuid_gpt_rootf_b},type=linux;"	\
	"name=module_b,size=32MiB,uuid=${uuid_gpt_module_b},type=linux;"	\
	"name=ramdisk_b,size=32MiB,uuid=${uuid_gpt_ramdisk_b},type=linux;"	\
	"name=ramdisk-recovery_b,size=32MiB,uuid=${uuid_gpt_ramdisk-recovery_b},type=linux;"	\
	"name=hal_b,size=256MiB,uuid=${uuid_gpt_hal_b},type=linux;"	\
	"name=reserved0,size=4MiB,uuid=${uuid_gpt_reserved0},type=linux;"	\
	"name=reserved1,size=64MiB,uuid=${uuid_gpt_reserved1},type=linux;"	\
	"name=reserved2,size=-,uuid=${uuid_gpt_reserved2},type=linux;"	\
	""

#define SET_TO_PARTITION_A	\
	"if test -e mmc ${mmcbootdev}:${mmcinformpart} ${slotfile}; "	\
	"then ;"							\
	"load mmc ${mmcbootdev}:${mmcinformpart} ${slot_addr} /${slotfile} 2; " \
	"fi; "									\
	"mw.b ${slot_addr} 61; "						\
	"ext4write mmc ${mmcbootdev}:${mmcinformpart} ${slot_addr} /${slotfile} 2; "

#define SET_TO_PARTITION_B	\
	"if test -e mmc ${mmcbootdev}:${mmcinformpart} ${slotfile}; "	\
	"then ;"							\
	"load mmc ${mmcbootdev}:${mmcinformpart} ${slot_addr} /${slotfile} 2; " \
	"fi; "									\
	"mw.b ${slot_addr} 62; "						\
	"ext4write mmc ${mmcbootdev}:${mmcinformpart} ${slot_addr} /${slotfile} 2; "

#ifdef CONFIG_TARGET_RPI_4_32B
#define TIZEN_VC_MEM "vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000 swiotlb=8192 "
#else
#define TIZEN_VC_MEM "vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000 "
#endif

#define CLEAR_REBOOT_PARAM \
	"mw.l ${rebootparam_addr} ${normal_val} ; "						\
	"ext4write mmc ${mmcbootdev}:${mmcinformpart} ${rebootparam_addr} /${rebootparamfile} 8; "


/* SD/MMC configuration */
#define CONFIG_MMC_DEFAULT_DEV	0

#ifdef CONFIG_ARM64
#define KERNEL_NAME	"Image"
#else
#define KERNEL_NAME	"zImage"
#endif

/*
# use the ram address of ramdisk before loading ramdisk image
# 0x72677075 is ascii code for representing string "upgr"
# 0x72766372 is ascii code for representing string "rcvr"
# 0x6665646e is ascii code for representing string "ndef"
# 0x6c6e7764 is ascii code for representing string "dwnl"
*/
#define TIZEN_ENV_SETTING \
	"kernel=" KERNEL_NAME "\0"		\
	"dfu_alt_info=" DFU_ALT_SYSTEM "\0"	\
	"mmcbootdev=0\0"			\
	"mmcbootpart=1\0"			\
	"mmcrootdev=0\0"			\
	"mmcrootpart=2\0"			\
	"mmcinformpart=9\0"			\
	"rebootparamfile=reboot-param.bin\0"	\
	"slotfile=partition-ab.info\0"	\
	"slot_addr=0x02200000\0"		\
	"rebootparam_addr=0x02100000\0"		\
	"upgrade_val=72677075\0"		\
	"recovery_val=72766372\0"		\
	"nodef_val=6665646e\0"			\
	"normal_val=6d726f6e\0"			\
	"download_val=6c6e7764\0"		\
	"ramdiskpart=7\0"			\
	"part=7\0"				\
	"bootmode=ramdisk\0"			\
	"bootdev=mmc\0"				\
	"tfm=setenv bootmode download; run bootcmd\0"	\
	"tizen_bootarg="				\
		TIZEN_VC_MEM				\
		"8250.nr_uarts=1 dma.dmachans=0x7f35 bcm2709.serial=0xed6687d3 "		\
		"snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 "		\
		"bcm2709.uart_clock=48000000 dwc_otg.lpm_enable=0\0"	\
	"opts=loglevel=4\0"			\
	"dfu_usb_con=0\0"			\
	"dfu_interface=mmc\0"			\
	"dfu_device=" __stringify(CONFIG_MMC_DEFAULT_DEV) "\0" \
	"set_to_part_a=" SET_TO_PARTITION_A "\0"		\
	"set_to_part_b=" SET_TO_PARTITION_B "\0"		\
	"gpt_parts=" GPT_PARTS_DEFAULT "\0"		\
	"update_gpt_part=gpt write mmc ${mmcbootdev} ${gpt_parts}\0"		\
	"reboot_param_clear=" CLEAR_REBOOT_PARAM "\0"				\
	""

#endif /* __CONFIG_TIZEN_RPI_H */