diff --git a/.gitignore b/.gitignore index eee3ded..dc8b1f8 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ certs output dl +utilities/version_stamp diff --git a/Config.in b/Config.in index 2aff75d..e0b3f1c 100644 --- a/Config.in +++ b/Config.in @@ -1,3 +1,7 @@ +# filesystem utilities + +source "$BR2_EXTERNAL_MynaPlayer_PATH/fs/Config.in" + # packages source "$BR2_EXTERNAL_MynaPlayer_PATH/packages/Config.in" diff --git a/board/myna-player-odyssey/configs/barebox.config b/board/myna-player-odyssey/configs/barebox.config deleted file mode 100644 index 8a9b33a..0000000 --- a/board/myna-player-odyssey/configs/barebox.config +++ /dev/null @@ -1,146 +0,0 @@ -CONFIG_ARCH_STM32MP=y -CONFIG_MACH_SEEED_ODYSSEY=y -CONFIG_THUMB2_BAREBOX=y -CONFIG_ARM_BOARD_APPEND_ATAG=y -CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y -CONFIG_ARM_UNWIND=y -CONFIG_MMU=y -CONFIG_MALLOC_SIZE=0x0 -CONFIG_MALLOC_TLSF=y -CONFIG_KALLSYMS=y -CONFIG_RELOCATABLE=y -CONFIG_HUSH_FANCY_PROMPT=y -CONFIG_CMDLINE_EDITING=y -CONFIG_AUTO_COMPLETE=y -CONFIG_MENU=y -CONFIG_BOOTM_SHOW_TYPE=y -CONFIG_BOOTM_VERBOSE=y -CONFIG_BOOTM_INITRD=y -CONFIG_BOOTM_OFTREE=y -CONFIG_BOOTM_OFTREE_UIMAGE=y -CONFIG_BLSPEC=y -CONFIG_CONSOLE_ACTIVATE_NONE=y -CONFIG_CONSOLE_ALLOW_COLOR=y -CONFIG_PBL_CONSOLE=y -CONFIG_PARTITION_DISK_EFI=y -# CONFIG_PARTITION_DISK_EFI_GPT_NO_FORCE is not set -# CONFIG_PARTITION_DISK_EFI_GPT_COMPARE is not set -CONFIG_DEFAULT_COMPRESSION_XZ=y -CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y -CONFIG_STATE=y -CONFIG_BOOTCHOOSER=y -CONFIG_RESET_SOURCE=y -CONFIG_MACHINE_ID=y -CONFIG_DEFAULT_LOGLEVEL=3 -CONFIG_CMD_DMESG=y -CONFIG_LONGHELP=y -CONFIG_CMD_IOMEM=y -CONFIG_CMD_IMD=y -CONFIG_CMD_MEMINFO=y -CONFIG_CMD_ARM_MMUINFO=y -CONFIG_CMD_REGULATOR=y -CONFIG_CMD_MMC=y -CONFIG_CMD_MMC_EXTCSD=y -CONFIG_CMD_POLLER=y -# CONFIG_CMD_BOOTU is not set -CONFIG_CMD_GO=y -CONFIG_CMD_RESET=y -CONFIG_CMD_UIMAGE=y -CONFIG_CMD_PARTITION=y -CONFIG_CMD_EXPORT=y -CONFIG_CMD_DEFAULTENV=y -CONFIG_CMD_LOADENV=y -CONFIG_CMD_PRINTENV=y -CONFIG_CMD_MAGICVAR=y -CONFIG_CMD_MAGICVAR_HELP=y -CONFIG_CMD_SAVEENV=y -CONFIG_CMD_DIGEST=y -CONFIG_CMD_FILETYPE=y -CONFIG_CMD_LN=y -CONFIG_CMD_UNCOMPRESS=y -CONFIG_CMD_LET=y -CONFIG_CMD_MSLEEP=y -CONFIG_CMD_READF=y -CONFIG_CMD_SLEEP=y -CONFIG_CMD_ECHO_E=y -CONFIG_CMD_EDIT=y -CONFIG_CMD_MENU=y -CONFIG_CMD_MENU_MANAGEMENT=y -CONFIG_CMD_MENUTREE=y -CONFIG_CMD_READLINE=y -CONFIG_CMD_TIMEOUT=y -CONFIG_CMD_CRC=y -CONFIG_CMD_CRC_CMP=y -CONFIG_CMD_MEMTEST=y -CONFIG_CMD_MM=y -CONFIG_CMD_CLK=y -CONFIG_CMD_DETECT=y -CONFIG_CMD_FLASH=y -CONFIG_CMD_GPIO=y -CONFIG_CMD_I2C=y -CONFIG_CMD_LED=y -CONFIG_CMD_POWEROFF=y -CONFIG_CMD_SMC=y -CONFIG_CMD_WD=y -CONFIG_CMD_BAREBOX_UPDATE=y -CONFIG_CMD_OF_DIFF=y -CONFIG_CMD_OF_NODE=y -CONFIG_CMD_OF_PROPERTY=y -CONFIG_CMD_OFTREE=y -CONFIG_CMD_TIME=y -CONFIG_CMD_STATE=y -CONFIG_CMD_BOOTCHOOSER=y -CONFIG_NET=y -CONFIG_OFDEVICE=y -CONFIG_OF_BAREBOX_DRIVERS=y -CONFIG_DRIVER_SERIAL_STM32=y -CONFIG_DRIVER_NET_DESIGNWARE_EQOS=y -CONFIG_DRIVER_NET_DESIGNWARE_STM32=y -CONFIG_MICREL_PHY=y -# CONFIG_SPI is not set -CONFIG_I2C=y -CONFIG_I2C_STM32=y -CONFIG_MCI=y -CONFIG_MCI_MMC_BOOT_PARTITIONS=y -CONFIG_MCI_STM32_SDMMC2=y -CONFIG_MFD_STPMIC1=y -CONFIG_MFD_STM32_TIMERS=y -CONFIG_STATE_DRV=y -CONFIG_LED=y -CONFIG_LED_GPIO=y -CONFIG_LED_PWM=y -CONFIG_LED_GPIO_OF=y -CONFIG_LED_TRIGGERS=y -CONFIG_KEYBOARD_GPIO=y -CONFIG_INPUT_SPECIALKEYS=y -CONFIG_WATCHDOG=y -CONFIG_WATCHDOG_POLLER=y -CONFIG_STM32_IWDG_WATCHDOG=y -CONFIG_STPMIC1_WATCHDOG=y -CONFIG_PWM=y -CONFIG_PWM_STM32=y -CONFIG_HWRNG=y -CONFIG_HWRNG_STM32=y -CONFIG_NVMEM=y -CONFIG_STM32_BSEC=y -CONFIG_REGULATOR=y -CONFIG_REGULATOR_FIXED=y -CONFIG_REGULATOR_STM32_PWR=y -CONFIG_REGULATOR_STPMIC1=y -CONFIG_REMOTEPROC=y -CONFIG_STM32_REMOTEPROC=y -CONFIG_RESET_STM32=y -CONFIG_GENERIC_PHY=y -CONFIG_PHY_STM32_USBPHYC=y -CONFIG_FS_EXT4=y -CONFIG_FS_FAT=y -CONFIG_FS_FAT_WRITE=y -CONFIG_FS_FAT_LFN=y -CONFIG_FS_SQUASHFS=y -CONFIG_FS_RATP=y -CONFIG_ZLIB=y -CONFIG_XZ_DECOMPRESS=y -CONFIG_RATP=y -CONFIG_CRC8=y -CONFIG_DIGEST_SHA1_GENERIC=y -CONFIG_DIGEST_SHA1_ARM=y diff --git a/board/myna-player-odyssey/configs/linux.config b/board/myna-player-odyssey/configs/linux.config index db91319..0739bed 100644 --- a/board/myna-player-odyssey/configs/linux.config +++ b/board/myna-player-odyssey/configs/linux.config @@ -44,7 +44,6 @@ CONFIG_THUMB2_KERNEL=y CONFIG_HIGHMEM=y CONFIG_FORCE_MAX_ZONEORDER=12 -CONFIG_SECCOMP=y CONFIG_CPU_FREQ=y CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y CONFIG_CPU_FREQ_GOV_POWERSAVE=y @@ -291,11 +290,11 @@ # CONFIG_NET_VENDOR_VIA is not set # CONFIG_NET_VENDOR_WIZNET is not set # CONFIG_NET_VENDOR_XILINX is not set -CONFIG_MDIO_BCM_UNIMAC=m -CONFIG_MDIO_BITBANG=m CONFIG_PHYLIB=y CONFIG_MICREL_PHY=m -# CONFIG_USB_NET_DRIVERS is not set +CONFIG_MDIO_BITBANG=m +CONFIG_MDIO_BCM_UNIMAC=m +CONFIG_USB_USBNET=m # CONFIG_WLAN_VENDOR_ADMTEK is not set # CONFIG_WLAN_VENDOR_ATH is not set # CONFIG_WLAN_VENDOR_ATMEL is not set @@ -518,7 +517,6 @@ CONFIG_USB_SERIAL_SYMBOL=m CONFIG_USB_SERIAL_TI=m CONFIG_USB_SERIAL_CYBERJACK=m -CONFIG_USB_SERIAL_XIRCOM=m CONFIG_USB_SERIAL_OPTION=m CONFIG_USB_SERIAL_OMNINET=m CONFIG_USB_SERIAL_OPTICON=m @@ -611,7 +609,6 @@ CONFIG_SYNC_FILE=y # CONFIG_VIRTIO_MENU is not set # CONFIG_VHOST_MENU is not set -CONFIG_CLK_QORIQ=y CONFIG_HWSPINLOCK=y CONFIG_HWSPINLOCK_STM32=y CONFIG_PL320_MBOX=y @@ -657,8 +654,6 @@ CONFIG_OVERLAY_FS=y CONFIG_MSDOS_FS=m CONFIG_VFAT_FS=m -CONFIG_EXFAT_FS=m -CONFIG_NTFS_FS=m CONFIG_TMPFS=y CONFIG_TMPFS_POSIX_ACL=y CONFIG_SQUASHFS=y @@ -668,6 +663,7 @@ CONFIG_SQUASHFS_LZ4=y CONFIG_SQUASHFS_ZSTD=y CONFIG_SQUASHFS_4K_DEVBLK_SIZE=y +CONFIG_EROFS_FS=y # CONFIG_NETWORK_FILESYSTEMS is not set CONFIG_NLS=y CONFIG_NLS_CODEPAGE_437=y @@ -699,9 +695,7 @@ CONFIG_GDB_SCRIPTS=y CONFIG_DEBUG_SECTION_MISMATCH=y CONFIG_MAGIC_SYSRQ=y +CONFIG_DEBUG_FS=y CONFIG_SCHEDSTATS=y -CONFIG_BOOTTIME_TRACING=y -CONFIG_STACK_TRACER=y -CONFIG_FTRACE_SYSCALLS=y -CONFIG_TRACER_SNAPSHOT=y -CONFIG_BLK_DEV_IO_TRACE=y +CONFIG_STACKTRACE=y +# CONFIG_FTRACE is not set diff --git a/board/myna-player-odyssey/rootfs_overlay/etc/fstab b/board/myna-player-odyssey/rootfs_overlay/etc/fstab index 97c2706..e69de29 100644 --- a/board/myna-player-odyssey/rootfs_overlay/etc/fstab +++ b/board/myna-player-odyssey/rootfs_overlay/etc/fstab @@ -1 +0,0 @@ -PARTLABEL=Rauc /rauc ext4 rw,relatime,data=journal,noauto,x-systemd.automount diff --git a/board/myna-player-odyssey/rootfs_overlay/etc/rauc/system.conf b/board/myna-player-odyssey/rootfs_overlay/etc/rauc/system.conf index 03c286a..a0b5fb9 100644 --- a/board/myna-player-odyssey/rootfs_overlay/etc/rauc/system.conf +++ b/board/myna-player-odyssey/rootfs_overlay/etc/rauc/system.conf @@ -2,19 +2,27 @@ compatible=LuminaSensum MynaPlayer bootloader=barebox statusfile=/rauc/slot.status -max-bundle-download-size=40000000 +max-bundle-download-size=60000000 [keyring] path=/etc/rauc/keyring.pem [slot.rootfs.1] -type=ext4 +type=raw device=/dev/disk/by-partlabel/PrimaryRootfs bootname=system0 +[slot.kernel.1] +type=ext4 +device=/dev/disk/by-partlabel/PrimaryBoot +parent=rootfs.1 resize=true [slot.rootfs.2] -type=ext4 +type=raw device=/dev/disk/by-partlabel/SecondaryRootfs bootname=system1 +[slot.kernel.2] +type=ext4 +device=/dev/disk/by-partlabel/SecondaryBoot +parent=rootfs.2 resize=true diff --git a/board/myna-player-odyssey/rootfs_overlay/etc/systemd/system/rauc-mark-good.service b/board/myna-player-odyssey/rootfs_overlay/etc/systemd/system/rauc-mark-good.service index 48d3db5..767988b 100644 --- a/board/myna-player-odyssey/rootfs_overlay/etc/systemd/system/rauc-mark-good.service +++ b/board/myna-player-odyssey/rootfs_overlay/etc/systemd/system/rauc-mark-good.service @@ -7,6 +7,7 @@ [Service] Type=oneshot +ExecStartPre=/usr/bin/mkdir -p /rauc ExecStart=/usr/bin/rauc status mark-good [Install] diff --git a/board/myna-player-odyssey/rootfs_overlay/loader/entries/myna-player.conf b/board/myna-player-odyssey/rootfs_overlay/loader/entries/myna-player.conf deleted file mode 100644 index 639a08c..0000000 --- a/board/myna-player-odyssey/rootfs_overlay/loader/entries/myna-player.conf +++ /dev/null @@ -1,6 +0,0 @@ -title MynaPlayer -version 5.8rc7 -linux boot/zImage -devicetree boot/stm32mp157c-odyssey.dtb -options rootfstype=ext4 ro rootwait quiet systemd.log_color=off init=/sbin/pre-init -linux-appendroot true diff --git a/board/myna-player-odyssey/rootfs_overlay/usr/sbin/pre-init b/board/myna-player-odyssey/rootfs_overlay/usr/sbin/pre-init index 1c7fb61..fd07c40 100755 --- a/board/myna-player-odyssey/rootfs_overlay/usr/sbin/pre-init +++ b/board/myna-player-odyssey/rootfs_overlay/usr/sbin/pre-init @@ -19,13 +19,14 @@ mount -t tmpfs none /run # Step 2: Mount and initialize the data partition at /run/data -# For OverlayFS we need a partition (/dev/mmcblk2p6 in our case) and two +# For OverlayFS we need a partition (/dev/mmcblk2p7 in our case) and two # directories: overlay_root (contains the changes to the read-only root filesystem) # as well as overlay_work which is used as a temporary store when writing files # So mount and create these directories. mkdir /run/data -mount /dev/mmcblk2p6 /run/data +fsck.ext4 -p /dev/mmcblk2p7 +mount /dev/mmcblk2p7 /run/data for i in overlay_root overlay_work; do mkdir -p /run/data/$i; done diff --git a/board/myna-player-odyssey/rootfs_patches/dt-utils/0002-barebox-state-hardcode-lock-file-to-run-barebox-state.patch b/board/myna-player-odyssey/rootfs_patches/dt-utils/0002-barebox-state-hardcode-lock-file-to-run-barebox-state.patch new file mode 100644 index 0000000..c634962 --- /dev/null +++ b/board/myna-player-odyssey/rootfs_patches/dt-utils/0002-barebox-state-hardcode-lock-file-to-run-barebox-state.patch @@ -0,0 +1,37 @@ +From f28f46a3094dc19d78b574741c3f024336752c6a Mon Sep 17 00:00:00 2001 +From: Xogium +Date: Thu, 31 Dec 2020 07:09:16 -0500 +Subject: [PATCH] barebox-state: hardcode lock file to /run/barebox-state + instead + +This is required on newest systemd where sysvinit compatibility is disabled. Directories like /var/run/lock, /var/lock and /run/lock don't get created anymore, so we work around this. +--- + src/barebox-state.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/barebox-state.c b/src/barebox-state.c +index 946a8db..f7bebd7 100644 +--- a/src/barebox-state.c ++++ b/src/barebox-state.c +@@ -505,15 +505,15 @@ int main(int argc, char *argv[]) + ++nr_states; + } + +- lock_fd = open("/var/lock/barebox-state", O_CREAT | O_RDWR, 0600); ++ lock_fd = open("/run/barebox-state", O_CREAT | O_RDWR, 0600); + if (lock_fd < 0) { +- pr_err("Failed to open lock-file /var/lock/barebox-state\n"); ++ pr_err("Failed to open lock-file /run/barebox-state\n"); + exit(1); + } + + ret = flock(lock_fd, LOCK_EX); + if (ret < 0) { +- pr_err("Failed to lock /var/lock/barebox-state: %m\n"); ++ pr_err("Failed to lock /run/barebox-state: %m\n"); + close(lock_fd); + exit(1); + } +-- +2.29.2 + diff --git a/board/myna-player-odyssey/rootfs_patches/linux/000-dt-vendor-prefixes.patch b/board/myna-player-odyssey/rootfs_patches/linux/000-dt-vendor-prefixes.patch deleted file mode 100644 index 526d85d..0000000 --- a/board/myna-player-odyssey/rootfs_patches/linux/000-dt-vendor-prefixes.patch +++ /dev/null @@ -1,30 +0,0 @@ -From fd0ef066c3187ba067c954d704c93d43706887d6 Mon Sep 17 00:00:00 2001 -From: Marcin Sloniewski -Date: Sun, 9 Aug 2020 18:44:48 +0200 -Subject: [PATCH 1/7] dt-bindings: vendor-prefixes: add Seeed Studio - -Add the "seeed" vendor prefix for Seeed Technology Co., Ltd -Website: https://www.seeedstudio.com/ - -Signed-off-by: Marcin Sloniewski -Acked-by: Rob Herring ---- - Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml -index 9aeab66be85f..7dd03b3e9d3c 100644 ---- a/Documentation/devicetree/bindings/vendor-prefixes.yaml -+++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml -@@ -902,6 +902,8 @@ patternProperties: - description: Schindler - "^seagate,.*": - description: Seagate Technology PLC -+ "^seeed,.*": -+ description: Seeed Technology Co., Ltd - "^seirobotics,.*": - description: Shenzhen SEI Robotics Co., Ltd - "^semtech,.*": --- -2.20.1 - diff --git a/board/myna-player-odyssey/rootfs_patches/linux/0001-stm32mp157c-odyssey-Fix-i2c1-pinctrl.patch b/board/myna-player-odyssey/rootfs_patches/linux/0001-stm32mp157c-odyssey-Fix-i2c1-pinctrl.patch new file mode 100644 index 0000000..1b66bb8 --- /dev/null +++ b/board/myna-player-odyssey/rootfs_patches/linux/0001-stm32mp157c-odyssey-Fix-i2c1-pinctrl.patch @@ -0,0 +1,27 @@ +From e708bdd272400f1442cb1a875c6ae608fe63b7af Mon Sep 17 00:00:00 2001 +From: Jookia +Date: Wed, 12 Aug 2020 00:17:03 +1000 +Subject: [PATCH 1/9] stm32mp157c-odyssey: Fix i2c1 pinctrl + +--- + arch/arm/boot/dts/stm32mp157c-odyssey.dts | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/arm/boot/dts/stm32mp157c-odyssey.dts b/arch/arm/boot/dts/stm32mp157c-odyssey.dts +index a7ffec8f1516..027aaa441e4f 100644 +--- a/arch/arm/boot/dts/stm32mp157c-odyssey.dts ++++ b/arch/arm/boot/dts/stm32mp157c-odyssey.dts +@@ -50,8 +50,8 @@ phy0: ethernet-phy@7 { /* KSZ9031RN */ + + &i2c1 { + pinctrl-names = "default", "sleep"; +- pinctrl-0 = <&i2c1_pins_a>; +- pinctrl-1 = <&i2c1_sleep_pins_a>; ++ pinctrl-0 = <&i2c1_pins_b>; ++ pinctrl-1 = <&i2c1_sleep_pins_b>; + i2c-scl-rising-time-ns = <100>; + i2c-scl-falling-time-ns = <7>; + status = "okay"; +-- +2.29.2 + diff --git a/board/myna-player-odyssey/rootfs_patches/linux/0002-stm32mp157c-odyssey-Add-i2c4-support.patch b/board/myna-player-odyssey/rootfs_patches/linux/0002-stm32mp157c-odyssey-Add-i2c4-support.patch new file mode 100644 index 0000000..21d1c45 --- /dev/null +++ b/board/myna-player-odyssey/rootfs_patches/linux/0002-stm32mp157c-odyssey-Add-i2c4-support.patch @@ -0,0 +1,59 @@ +From d169a926726cf0a6aef2ce8c594224899629b7c8 Mon Sep 17 00:00:00 2001 +From: Jookia +Date: Wed, 12 Aug 2020 00:19:06 +1000 +Subject: [PATCH 2/9] stm32mp157c-odyssey: Add i2c4 support + +--- + arch/arm/boot/dts/stm32mp15-pinctrl.dtsi | 17 +++++++++++++++++ + arch/arm/boot/dts/stm32mp157c-odyssey.dts | 10 ++++++++++ + 2 files changed, 27 insertions(+) + +diff --git a/arch/arm/boot/dts/stm32mp15-pinctrl.dtsi b/arch/arm/boot/dts/stm32mp15-pinctrl.dtsi +index d84686e00370..b2329d29a2dc 100644 +--- a/arch/arm/boot/dts/stm32mp15-pinctrl.dtsi ++++ b/arch/arm/boot/dts/stm32mp15-pinctrl.dtsi +@@ -432,6 +432,23 @@ pins { + }; + }; + ++ i2c4_pins_s: i2c4-0 { ++ pins { ++ pinmux = , /* I2C4_SCL */ ++ ; /* I2C4_SDA */ ++ bias-disable; ++ drive-open-drain; ++ slew-rate = <0>; ++ }; ++ }; ++ ++ i2c4_pins_sleep_s: i2c4-1 { ++ pins { ++ pinmux = , /* I2C4_SCL */ ++ ; /* I2C4_SDA */ ++ }; ++ }; ++ + i2c5_pins_a: i2c5-0 { + pins { + pinmux = , /* I2C5_SCL */ +diff --git a/arch/arm/boot/dts/stm32mp157c-odyssey.dts b/arch/arm/boot/dts/stm32mp157c-odyssey.dts +index 027aaa441e4f..f9861e8fdb3a 100644 +--- a/arch/arm/boot/dts/stm32mp157c-odyssey.dts ++++ b/arch/arm/boot/dts/stm32mp157c-odyssey.dts +@@ -78,3 +78,13 @@ &uart4 { + status = "okay"; + }; + ++&i2c4 { ++ pinctrl-names = "default", "sleep"; ++ pinctrl-0 = <&i2c4_pins_s>; ++ pinctrl-1 = <&i2c4_pins_sleep_s>; ++ i2c-scl-rising-time-ns = <185>; ++ i2c-scl-falling-time-ns = <20>; ++ status = "okay"; ++ /delete-property/dmas; ++ /delete-property/dma-names; ++}; +-- +2.29.2 + diff --git a/board/myna-player-odyssey/rootfs_patches/linux/0003-stm32mp157c-odyssey-Add-Wi-Fi.patch b/board/myna-player-odyssey/rootfs_patches/linux/0003-stm32mp157c-odyssey-Add-Wi-Fi.patch new file mode 100644 index 0000000..f07944f --- /dev/null +++ b/board/myna-player-odyssey/rootfs_patches/linux/0003-stm32mp157c-odyssey-Add-Wi-Fi.patch @@ -0,0 +1,121 @@ +From 4521bf754777c223b6c7bcceda7f01c057a07cee Mon Sep 17 00:00:00 2001 +From: Jookia +Date: Wed, 12 Aug 2020 00:28:50 +1000 +Subject: [PATCH 3/9] stm32mp157c-odyssey: Add Wi-Fi + +--- + arch/arm/boot/dts/stm32mp15-pinctrl.dtsi | 54 +++++++++++++++++++++++ + arch/arm/boot/dts/stm32mp157c-odyssey.dts | 25 +++++++++++ + 2 files changed, 79 insertions(+) + +diff --git a/arch/arm/boot/dts/stm32mp15-pinctrl.dtsi b/arch/arm/boot/dts/stm32mp15-pinctrl.dtsi +index b2329d29a2dc..1ab13fc1f5c6 100644 +--- a/arch/arm/boot/dts/stm32mp15-pinctrl.dtsi ++++ b/arch/arm/boot/dts/stm32mp15-pinctrl.dtsi +@@ -1580,6 +1580,60 @@ pins { + }; + }; + ++ sdmmc3_b4_pins_s: sdmmc3-b4-1 { ++ pins1 { ++ pinmux = , /* SDMMC3_D0 */ ++ , /* SDMMC3_D1 */ ++ , /* SDMMC3_D2 */ ++ , /* SDMMC3_D3 */ ++ ; /* SDMMC3_CMD */ ++ slew-rate = <1>; ++ drive-push-pull; ++ bias-pull-up; ++ }; ++ pins2 { ++ pinmux = ; /* SDMMC3_CLK */ ++ slew-rate = <2>; ++ drive-push-pull; ++ bias-pull-up; ++ }; ++ }; ++ ++ sdmmc3_b4_od_pins_s: sdmmc3-b4-od-1 { ++ pins1 { ++ pinmux = , /* SDMMC3_D0 */ ++ , /* SDMMC3_D1 */ ++ , /* SDMMC3_D2 */ ++ ; /* SDMMC3_D3 */ ++ slew-rate = <1>; ++ drive-push-pull; ++ bias-pull-up; ++ }; ++ pins2 { ++ pinmux = ; /* SDMMC3_CLK */ ++ slew-rate = <2>; ++ drive-push-pull; ++ bias-pull-up; ++ }; ++ pins3 { ++ pinmux = ; /* SDMMC2_CMD */ ++ slew-rate = <1>; ++ drive-open-drain; ++ bias-pull-up; ++ }; ++ }; ++ ++ sdmmc3_b4_sleep_pins_s: sdmmc3-b4-sleep-1 { ++ pins { ++ pinmux = , /* SDMMC3_D0 */ ++ , /* SDMMC3_D1 */ ++ , /* SDMMC3_D2 */ ++ , /* SDMMC3_D3 */ ++ , /* SDMMC3_CK */ ++ ; /* SDMMC3_CMD */ ++ }; ++ }; ++ + spdifrx_pins_a: spdifrx-0 { + pins { + pinmux = ; /* SPDIF_IN1 */ +diff --git a/arch/arm/boot/dts/stm32mp157c-odyssey.dts b/arch/arm/boot/dts/stm32mp157c-odyssey.dts +index f9861e8fdb3a..787c001fadef 100644 +--- a/arch/arm/boot/dts/stm32mp157c-odyssey.dts ++++ b/arch/arm/boot/dts/stm32mp157c-odyssey.dts +@@ -20,6 +20,12 @@ aliases { + chosen { + stdout-path = "serial0:115200n8"; + }; ++ ++ wifi_pwrseq: wifi-pwrseq { ++ compatible = "mmc-pwrseq-simple"; ++ reset-gpios = <&gpiod 9 GPIO_ACTIVE_LOW>; ++ post-power-on-delay-ms = <1>; ++ }; + }; + + ðernet0 { +@@ -72,6 +78,25 @@ &sdmmc1 { + status = "okay"; + }; + ++&sdmmc3 { ++ pinctrl-names = "default", "opendrain", "sleep"; ++ pinctrl-0 = <&sdmmc3_b4_pins_s>; ++ pinctrl-1 = <&sdmmc3_b4_od_pins_s>; ++ pinctrl-2 = <&sdmmc3_b4_sleep_pins_s>; ++ bus-width = <4>; ++ vmmc-supply = <&v3v3>; ++ mmc-pwrseq = <&wifi_pwrseq>; ++ status = "okay"; ++ keep-power-in-suspend; ++ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ brcmf: bcrmf@1 { ++ reg = <1>; ++ compatible = "brcm,bcm4329-fmac"; ++ }; ++}; ++ + &uart4 { + pinctrl-names = "default"; + pinctrl-0 = <&uart4_pins_a>; +-- +2.29.2 + diff --git a/board/myna-player-odyssey/rootfs_patches/linux/0004-stm32mp157c-odyssey-Re-order-i2c-devices-for-Raspber.patch b/board/myna-player-odyssey/rootfs_patches/linux/0004-stm32mp157c-odyssey-Re-order-i2c-devices-for-Raspber.patch new file mode 100644 index 0000000..5863f3d --- /dev/null +++ b/board/myna-player-odyssey/rootfs_patches/linux/0004-stm32mp157c-odyssey-Re-order-i2c-devices-for-Raspber.patch @@ -0,0 +1,27 @@ +From ed903a0c9e8812b1ef6390505453e6bd3c5e0953 Mon Sep 17 00:00:00 2001 +From: Jookia +Date: Fri, 14 Aug 2020 13:15:17 +1000 +Subject: [PATCH 4/9] stm32mp157c-odyssey: Re-order i2c devices for Raspberry + Pi compatibility + +--- + arch/arm/boot/dts/stm32mp157c-odyssey.dts | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/arch/arm/boot/dts/stm32mp157c-odyssey.dts b/arch/arm/boot/dts/stm32mp157c-odyssey.dts +index 787c001fadef..c498d51c72ba 100644 +--- a/arch/arm/boot/dts/stm32mp157c-odyssey.dts ++++ b/arch/arm/boot/dts/stm32mp157c-odyssey.dts +@@ -15,6 +15,9 @@ / { + aliases { + ethernet0 = ðernet0; + serial0 = &uart4; ++ i2c0 = &i2c2; ++ i2c1 = &i2c4; /* RPi compatible */ ++ i2c2 = &i2c1; + }; + + chosen { +-- +2.29.2 + diff --git a/board/myna-player-odyssey/rootfs_patches/linux/0005-stm32mp157c-odyssey-enable-thermal-in-device-tree.patch b/board/myna-player-odyssey/rootfs_patches/linux/0005-stm32mp157c-odyssey-enable-thermal-in-device-tree.patch new file mode 100644 index 0000000..6231754 --- /dev/null +++ b/board/myna-player-odyssey/rootfs_patches/linux/0005-stm32mp157c-odyssey-enable-thermal-in-device-tree.patch @@ -0,0 +1,24 @@ +From 7f517f62d66ebe260f5010ddf10582f1ff67e794 Mon Sep 17 00:00:00 2001 +From: Xogium +Date: Fri, 1 Jan 2021 19:12:19 -0500 +Subject: [PATCH 5/9] stm32mp157c-odyssey: enable thermal in device tree. + +--- + arch/arm/boot/dts/stm32mp157c-odyssey.dts | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/arch/arm/boot/dts/stm32mp157c-odyssey.dts b/arch/arm/boot/dts/stm32mp157c-odyssey.dts +index c498d51c72ba..f9128b104ae9 100644 +--- a/arch/arm/boot/dts/stm32mp157c-odyssey.dts ++++ b/arch/arm/boot/dts/stm32mp157c-odyssey.dts +@@ -116,3 +116,7 @@ &i2c4 { + /delete-property/dmas; + /delete-property/dma-names; + }; ++ ++&dts { ++ status = "okay"; ++}; +-- +2.29.2 + diff --git a/board/myna-player-odyssey/rootfs_patches/linux/0006-stm32mp157c-odyssey-create-regulators-needed-for-usb.patch b/board/myna-player-odyssey/rootfs_patches/linux/0006-stm32mp157c-odyssey-create-regulators-needed-for-usb.patch new file mode 100644 index 0000000..b55b736 --- /dev/null +++ b/board/myna-player-odyssey/rootfs_patches/linux/0006-stm32mp157c-odyssey-create-regulators-needed-for-usb.patch @@ -0,0 +1,41 @@ +From 73722a8b3ddb85a81b304c389f1b9a1f68223dee Mon Sep 17 00:00:00 2001 +From: Xogium +Date: Thu, 7 Jan 2021 13:44:18 -0500 +Subject: [PATCH 1/4] stm32mp157c-odyssey: create regulators needed for usb + ports. + +The two regulators created in this patches set gpioh 13 and gpiof 8 to high, respectively. This should enable power for the usb ports. +--- + arch/arm/boot/dts/stm32mp157c-odyssey.dts | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/arch/arm/boot/dts/stm32mp157c-odyssey.dts b/arch/arm/boot/dts/stm32mp157c-odyssey.dts +index f9128b104ae9..73da983bd76a 100644 +--- a/arch/arm/boot/dts/stm32mp157c-odyssey.dts ++++ b/arch/arm/boot/dts/stm32mp157c-odyssey.dts +@@ -29,6 +29,22 @@ wifi_pwrseq: wifi-pwrseq { + reset-gpios = <&gpiod 9 GPIO_ACTIVE_LOW>; + post-power-on-delay-ms = <1>; + }; ++ ++ usb1vbus: fixed-regulator-usb1vbus { ++ compatible = "regulator-fixed"; ++ regulator-name = "host_usb1_vbus"; ++ gpios = <&gpioh 13 0>; // USB1_EN ++ enable-active-high; ++ regulator-always-on; ++ }; ++ ++ usb2vbus: fixed-regulator-usb2vbus { ++ compatible = "regulator-fixed"; ++ regulator-name = "host_usb2_vbus"; ++ gpios = <&gpiof 8 0>; // USB2_EN ++ enable-active-high; ++ regulator-always-on; ++ }; + }; + + ðernet0 { +-- +2.29.2 + diff --git a/board/myna-player-odyssey/rootfs_patches/linux/0007-stm32mp157c-odyssey-enable-usb-ports.patch b/board/myna-player-odyssey/rootfs_patches/linux/0007-stm32mp157c-odyssey-enable-usb-ports.patch new file mode 100644 index 0000000..798a440 --- /dev/null +++ b/board/myna-player-odyssey/rootfs_patches/linux/0007-stm32mp157c-odyssey-enable-usb-ports.patch @@ -0,0 +1,54 @@ +From a5fc04994cc0d858849945801c851cbcadfd896e Mon Sep 17 00:00:00 2001 +From: Xogium +Date: Thu, 7 Jan 2021 14:51:55 -0500 +Subject: [PATCH 1/3] stm32mp157c-odyssey: enable usb ports. + +This commit enables both usb host ports on board in ehci mode, as well as the OTG (type c) port in ohci mode. +--- + arch/arm/boot/dts/stm32mp157c-odyssey.dts | 33 +++++++++++++++++++++++ + 1 file changed, 33 insertions(+) + +diff --git a/arch/arm/boot/dts/stm32mp157c-odyssey.dts b/arch/arm/boot/dts/stm32mp157c-odyssey.dts +index 73da983bd76a..4fa0d2349300 100644 +--- a/arch/arm/boot/dts/stm32mp157c-odyssey.dts ++++ b/arch/arm/boot/dts/stm32mp157c-odyssey.dts +@@ -136,3 +136,36 @@ &i2c4 { + &dts { + status = "okay"; + }; ++ ++&usbphyc { ++ status = "okay"; ++}; ++ ++&usbh_ehci { ++ phys = <&usbphyc_port0>, <&usbphyc_port1 1>; ++ phy-names = "usb1-phy", "usb2-phy"; ++ status = "okay"; ++}; ++ ++&usbphyc_port0 { ++ phy-supply = <&vdd_usb>; ++ vbus-supply = <&usb1vbus>; ++ vdda1v1-supply = <®11>; ++ vdda1v8-supply = <®18>; ++}; ++ ++&usbphyc_port1 { ++ phy-supply = <&vdd_usb>; ++ vbus-supply = <&usb2vbus>; ++ vdda1v1-supply = <®11>; ++ vdda1v8-supply = <®18>; ++}; ++ ++&usbotg_hs { ++ compatible = "st,stm32mp15-fsotg", "snps,dwc2"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&usbotg_hs_pins_a &usbotg_fs_dp_dm_pins_a>; /* configure OTG ID and full-speed data pins */ ++ vbus-supply = <&vbus_otg>; /* voltage regulator to supply Vbus */ ++ dr_mode = "peripheral"; ++ status = "okay"; ++}; +-- +2.29.2 + diff --git a/board/myna-player-odyssey/rootfs_patches/linux/0008-stm32mp157c-odyssey-setting-broken-cd-for-sdmmc1.patch b/board/myna-player-odyssey/rootfs_patches/linux/0008-stm32mp157c-odyssey-setting-broken-cd-for-sdmmc1.patch new file mode 100644 index 0000000..fa44443 --- /dev/null +++ b/board/myna-player-odyssey/rootfs_patches/linux/0008-stm32mp157c-odyssey-setting-broken-cd-for-sdmmc1.patch @@ -0,0 +1,24 @@ +From ea57a5eb3ff4274c7661f878f6131e4d793365a7 Mon Sep 17 00:00:00 2001 +From: Xogium +Date: Fri, 8 Jan 2021 11:10:35 -0500 +Subject: [PATCH 8/9] stm32mp157c-odyssey: setting broken-cd for sdmmc1. + +--- + arch/arm/boot/dts/stm32mp157c-odyssey.dts | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/arm/boot/dts/stm32mp157c-odyssey.dts b/arch/arm/boot/dts/stm32mp157c-odyssey.dts +index 85ea8c040ae0..3bd92ca1ae03 100644 +--- a/arch/arm/boot/dts/stm32mp157c-odyssey.dts ++++ b/arch/arm/boot/dts/stm32mp157c-odyssey.dts +@@ -91,6 +91,7 @@ &sdmmc1 { + pinctrl-2 = <&sdmmc1_b4_sleep_pins_a>; + cd-gpios = <&gpiob 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + disable-wp; ++ broken-cd; + st,neg-edge; + bus-width = <4>; + vmmc-supply = <&v3v3>; +-- +2.29.2 + diff --git a/board/myna-player-odyssey/rootfs_patches/linux/0009-stm32mp157c-odyssey-set-non-removable-property-for-s.patch b/board/myna-player-odyssey/rootfs_patches/linux/0009-stm32mp157c-odyssey-set-non-removable-property-for-s.patch new file mode 100644 index 0000000..2152dc4 --- /dev/null +++ b/board/myna-player-odyssey/rootfs_patches/linux/0009-stm32mp157c-odyssey-set-non-removable-property-for-s.patch @@ -0,0 +1,25 @@ +From 719fd81b93fca954f6f7b0a2933e88d65e5d8408 Mon Sep 17 00:00:00 2001 +From: Xogium +Date: Fri, 8 Jan 2021 11:50:07 -0500 +Subject: [PATCH 9/9] stm32mp157c-odyssey: set non-removable property for + sdmmc1. + +--- + arch/arm/boot/dts/stm32mp157c-odyssey.dts | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/arm/boot/dts/stm32mp157c-odyssey.dts b/arch/arm/boot/dts/stm32mp157c-odyssey.dts +index 3bd92ca1ae03..927a8332bd15 100644 +--- a/arch/arm/boot/dts/stm32mp157c-odyssey.dts ++++ b/arch/arm/boot/dts/stm32mp157c-odyssey.dts +@@ -92,6 +92,7 @@ &sdmmc1 { + cd-gpios = <&gpiob 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + disable-wp; + broken-cd; ++ non-removable; + st,neg-edge; + bus-width = <4>; + vmmc-supply = <&v3v3>; +-- +2.29.2 + diff --git a/board/myna-player-odyssey/rootfs_patches/linux/001-dt-document-vendor-prefixes.patch b/board/myna-player-odyssey/rootfs_patches/linux/001-dt-document-vendor-prefixes.patch deleted file mode 100644 index 2629e6a..0000000 --- a/board/myna-player-odyssey/rootfs_patches/linux/001-dt-document-vendor-prefixes.patch +++ /dev/null @@ -1,31 +0,0 @@ -From faec90aac9be0611a4f63a9b13df74b0657b3732 Mon Sep 17 00:00:00 2001 -From: Marcin Sloniewski -Date: Sun, 9 Aug 2020 18:44:49 +0200 -Subject: [PATCH 2/7] dt-bindings: arm: stm32: document Odyssey compatible - -Document device tree bindings of Seeed SoM and carrier board. - -Signed-off-by: Marcin Sloniewski -Reviewed-by: Rob Herring ---- - Documentation/devicetree/bindings/arm/stm32/stm32.yaml | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/Documentation/devicetree/bindings/arm/stm32/stm32.yaml b/Documentation/devicetree/bindings/arm/stm32/stm32.yaml -index 790e6dd48e34..3b318fe15194 100644 ---- a/Documentation/devicetree/bindings/arm/stm32/stm32.yaml -+++ b/Documentation/devicetree/bindings/arm/stm32/stm32.yaml -@@ -50,4 +50,10 @@ properties: - - const: st,stm32mp157c-ev1 - - const: st,stm32mp157c-ed1 - - const: st,stm32mp157 -+ - description: Odyssey STM32MP1 SoM based Boards -+ items: -+ - enum: -+ - seeed,stm32mp157c-odyssey -+ - const: seeed,stm32mp157c-odyssey-som -+ - const: st,stm32mp157 - ... --- -2.20.1 - diff --git a/board/myna-player-odyssey/rootfs_patches/linux/0010-stm32mp157c-odyssey-fix-hang-for-usb-otg.patch b/board/myna-player-odyssey/rootfs_patches/linux/0010-stm32mp157c-odyssey-fix-hang-for-usb-otg.patch new file mode 100644 index 0000000..99102d3 --- /dev/null +++ b/board/myna-player-odyssey/rootfs_patches/linux/0010-stm32mp157c-odyssey-fix-hang-for-usb-otg.patch @@ -0,0 +1,32 @@ +diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c +index 5f18acac7406..c5332ddce4bd 100644 +--- a/drivers/usb/dwc2/platform.c ++++ b/drivers/usb/dwc2/platform.c +@@ -495,6 +495,27 @@ static int dwc2_driver_probe(struct platform_device *dev) + if (retval) + goto error; + ++ /* ++ * Connect FS PHY transceiver to prevent 'HANG! Soft Reset timeout' ++ */ ++ if (!hsotg->phy) { ++ u32 v; ++ ++ v = dwc2_readl(hsotg, GGPIO); ++ if (!(v & GGPIO_STM32_OTG_GCCFG_PWRDWN)) { ++ /* ++ * STM32 uses the GGPIO register as general ++ * core configuration register. ++ */ ++ v |= GGPIO_STM32_OTG_GCCFG_PWRDWN; ++ dwc2_writel(hsotg, v, GGPIO); ++ } ++ ++ v = dwc2_readl(hsotg, GUSBCFG); ++ v |= GUSBCFG_PHYSEL; ++ dwc2_writel(hsotg, v, GUSBCFG); ++ } ++ + /* + * Reset before dwc2_get_hwparams() then it could get power-on real + * reset value form registers. diff --git a/board/myna-player-odyssey/rootfs_patches/linux/0011-stm32mp157c-odyssey-set-sdmmc3-in-non-dma-mode.patch b/board/myna-player-odyssey/rootfs_patches/linux/0011-stm32mp157c-odyssey-set-sdmmc3-in-non-dma-mode.patch new file mode 100644 index 0000000..f0953cb --- /dev/null +++ b/board/myna-player-odyssey/rootfs_patches/linux/0011-stm32mp157c-odyssey-set-sdmmc3-in-non-dma-mode.patch @@ -0,0 +1,27 @@ +From 4a176283dd96ad2b21c0f2d04364a7bb29bb4f69 Mon Sep 17 00:00:00 2001 +From: Xogium +Date: Wed, 3 Mar 2021 14:51:23 -0500 +Subject: [PATCH] stm32mp157c-odyssey: set sdmmc3 in non-dma mode. + +5.11 kernel introduced the mmc controllers in dma mode, but it appears the wifi driver isn't able to deal with this. + +Explicitly set the sdmmc3 interface in non-dma mode. +--- + arch/arm/boot/dts/stm32mp157c-odyssey.dts | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/arm/boot/dts/stm32mp157c-odyssey.dts b/arch/arm/boot/dts/stm32mp157c-odyssey.dts +index f0aa9a99887e..7b92d218af0f 100644 +--- a/arch/arm/boot/dts/stm32mp157c-odyssey.dts ++++ b/arch/arm/boot/dts/stm32mp157c-odyssey.dts +@@ -106,6 +106,7 @@ &sdmmc3 { + pinctrl-2 = <&sdmmc3_b4_sleep_pins_s>; + bus-width = <4>; + vmmc-supply = <&v3v3>; ++ arm,primecell-periphid = <0x10153180>; + mmc-pwrseq = <&wifi_pwrseq>; + status = "okay"; + keep-power-in-suspend; +-- +2.30.1 + diff --git a/board/myna-player-odyssey/rootfs_patches/linux/002-dt-stm32mp157c-odyssey.patch b/board/myna-player-odyssey/rootfs_patches/linux/002-dt-stm32mp157c-odyssey.patch deleted file mode 100644 index a571b6f..0000000 --- a/board/myna-player-odyssey/rootfs_patches/linux/002-dt-stm32mp157c-odyssey.patch +++ /dev/null @@ -1,439 +0,0 @@ -From b70a4f521d1d0c09e18f4e60c99b7e9017908f41 Mon Sep 17 00:00:00 2001 -From: Marcin Sloniewski -Date: Sun, 9 Aug 2020 18:44:50 +0200 -Subject: [PATCH 3/7] ARM: dts: stm32: add initial support for - stm32mp157-odyssey board - -Add support for Seeed Studio's stm32mp157c odyssey board. -Board consists of SoM with stm32mp157c with 4GB eMMC and 512 MB DDR3 RAM -and carrier board with USB and ETH interfaces, SD card connector, -wifi and BT chip AP6236. - -In this patch only basic kernel boot is supported and interfacing -SD card and on-board eMMC. - -Signed-off-by: Marcin Sloniewski -Reviewed-by: Ahmad Fatoum ---- - arch/arm/boot/dts/Makefile | 3 +- - arch/arm/boot/dts/stm32mp15-pinctrl.dtsi | 18 ++ - .../arm/boot/dts/stm32mp157c-odyssey-som.dtsi | 276 ++++++++++++++++++ - arch/arm/boot/dts/stm32mp157c-odyssey.dts | 80 +++++ - 4 files changed, 376 insertions(+), 1 deletion(-) - create mode 100644 arch/arm/boot/dts/stm32mp157c-odyssey-som.dtsi - create mode 100644 arch/arm/boot/dts/stm32mp157c-odyssey.dts - -diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile -index e6a1cac0bfc7..a3ea2301c82c 100644 ---- a/arch/arm/boot/dts/Makefile -+++ b/arch/arm/boot/dts/Makefile -@@ -1047,7 +1047,8 @@ dtb-$(CONFIG_ARCH_STM32) += \ - stm32mp157c-dk2.dtb \ - stm32mp157c-ed1.dtb \ - stm32mp157c-ev1.dtb \ -- stm32mp157c-lxa-mc1.dtb -+ stm32mp157c-lxa-mc1.dtb \ -+ stm32mp157c-odyssey.dtb - dtb-$(CONFIG_MACH_SUN4I) += \ - sun4i-a10-a1000.dtb \ - sun4i-a10-ba10-tvbox.dtb \ -diff --git a/arch/arm/boot/dts/stm32mp15-pinctrl.dtsi b/arch/arm/boot/dts/stm32mp15-pinctrl.dtsi -index 7eb858732d6d..2f75b631feac 100644 ---- a/arch/arm/boot/dts/stm32mp15-pinctrl.dtsi -+++ b/arch/arm/boot/dts/stm32mp15-pinctrl.dtsi -@@ -1438,6 +1438,24 @@ - }; - }; - -+ sdmmc2_d47_pins_d: sdmmc2-d47-3 { -+ pins { -+ pinmux = , /* SDMMC2_D4 */ -+ , /* SDMMC2_D5 */ -+ , /* SDMMC2_D6 */ -+ ; /* SDMMC2_D7 */ -+ }; -+ }; -+ -+ sdmmc2_d47_sleep_pins_d: sdmmc2-d47-sleep-3 { -+ pins { -+ pinmux = , /* SDMMC2_D4 */ -+ , /* SDMMC2_D5 */ -+ , /* SDMMC2_D6 */ -+ ; /* SDMMC2_D7 */ -+ }; -+ }; -+ - sdmmc3_b4_pins_a: sdmmc3-b4-0 { - pins1 { - pinmux = , /* SDMMC3_D0 */ -diff --git a/arch/arm/boot/dts/stm32mp157c-odyssey-som.dtsi b/arch/arm/boot/dts/stm32mp157c-odyssey-som.dtsi -new file mode 100644 -index 000000000000..6cf49a0a9e69 ---- /dev/null -+++ b/arch/arm/boot/dts/stm32mp157c-odyssey-som.dtsi -@@ -0,0 +1,276 @@ -+// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) -+/* -+ * Copyright (C) 2020 Marcin Sloniewski . -+ */ -+ -+/dts-v1/; -+ -+#include "stm32mp157.dtsi" -+#include "stm32mp15xc.dtsi" -+#include "stm32mp15-pinctrl.dtsi" -+#include "stm32mp15xxac-pinctrl.dtsi" -+#include -+#include -+#include -+ -+/ { -+ model = "Seeed Studio Odyssey-STM32MP157C SOM"; -+ compatible = "seeed,stm32mp157c-odyssey-som", "st,stm32mp157"; -+ -+ memory@c0000000 { -+ device_type = "memory"; -+ reg = <0xc0000000 0x20000000>; -+ }; -+ -+ reserved-memory { -+ #address-cells = <1>; -+ #size-cells = <1>; -+ ranges; -+ -+ mcuram2: mcuram2@10000000 { -+ compatible = "shared-dma-pool"; -+ reg = <0x10000000 0x40000>; -+ no-map; -+ }; -+ -+ vdev0vring0: vdev0vring0@10040000 { -+ compatible = "shared-dma-pool"; -+ reg = <0x10040000 0x1000>; -+ no-map; -+ }; -+ -+ vdev0vring1: vdev0vring1@10041000 { -+ compatible = "shared-dma-pool"; -+ reg = <0x10041000 0x1000>; -+ no-map; -+ }; -+ -+ vdev0buffer: vdev0buffer@10042000 { -+ compatible = "shared-dma-pool"; -+ reg = <0x10042000 0x4000>; -+ no-map; -+ }; -+ -+ mcuram: mcuram@30000000 { -+ compatible = "shared-dma-pool"; -+ reg = <0x30000000 0x40000>; -+ no-map; -+ }; -+ -+ retram: retram@38000000 { -+ compatible = "shared-dma-pool"; -+ reg = <0x38000000 0x10000>; -+ no-map; -+ }; -+ -+ gpu_reserved: gpu@d4000000 { -+ reg = <0xd4000000 0x4000000>; -+ no-map; -+ }; -+ }; -+ -+ led { -+ compatible = "gpio-leds"; -+ led-blue { -+ color = ; -+ function = LED_FUNCTION_HEARTBEAT; -+ gpios = <&gpiog 3 GPIO_ACTIVE_HIGH>; -+ linux,default-trigger = "heartbeat"; -+ }; -+ }; -+}; -+ -+&gpu { -+ contiguous-area = <&gpu_reserved>; -+ status = "okay"; -+}; -+ -+&i2c2 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c2_pins_a>; -+ i2c-scl-rising-time-ns = <185>; -+ i2c-scl-falling-time-ns = <20>; -+ status = "okay"; -+ /* spare dmas for other usage */ -+ /delete-property/dmas; -+ /delete-property/dma-names; -+ -+ pmic: stpmic@33 { -+ compatible = "st,stpmic1"; -+ reg = <0x33>; -+ interrupts-extended = <&gpioa 0 IRQ_TYPE_EDGE_FALLING>; -+ interrupt-controller; -+ #interrupt-cells = <2>; -+ -+ regulators { -+ compatible = "st,stpmic1-regulators"; -+ ldo1-supply = <&v3v3>; -+ ldo3-supply = <&vdd_ddr>; -+ ldo6-supply = <&v3v3>; -+ pwr_sw1-supply = <&bst_out>; -+ pwr_sw2-supply = <&bst_out>; -+ -+ vddcore: buck1 { -+ regulator-name = "vddcore"; -+ regulator-min-microvolt = <800000>; -+ regulator-max-microvolt = <1350000>; -+ regulator-always-on; -+ regulator-initial-mode = <0>; -+ regulator-over-current-protection; -+ }; -+ -+ vdd_ddr: buck2 { -+ regulator-name = "vdd_ddr"; -+ regulator-min-microvolt = <1350000>; -+ regulator-max-microvolt = <1350000>; -+ regulator-always-on; -+ regulator-initial-mode = <0>; -+ regulator-over-current-protection; -+ }; -+ -+ vdd: buck3 { -+ regulator-name = "vdd"; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-always-on; -+ st,mask-reset; -+ regulator-initial-mode = <0>; -+ regulator-over-current-protection; -+ }; -+ -+ v3v3: buck4 { -+ regulator-name = "v3v3"; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-always-on; -+ regulator-over-current-protection; -+ regulator-initial-mode = <0>; -+ }; -+ -+ v1v8_audio: ldo1 { -+ regulator-name = "v1v8_audio"; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ regulator-always-on; -+ interrupts = ; -+ }; -+ -+ v3v3_hdmi: ldo2 { -+ regulator-name = "v3v3_hdmi"; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-always-on; -+ interrupts = ; -+ }; -+ -+ vtt_ddr: ldo3 { -+ regulator-name = "vtt_ddr"; -+ regulator-min-microvolt = <500000>; -+ regulator-max-microvolt = <750000>; -+ regulator-always-on; -+ regulator-over-current-protection; -+ }; -+ -+ vdd_usb: ldo4 { -+ regulator-name = "vdd_usb"; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ interrupts = ; -+ }; -+ -+ vdda: ldo5 { -+ regulator-name = "vdda"; -+ regulator-min-microvolt = <2900000>; -+ regulator-max-microvolt = <2900000>; -+ interrupts = ; -+ regulator-boot-on; -+ }; -+ -+ v1v2_hdmi: ldo6 { -+ regulator-name = "v1v2_hdmi"; -+ regulator-min-microvolt = <1200000>; -+ regulator-max-microvolt = <1200000>; -+ regulator-always-on; -+ interrupts = ; -+ }; -+ -+ vref_ddr: vref_ddr { -+ regulator-name = "vref_ddr"; -+ regulator-always-on; -+ regulator-over-current-protection; -+ }; -+ -+ bst_out: boost { -+ regulator-name = "bst_out"; -+ interrupts = ; -+ }; -+ -+ vbus_otg: pwr_sw1 { -+ regulator-name = "vbus_otg"; -+ interrupts = ; -+ }; -+ -+ vbus_sw: pwr_sw2 { -+ regulator-name = "vbus_sw"; -+ interrupts = ; -+ regulator-active-discharge; -+ }; -+ }; -+ -+ onkey { -+ compatible = "st,stpmic1-onkey"; -+ interrupts = , ; -+ interrupt-names = "onkey-falling", "onkey-rising"; -+ power-off-time-sec = <10>; -+ }; -+ -+ watchdog { -+ compatible = "st,stpmic1-wdt"; -+ status = "disabled"; -+ }; -+ }; -+}; -+ -+&ipcc { -+ status = "okay"; -+}; -+ -+&iwdg2 { -+ timeout-sec = <32>; -+ status = "okay"; -+}; -+ -+&m4_rproc { -+ memory-region = <&retram>, <&mcuram>, <&mcuram2>, <&vdev0vring0>, -+ <&vdev0vring1>, <&vdev0buffer>; -+ mboxes = <&ipcc 0>, <&ipcc 1>, <&ipcc 2>; -+ mbox-names = "vq0", "vq1", "shutdown"; -+ interrupt-parent = <&exti>; -+ interrupts = <68 1>; -+ status = "okay"; -+}; -+ -+&rng1 { -+ status = "okay"; -+}; -+ -+&rtc { -+ status = "okay"; -+}; -+ -+&sdmmc2 { -+ pinctrl-names = "default", "opendrain", "sleep"; -+ pinctrl-0 = <&sdmmc2_b4_pins_a &sdmmc2_d47_pins_d>; -+ pinctrl-1 = <&sdmmc2_b4_od_pins_a &sdmmc2_d47_pins_d>; -+ pinctrl-2 = <&sdmmc2_b4_sleep_pins_a &sdmmc2_d47_sleep_pins_d>; -+ non-removable; -+ no-sd; -+ no-sdio; -+ st,neg-edge; -+ bus-width = <8>; -+ vmmc-supply = <&v3v3>; -+ vqmmc-supply = <&v3v3>; -+ mmc-ddr-3_3v; -+ status = "okay"; -+}; -+ -diff --git a/arch/arm/boot/dts/stm32mp157c-odyssey.dts b/arch/arm/boot/dts/stm32mp157c-odyssey.dts -new file mode 100644 -index 000000000000..a7ffec8f1516 ---- /dev/null -+++ b/arch/arm/boot/dts/stm32mp157c-odyssey.dts -@@ -0,0 +1,80 @@ -+// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) -+/* -+ * Copyright (C) 2020 Marcin Sloniewski . -+ */ -+ -+/dts-v1/; -+ -+#include "stm32mp157c-odyssey-som.dtsi" -+ -+/ { -+ model = "Seeed Studio Odyssey-STM32MP157C Board"; -+ compatible = "seeed,stm32mp157c-odyssey", -+ "seeed,stm32mp157c-odyssey-som", "st,stm32mp157"; -+ -+ aliases { -+ ethernet0 = ðernet0; -+ serial0 = &uart4; -+ }; -+ -+ chosen { -+ stdout-path = "serial0:115200n8"; -+ }; -+}; -+ -+ðernet0 { -+ status = "okay"; -+ pinctrl-0 = <ðernet0_rgmii_pins_a>; -+ pinctrl-1 = <ðernet0_rgmii_sleep_pins_a>; -+ pinctrl-names = "default", "sleep"; -+ phy-mode = "rgmii-id"; -+ max-speed = <1000>; -+ phy-handle = <&phy0>; -+ assigned-clocks = <&rcc ETHCK_K>, <&rcc PLL4_P>; -+ assigned-clock-parents = <&rcc PLL4_P>; -+ assigned-clock-rates = <125000000>; /* Clock PLL4 to 750Mhz in ATF/U-Boot */ -+ st,eth-clk-sel; -+ -+ mdio0 { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ compatible = "snps,dwmac-mdio"; -+ phy0: ethernet-phy@7 { /* KSZ9031RN */ -+ reg = <7>; -+ reset-gpios = <&gpiog 0 GPIO_ACTIVE_LOW>; /* ETH_RST# */ -+ reset-assert-us = <10000>; -+ reset-deassert-us = <300>; -+ }; -+ }; -+}; -+ -+&i2c1 { -+ pinctrl-names = "default", "sleep"; -+ pinctrl-0 = <&i2c1_pins_a>; -+ pinctrl-1 = <&i2c1_sleep_pins_a>; -+ i2c-scl-rising-time-ns = <100>; -+ i2c-scl-falling-time-ns = <7>; -+ status = "okay"; -+ /delete-property/dmas; -+ /delete-property/dma-names; -+}; -+ -+&sdmmc1 { -+ pinctrl-names = "default", "opendrain", "sleep"; -+ pinctrl-0 = <&sdmmc1_b4_pins_a>; -+ pinctrl-1 = <&sdmmc1_b4_od_pins_a>; -+ pinctrl-2 = <&sdmmc1_b4_sleep_pins_a>; -+ cd-gpios = <&gpiob 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; -+ disable-wp; -+ st,neg-edge; -+ bus-width = <4>; -+ vmmc-supply = <&v3v3>; -+ status = "okay"; -+}; -+ -+&uart4 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart4_pins_a>; -+ status = "okay"; -+}; -+ --- -2.20.1 - diff --git a/board/myna-player-odyssey/rootfs_patches/linux/100-i2c1-fix.patch b/board/myna-player-odyssey/rootfs_patches/linux/100-i2c1-fix.patch deleted file mode 100644 index 46fa5b0..0000000 --- a/board/myna-player-odyssey/rootfs_patches/linux/100-i2c1-fix.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 699deaabfacf831d0e984e8c1f9391b2f7a0c807 Mon Sep 17 00:00:00 2001 -From: Jookia -Date: Wed, 12 Aug 2020 00:17:03 +1000 -Subject: [PATCH 4/7] stm32mp157c-odyssey: Fix i2c1 pinctrl - ---- - arch/arm/boot/dts/stm32mp157c-odyssey.dts | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/arch/arm/boot/dts/stm32mp157c-odyssey.dts b/arch/arm/boot/dts/stm32mp157c-odyssey.dts -index a7ffec8f1516..027aaa441e4f 100644 ---- a/arch/arm/boot/dts/stm32mp157c-odyssey.dts -+++ b/arch/arm/boot/dts/stm32mp157c-odyssey.dts -@@ -50,8 +50,8 @@ - - &i2c1 { - pinctrl-names = "default", "sleep"; -- pinctrl-0 = <&i2c1_pins_a>; -- pinctrl-1 = <&i2c1_sleep_pins_a>; -+ pinctrl-0 = <&i2c1_pins_b>; -+ pinctrl-1 = <&i2c1_sleep_pins_b>; - i2c-scl-rising-time-ns = <100>; - i2c-scl-falling-time-ns = <7>; - status = "okay"; --- -2.20.1 - diff --git a/board/myna-player-odyssey/rootfs_patches/linux/101-dt-i2c4.patch b/board/myna-player-odyssey/rootfs_patches/linux/101-dt-i2c4.patch deleted file mode 100644 index cfe310d..0000000 --- a/board/myna-player-odyssey/rootfs_patches/linux/101-dt-i2c4.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 6b74f44ebbf8af3bfe3ebd0db1296d641e51857a Mon Sep 17 00:00:00 2001 -From: Jookia -Date: Wed, 12 Aug 2020 00:19:06 +1000 -Subject: [PATCH 5/7] stm32mp157c-odyssey: Add i2c4 support - ---- - arch/arm/boot/dts/stm32mp15-pinctrl.dtsi | 17 +++++++++++++++++ - arch/arm/boot/dts/stm32mp157c-odyssey.dts | 10 ++++++++++ - 2 files changed, 27 insertions(+) - -diff --git a/arch/arm/boot/dts/stm32mp15-pinctrl.dtsi b/arch/arm/boot/dts/stm32mp15-pinctrl.dtsi -index 2f75b631feac..9828de2900a7 100644 ---- a/arch/arm/boot/dts/stm32mp15-pinctrl.dtsi -+++ b/arch/arm/boot/dts/stm32mp15-pinctrl.dtsi -@@ -432,6 +432,23 @@ - }; - }; - -+ i2c4_pins_s: i2c4-0 { -+ pins { -+ pinmux = , /* I2C4_SCL */ -+ ; /* I2C4_SDA */ -+ bias-disable; -+ drive-open-drain; -+ slew-rate = <0>; -+ }; -+ }; -+ -+ i2c4_pins_sleep_s: i2c4-1 { -+ pins { -+ pinmux = , /* I2C4_SCL */ -+ ; /* I2C4_SDA */ -+ }; -+ }; -+ - i2c5_pins_a: i2c5-0 { - pins { - pinmux = , /* I2C5_SCL */ -diff --git a/arch/arm/boot/dts/stm32mp157c-odyssey.dts b/arch/arm/boot/dts/stm32mp157c-odyssey.dts -index 027aaa441e4f..f9861e8fdb3a 100644 ---- a/arch/arm/boot/dts/stm32mp157c-odyssey.dts -+++ b/arch/arm/boot/dts/stm32mp157c-odyssey.dts -@@ -78,3 +78,13 @@ - status = "okay"; - }; - -+&i2c4 { -+ pinctrl-names = "default", "sleep"; -+ pinctrl-0 = <&i2c4_pins_s>; -+ pinctrl-1 = <&i2c4_pins_sleep_s>; -+ i2c-scl-rising-time-ns = <185>; -+ i2c-scl-falling-time-ns = <20>; -+ status = "okay"; -+ /delete-property/dmas; -+ /delete-property/dma-names; -+}; --- -2.20.1 - diff --git a/board/myna-player-odyssey/rootfs_patches/linux/102-dt-i2c-order.patch b/board/myna-player-odyssey/rootfs_patches/linux/102-dt-i2c-order.patch deleted file mode 100644 index 9da0a70..0000000 --- a/board/myna-player-odyssey/rootfs_patches/linux/102-dt-i2c-order.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 7c0334a831aa3812b0e4004836a7d636d89fd9ba Mon Sep 17 00:00:00 2001 -From: Jookia -Date: Fri, 14 Aug 2020 13:15:17 +1000 -Subject: [PATCH 7/7] stm32mp157c-odyssey: Re-order i2c devices for Raspberry - Pi compatibility - ---- - arch/arm/boot/dts/stm32mp157c-odyssey.dts | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/arch/arm/boot/dts/stm32mp157c-odyssey.dts b/arch/arm/boot/dts/stm32mp157c-odyssey.dts -index 787c001fadef..c498d51c72ba 100644 ---- a/arch/arm/boot/dts/stm32mp157c-odyssey.dts -+++ b/arch/arm/boot/dts/stm32mp157c-odyssey.dts -@@ -15,6 +15,9 @@ - aliases { - ethernet0 = ðernet0; - serial0 = &uart4; -+ i2c0 = &i2c2; -+ i2c1 = &i2c4; /* RPi compatible */ -+ i2c2 = &i2c1; - }; - - chosen { --- -2.20.1 - diff --git a/board/myna-player-odyssey/rootfs_patches/linux/200-dt-wifi.patch b/board/myna-player-odyssey/rootfs_patches/linux/200-dt-wifi.patch deleted file mode 100644 index 130fb49..0000000 --- a/board/myna-player-odyssey/rootfs_patches/linux/200-dt-wifi.patch +++ /dev/null @@ -1,121 +0,0 @@ -From 369ab26131981738b9ecee777882e1bf6d442138 Mon Sep 17 00:00:00 2001 -From: Jookia -Date: Wed, 12 Aug 2020 00:28:50 +1000 -Subject: [PATCH 6/7] stm32mp157c-odyssey: Add Wi-Fi - ---- - arch/arm/boot/dts/stm32mp15-pinctrl.dtsi | 54 +++++++++++++++++++++++ - arch/arm/boot/dts/stm32mp157c-odyssey.dts | 25 +++++++++++ - 2 files changed, 79 insertions(+) - -diff --git a/arch/arm/boot/dts/stm32mp15-pinctrl.dtsi b/arch/arm/boot/dts/stm32mp15-pinctrl.dtsi -index 9828de2900a7..617d1f0cc8ec 100644 ---- a/arch/arm/boot/dts/stm32mp15-pinctrl.dtsi -+++ b/arch/arm/boot/dts/stm32mp15-pinctrl.dtsi -@@ -1581,6 +1581,60 @@ - }; - }; - -+ sdmmc3_b4_pins_s: sdmmc3-b4-1 { -+ pins1 { -+ pinmux = , /* SDMMC3_D0 */ -+ , /* SDMMC3_D1 */ -+ , /* SDMMC3_D2 */ -+ , /* SDMMC3_D3 */ -+ ; /* SDMMC3_CMD */ -+ slew-rate = <1>; -+ drive-push-pull; -+ bias-pull-up; -+ }; -+ pins2 { -+ pinmux = ; /* SDMMC3_CLK */ -+ slew-rate = <2>; -+ drive-push-pull; -+ bias-pull-up; -+ }; -+ }; -+ -+ sdmmc3_b4_od_pins_s: sdmmc3-b4-od-1 { -+ pins1 { -+ pinmux = , /* SDMMC3_D0 */ -+ , /* SDMMC3_D1 */ -+ , /* SDMMC3_D2 */ -+ ; /* SDMMC3_D3 */ -+ slew-rate = <1>; -+ drive-push-pull; -+ bias-pull-up; -+ }; -+ pins2 { -+ pinmux = ; /* SDMMC3_CLK */ -+ slew-rate = <2>; -+ drive-push-pull; -+ bias-pull-up; -+ }; -+ pins3 { -+ pinmux = ; /* SDMMC2_CMD */ -+ slew-rate = <1>; -+ drive-open-drain; -+ bias-pull-up; -+ }; -+ }; -+ -+ sdmmc3_b4_sleep_pins_s: sdmmc3-b4-sleep-1 { -+ pins { -+ pinmux = , /* SDMMC3_D0 */ -+ , /* SDMMC3_D1 */ -+ , /* SDMMC3_D2 */ -+ , /* SDMMC3_D3 */ -+ , /* SDMMC3_CK */ -+ ; /* SDMMC3_CMD */ -+ }; -+ }; -+ - spdifrx_pins_a: spdifrx-0 { - pins { - pinmux = ; /* SPDIF_IN1 */ -diff --git a/arch/arm/boot/dts/stm32mp157c-odyssey.dts b/arch/arm/boot/dts/stm32mp157c-odyssey.dts -index f9861e8fdb3a..787c001fadef 100644 ---- a/arch/arm/boot/dts/stm32mp157c-odyssey.dts -+++ b/arch/arm/boot/dts/stm32mp157c-odyssey.dts -@@ -20,6 +20,12 @@ - chosen { - stdout-path = "serial0:115200n8"; - }; -+ -+ wifi_pwrseq: wifi-pwrseq { -+ compatible = "mmc-pwrseq-simple"; -+ reset-gpios = <&gpiod 9 GPIO_ACTIVE_LOW>; -+ post-power-on-delay-ms = <1>; -+ }; - }; - - ðernet0 { -@@ -72,6 +78,25 @@ - status = "okay"; - }; - -+&sdmmc3 { -+ pinctrl-names = "default", "opendrain", "sleep"; -+ pinctrl-0 = <&sdmmc3_b4_pins_s>; -+ pinctrl-1 = <&sdmmc3_b4_od_pins_s>; -+ pinctrl-2 = <&sdmmc3_b4_sleep_pins_s>; -+ bus-width = <4>; -+ vmmc-supply = <&v3v3>; -+ mmc-pwrseq = <&wifi_pwrseq>; -+ status = "okay"; -+ keep-power-in-suspend; -+ -+ #address-cells = <1>; -+ #size-cells = <0>; -+ brcmf: bcrmf@1 { -+ reg = <1>; -+ compatible = "brcm,bcm4329-fmac"; -+ }; -+}; -+ - &uart4 { - pinctrl-names = "default"; - pinctrl-0 = <&uart4_pins_a>; --- -2.20.1 - diff --git a/board/myna-player-odyssey/rootfs_patches/rauc/0001-update_handler-added-erofs-support-to-the-raw-handler.patch b/board/myna-player-odyssey/rootfs_patches/rauc/0001-update_handler-added-erofs-support-to-the-raw-handler.patch new file mode 100644 index 0000000..b1e730b --- /dev/null +++ b/board/myna-player-odyssey/rootfs_patches/rauc/0001-update_handler-added-erofs-support-to-the-raw-handler.patch @@ -0,0 +1,24 @@ +From b1f5fe3a8f1fb9bc640d1d77f5e3efe034e2e5ba Mon Sep 17 00:00:00 2001 +From: Xogium +Date: Wed, 3 Mar 2021 05:07:34 -0500 +Subject: [PATCH] update_handler: added erofs support to the raw handler. + +--- + src/update_handler.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/update_handler.c b/src/update_handler.c +index ebadd97..65dcebf 100644 +--- a/src/update_handler.c ++++ b/src/update_handler.c +@@ -1798,6 +1798,7 @@ RaucUpdatePair updatepairs[] = { + {"*.caidx", "ext4", archive_to_ext4_handler}, + {"*.caidx", "ubifs", archive_to_ubifs_handler}, + {"*.caidx", "vfat", archive_to_vfat_handler}, ++ {"*.erofs", "raw", img_to_raw_handler}, + {"*.ext4", "ext4", img_to_fs_handler}, + {"*.ext4", "raw", img_to_raw_handler}, + {"*.vfat", "raw", img_to_raw_handler}, +-- +2.30.1 + diff --git a/board/myna-player-odyssey/scripts/rootfs_postbuild.sh b/board/myna-player-odyssey/scripts/rootfs_postbuild.sh index 1df1054..d20e2b0 100755 --- a/board/myna-player-odyssey/scripts/rootfs_postbuild.sh +++ b/board/myna-player-odyssey/scripts/rootfs_postbuild.sh @@ -15,6 +15,11 @@ cp "${BR2_EXTERNAL_MynaPlayer_PATH}"/changelog.md \ "${TARGET_DIR}"/etc/changelog.md +# copy version stamp + +cp "${BR2_EXTERNAL_MynaPlayer_PATH}"/utilities/version_stamp \ + "${TARGET_DIR}"/etc/version_stamp + # grab keyring needed for rauc cp "${BR2_EXTERNAL_MynaPlayer_PATH}"/certs/keyring.pem \ diff --git a/board/myna-player-odyssey/scripts/rootfs_postimage.sh b/board/myna-player-odyssey/scripts/rootfs_postimage.sh index 67a85e0..2894d40 100755 --- a/board/myna-player-odyssey/scripts/rootfs_postimage.sh +++ b/board/myna-player-odyssey/scripts/rootfs_postimage.sh @@ -2,10 +2,29 @@ set -e -# create filesystem for rauc slot status +# copy boot specs, kernel and device tree to a well known location -fallocate -l 2m "${BINARIES_DIR}/rauc.ext4" -mkfs.ext4 -F "${BINARIES_DIR}/rauc.ext4" +mkdir -p "${BINARIES_DIR}"/kernel +cp -ar \ + "${BR2_EXTERNAL_MynaPlayer_PATH}"/board/myna-player-odyssey/utilities/bootspecs/loader \ + "${BINARIES_DIR}"/stm32mp157c-odyssey.dtb \ + "${BINARIES_DIR}"/zImage \ + "${BINARIES_DIR}"/kernel + +# compress them into a tarball for rauc + +tar -cJf \ + "${BINARIES_DIR}"/kernel.tar.xz \ + -C "${BINARIES_DIR}"/kernel \ + . + +# create a filesystem for the initial image containing them + +fallocate -l 8m \ + "${BINARIES_DIR}"/kernel.ext4 +mkfs.ext4 -Fd \ + "${BINARIES_DIR}"/kernel \ + "${BINARIES_DIR}"/kernel.ext4 # prepare for genimage cd "${BINARIES_DIR}" @@ -13,7 +32,7 @@ GENIMAGE_CFG="${BR2_EXTERNAL_MynaPlayer_PATH}/board/myna-player-odyssey/utilities/genimage.cfg" export GENIMAGE_USER=$(whoami) export GENIMAGE_HOST=$(hostname) -export GENIMAGE_BUILD_ID=$(git describe --dirty --broken) +export GENIMAGE_BUILD_ID=$(cat "${BR2_EXTERNAL_MynaPlayer_PATH}"/utilities/version_stamp) envsubst \ \$GENIMAGE_USER,\ diff --git a/board/myna-player-odyssey/utilities/barebox-env/boot/system0 b/board/myna-player-odyssey/utilities/barebox-env/boot/system0 new file mode 100644 index 0000000..53e647a --- /dev/null +++ b/board/myna-player-odyssey/utilities/barebox-env/boot/system0 @@ -0,0 +1,4 @@ +#!/bin/sh + +global.bootm.root_dev="/dev/mmc1.4" +boot mmc1.2 diff --git a/board/myna-player-odyssey/utilities/barebox-env/boot/system1 b/board/myna-player-odyssey/utilities/barebox-env/boot/system1 new file mode 100644 index 0000000..5c27ec6 --- /dev/null +++ b/board/myna-player-odyssey/utilities/barebox-env/boot/system1 @@ -0,0 +1,4 @@ +#!/bin/sh + +global.bootm.root_dev="/dev/mmc1.5" +boot mmc1.3 diff --git a/board/myna-player-odyssey/utilities/barebox-env/nv/bootchooser.system0 b/board/myna-player-odyssey/utilities/barebox-env/nv/bootchooser.system0 new file mode 100644 index 0000000..dcc64ac --- /dev/null +++ b/board/myna-player-odyssey/utilities/barebox-env/nv/bootchooser.system0 @@ -0,0 +1 @@ +system0 \ No newline at end of file diff --git a/board/myna-player-odyssey/utilities/barebox-env/nv/bootchooser.system0.boot b/board/myna-player-odyssey/utilities/barebox-env/nv/bootchooser.system0.boot deleted file mode 100644 index b7e26ca..0000000 --- a/board/myna-player-odyssey/utilities/barebox-env/nv/bootchooser.system0.boot +++ /dev/null @@ -1 +0,0 @@ -mmc1.2 \ No newline at end of file diff --git a/board/myna-player-odyssey/utilities/barebox-env/nv/bootchooser.system1 b/board/myna-player-odyssey/utilities/barebox-env/nv/bootchooser.system1 new file mode 100644 index 0000000..2858d07 --- /dev/null +++ b/board/myna-player-odyssey/utilities/barebox-env/nv/bootchooser.system1 @@ -0,0 +1 @@ +system1 \ No newline at end of file diff --git a/board/myna-player-odyssey/utilities/barebox-env/nv/bootchooser.system1.boot b/board/myna-player-odyssey/utilities/barebox-env/nv/bootchooser.system1.boot deleted file mode 100644 index 76ab638..0000000 --- a/board/myna-player-odyssey/utilities/barebox-env/nv/bootchooser.system1.boot +++ /dev/null @@ -1 +0,0 @@ -mmc1.3 \ No newline at end of file diff --git a/board/myna-player-odyssey/utilities/bootspecs/loader/entries/myna-player.conf b/board/myna-player-odyssey/utilities/bootspecs/loader/entries/myna-player.conf new file mode 100644 index 0000000..deb4f1d --- /dev/null +++ b/board/myna-player-odyssey/utilities/bootspecs/loader/entries/myna-player.conf @@ -0,0 +1,6 @@ +title MynaPlayer +version 5.8rc7 +linux zImage +devicetree stm32mp157c-odyssey.dtb +options rootfstype=erofs rootwait quiet systemd.log_color=off init=/sbin/pre-init +linux-appendroot true diff --git a/board/myna-player-odyssey/utilities/genimage.tmp b/board/myna-player-odyssey/utilities/genimage.tmp index 4c883dc..dfc8593 100644 --- a/board/myna-player-odyssey/utilities/genimage.tmp +++ b/board/myna-player-odyssey/utilities/genimage.tmp @@ -1,3 +1,12 @@ +image overlayfs.ext4 { + ext4 { + use-mke2fs = "true" + label = "overlayfs" + } + empty = "true" + size = 2G +} + image MynaPlayer.img { name = "MynaPlayer-${GENIMAGE_BUILD_ID}" hdimage { @@ -17,23 +26,32 @@ } partition ssbl { - partition-type = 0x83 - image = "barebox.bin" + image = "barebox-stm32mp157c-seeed-odyssey.img" + size = 1M + } + + partition PrimaryBoot { + image = "kernel.ext4" + size = 8M + } + + partition SecondaryBoot { + image = "kernel.ext4" + size = 8M } partition PrimaryRootfs { - partition-type = 0x83 - image = "rootfs.ext4" + image = "rootfs.erofs" + size = 128M } partition SecondaryRootfs { - partition-type = 0x83 - image = "rootfs.ext4" + image = "rootfs.erofs" + size = 128M } - partition Rauc { - partition-type = 0x83 - image = "rauc.ext4" + partition overlayfs { + image = "overlayfs.ext4" } } @@ -41,7 +59,8 @@ name = "bundle-MynaPlayer-${GENIMAGE_BUILD_ID}" rauc { files = { - "rootfs.tar.xz" + "kernel.tar.xz", + "rootfs.erofs" } key = "${BR2_EXTERNAL_MynaPlayer_PATH}/certs/signing.key" cert = "${BR2_EXTERNAL_MynaPlayer_PATH}/certs/signing.crt" @@ -51,7 +70,9 @@ compatible=LuminaSensum MynaPlayer version=${GENIMAGE_BUILD_ID} description=RAUC bundle for LuminaSensum MynaPlayer version ${GENIMAGE_BUILD_ID}, built by ${GENIMAGE_USER}@${GENIMAGE_HOST}. + [image.kernel] + filename=kernel.tar.xz [image.rootfs] - filename=rootfs.tar.xz" + filename=rootfs.erofs" } } diff --git a/configs/myna_player_odyssey_defconfig b/configs/myna_player_odyssey_defconfig index adb732d..ac48599 100644 --- a/configs/myna_player_odyssey_defconfig +++ b/configs/myna_player_odyssey_defconfig @@ -11,8 +11,8 @@ BR2_TOOLCHAIN_EXTERNAL=y BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y -BR2_TOOLCHAIN_EXTERNAL_URL="https://toolchains.bootlin.com/downloads/releases/toolchains/armv7-eabihf/tarballs/armv7-eabihf--glibc--bleeding-edge-2020.02-2.tar.bz2" -BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_19=y +BR2_TOOLCHAIN_EXTERNAL_URL="https://toolchains.bootlin.com/downloads/releases/toolchains/armv7-eabihf/tarballs/armv7-eabihf--glibc--bleeding-edge-2020.08-1.tar.bz2" +BR2_TOOLCHAIN_EXTERNAL_HEADERS_5_4=y BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y BR2_TOOLCHAIN_EXTERNAL_CXX=y BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY=y @@ -31,21 +31,19 @@ BR2_ROOTFS_POST_SCRIPT_ARGS="-c $(BR2_EXTERNAL_MynaPlayer_PATH)/board/myna-player-odyssey/utilities/genimage.cfg" BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_VERSION=y -BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.8.10" +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.11" BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_MynaPlayer_PATH)/board/myna-player-odyssey/configs/linux.config" BR2_LINUX_KERNEL_LZ4=y BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="stm32mp157c-odyssey" BR2_LINUX_KERNEL_DTB_OVERLAY_SUPPORT=y -BR2_LINUX_KERNEL_INSTALL_TARGET=y BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF=y # BR2_PACKAGE_BUSYBOX is not set BR2_PACKAGE_XZ=y BR2_PACKAGE_ZIP=y BR2_PACKAGE_STRACE=y -BR2_PACKAGE_TRACE_CMD=y BR2_PACKAGE_FINDUTILS=y BR2_PACKAGE_GREP=y BR2_PACKAGE_SED=y @@ -54,7 +52,7 @@ BR2_PACKAGE_DOSFSTOOLS_FSCK_FAT=y BR2_PACKAGE_DOSFSTOOLS_MKFS_FAT=y BR2_PACKAGE_E2FSPROGS=y -BR2_PACKAGE_EXFATPROGS=y +BR2_PACKAGE_MMC_UTILS=y BR2_PACKAGE_LINUX_FIRMWARE=y BR2_PACKAGE_LINUX_FIRMWARE_BRCM_BCM43XX=y BR2_PACKAGE_LINUX_FIRMWARE_BRCM_BCM43XXX=y @@ -97,6 +95,7 @@ BR2_PACKAGE_PSMISC=y BR2_PACKAGE_RAUC=y BR2_PACKAGE_RAUC_NETWORK=y +BR2_PACKAGE_SYSTEMD_ANALYZE=y # BR2_PACKAGE_SYSTEMD_PSTORE is not set # BR2_PACKAGE_SYSTEMD_HWDB is not set BR2_PACKAGE_SYSTEMD_LOGIND=y @@ -105,6 +104,7 @@ # BR2_PACKAGE_SYSTEMD_VCONSOLE is not set BR2_PACKAGE_SYSTEMD_BOOTCHART=y BR2_PACKAGE_TAR=y +BR2_PACKAGE_UTIL_LINUX_BINARIES=y BR2_PACKAGE_UTIL_LINUX_HWCLOCK=y BR2_PACKAGE_UTIL_LINUX_KILL=y BR2_PACKAGE_UTIL_LINUX_LAST=y @@ -122,10 +122,9 @@ BR2_PACKAGE_NANO=y BR2_PACKAGE_VIM=y # BR2_PACKAGE_VIM_RUNTIME is not set -BR2_TARGET_ROOTFS_EXT2=y -BR2_TARGET_ROOTFS_EXT2_4=y -BR2_TARGET_ROOTFS_EXT2_SIZE="512M" -BR2_TARGET_ROOTFS_TAR_XZ=y +BR2_TARGET_ROOTFS_EROFS=y +BR2_TARGET_ROOTFS_EROFS_LZ4HC=y +# BR2_TARGET_ROOTFS_TAR is not set BR2_TARGET_ARM_TRUSTED_FIRMWARE=y BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION=y BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION_VALUE="v2.2" @@ -134,11 +133,11 @@ BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES="*.stm32" BR2_TARGET_ARM_TRUSTED_FIRMWARE_NEEDS_DTC=y BR2_TARGET_BAREBOX=y -BR2_TARGET_BAREBOX_CUSTOM_GIT=y -BR2_TARGET_BAREBOX_CUSTOM_GIT_REPO_URL="https://git.pengutronix.de/cgit/barebox" -BR2_TARGET_BAREBOX_CUSTOM_GIT_VERSION="d4d3e9c87" +BR2_TARGET_BAREBOX_CUSTOM_VERSION=y +BR2_TARGET_BAREBOX_CUSTOM_VERSION_VALUE="2020.12.0" BR2_TARGET_BAREBOX_USE_CUSTOM_CONFIG=y -BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_MynaPlayer_PATH)/board/myna-player-odyssey/configs/barebox.config" +BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_MynaPlayer_PATH)/utilities/barebox.config" +BR2_TARGET_BAREBOX_IMAGE_FILE="images/barebox-stm32mp157c-seeed-odyssey.img" BR2_TARGET_BAREBOX_CUSTOM_EMBEDDED_ENV_PATH="$(BR2_EXTERNAL_MynaPlayer_PATH)/board/myna-player-odyssey/utilities/barebox-env" BR2_PACKAGE_HOST_GENIMAGE=y BR2_PACKAGE_HOST_RAUC=y diff --git a/external.mk b/external.mk index 3f7c98a..2587e29 100644 --- a/external.mk +++ b/external.mk @@ -10,4 +10,7 @@ rauc-fixups: $(BR2_EXTERNAL_MynaPlayer_PATH)/scripts/rauc_fixups.sh -world: rauc-fixups +version-stamp: + $(BR2_EXTERNAL_MynaPlayer_PATH)/scripts/version_stamp.sh + +world: rauc-fixups version-stamp diff --git a/fs/Config.in b/fs/Config.in new file mode 100644 index 0000000..2052af5 --- /dev/null +++ b/fs/Config.in @@ -0,0 +1,5 @@ +menu "Filesystem utilities" + +source "$BR2_EXTERNAL_MynaPlayer_PATH/fs/dracut/Config.in" + +endmenu diff --git a/fs/dracut/Config.in b/fs/dracut/Config.in new file mode 100644 index 0000000..d5e2e89 --- /dev/null +++ b/fs/dracut/Config.in @@ -0,0 +1,150 @@ +config BR2_TARGET_ROOTFS_DRACUT + bool "dracut initramfs" + depends on BR2_USE_MMU # dracut -> fork() + depends on !BR2_STATIC_LIBS # dracut -> kmod + depends on BR2_PACKAGE_SYSTEMD + select BR2_PACKAGE_DRACUT + help + Build a initramfs using dracut + + https://github.com/dracutdevs/dracut + +if BR2_TARGET_ROOTFS_DRACUT + +config BR2_TARGET_ROOTFS_DRACUT_HOST_ONLY + bool "Host only build" + help + Host-Only mode: Install only what is needed for booting the + local host instead of a generic host and generate + host-specific configuration. This can greatly reduce the size + of the image, but won't work on as many systems out of the + box. + + Select this option if you are building for a specific hardware + platform and not a generic PC. + +if BR2_TARGET_ROOTFS_DRACUT_HOST_ONLY + +choice + prompt "host-only mode" + default BR2_TARGET_ROOTFS_DRACUT_HOST_ONLY_SLOPPY + help + Select the host-only mode + +config BR2_TARGET_ROOTFS_DRACUT_HOST_ONLY_SLOPPY + bool "sloppy" + help + Extra drivers and modules will be installed, so minor hardware + change won't make the image unbootable (eg. changed keyboard), + and the image is still portable among similar hosts. + +config BR2_TARGET_ROOTFS_DRACUT_HOST_ONLY_STRICT + bool "strict" + help + Anything not necessary for booting the local host in its + current state will not be included, and modules may do + some extra job to save more space. Minor change of + hardware or environment could make the image unbootable. + +endchoice + +config BR2_TARGET_ROOTFS_DRACUT_KERNEL_MODULES + string "Additional kernel modules to include" + help + An optional space seperated list of additional kernel modules + of which to include in the initramfs image. + +endif # BR2_TARGET_ROOTFS_DRACUT_HOST_ONLY + +config BR2_PACKAGE_ROOTFS_CONF_PATH + string "conf file path" + help + An optional path to a dracut conf file + +config BR2_TARGET_ROOTFS_DRACUT_MODULES + string "Additional dracut modules" + help + Space seperated list of additional dracut modules of which to + install. A full list of modules can be found in the modules.d + directory of the dracut source code. + +config BR2_TARGET_ROOTFS_DRACUT_CUSTOM_KERNEL_CMDLINE + string "custom kernel command line arguments" + help + Specify custom kernel command line argumets. Leave blank to + use the kernel defaults. + +config BR2_TARGET_ROOTFS_DRACUT_MOD_SIG + bool "Module signing support" + select BR2_PACKAGE_KEYUTILS + help + Select this if your kernel modules are signed. + +choice + prompt "Compression method" + default BR2_TARGET_ROOTFS_DRACUT_NO_COMPRESSION + depends on BR2_TARGET_ROOTFS_DRACUT + help + Select compressor for tar archive of the root filesystem + +config BR2_TARGET_ROOTFS_DRACUT_NO_COMPRESSION + bool "no compression" + help + Do not compress the dracut image. + +config BR2_TARGET_ROOTFS_DRACUT_GZIP_COMPRESSION + bool "gzip" + help + Do compress the dracut image with gzip. + +config BR2_TARGET_ROOTFS_DRACUT_BZIP2_COMPRESSION + bool "bzip2" + help + Do compress the dracut image with bzip2. + +config BR2_TARGET_ROOTFS_DRACUT_LZ4_COMPRESSION + bool "lz4" + help + Do compress the dracut image with lz4. + +config BR2_TARGET_ROOTFS_DRACUT_LZMA_COMPRESSION + bool "lzma" + help + Do compress the dracut image with lzma. + +config BR2_TARGET_ROOTFS_DRACUT_LZO_COMPRESSION + bool "lzo" + help + Do compress the dracut image with lzop. + +config BR2_TARGET_ROOTFS_DRACUT_XZ_COMPRESSION + bool "xz" + help + Do compress the dracut image with xz. + +config BR2_TARGET_ROOTFS_DRACUT_ZSTD_COMPRESSION + bool "zstd" + help + Do compress the dracut image with zstd. + +endchoice + +config BR2_TARGET_ROOTFS_DRACUT_COMPRESSION_METHOD + string + default "no-compress" if BR2_TARGET_ROOTFS_DRACUT_NO_COMPRESSION + default "gzip" if BR2_TARGET_ROOTFS_DRACUT_GZIP_COMPRESSION + default "bzip2" if BR2_TARGET_ROOTFS_DRACUT_BZIP2_COMPRESSION + default "lz4" if BR2_TARGET_ROOTFS_DRACUT_LZ4_COMPRESSION + default "lzma" if BR2_TARGET_ROOTFS_DRACUT_LZMA_COMPRESSION + default "lzo" if BR2_TARGET_ROOTFS_DRACUT_LZO_COMPRESSION + default "xz" if BR2_TARGET_ROOTFS_DRACUT_XZ_COMPRESSION + default "zstd" if BR2_TARGET_ROOTFS_DRACUT_ZSTD_COMPRESSION + +endif + +comment "dracut needs systemd" + depends on !BR2_PACKAGE_SYSTEMD + +comment "dracut needs a toolchain w/ dynamic library" + depends on BR2_USE_MMU + depends on BR2_STATIC_LIBS diff --git a/fs/dracut/dracut.mk b/fs/dracut/dracut.mk new file mode 100644 index 0000000..7433f5d --- /dev/null +++ b/fs/dracut/dracut.mk @@ -0,0 +1,234 @@ +################################################################################ +# +# Build the dracut initramfs image +# +################################################################################ + +# Dracut requires realpath from coreutils +ROOTFS_DRACUT_DEPENDENCIES += \ + host-dracut \ + dracut + +ROOTFS_DRACUT_MODULES_INCLUDE = \ + base \ + dbus \ + rootfs-block \ + systemd \ + systemd-initrd \ + dracut-systemd \ + udev-rules +ROOTFS_DRACUT_MODULES_OMIT = dbus-broker + +# Environment variables used to execute dracut +# We have to unset "prefix" as dracut uses it to move files around. +# Dracut doesn't support decimal points for the systemd version. +ROOTFS_DRACUT_SYSTEMD_VERSION_SANATIZED=`echo $(SYSTEMD_VERSION) |cut -d . -f 1` +ROOTFS_DRACUT_TARGET_DIR="$(ROOTFS_DRACUT_DIR)/target +ROOTFS_DRACUT_FS_ENV = \ + prefix="" \ + DESTROOTDIR="$(ROOTFS_DRACUT_TARGET_DIR)" \ + DRACUT_ARCH=$(BR2_ARCH) \ + DRACUT_COMPRESS_BZIP2="$(HOST_DIR)/bin/bzip2" \ + DRACUT_COMPRESS_GZIP="$(HOST_DIR)/bin/gzip" \ + DRACUT_COMPRESS_LZMA="$(HOST_DIR)/bin/lzma" \ + DRACUT_COMPRESS_XZ="$(HOST_DIR)/bin/xz" \ + DRACUT_FIRMWARE_PATH="$(ROOTFS_DRACUT_TARGET_DIR)/usr/lib/firmware" \ + DRACUT_INSTALL="$(HOST_DIR)/bin/dracut-install" \ + DRACUT_INSTALL_PATH="$(ROOTFS_DRACUT_TARGET_DIR)/usr/bin:$(ROOTFS_DRACUT_TARGET_DIR)/usr/sbin:$(ROOTFS_DRACUT_TARGET_DIR)/usr/lib" \ + DRACUT_LDCONFIG=/bin/true \ + DRACUT_LDD="$(HOST_DIR)/sbin/prelink-rtld --root=$(ROOTFS_DRACUT_TARGET_DIR)/" \ + DRACUT_PATH="/bin /sbin" \ + STRIP_CMD="$(TARGET_CROSS)strip" \ + SYSTEMCTL="$(HOST_DIR)/bin/systemctl" \ + systemctlpath="$(HOST_DIR)/bin/systemctl" \ + systemdsystemconfdir="$(ROOTFS_DRACUT_TARGET_DIR)/etc/systemd/system" \ + systemdsystemunitdir="$(ROOTFS_DRACUT_TARGET_DIR)/lib/systemd/system" \ + systemdutildir="$(ROOTFS_DRACUT_TARGET_DIR)/lib/systemd/" \ + SYSTEMD_VERSION=$(ROOTFS_DRACUT_SYSTEMD_VERSION_SANATIZED) \ + udevdir="$(ROOTFS_DRACUT_TARGET_DIR)/usr/lib/udev" \ + UDEVVERSION=$(ROOTFS_DRACUT_SYSTEMD_VERSION_SANATIZED) + +ROOTFS_DRACUT_MKFS_CONF_OPTS = \ + --force \ + --fstab \ + --noprefix \ + --sysroot=$(ROOTFS_DRACUT_TARGET_DIR) \ + --tmpdir=$(ROOTFS_DRACUT_DIR)/rootfs.dracut.tmp \ + --verbose + +ifeq ($(BR2_ROOTFS_DEVICE_TABLE_SUPPORTS_EXTENDED_ATTRIBUTES),y) +ROOTFS_DRACUT_FS_ENV += DRACUT_NO_XATTR=true +else +ROOTFS_DRACUT_FS_ENV += DRACUT_NO_XATTR=false +endif + +ifeq ($(BR2_PACKAGE_BASH),y) +ROOTFS_DRACUT_MODULES_INCLUDE += bash +else +ROOTFS_DRACUT_MODULES_OMIT += bash +endif + +# Dracut typically executes busybox --list to get a list of installed busybox +# applets. Without a qemu wrapper, executing the busybox binary won't work in a +# cross-compiled environment. To avoid using a qemu-wrapper, we manually pass +# the list to Dracut using the busybox.links file that busybox creates when +# compiling. +ifeq ($(BR2_PACKAGE_BUSYBOX)$(BR2_PACKAGE_BUSYBOX_INDIVIDUAL_BINARIES),y) +ROOTFS_DRACUT_FS_ENV += \ + BUSYBOX_LIST=`sed -r -e s%.*/%% $(BUSYBOX_DIR)/busybox.links;` +ROOTFS_DRACUT_MODULES_INCLUDE += busybox +else +ROOTFS_DRACUT_MODULES_OMIT += busybox +endif + +ifeq ($(BR2_PACKAGE_MKSH),y) +ROOTFS_DRACUT_MODULES_INCLUDE += mksh +else +ROOTFS_DRACUT_MODULES_OMIT += mksh +endif + +ifeq ($(BR2_PACKAGE_BTRFS_PROGS),y) +ROOTFS_DRACUT_MODULES_INCLUDE += btrfs +else +ROOTFS_DRACUT_MODULES_OMIT += btrfs +endif + +ifeq ($(BR2_PACKAGE_DASH),y) +ROOTFS_DRACUT_MODULES_INCLUDE += dash +else +ROOTFS_DRACUT_MODULES_OMIT += dash +endif + +ifeq ($(BR2_PACKAGE_PERL_I18N)$(BR2_PACKAGE_KBD),yy) +ROOTFS_DRACUT_MODULES_INCLUDE += i18n +else +ROOTFS_DRACUT_MODULES_OMIT += i18n +endif + +ifeq ($(BR2_PACKAGE_RNG_TOOLS),y) +ROOTFS_DRACUT_MODULES_INCLUDE += rngd +else +ROOTFS_DRACUT_MODULES_OMIT += rngd +endif + +ifeq ($(BR2_PACKAGE_LIBSELINUX),y) +ROOTFS_DRACUT_MODULES_INCLUDE += securityfs selinux +else +ROOTFS_DRACUT_MODULES_OMIT += securityfs selinux +endif + +ifeq ($(BR2_PACKAGE_SYSTEMD_REPART),y) +ROOTFS_DRACUT_MODULES_INCLUDE += systemd-repart +else +ROOTFS_DRACUT_MODULES_OMIT += systemd-repart +endif + +ifeq ($(BR2_PACKAGE_SYSTEMD_SYSUSERS),y) +ROOTFS_DRACUT_MODULES_INCLUDE += systemd-sysusers +else +ROOTFS_DRACUT_MODULES_OMIT += systemd-sysusers +endif + +ifeq ($(BR2_PACKAGE_SYSTEMD_NETWORKD),y) +ROOTFS_DRACUT_MODULES_INCLUDE += systemd-networkd +else +ROOTFS_DRACUT_MODULES_OMIT += systemd-networkd +endif + +ifeq ($(BR2_PACKAGE_UTIL_LINUX_HWCLOCK),y) +ROOTFS_DRACUT_MODULES_INCLUDE += warpclock +else +ROOTFS_DRACUT_MODULES_OMIT += warpclock +endif + +ifeq ($(BR2_PACKAGE_PLYMOUTH),y) +ROOTFS_DRACUT_DEPENDENCIES += plymouth +ROOTFS_DRACUT_MODULES_INCLUDE += plymouth +ROOTFS_DRACUT_FS_ENV += \ + PLYMOUTH_SYSROOT=$(ROOTFS_DRACUT_TARGET_DIR) \ + PLYMOUTH_CONFDIR=/etc/plymouth \ + PLYMOUTH_DATADIR=/usr/share \ + PLYMOUTH_POLICYDIR=/usr/share/plymouth/ \ + PLYMOUTH_LOGO_FILE=/etc/plymouth/bizcom.png \ + PLYMOUTH_LIBEXECDIR=/usr/libexec \ + PLYMOUTH_LDD="$(HOST_DIR)/sbin/prelink-rtld --root=$(ROOTFS_DRACUT_TARGET_DIR)/" \ + PLYMOUTH_LDD_PATH=/bin/true \ + PLYMOUTH_PLUGIN_PATH=/usr/lib/plymouth \ + PLYMOUTH_THEME_NAME="spinner" \ + PLYMOUTH_THEME="spinner" +else +ROOTFS_DRACUT_MODULES_OMIT += plymouth +endif + +ifeq ($(BR2_TARGET_ROOTFS_DRACUT_MOD_SIG),y) +ROOTFS_DRACUT_DEPENDENCIES += keyutils +ROOTFS_DRACUT_MODULES_INCLUDE += modsign +else +ROOTFS_DRACUT_MODULES_OMIT += modsign +endif + +ROOTFS_DRACUT_KERNEL_MODULES = $(call qstrip,$(BR2_TARGET_ROOTFS_DRACUT_KERNEL_MODULES)) +ROOTFS_DRACUT_MODULES_INCLUDE += $(call qstrip,$(BR2_TARGET_ROOTFS_DRACUT_MODULES)) +ROOTFS_DRACUT_CUSTOM_KERNEL_CMDLINE = $(call qstrip,$(BR2_TARGET_ROOTFS_DRACUT_CUSTOM_KERNEL_CMDLINE)) +ROOTFS_DRACUT_COMPRESSION_METHOD = $(call qstrip,$(BR2_TARGET_ROOTFS_DRACUT_COMPRESSION_METHOD)) +ROOTFS_DRACUT_CONF_PATH = $(call qstrip,$(BR2_TARGET_ROOTFS_DRACUT_CONF_PATH)) +ROOTFS_DRACUT_MKFS_CONF_OPTS += \ + --modules="$(ROOTFS_DRACUT_MODULES_INCLUDE)" \ + --omit="$(ROOTFS_DRACUT_MODULES_OMIT)" \ + --drivers=$(ROOTFS_DRACUT_KERNEL_MODULES) \ + --$(ROOTFS_DRACUT_COMPRESSION_METHOD) + +ifneq ($(ROOTFS_DRACUT_CONF_PATH),) +ROOTFS_DRACUT_MKFS_CONF_OPTS += --conf=$(ROOTFS_DRACUT_CONF_PATH) +endif + +ifneq ($(ROOTFS_DRACUT_CUSTOM_KERNEL_CMDLINE),) +ROOTFS_DRACUT_MKFS_CONF_OPTS += --kernel-cmdline=$(ROOTFS_DRACUT_CUSTOM_KERNEL_CMDLINE) +endif + +ifeq ($(BR2_LINUX_KERNEL),y) +ROOTFS_DRACUT_KERNEL_IMAGE_PATH=$(BINARIES_DIR)/$(LINUX_TARGET_NAME) +ROOTFS_DRACUT_KERNEL_VERSION=$(LINUX_VERSION_PROBED) + +ROOTFS_DRACUT_MKFS_CONF_OPTS += \ + --kver=$(ROOTFS_DRACUT_KERNEL_VERSION) \ + --kernel-image=$(ROOTFS_DRACUT_KERNEL_IMAGE_PATH) \ + --kmoddir="$(ROOTFS_DRACUT_TARGET_DIR)/lib/modules/$(ROOTFS_DRACUT_KERNEL_VERSION)" + +ROOTFS_DRACUT_FS_ENV += KERNEL_VERSION=$(ROOTFS_DRACUT_KERNEL_VERSION) +ROOTFS_DRACUT_MODULES_INCLUDE += kernel-modules +endif + +ifeq ($(BR2_TARGET_ROOTFS_DRACUT_HOST_ONLY),y) +ROOTFS_DRACUT_MKFS_CONF_OPTS += --hostonly +ROOTFS_DRACUT_MKFS_CONF_OPTS += --no-hostonly-cmdline +ifeq ($(BR2_TARGET_ROOTFS_DRACUT_HOST_ONLY_SLOPPY),y) +ROOTFS_DRACUT_MKFS_CONF_OPTS += --hostonly-mode=sloppy +else +ROOTFS_DRACUT_MKFS_CONF_OPTS += --hostonly-mode=strict +endif +else +ROOTFS_DRACUT_MKFS_CONF_OPTS += --no-hostonly +endif + +ifeq ($(BR2_STRIP_strip),y) +ROOTFS_DRACUT_MKFS_CONF_OPTS += --strip +else +ROOTFS_DRACUT_MKFS_CONF_OPTS += --nostrip +endif + +ifeq ($(BR2_REPRODUCIBLE),y) +ROOTFS_DRACUT_MKFS_CONF_OPTS += --reproducible +else +ROOTFS_DRACUT_MKFS_CONF_OPTS += --no-reproducible +endif + +define ROOTFS_DRACUT_CMD + (mkdir -p $(ROOTFS_DRACUT_DIR)/rootfs.dracut.tmp && \ + $(ROOTFS_DRACUT_FS_ENV) \ + $(HOST_DIR)/bin/dracut \ + $(ROOTFS_DRACUT_MKFS_CONF_OPTS) \ + $(BINARIES_DIR)/rootfs.cpio) +endef + +$(eval $(rootfs)) diff --git a/packages/Config.in b/packages/Config.in index 2165ae6..cf74dff 100644 --- a/packages/Config.in +++ b/packages/Config.in @@ -1,6 +1,7 @@ menu "Target packages" source "$BR2_EXTERNAL_MynaPlayer_PATH/packages/disabled-services/Config.in" +source "$BR2_EXTERNAL_MynaPlayer_PATH/packages/dracut/Config.in" source "$BR2_EXTERNAL_MynaPlayer_PATH/packages/duktape-pc/Config.in" source "$BR2_EXTERNAL_MynaPlayer_PATH/packages/lifepo4wered-pi/Config.in" source "$BR2_EXTERNAL_MynaPlayer_PATH/packages/openssh-systemd/Config.in" diff --git a/packages/disabled-services/70-disabled.preset b/packages/disabled-services/70-disabled.preset index 1b6ec28..cf9d1e9 100644 --- a/packages/disabled-services/70-disabled.preset +++ b/packages/disabled-services/70-disabled.preset @@ -1,6 +1,7 @@ disable alsa-state.service disable alsa-restore.service disable ninfod.service +disable rauc-mark-good.service disable rdisc.service disable systemd-bootchart.service disable systemd-network-generator.service diff --git a/packages/dracut/0001-dracut.sh-add-library-path-option.patch b/packages/dracut/0001-dracut.sh-add-library-path-option.patch new file mode 100644 index 0000000..23c33ba --- /dev/null +++ b/packages/dracut/0001-dracut.sh-add-library-path-option.patch @@ -0,0 +1,58 @@ +From b9545a912b233eb7576649921c3795ee9fcdd893 Mon Sep 17 00:00:00 2001 +From: Adam Duskett +Date: Sat, 20 Feb 2021 15:35:55 -0800 +Subject: [PATCH] dracut.sh: add library-path option + +Dracut.sh calls out to dracut-install which will use the default system +library paths. This causes issues if the host system doesn't have libkmod +installed. + +Add the new option --library-path, which if set, exports LD_LIBRARY_PATH before +calling dracut-install + +Signed-off-by: Adam Duskett +--- + dracut.sh | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/dracut.sh b/dracut.sh +index df72d9c..885c921 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -119,6 +119,7 @@ Creates initial ramdisk images for preloading modules + --noprefix Do not prefix initramfs files + --mdadmconf Include local /etc/mdadm.conf + --nomdadmconf Do not include local /etc/mdadm.conf ++ --library-path Specify a library path of which to use + --lvmconf Include local /etc/lvm/lvm.conf + --nolvmconf Do not include local /etc/lvm/lvm.conf + --fscks [LIST] Add a space-separated list of fsck helpers. +@@ -359,6 +360,7 @@ rearrange_params() + --long libdirs: \ + --long fscks: \ + --long add-fstab: \ ++ --long library-path: \ + --long mount: \ + --long device: \ + --long add-device: \ +@@ -538,6 +540,7 @@ while :; do + --libdirs) libdirs_l+=("$2"); PARMS_TO_STORE+=" '$2'"; shift;; + --fscks) fscks_l+=("$2"); PARMS_TO_STORE+=" '$2'"; shift;; + --add-fstab) add_fstab_l+=("$2"); PARMS_TO_STORE+=" '$2'"; shift;; ++ --library-path) library_path="$2"; shift;; + --mount) fstab_lines+=("$2"); PARMS_TO_STORE+=" '$2'"; shift;; + --add-device|--device) add_device_l+=("$2"); PARMS_TO_STORE+=" '$2'"; shift;; + --kernel-cmdline) kernel_cmdline_l+=("$2"); PARMS_TO_STORE+=" '$2'"; shift;; +@@ -1056,6 +1059,9 @@ fi + + if ! [[ $print_cmdline ]]; then + inst "$DRACUT_TESTBIN" ++ if [ -n "${library_path}" ]; then ++ export LD_LIBRARY_PATH="${library_path}" ++ fi + if ! $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${dracutsysrootdir:+-r "$dracutsysrootdir"} -R "$DRACUT_TESTBIN" &>/dev/null; then + unset DRACUT_RESOLVE_LAZY + export DRACUT_RESOLVE_DEPS=1 +-- +2.25.1 + diff --git a/packages/dracut/0002-force-symlink-making.patch b/packages/dracut/0002-force-symlink-making.patch new file mode 100644 index 0000000..22c42db --- /dev/null +++ b/packages/dracut/0002-force-symlink-making.patch @@ -0,0 +1,37 @@ +From 1e47223f7a1f112dc5672cc943a8b3c7fb001f45 Mon Sep 17 00:00:00 2001 +From: Adam Duskett +Date: Sat, 20 Feb 2021 15:41:20 -0800 +Subject: [PATCH] force symlink making + +This prevents subsequent rebuilds from failing if the symlinks already exist + +Signed-off-by: Adam Duskett +--- + Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Makefile b/Makefile +index 637e65b..01bd14c 100644 +--- a/Makefile ++++ b/Makefile +@@ -155,7 +155,7 @@ endif + mkdir -p $(DESTDIR)$(systemdsystemunitdir); \ + ln -srf $(DESTDIR)$(pkglibdir)/modules.d/98dracut-systemd/dracut-shutdown.service $(DESTDIR)$(systemdsystemunitdir)/dracut-shutdown.service; \ + mkdir -p $(DESTDIR)$(systemdsystemunitdir)/sysinit.target.wants; \ +- ln -s ../dracut-shutdown.service \ ++ ln -sf ../dracut-shutdown.service \ + $(DESTDIR)$(systemdsystemunitdir)/sysinit.target.wants/dracut-shutdown.service; \ + mkdir -p $(DESTDIR)$(systemdsystemunitdir)/initrd.target.wants; \ + for i in \ +@@ -168,7 +168,7 @@ endif + dracut-pre-udev.service \ + ; do \ + ln -srf $(DESTDIR)$(pkglibdir)/modules.d/98dracut-systemd/$$i $(DESTDIR)$(systemdsystemunitdir); \ +- ln -s ../$$i \ ++ ln -sf ../$$i \ + $(DESTDIR)$(systemdsystemunitdir)/initrd.target.wants/$$i; \ + done \ + fi +-- +2.25.1 + diff --git a/packages/dracut/0003-busybox-module-add-BUSYBOX_LIST-variable.patch b/packages/dracut/0003-busybox-module-add-BUSYBOX_LIST-variable.patch new file mode 100644 index 0000000..0967473 --- /dev/null +++ b/packages/dracut/0003-busybox-module-add-BUSYBOX_LIST-variable.patch @@ -0,0 +1,35 @@ +From 665bdc0c91f6d4f33bfd6cd4254c8bb31150eb78 Mon Sep 17 00:00:00 2001 +From: Adam Duskett +Date: Sun, 21 Feb 2021 14:35:45 -0800 +Subject: [PATCH] busybox module: add BUSYBOX_LIST variable + +When installing the Busybox module, Dracut attempts to execute busybox --list +to get a list of all installed busybox modules. + +Executing a cross-compiled busybox won't work when the binary is a different +architecture from the host. To fix this issue, allow a user to specify a list +of Busybox files via the "BUSYBOX_LIST" variable and execute busybox --list +if the list is empty. + +Signed-off-by: Adam Duskett +--- + modules.d/05busybox/module-setup.sh | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/modules.d/05busybox/module-setup.sh b/modules.d/05busybox/module-setup.sh +index 20b36c1..4f0660e 100755 +--- a/modules.d/05busybox/module-setup.sh ++++ b/modules.d/05busybox/module-setup.sh +@@ -18,7 +18,8 @@ install() { + local _progs=() + _busybox=$(find_binary busybox) + inst $_busybox /usr/bin/busybox +- for _i in $($_busybox --list); do ++ [ -z "$BUSYBOX_LIST" ] && BUSYBOX_LIST=$($_busybox --list) ++ for _i in ${BUSYBOX_LIST}; do + [[ ${_i} == busybox ]] && continue + _progs+=("${_i}") + done +-- +2.25.1 + diff --git a/packages/dracut/0004-fakeroot-fixes.patch b/packages/dracut/0004-fakeroot-fixes.patch new file mode 100644 index 0000000..b0432a5 --- /dev/null +++ b/packages/dracut/0004-fakeroot-fixes.patch @@ -0,0 +1,29 @@ +From 4e5776c4cb230d926bd0e72c86a56a1471919cd9 Mon Sep 17 00:00:00 2001 +From: Adam Duskett +Date: Wed, 24 Feb 2021 14:11:21 -0800 +Subject: [PATCH] fakeroot fixes + +Dracut unsets LD_PRELOAD and LD_LIBRARY_PATH, both of which are used by +fakeroot. If these are not set, fakeroot doesn't work and mknod fails. + +Signed-off-by: Adam Duskett +--- + dracut.sh | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/dracut.sh b/dracut.sh +index 800a676..515bd1b 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -698,8 +698,6 @@ export LC_ALL=C + export LANG=C + unset LC_MESSAGES + unset LC_CTYPE +-unset LD_LIBRARY_PATH +-unset LD_PRELOAD + unset GREP_OPTIONS + + export DRACUT_LOG_LEVEL=warning +-- +2.29.2 + diff --git a/packages/dracut/0005-allow-custom-strip-command.patch b/packages/dracut/0005-allow-custom-strip-command.patch new file mode 100644 index 0000000..f992157 --- /dev/null +++ b/packages/dracut/0005-allow-custom-strip-command.patch @@ -0,0 +1,35 @@ +From 9b696e31c9843e96c1a7b0b6562a7c2b01cfd098 Mon Sep 17 00:00:00 2001 +From: Adam Duskett +Date: Sun, 21 Feb 2021 17:32:49 -0800 +Subject: [PATCH] allow custom strip command + +For cross-compiled environments, the normal strip command does not work due to +the difference between architectures. + +Add the STRIP_CMD environment variable that can be passed to dracut. + +Signed-off-by: Adam Duskett +--- + dracut.sh | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/dracut.sh b/dracut.sh +index 3882e8f..6a5aa06 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -1921,8 +1921,11 @@ if [[ $do_strip = yes ]] ; then + # Prefer strip from elfutils for package size + declare strip_cmd + strip_cmd=$(command -v eu-strip) +- [ -z "$strip_cmd" ] && strip_cmd="strip" + ++ [ -z "$strip_cmd" ] && strip_cmd="strip" ++ if [ -n "$STRIP_CMD" ]; then ++ strip_cmd="${STRIP_CMD}" ++ fi + for p in $strip_cmd xargs find; do + if ! type -P $p >/dev/null; then + dinfo "Could not find '$p'. Not stripping the initramfs." +-- +2.25.1 + diff --git a/packages/dracut/Config.in b/packages/dracut/Config.in new file mode 100644 index 0000000..76d4e74 --- /dev/null +++ b/packages/dracut/Config.in @@ -0,0 +1,25 @@ +config BR2_PACKAGE_DRACUT + bool "dracut" + depends on BR2_USE_MMU # fork() + depends on !BR2_STATIC_LIBS # kmod + depends on BR2_PACKAGE_SYSTEMD + select BR2_PACKAGE_KMOD + select BR2_PACKAGE_PKGCONF + select BR2_PACKAGE_BASH_COMPLETION if BR2_PACKAGE_BASH + select BR2_PACKAGE_SYSTEMD_INITRD # runtime + select BR2_PACKAGE_UTIL_LINUX # runtime + select BR2_PACKAGE_UTIL_LINUX_SULOGIN # runtime + help + dracut (the tool) is used to create an initramfs image by + copying tools and files from an installed system and combining + it with the dracut framework, usually found in + /usr/lib/dracut/modules.d. + + https://github.com/dracutdevs/dracut + +comment "dracut needs systemd" + depends on !BR2_PACKAGE_SYSTEMD + +comment "dracut needs a toolchain w/ dynamic library" + depends on BR2_USE_MMU + depends on BR2_STATIC_LIBS diff --git a/packages/dracut/dracut-install.in b/packages/dracut/dracut-install.in new file mode 100755 index 0000000..a7877e1 --- /dev/null +++ b/packages/dracut/dracut-install.in @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -e + +LD_LIBRARY_PATH="$(dirname "$0")/../lib:$(dirname "$0")/../lib/systemd" $(dirname "$0")/../lib/dracut/dracut-install "${@}" diff --git a/packages/dracut/dracut.hash b/packages/dracut/dracut.hash new file mode 100644 index 0000000..574bd23 --- /dev/null +++ b/packages/dracut/dracut.hash @@ -0,0 +1,3 @@ +# Locally computed +sha256 12708a23745cf6e1c1cc3df5674534679f14db0410d854db01172c01fe00b508 dracut-053.tar.gz +sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 COPYING diff --git a/packages/dracut/dracut.mk b/packages/dracut/dracut.mk new file mode 100644 index 0000000..02e3032 --- /dev/null +++ b/packages/dracut/dracut.mk @@ -0,0 +1,84 @@ +################################################################################ +# +# dracut +# +################################################################################ + +DRACUT_VERSION = 053 +DRACUT_SITE = $(call github,dracutdevs,dracut,$(DRACUT_VERSION)) +DRACUT_LICENSE = GPL-2.0 +DRACUT_LICENSE_FILES = COPYING +DRACUT_INSTALL_STAGING = YES + +# Dracut requires realpath from coreutils +# prelink-cross is used to determin which libraries to copy. +HOST_DRACUT_DEPENDENCIES += \ + host-pkgconf \ + host-kmod \ + host-coreutils \ + host-cpio \ + host-gzip \ + host-util-linux \ + host-prelink-cross + +DRACUT_DEPENDENCIES += \ + host-dracut \ + kmod \ + pkgconf \ + systemd \ + util-linux + +DRACUT_MAKE_ENV += \ + CC="$(TARGET_CC)" \ + PKG_CONFIG="$(HOST_PKG_CONFIG_PATH)" \ + SYSTEMCTL=$(HOST_DIR)/usr/bin/systemctl \ + dracutsysrootdir=$(TARGET_DIR) + +DRACUT_CONF_OPTS = \ + --disable-documentation \ + --systemdsystemunitdir=/usr/lib/systemd/system + +HOST_DRACUT_MAKE_ENV += \ + PKG_CONFIG="$(HOST_PKG_CONFIG_PATH)" + +HOST_DRACUT_CONF_OPTS = \ + --disable-documentation \ + --libdir=$(HOST_DIR)/lib \ + --libexecdir=$(HOST_DIR)/lib \ + --bindir=$(HOST_DIR)/bin \ + --sbindir=$(HOST_DIR)/sbin + +ifeq ($(BR2_PACKAGE_BASH),y) +DRACUT_DEPENDENCIES += \ + bash \ + bash-completion +endif + +# gensplash is gentoo specific +define DRACUT_REMOVE_UNEEDED_MODULES + $(RM) -r $(TARGET_DIR)/usr/lib/dracut/modules.d/50gensplash +endef +DRACUT_TARGET_FINALIZE_HOOKS += DRACUT_REMOVE_UNEEDED_MODULES + +define DRACUT_LINUX_CONFIG_FIXUPS + $(call KCONFIG_ENABLE_OPT,CONFIG_BLK_DEV_INITRD) + $(call KCONFIG_ENABLE_OPT,CONFIG_DEVTMPFS) +endef + +define DRACUT_REMOVE_SYSTEMD_FILES + # Do not start dracut services normally. Dracut will enable the dracut + # services during image creation. + find $(TARGET_DIR)/etc/systemd/system -name "*dracut*.service" -delete +endef +DRACUT_TARGET_FINALIZE_HOOKS += DRACUT_REMOVE_SYSTEMD_FILES + +# Install the dracut-install wrapper which exports the proper LD_LIBRARY_PATH +# when called. +define HOST_DRACUT_INSTALL_WRAPPER + $(INSTALL) -D -m 755 $(DRACUT_PKGDIR)/dracut-install.in \ + $(HOST_DIR)/bin/dracut-install +endef +HOST_DRACUT_POST_INSTALL_HOOKS += HOST_DRACUT_INSTALL_WRAPPER + +$(eval $(autotools-package)) +$(eval $(host-autotools-package)) diff --git a/scripts/version_stamp.sh b/scripts/version_stamp.sh new file mode 100755 index 0000000..a44e74e --- /dev/null +++ b/scripts/version_stamp.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +# This script runs git describe inside the external tree to generate a file containing the release tag, stored in utilities/version_stamp. +# It can be used appropriately from each boards' respective postbuild or postimage script depending on what is needed. +# The generated file is ignored in .gitignore. + +set -e +cd "${BR2_EXTERNAL_MynaPlayer_PATH}" +git describe --broken --dirty > utilities/version_stamp diff --git a/utilities/barebox.config b/utilities/barebox.config new file mode 100644 index 0000000..7d15ea3 --- /dev/null +++ b/utilities/barebox.config @@ -0,0 +1,151 @@ +CONFIG_ARCH_STM32MP=y +CONFIG_MACH_STM32MP15XX_DKX=y +CONFIG_MACH_LXA_MC1=y +CONFIG_MACH_SEEED_ODYSSEY=y +CONFIG_THUMB2_BAREBOX=y +CONFIG_ARM_BOARD_APPEND_ATAG=y +CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y +CONFIG_ARM_UNWIND=y +CONFIG_MMU=y +CONFIG_MALLOC_SIZE=0x0 +CONFIG_MALLOC_TLSF=y +CONFIG_KALLSYMS=y +CONFIG_RELOCATABLE=y +CONFIG_HUSH_FANCY_PROMPT=y +CONFIG_CMDLINE_EDITING=y +CONFIG_AUTO_COMPLETE=y +CONFIG_MENU=y +CONFIG_BOOTM_SHOW_TYPE=y +CONFIG_BOOTM_VERBOSE=y +CONFIG_BOOTM_INITRD=y +CONFIG_BOOTM_OFTREE=y +CONFIG_BOOTM_OFTREE_UIMAGE=y +CONFIG_BLSPEC=y +CONFIG_CONSOLE_ACTIVATE_NONE=y +CONFIG_CONSOLE_ALLOW_COLOR=y +CONFIG_PBL_CONSOLE=y +CONFIG_PARTITION_DISK_EFI=y +# CONFIG_PARTITION_DISK_EFI_GPT_NO_FORCE is not set +# CONFIG_PARTITION_DISK_EFI_GPT_COMPARE is not set +CONFIG_DEFAULT_COMPRESSION_XZ=y +CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y +CONFIG_STATE=y +CONFIG_BOOTCHOOSER=y +CONFIG_RESET_SOURCE=y +CONFIG_MACHINE_ID=y +CONFIG_DEFAULT_LOGLEVEL=3 +CONFIG_CMD_DMESG=y +CONFIG_LONGHELP=y +CONFIG_CMD_IOMEM=y +CONFIG_CMD_IMD=y +CONFIG_CMD_MEMINFO=y +CONFIG_CMD_ARM_MMUINFO=y +CONFIG_CMD_REGULATOR=y +CONFIG_CMD_MMC=y +CONFIG_CMD_MMC_EXTCSD=y +CONFIG_CMD_POLLER=y +# CONFIG_CMD_BOOTU is not set +CONFIG_CMD_GO=y +CONFIG_CMD_RESET=y +CONFIG_CMD_UIMAGE=y +CONFIG_CMD_PARTITION=y +CONFIG_CMD_EXPORT=y +CONFIG_CMD_DEFAULTENV=y +CONFIG_CMD_LOADENV=y +CONFIG_CMD_PRINTENV=y +CONFIG_CMD_MAGICVAR=y +CONFIG_CMD_MAGICVAR_HELP=y +CONFIG_CMD_SAVEENV=y +CONFIG_CMD_DIGEST=y +CONFIG_CMD_FILETYPE=y +CONFIG_CMD_LN=y +CONFIG_CMD_UNCOMPRESS=y +CONFIG_CMD_LET=y +CONFIG_CMD_MSLEEP=y +CONFIG_CMD_READF=y +CONFIG_CMD_SLEEP=y +CONFIG_CMD_ECHO_E=y +CONFIG_CMD_EDIT=y +CONFIG_CMD_MENU=y +CONFIG_CMD_MENU_MANAGEMENT=y +CONFIG_CMD_MENUTREE=y +CONFIG_CMD_READLINE=y +CONFIG_CMD_TIMEOUT=y +CONFIG_CMD_CRC=y +CONFIG_CMD_CRC_CMP=y +CONFIG_CMD_MEMTEST=y +CONFIG_CMD_MM=y +CONFIG_CMD_CLK=y +CONFIG_CMD_DETECT=y +CONFIG_CMD_FLASH=y +CONFIG_CMD_GPIO=y +CONFIG_CMD_I2C=y +CONFIG_CMD_LED=y +CONFIG_CMD_POWEROFF=y +CONFIG_CMD_SMC=y +CONFIG_CMD_WD=y +CONFIG_CMD_BAREBOX_UPDATE=y +CONFIG_CMD_OF_DIFF=y +CONFIG_CMD_OF_NODE=y +CONFIG_CMD_OF_PROPERTY=y +CONFIG_CMD_OFTREE=y +CONFIG_CMD_TIME=y +CONFIG_CMD_STATE=y +CONFIG_CMD_BOOTCHOOSER=y +CONFIG_NET=y +CONFIG_OFDEVICE=y +CONFIG_OF_BAREBOX_DRIVERS=y +CONFIG_DRIVER_SERIAL_STM32=y +CONFIG_DRIVER_NET_DESIGNWARE_EQOS=y +CONFIG_DRIVER_NET_DESIGNWARE_STM32=y +CONFIG_MICREL_PHY=y +# CONFIG_SPI is not set +CONFIG_I2C=y +CONFIG_I2C_STM32=y +CONFIG_MCI=y +CONFIG_MCI_MMC_BOOT_PARTITIONS=y +CONFIG_MCI_STM32_SDMMC2=y +CONFIG_MFD_STPMIC1=y +CONFIG_MFD_STM32_TIMERS=y +CONFIG_STATE_DRV=y +CONFIG_LED=y +CONFIG_LED_GPIO=y +CONFIG_LED_PWM=y +CONFIG_LED_GPIO_OF=y +CONFIG_LED_TRIGGERS=y +CONFIG_KEYBOARD_GPIO=y +CONFIG_INPUT_SPECIALKEYS=y +CONFIG_WATCHDOG=y +CONFIG_WATCHDOG_POLLER=y +CONFIG_STM32_IWDG_WATCHDOG=y +CONFIG_STPMIC1_WATCHDOG=y +CONFIG_PWM=y +CONFIG_PWM_STM32=y +CONFIG_HWRNG=y +CONFIG_HWRNG_STM32=y +CONFIG_NVMEM=y +CONFIG_STM32_BSEC=y +CONFIG_REGULATOR=y +CONFIG_REGULATOR_FIXED=y +CONFIG_REGULATOR_STM32_PWR=y +CONFIG_REGULATOR_STPMIC1=y +CONFIG_REMOTEPROC=y +CONFIG_STM32_REMOTEPROC=y +CONFIG_RESET_STM32=y +CONFIG_GENERIC_PHY=y +CONFIG_PHY_STM32_USBPHYC=y +CONFIG_FS_EXT4=y +CONFIG_FS_FAT=y +CONFIG_FS_FAT_WRITE=y +CONFIG_FS_FAT_LFN=y +CONFIG_FS_SQUASHFS=y +CONFIG_FS_RATP=y +CONFIG_ZLIB=y +CONFIG_BZLIB=y +CONFIG_LZ4_DECOMPRESS=y +CONFIG_ZSTD_DECOMPRESS=y +CONFIG_XZ_DECOMPRESS=y +CONFIG_RATP=y +CONFIG_CRC8=y +CONFIG_DIGEST_SHA1_GENERIC=y +CONFIG_DIGEST_SHA1_ARM=y