/* * 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 */