2 * Copyright (C) 2019 Samsung Electronics
4 * Configuration settings for the Tizen RPI board.
6 * SPDX-License-Identifier: GPL-2.0+
9 #ifndef __CONFIG_TIZEN_RPI_H
10 #define __CONFIG_TIZEN_RPI_H
13 #ifdef CONFIG_SPL_BUILD
14 #define CONFIG_SPL_TEXT_BASE 0x00008000
15 #define CONFIG_SPL_MAX_SIZE 0x00030000
16 #define CONFIG_SPL_BSS_START_ADDR 0x00380000
17 #define CONFIG_SPL_BSS_MAX_SIZE 0x00040000
18 #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1
19 #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
23 #define DFU_ALT_SYSTEM \
25 "bcm2710-rpi-3-b.dtb fat 0 1;" \
26 "bcm2837-rpi-3-b.dtb fat 0 1;" \
27 "bcm2710-rpi-3-b-plus.dtb fat 0 1;" \
28 "bcm2711-rpi-4-b.dtb fat 0 1;" \
29 "u-boot.bin fat 0 1;" \
30 "uboot.env fat 0 1;" \
31 "boot.scr.uimg fat 0 1;" \
33 "boot.img part 0 1;" \
35 "system-data part 0 3;" \
38 "ramdisk.img part 0 7;" \
39 "ramdisk-recovery part 0 8;" \
42 #define CONFIG_SET_DFU_ALT_BUF_LEN (SZ_1K)
44 #define PARTS_DEFAULT \
45 "name=boot,start=4M,size=64M,bootable,id=0x0e;" \
46 "name=rootfs,size=3072M,id=0x83;" \
47 "name=system-data,size=1344M,id=0x83;" \
48 "name=[ext],size=-,id=0x05;" \
49 "name=user,size=-,id=0x83;" \
50 "name=modules,size=32M,id=0x83;" \
51 "name=ramdisk,size=8M,id=0x83;" \
52 "name=ramdisk-recovery,size=32M,id=0x83;" \
53 "name=inform,size=8M,id=0x83;" \
54 "name=hal,size=256M,id=0x83;" \
55 "name=reserved2,size=125M,id=0x83;" \
59 "env default mbr_parts; " \
60 "if mbr verify ${dfu_interface} ${dfu_device}; " \
62 "echo \"MBR partition layout does not match flashed bootloader!\"; " \
63 "echo \"Please format SD card with recent sd_fusing_rpi3.sh script or Ctrl-C to continue.\"; " \
64 "while sleep 2; do echo .\\\\\\\\c; done; echo; " \
67 #define GPT_PARTS_DEFAULT \
68 "uuid_disk=${uuid_gpt_disk};" \
69 "name=boot_a,start=4MiB,uuid=${uuid_gpt_boot_a},size=64MiB,type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B;" \
70 "name=rootfs_a,size=3072MiB,uuid=${uuid_gpt_rootfs_a},type=linux;" \
71 "name=system-data,size=1344MiB,uuid=${uuid_gpt_data},type=linux;" \
72 "name=none,size=36MiB,uuid=${uuid_gpt_none},type=linux;" \
73 "name=user,size=6636MiB,uuid=${uuid_gpt_user},type=linux;" \
74 "name=module_a,size=32MiB,uuid=${uuid_gpt_module_a},type=linux;" \
75 "name=ramdisk_a,size=32MiB,uuid=${uuid_gpt_ramdisk_a},type=linux;" \
76 "name=ramdisk-recovery_a,size=32MiB,uuid=${uuid_gpt_ramdisk-recovery_a},type=linux;" \
77 "name=inform,size=8MiB,uuid=${uuid_gpt_inform},type=linux;" \
78 "name=hal_a,size=256MiB,uuid=${uuid_gpt_hal_a},type=linux;" \
79 "name=boot_b,size=64MiB,uuid=${uuid_gpt_boot_b},type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B;" \
80 "name=rootfs_b,size=3072MiB,uuid=${uuid_gpt_rootf_b},type=linux;" \
81 "name=module_b,size=32MiB,uuid=${uuid_gpt_module_b},type=linux;" \
82 "name=ramdisk_b,size=32MiB,uuid=${uuid_gpt_ramdisk_b},type=linux;" \
83 "name=ramdisk-recovery_b,size=32MiB,uuid=${uuid_gpt_ramdisk-recovery_b},type=linux;" \
84 "name=hal_b,size=256MiB,uuid=${uuid_gpt_hal_b},type=linux;" \
85 "name=reserved0,size=4MiB,uuid=${uuid_gpt_reserved0},type=linux;" \
86 "name=reserved1,size=64MiB,uuid=${uuid_gpt_reserved1},type=linux;" \
87 "name=reserved2,size=-,uuid=${uuid_gpt_reserved2},type=linux;" \
90 #define SET_TO_PARTITION_A \
91 "if test -e mmc ${mmcbootdev}:${mmcinformpart} ${slotfile}; " \
93 "load mmc ${mmcbootdev}:${mmcinformpart} ${slot_addr} /${slotfile} 2; " \
95 "mw.b ${slot_addr} 61; " \
96 "ext4write mmc ${mmcbootdev}:${mmcinformpart} ${slot_addr} /${slotfile} 2; "
98 #define SET_TO_PARTITION_B \
99 "if test -e mmc ${mmcbootdev}:${mmcinformpart} ${slotfile}; " \
101 "load mmc ${mmcbootdev}:${mmcinformpart} ${slot_addr} /${slotfile} 2; " \
103 "mw.b ${slot_addr} 62; " \
104 "ext4write mmc ${mmcbootdev}:${mmcinformpart} ${slot_addr} /${slotfile} 2; "
106 #ifdef CONFIG_TARGET_RPI_4_32B
107 #define TIZEN_VC_MEM "vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000 swiotlb=8192 "
109 #define TIZEN_VC_MEM "vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000 "
112 #define CLEAR_REBOOT_PARAM \
113 "mw.l ${rebootparam_addr} ${normal_val} ; " \
114 "ext4write mmc ${mmcbootdev}:${mmcinformpart} ${rebootparam_addr} /${rebootparamfile} 8; "
117 /* SD/MMC configuration */
118 #define CONFIG_MMC_DEFAULT_DEV 0
121 #define KERNEL_NAME "Image"
123 #define KERNEL_NAME "zImage"
127 # use the ram address of ramdisk before loading ramdisk image
128 # 0x72677075 is ascii code for representing string "upgr"
129 # 0x72766372 is ascii code for representing string "rcvr"
130 # 0x6665646e is ascii code for representing string "ndef"
131 # 0x6c6e7764 is ascii code for representing string "dwnl"
133 #define TIZEN_ENV_SETTING \
134 "kernel=" KERNEL_NAME "\0" \
135 "dfu_alt_info=" DFU_ALT_SYSTEM "\0" \
140 "mmcinformpart=9\0" \
141 "rebootparamfile=reboot-param.bin\0" \
142 "slotfile=partition-ab.info\0" \
143 "slot_addr=0x02200000\0" \
144 "rebootparam_addr=0x02100000\0" \
145 "upgrade_val=72677075\0" \
146 "recovery_val=72766372\0" \
147 "nodef_val=6665646e\0" \
148 "normal_val=6d726f6e\0" \
149 "download_val=6c6e7764\0" \
152 "bootmode=ramdisk\0" \
154 "tfm=setenv bootmode download; run bootcmd\0" \
157 "8250.nr_uarts=1 dma.dmachans=0x7f35 bcm2709.serial=0xed6687d3 " \
158 "snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 " \
159 "bcm2709.uart_clock=48000000 dwc_otg.lpm_enable=0\0" \
160 "opts=loglevel=4\0" \
162 "dfu_interface=mmc\0" \
163 "dfu_device=" __stringify(CONFIG_MMC_DEFAULT_DEV) "\0" \
164 "mbr_parts=" PARTS_DEFAULT "\0" \
165 "mbr_check=" MBR_CHECK "\0" \
166 "set_to_part_a=" SET_TO_PARTITION_A "\0" \
167 "set_to_part_b=" SET_TO_PARTITION_B "\0" \
168 "gpt_parts=" GPT_PARTS_DEFAULT "\0" \
169 "update_gpt_part=gpt write mmc ${mmcbootdev} ${gpt_parts}\0" \
170 "reboot_param_clear=" CLEAR_REBOOT_PARAM "\0" \
173 #endif /* __CONFIG_TIZEN_RPI_H */