Commit 5d6a41a2 authored by Vladimir Bashkirtsev's avatar Vladimir Bashkirtsev

Added support for Odroid HC2

parent cf01e958
......@@ -192,6 +192,100 @@ define FW_ENV_OPIPCPLUS_MENDER
endef
export FW_ENV_OPIPCPLUS_MENDER
odroidhc2: odroidhc2-boot-cmd odroidhc2-fw_env.config
tar xf u-boot-2020.04.tar.bz2
patch -Np1 -d u-boot-2020.04 < u-boot-2020.04-serial-number-fix.patch
$(MAKE) -C u-boot-2020.04 odroid-xu3_defconfig
@echo "# CONFIG_ENV_IS_IN_FAT is not set" >> u-boot-2020.04/.config
@echo "CONFIG_ENV_IS_IN_MMC=y" >> u-boot-2020.04/.config
@echo "# CONFIG_SYS_REDUNDAND_ENVIRONMENT is not set" >> u-boot-2020.04/.config
@echo "CONFIG_ENV_OFFSET=0x140000" >> u-boot-2020.04/.config
$(MAKE) -C u-boot-2020.04 oldconfig
$(MAKE) -C u-boot-2020.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
tar xf xu4-firmware.tar.xz -C u-boot-2020.04
dd if=u-boot-2020.04/bl1.bin of=/dev/$(ROOT_DEVICE) bs=512 seek=1
dd if=u-boot-2020.04/bl2.bin of=/dev/$(ROOT_DEVICE) bs=512 seek=31
dd if=u-boot-2020.04/u-boot-dtb.bin of=/dev/$(ROOT_DEVICE) bs=512 seek=63
dd if=u-boot-2020.04/tzsw.bin of=/dev/$(ROOT_DEVICE) bs=512 seek=1503
@echo "$$BOOTCMD_ODROIDHC2" > u-boot-2020.04/boot.cmd
u-boot-2020.04/tools/mkimage -C none -A arm -T script -d u-boot-2020.04/boot.cmd /uboot/boot.scr
$(MAKE) -C u-boot-2020.04 envtools
cp u-boot-2020.04/tools/env/fw_printenv /sbin/fw_printenv
ln -sf /sbin/fw_printenv /sbin/fw_setenv
@echo "$$FW_ENV_ODROIDHC2" > /etc/fw_env.config
/sbin/fw_setenv reset
if [ -n "$(ENV_DEVICE)" ]; then sed -i 's/$(ROOT_DEVICE)/$(ENV_DEVICE)/' /etc/fw_env.config; fi
umount /dev/$(DISK)1
rm -rf u-boot-2020.04
odroidhc2-boot-cmd:
define BOOTCMD_ODROIDHC2
load mmc 0:2 $${kernel_addr_r} boot/zImage
load mmc 0:2 $${fdt_addr_r} boot/machine.dtb
setenv bootargs console=tty1 root=/dev/$(DISK)2 rootfstype=ext4 rootflags=discard rw rootwait elevator=noop quiet loglevel=3 systemd.show_status=1
bootz $${kernel_addr_r} - $${fdt_addr_r}
endef
export BOOTCMD_ODROIDHC2
odroidhc2-fw_env.config:
define FW_ENV_ODROIDHC2
/dev/$(ROOT_DEVICE) 0x140000 0x20000
endef
export FW_ENV_ODROIDHC2
odroidhc2-mender: odroidhc2-boot-cmd-mender odroidhc2-fw_env.config-mender
tar xf u-boot-2020.04.tar.bz2
patch -Np1 -d u-boot-2020.04 < u-boot-2020.04-serial-number-fix.patch
patch -Np1 -d u-boot-2020.04 < u-boot-2020.04-mender.patch
$(MAKE) -C u-boot-2020.04 odroid-xu3_defconfig
@echo "# CONFIG_ENV_IS_NOWHERE is not set" >> u-boot-2020.04/.config
@echo "# CONFIG_ENV_IS_IN_FAT is not set" >> u-boot-2020.04/.config
@echo "CONFIG_ENV_IS_IN_MMC=y" >> u-boot-2020.04/.config
@echo "CONFIG_SYS_REDUNDAND_ENVIRONMENT=y" >> u-boot-2020.04/.config
@echo "# CONFIG_ENV_OFFSET is not set" >> u-boot-2020.04/.config
@echo "# CONFIG_ENV_OFFSET_REDUND is not set" >> u-boot-2020.04/.config
$(MAKE) -C u-boot-2020.04 oldconfig
$(MAKE) -C u-boot-2020.04
mount /dev/$(DISK)1 /uboot
dd if=/dev/zero of=/dev/$(ROOT_DEVICE) bs=512 seek=1 count=49151
tar xf xu4-firmware.tar.xz -C u-boot-2020.04
dd if=u-boot-2020.04/bl1.bin of=/dev/$(ROOT_DEVICE) bs=512 seek=1
dd if=u-boot-2020.04/bl2.bin of=/dev/$(ROOT_DEVICE) bs=512 seek=31
dd if=u-boot-2020.04/u-boot-dtb.bin of=/dev/$(ROOT_DEVICE) bs=512 seek=63
dd if=u-boot-2020.04/tzsw.bin of=/dev/$(ROOT_DEVICE) bs=512 seek=1503
@echo "$$BOOTCMD_ODROIDHC2_MENDER" > u-boot-2020.04/boot.cmd
u-boot-2020.04/tools/mkimage -C none -A arm -T script -d u-boot-2020.04/boot.cmd /uboot/boot.scr
$(MAKE) -C u-boot-2020.04 envtools
cp u-boot-2020.04/tools/env/fw_printenv /sbin/fw_printenv
ln -sf /sbin/fw_printenv /sbin/fw_setenv
@echo "$$FW_ENV_ODROIDHC2_MENDER" > /etc/fw_env.config
/sbin/fw_setenv reset
if [ -n "$(ENV_DEVICE)" ]; then sed -i 's/$(ROOT_DEVICE)/$(ENV_DEVICE)/' /etc/fw_env.config; fi
umount /dev/$(DISK)1
rm -rf u-boot-2020.04
odroidhc2-boot-cmd-mender:
define BOOTCMD_ODROIDHC2_MENDER
run mender_setup
load $${mender_uboot_root} $${kernel_addr_r} boot/zImage
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 elevator=noop quiet loglevel=3 systemd.show_status=1
bootz $${kernel_addr_r} - $${fdt_addr_r}
run mender_try_to_recover
endef
export BOOTCMD_ODROIDHC2_MENDER
odroidhc2-fw_env.config-mender:
define FW_ENV_ODROIDHC2_MENDER
/dev/$(ROOT_DEVICE) 0x400000 0x20000
/dev/$(ROOT_DEVICE) 0x800000 0x20000
endef
export FW_ENV_ODROIDHC2_MENDER
terasicde10standard: terasicde10standard-boot-cmd terasicde10standard-fw_env.config
tar xf u-boot-2020.04.tar.bz2
$(MAKE) -C u-boot-2020.04 socfpga_de10_nano_defconfig
......
diff -uNr u-boot-2020.04/configs/odroid-xu3_defconfig u-boot-2020.04-mender/configs/odroid-xu3_defconfig
--- u-boot-2020.04/configs/odroid-xu3_defconfig 2020-04-13 15:02:18.000000000 +0000
+++ u-boot-2020.04-mender/configs/odroid-xu3_defconfig 2021-09-15 13:41:54.571365816 +0000
@@ -3,8 +3,7 @@
CONFIG_ARCH_EXYNOS=y
CONFIG_SYS_TEXT_BASE=0x43E00000
CONFIG_ARCH_EXYNOS5=y
-CONFIG_ENV_SIZE=0x4000
-CONFIG_ENV_OFFSET=0x310000
+CONFIG_ENV_SIZE=0x20000
CONFIG_NR_DRAM_BANKS=8
CONFIG_IDENT_STRING=" for ODROID-XU3/XU4/HC1/HC2"
CONFIG_DISTRO_DEFAULTS=y
diff -uNr u-boot-2020.04/configs/p212_defconfig u-boot-2020.04-mender/configs/p212_defconfig
--- u-boot-2020.04/configs/p212_defconfig 2020-04-14 00:32:18.000000000 +0930
+++ u-boot-2020.04-mender/configs/p212_defconfig 2020-07-24 12:05:58.751487092 +0930
--- u-boot-2020.04/configs/p212_defconfig 2020-04-13 15:02:18.000000000 +0000
+++ u-boot-2020.04-mender/configs/p212_defconfig 2021-09-15 13:31:30.197336190 +0000
@@ -1,7 +1,7 @@
CONFIG_ARM=y
CONFIG_ARCH_MESON=y
......@@ -11,8 +24,8 @@ diff -uNr u-boot-2020.04/configs/p212_defconfig u-boot-2020.04-mender/configs/p2
CONFIG_MESON_GXL=y
CONFIG_NR_DRAM_BANKS=1
diff -uNr u-boot-2020.04/configs/rpi_3_defconfig u-boot-2020.04-mender/configs/rpi_3_defconfig
--- u-boot-2020.04/configs/rpi_3_defconfig 2020-04-14 00:32:18.000000000 +0930
+++ u-boot-2020.04-mender/configs/rpi_3_defconfig 2020-07-24 12:05:58.751487092 +0930
--- u-boot-2020.04/configs/rpi_3_defconfig 2020-04-13 15:02:18.000000000 +0000
+++ u-boot-2020.04-mender/configs/rpi_3_defconfig 2021-09-15 13:31:30.197336190 +0000
@@ -4,7 +4,7 @@
CONFIG_SYS_TEXT_BASE=0x00080000
CONFIG_TARGET_RPI_3=y
......@@ -23,8 +36,8 @@ diff -uNr u-boot-2020.04/configs/rpi_3_defconfig u-boot-2020.04-mender/configs/r
CONFIG_DISTRO_DEFAULTS=y
CONFIG_OF_BOARD_SETUP=y
diff -uNr u-boot-2020.04/env/Kconfig u-boot-2020.04-mender/env/Kconfig
--- u-boot-2020.04/env/Kconfig 2020-04-14 00:32:18.000000000 +0930
+++ u-boot-2020.04-mender/env/Kconfig 2020-07-24 12:05:58.751487092 +0930
--- u-boot-2020.04/env/Kconfig 2020-04-13 15:02:18.000000000 +0000
+++ u-boot-2020.04-mender/env/Kconfig 2021-09-15 13:33:58.461645828 +0000
@@ -488,25 +488,14 @@
environment location.
......@@ -42,7 +55,7 @@ diff -uNr u-boot-2020.04/env/Kconfig u-boot-2020.04-mender/env/Kconfig
- default 0x140000 if ARCH_AT91
- default 0x260000 if ARCH_OMAP2PLUS
+ hex "Environment Offset will be set by mender patch"
+ depends on !ARCH_SUNXI && !ARCH_MESON && !ARCH_BCM283X
+ depends on !ARCH_SUNXI && !ARCH_MESON && !ARCH_BCM283X && !ARCH_EXYNOS
help
Offset from the start of the device (or partition)
......@@ -51,13 +64,13 @@ diff -uNr u-boot-2020.04/env/Kconfig u-boot-2020.04-mender/env/Kconfig
- depends on (ENV_IS_IN_EEPROM || ENV_IS_IN_MMC || ENV_IS_IN_NAND || \
- ENV_IS_IN_SPI_FLASH) && SYS_REDUNDAND_ENVIRONMENT
+ hex "Redundant Environment Offset will be set by mender patch"
+ depends on !ARCH_SUNXI && !ARCH_MESON && !ARCH_BCM283X && !ARCH_SOCFPGA
+ depends on !ARCH_SUNXI && !ARCH_MESON && !ARCH_BCM283X && !ARCH_SOCFPGA && !ARCH_EXYNOS
help
Offset from the start of the device (or partition) of the redundant
environment location.
diff -uNr u-boot-2020.04/include/config_mender_defines.h u-boot-2020.04-mender/include/config_mender_defines.h
--- u-boot-2020.04/include/config_mender_defines.h 1970-01-01 09:30:00.000000000 +0930
+++ u-boot-2020.04-mender/include/config_mender_defines.h 2020-07-24 12:05:58.752487094 +0930
--- u-boot-2020.04/include/config_mender_defines.h 1970-01-01 00:00:00.000000000 +0000
+++ u-boot-2020.04-mender/include/config_mender_defines.h 2021-09-15 13:31:30.202335998 +0000
@@ -0,0 +1,17 @@
+/* Shell variables */
+#define MENDER_BOOT_PART_NUMBER 1
......@@ -77,8 +90,8 @@ diff -uNr u-boot-2020.04/include/config_mender_defines.h u-boot-2020.04-mender/i
+/* For sanity checks. */
+#define MENDER_BOOTENV_SIZE 0x20000
diff -uNr u-boot-2020.04/include/config_mender.h u-boot-2020.04-mender/include/config_mender.h
--- u-boot-2020.04/include/config_mender.h 1970-01-01 09:30:00.000000000 +0930
+++ u-boot-2020.04-mender/include/config_mender.h 2020-07-24 12:05:58.752487094 +0930
--- u-boot-2020.04/include/config_mender.h 1970-01-01 00:00:00.000000000 +0000
+++ u-boot-2020.04-mender/include/config_mender.h 2021-09-15 13:31:30.202335998 +0000
@@ -0,0 +1,83 @@
+/*
+ Copyright 2017 Northern.tech AS
......@@ -163,9 +176,21 @@ diff -uNr u-boot-2020.04/include/config_mender.h u-boot-2020.04-mender/include/c
+#endif /* !MENDER_AUTO_PROBING */
+
+#endif /* HEADER_CONFIG_MENDER_H */
diff -uNr u-boot-2020.04/include/configs/exynos5-common.h u-boot-2020.04-mender/include/configs/exynos5-common.h
--- u-boot-2020.04/include/configs/exynos5-common.h 2020-04-13 15:02:18.000000000 +0000
+++ u-boot-2020.04-mender/include/configs/exynos5-common.h 2021-09-15 14:01:50.212321166 +0000
@@ -74,8 +74,6 @@
#define CONFIG_SYS_MONITOR_BASE 0x00000000
-#define CONFIG_SYS_MMC_ENV_DEV 0
-
#define CONFIG_SECURE_BL1_ONLY
/* Secure FW size configuration */
diff -uNr u-boot-2020.04/include/configs/meson64.h u-boot-2020.04-mender/include/configs/meson64.h
--- u-boot-2020.04/include/configs/meson64.h 2020-04-14 00:32:18.000000000 +0930
+++ u-boot-2020.04-mender/include/configs/meson64.h 2020-07-24 12:05:58.752487094 +0930
--- u-boot-2020.04/include/configs/meson64.h 2020-04-13 15:02:18.000000000 +0000
+++ u-boot-2020.04-mender/include/configs/meson64.h 2021-09-15 13:31:30.207335806 +0000
@@ -37,6 +37,8 @@
#define CONFIG_CPU_ARMV8
......@@ -175,9 +200,22 @@ diff -uNr u-boot-2020.04/include/configs/meson64.h u-boot-2020.04-mender/include
#define CONFIG_SYS_MAXARGS 32
#define CONFIG_SYS_MALLOC_LEN (32 << 20)
#define CONFIG_SYS_CBSIZE 1024
diff -uNr u-boot-2020.04/include/configs/odroid_xu3.h u-boot-2020.04-mender/include/configs/odroid_xu3.h
--- u-boot-2020.04/include/configs/odroid_xu3.h 2020-04-13 15:02:18.000000000 +0000
+++ u-boot-2020.04-mender/include/configs/odroid_xu3.h 2021-09-15 13:44:30.861966387 +0000
@@ -10,6 +10,9 @@
#include <configs/exynos5420-common.h>
#include <configs/exynos5-common.h>
+#define CONFIG_BOOTCOUNT_LIMIT
+#define CONFIG_BOOTCOUNT_ENV
+
#define CONFIG_BOARD_COMMON
#define CONFIG_SYS_SDRAM_BASE 0x40000000
diff -uNr u-boot-2020.04/include/configs/rpi.h u-boot-2020.04-mender/include/configs/rpi.h
--- u-boot-2020.04/include/configs/rpi.h 2020-04-14 00:32:18.000000000 +0930
+++ u-boot-2020.04-mender/include/configs/rpi.h 2020-07-24 12:05:58.752487094 +0930
--- u-boot-2020.04/include/configs/rpi.h 2020-04-13 15:02:18.000000000 +0000
+++ u-boot-2020.04-mender/include/configs/rpi.h 2021-09-15 13:31:30.207335806 +0000
@@ -97,6 +97,8 @@
#define CONFIG_SYS_CBSIZE 1024
......@@ -188,8 +226,8 @@ diff -uNr u-boot-2020.04/include/configs/rpi.h u-boot-2020.04-mender/include/con
/* Shell */
diff -uNr u-boot-2020.04/include/configs/sun8i.h u-boot-2020.04-mender/include/configs/sun8i.h
--- u-boot-2020.04/include/configs/sun8i.h 2020-04-14 00:32:18.000000000 +0930
+++ u-boot-2020.04-mender/include/configs/sun8i.h 2020-07-24 12:05:58.752487094 +0930
--- u-boot-2020.04/include/configs/sun8i.h 2020-04-13 15:02:18.000000000 +0000
+++ u-boot-2020.04-mender/include/configs/sun8i.h 2021-09-15 13:31:30.207335806 +0000
@@ -17,4 +17,7 @@
*/
#include <configs/sunxi-common.h>
......@@ -199,8 +237,8 @@ diff -uNr u-boot-2020.04/include/configs/sun8i.h u-boot-2020.04-mender/include/c
+
#endif /* __CONFIG_H */
diff -uNr u-boot-2020.04/include/configs/sunxi-common.h u-boot-2020.04-mender/include/configs/sunxi-common.h
--- u-boot-2020.04/include/configs/sunxi-common.h 2020-04-14 00:32:18.000000000 +0930
+++ u-boot-2020.04-mender/include/configs/sunxi-common.h 2020-07-24 12:11:10.614282053 +0930
--- u-boot-2020.04/include/configs/sunxi-common.h 2020-04-13 15:02:18.000000000 +0000
+++ u-boot-2020.04-mender/include/configs/sunxi-common.h 2021-09-15 13:31:30.212335614 +0000
@@ -134,13 +134,6 @@
#define CONFIG_BOARD_SIZE_LIMIT 0x7e000
#endif
......@@ -216,8 +254,8 @@ diff -uNr u-boot-2020.04/include/configs/sunxi-common.h u-boot-2020.04-mender/in
#endif
diff -uNr u-boot-2020.04/include/env_default.h u-boot-2020.04-mender/include/env_default.h
--- u-boot-2020.04/include/env_default.h 2020-04-14 00:32:18.000000000 +0930
+++ u-boot-2020.04-mender/include/env_default.h 2020-07-24 12:05:58.752487094 +0930
--- u-boot-2020.04/include/env_default.h 2020-04-13 15:02:18.000000000 +0000
+++ u-boot-2020.04-mender/include/env_default.h 2021-09-15 13:31:30.217335422 +0000
@@ -9,6 +9,8 @@
#include <env_callback.h>
......@@ -245,8 +283,8 @@ diff -uNr u-boot-2020.04/include/env_default.h u-boot-2020.04-mender/include/env
#ifdef CONFIG_RAMBOOTCOMMAND
"ramboot=" CONFIG_RAMBOOTCOMMAND "\0"
diff -uNr u-boot-2020.04/include/env_mender.h u-boot-2020.04-mender/include/env_mender.h
--- u-boot-2020.04/include/env_mender.h 1970-01-01 09:30:00.000000000 +0930
+++ u-boot-2020.04-mender/include/env_mender.h 2020-07-24 12:05:58.753487097 +0930
--- u-boot-2020.04/include/env_mender.h 1970-01-01 00:00:00.000000000 +0000
+++ u-boot-2020.04-mender/include/env_mender.h 2021-09-15 13:31:30.217335422 +0000
@@ -0,0 +1,86 @@
+/*
+ Copyright 2017 Northern.tech AS
......@@ -335,8 +373,8 @@ diff -uNr u-boot-2020.04/include/env_mender.h u-boot-2020.04-mender/include/env_
+
+#endif /* HEADER_ENV_MENDER_H */
diff -uNr u-boot-2020.04/scripts/Makefile.autoconf u-boot-2020.04-mender/scripts/Makefile.autoconf
--- u-boot-2020.04/scripts/Makefile.autoconf 2020-04-14 00:32:18.000000000 +0930
+++ u-boot-2020.04-mender/scripts/Makefile.autoconf 2020-07-24 12:05:58.753487097 +0930
--- u-boot-2020.04/scripts/Makefile.autoconf 2020-04-13 15:02:18.000000000 +0000
+++ u-boot-2020.04-mender/scripts/Makefile.autoconf 2021-09-15 13:31:30.217335422 +0000
@@ -109,7 +109,8 @@
echo \#include \<configs/$(CONFIG_SYS_CONFIG_NAME).h\>; \
echo \#include \<asm/config.h\>; \
......
bin
/sbin/.*
/var/lock/.*
etc
/etc/.*
bin
/sbin/.*
/var/lock/.*
etc
/etc/.*
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