Commit 4bc334c9 authored by Vladimir Bashkirtsev's avatar Vladimir Bashkirtsev

Added support for Rockchip CM3588 Plus

parent 4335e8bc
......@@ -1088,3 +1088,84 @@ define FW_ENV_AMLOGICS905X_MENDER
/dev/$(BOOT_DEVICE) 0x800000 0x20000
endef
export FW_ENV_AMLOGICS905X_MENDER
friendlyelec-cm3588-plus: friendlyelec-cm3588-plus-boot-cmd friendlyelec-cm3588-plus-fw_env.config
tar xf u-boot-2021.04.tar.gz
patch -Np1 -d u-boot-2021.04 < u-boot-2021.04-cm3588-nas.patch
tar xf rk3588-firmware.tar.xz -C u-boot-2021.04
$(MAKE) -C u-boot-2021.04 cm3588-nas-rk3588_defconfig
BL31=rk3588_bl31_v1.56.elf ROCKCHIP_TPL=rk3588_ddr_lp4_2112MHz_lp5_2400MHz_v1.24.bin $(MAKE) -C u-boot-2021.04
mkdir /uboot
mkfs -t vfat -n UBOOT /dev/$(DISK)1
sed -i '/\/dev\/root/a \/dev\/disk\/by-label\/UBOOT \/uboot vfat defaults,sync,auto 0 0' /etc/fstab
mount /dev/$(DISK)1 /uboot
dd if=u-boot-2021.04/u-boot-rockchip.bin of=/dev/$(ROOT_DEVICE) conv=fsync,notrunc bs=512 seek=64
@echo "$$BOOTCMD_FRIENDLYELECCM3588PLUS" > u-boot-2021.04/boot.cmd
u-boot-2021.04/tools/mkimage -C none -A arm -T script -d u-boot-2021.04/boot.cmd /uboot/boot.scr
$(MAKE) -C u-boot-2021.04 envtools
cp u-boot-2021.04/tools/env/fw_printenv /sbin/fw_printenv
ln -sf /sbin/fw_printenv /sbin/fw_setenv
@echo "$$FW_ENV_FRIENDLYELECCM3588PLUS" > /etc/fw_env.config
dd if=/dev/zero of=/uboot/uboot.env bs=1024 count=16
/sbin/fw_setenv reset
if [ -n "$(ENV_DEVICE)" ]; then sed -i 's/$(BOOT_DEVICE)/$(ENV_DEVICE)/' /etc/fw_env.config; fi
umount /dev/$(DISK)1
rm -rf u-boot-2021.04
friendlyelec-cm3588-plus-boot-cmd:
define BOOTCMD_FRIENDLYELECCM3588PLUS
load mmc 1:2 $${kernel_addr_r} boot/Image
load mmc 1:2 $${fdt_addr_r} boot/machine.dtb
setenv bootargs console=tty1 root=/dev/$(BOOT_DISK)2 rootfstype=ext4 rootflags=discard rw rootwait quiet loglevel=3 systemd.show_status=1 net.ifnames=0
booti $${kernel_addr_r} - $${fdt_addr_r}
endef
export BOOTCMD_FRIENDLYELECCM3588PLUS
friendlyelec-cm3588-plus-fw_env.config:
define FW_ENV_FRIENDLYELECCM3588PLUS
/uboot/uboot.env 0x00000 0x04000
endef
export FW_ENV_FRIENDLYELECCM3588PLUS
friendlyelec-cm3588-plus-mender: friendlyelec-cm3588-plus-boot-cmd-mender friendlyelec-cm3588-plus-fw_env.config-mender
tar xf u-boot-2021.04.tar.gz
patch -Np1 -d u-boot-2021.04 < u-boot-2021.04-cm3588-nas.patch
tar xf rk3588-firmware.tar.xz -C u-boot-2021.04
$(MAKE) -C u-boot-2021.04 cm3588-nas-rk3588_defconfig
@echo "# CONFIG_ENV_IS_NOWHERE is not set" >> u-boot-2021.04/.config
@echo "# CONFIG_ENV_IS_IN_FAT is not set" >> u-boot-2021.04/.config
@echo "CONFIG_ENV_IS_IN_MMC=y" >> u-boot-2021.04/.config
@echo "CONFIG_SYS_REDUNDAND_ENVIRONMENT=y" >> u-boot-2021.04/.config
$(MAKE) -C u-boot-2021.04 oldconfig
BL31=rk3588_bl31_v1.56.elf ROCKCHIP_TPL=rk3588_ddr_lp4_2112MHz_lp5_2400MHz_v1.24.bin $(MAKE) -C u-boot-2021.04
mount /dev/$(DISK)1 /uboot
dd if=/dev/zero of=/dev/$(ROOT_DEVICE) bs=512 seek=1 count=49151
dd if=u-boot-2021.04/u-boot-rockchip.bin of=/dev/$(ROOT_DEVICE) conv=fsync,notrunc bs=512 seek=64
@echo "$$BOOTCMD_FRIENDLYELECCM3588PLUS_MENDER" > u-boot-2021.04/boot.cmd
u-boot-2021.04/tools/mkimage -C none -A arm -T script -d u-boot-2021.04/boot.cmd /uboot/boot.scr
$(MAKE) -C u-boot-2021.04 envtools
cp u-boot-2021.04/tools/env/fw_printenv /sbin/fw_printenv
ln -svf /sbin/fw_printenv /sbin/fw_setenv
@echo "$$FW_ENV_FRIENDLYELECCM3588PLUS_MENDER" > /etc/fw_env.config
/sbin/fw_setenv reset
if [ -n "$(ENV_DEVICE)" ]; then sed -i 's/$(BOOT_DEVICE)/$(ENV_DEVICE)/' /etc/fw_env.config; fi
umount /dev/$(DISK)1
rm -rf u-boot-2021.04
friendlyelec-cm3588-plus-boot-cmd-mender:
define BOOTCMD_FRIENDLYELECCM3588PLUS_MENDER
run mender_setup
load $${mender_uboot_root} $${kernel_addr_r} boot/Image
load $${mender_uboot_root} $${fdt_addr_r} boot/machine.dtb
setenv bootargs console=tty1 panic=10 panic_on_oops=1 root=$${mender_kernel_root} rootfstype=ext4 ro rootwait quiet loglevel=3 systemd.show_status=1 net.ifnames=0
booti $${kernel_addr_r} - $${fdt_addr_r}
run mender_try_to_recover
endef
export BOOTCMD_FRIENDLYELECCM3588PLUS_MENDER
friendlyelec-cm3588-plus-fw_env.config-mender:
define FW_ENV_FRIENDLYELECCM3588PLUS_MENDER
/dev/$(BOOT_DEVICE) 0x400000 0x20000
/dev/$(BOOT_DEVICE) 0x800000 0x20000
endef
export FW_ENV_FRIENDLYELECCM3588PLUS_MENDER
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment