commit 025b7c61156341966639ce498655d52eaf395f2f Author: Dustin C. Hatch Date: Mon Feb 13 17:52:13 2023 -0600 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a7040c0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/images +/linux +/output diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..6bb60f3 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "u-boot"] + path = u-boot + url = https://source.denx.de/u-boot/u-boot.git + branch = v2023.01 diff --git a/README.md b/README.md new file mode 100644 index 0000000..86f04e9 --- /dev/null +++ b/README.md @@ -0,0 +1,18 @@ +## Errors + +### SWIOTLB Buffer + +> OF: reserved mem: failed to allocate memory for node +> … +> Can not allocate SWIOTLB buffer earlier and can't now provide you with the +> DMA bounce buffer + +Ensure `start_x=1` is in `config.txt` and `start_file`/`fixup_file` are not +specified. + + +### U-Boot: Overwrite Reserved Memory + +> ** Reading file would overwrite reserved memory ** + +Set `CONFIG_LMB_MAX_REGIONS=16` in `u-boot/.config` diff --git a/build-all.sh b/build-all.sh new file mode 100755 index 0000000..06e6976 --- /dev/null +++ b/build-all.sh @@ -0,0 +1,21 @@ +#!/bin/sh +# vim: set sw=4 ts=4 sts=4 et : + +set -e + +. ./config + +./prepare.sh +./config-portage.sh +./setup-local-repo.sh +./build.sh +./build-host-tools.sh +./build-rootfs.sh +./build-uboot.sh +./build-grub.sh +./build-kernel.sh +./build-squashfs.sh +./post-build.sh + +./genimage.sh +./build-update.sh diff --git a/build-grub.sh b/build-grub.sh new file mode 100755 index 0000000..4d53937 --- /dev/null +++ b/build-grub.sh @@ -0,0 +1,42 @@ +#!/bin/sh +# vim: set sw=4 ts=4 sts=4 et : + +set -e + +. ./config + +GRUB_MODULES=' +boot +echo +efi_gop +eval +fat +gzio +linux +loadenv +normal +part_gpt +probe +regexp +serial +squash4 +test +xzio +zstd +' + +echo 'Creating GRUB image ...' +mkdir -p output/efi-part/EFI/BOOT +grub-mkimage \ + -O arm64-efi \ + -o output/efi-part/EFI/BOOT/BOOTAA64.efi \ + -d /usr/${target}/usr/lib/grub/arm64-efi \ + -p /EFI/gentoo \ + ${GRUB_MODULES} + +echo 'Generating GRUB configuration file ...' +mkdir -p output/efi-part/EFI/gentoo +cp -uv grub.cfg output/efi-part/EFI/gentoo +grub-editenv output/efi-part/EFI/gentoo/grubenv set rootflags='ro' +grub-editenv output/efi-part/EFI/gentoo/grubenv set default=0 +grub-editenv output/efi-part/EFI/gentoo/grubenv set timeout=5 diff --git a/build-host-tools.sh b/build-host-tools.sh new file mode 100755 index 0000000..72d7ea2 --- /dev/null +++ b/build-host-tools.sh @@ -0,0 +1,13 @@ +#!/bin/sh +# vim: set sw=4 ts=4 sts=4 et : + +emerge -vnUj \ + dev-vcs/git \ + sys-apps/systemd \ + sys-boot/grub \ + sys-fs/btrfs-progs \ + sys-fs/dosfstools \ + sys-fs/genimage \ + sys-fs/mtools \ + sys-fs/squashfs-tools \ + || exit diff --git a/build-kernel.sh b/build-kernel.sh new file mode 100755 index 0000000..89535e9 --- /dev/null +++ b/build-kernel.sh @@ -0,0 +1,34 @@ +#!/bin/sh +# vim: set sw=4 ts=4 sts=4 et : + +set -e + +. ./config + +emerge -vnj ${kernel_pkg} + +export ARCH=arm64 CROSS_COMPILE=${target}- +mkdir -p linux +cd linux +/usr/src/linux/scripts/kconfig/merge_config.sh -m \ + /usr/src/linux/arch/*/configs/${kernel_defconfig}_defconfig \ + ../linux.config +make -C /usr/src/linux O=${PWD} olddefconfig +make -j$(nproc) +kver=$(make kernelversion) +make modules_install INSTALL_MOD_PATH=/mnt/gentoo +cd - + +printf 'Installing Kernel ...\n' +mkdir -p /mnt/gentoo/boot +cp -au linux/arch/arm64/boot/Image.gz /mnt/gentoo/boot/vmlinuz-${kver} +cp -au linux/.config /mnt/gentoo/boot/config-${kver} +cp -au linux/System.map /mnt/gentoo/boot/System.map-${kver} + +printf 'Installing device tree binaries ...\n' +mkdir -p output/efi-part/overlays +cp -au linux/arch/arm64/boot/dts/${device_tree} output/efi-part/ +cp -au \ + linux/arch/arm64/boot/dts/overlays/*.dtb \ + linux/arch/arm64/boot/dts/overlays/*.dtbo \ + output/efi-part/overlays/ diff --git a/build-rootfs.sh b/build-rootfs.sh new file mode 100755 index 0000000..a965b03 --- /dev/null +++ b/build-rootfs.sh @@ -0,0 +1,72 @@ +#!/bin/sh +# vim: set sw=4 ts=4 sts=4 et : + +set -e + +. ./config + +mkdir -p /mnt/gentoo/usr/bin +[ -h /mnt/gentoo/bin ] || ln -s usr/bin /mnt/gentoo/bin +[ -h /mnt/gentoo/sbin ] || ln -s usr/sbin /mnt/gentoo/sbin +[ -h /mnt/gentoo/usr/sbin ] || ln -s bin /mnt/gentoo/usr/sbin + +mkdir -p /mnt/gentoo/etc/portage +ln -snf \ + /var/db/repos/gentoo/profiles/${profile} \ + /mnt/gentoo/etc/portage/make.profile +cp -r portage/. /mnt/gentoo/etc/portage/ + +ROOT=/mnt/gentoo \ +PORTAGE_CONFIGROOT=/mnt/gentoo \ +${target}-emerge -Kvnj \ + sys-apps/busybox \ + sys-apps/systemd \ + net-misc/openssh \ + net-misc/wget \ + sys-fs/btrfs-progs \ + -- +ROOT=/mnt/gentoo \ +PORTAGE_CONFIGROOT=/mnt/gentoo \ +${target}-emerge -vnj \ + net-wireless/wireless-regdb \ + sys-kernel/linux-firmware \ + -- + +mkdir -p \ + /mnt/gentoo/boot/efi \ + /mnt/gentoo/dev \ + /mnt/gentoo/home \ + /mnt/gentoo/proc \ + /mnt/gentoo/sys \ + || exit + +: > /mnt/gentoo/etc/machine-id + +while read name; do + if [ ! -h /mnt/gentoo/bin/"${name}" ]; then + printf "'/bin/%s' -> 'busybox'\n" "${name}" + ln -snf busybox /mnt/gentoo/bin/"${name}" \ + || printf 'Failed to create busybox symlink for %s\n' "${name}" + fi +done < busybox.symlinks + +tar -c -C overlay . \ + | tar -x --keep-newer-files -C /mnt/gentoo + +cp -uv /usr/${target}/usr/bin/grub-editenv /mnt/gentoo/usr/bin/ + +if [ -f /mnt/gentoo/etc/udev/hwdb.bin ]; then + mv /mnt/gentoo/etc/udev/hwdb.bin /mnt/gentoo/usr/lib/udev/ +fi + +systemctl preset-all --root=/mnt/gentoo + +systemd-sysusers --root=/mnt/gentoo +if grep -q '^root:.*/bin/bash$' /mnt/gentoo/etc/passwd; then + sed -ri 's@(root:.*):/bin/bash@\1:/bin/sh@' /mnt/gentoo/etc/passwd +fi + +if ! grep -q Include /mnt/gentoo/etc/ssh/sshd_config; then + echo 'Include /etc/ssh/sshd_config.d/*.conf' \ + >> /mnt/gentoo/etc/ssh/sshd_config +fi diff --git a/build-squashfs.sh b/build-squashfs.sh new file mode 100755 index 0000000..e8863b7 --- /dev/null +++ b/build-squashfs.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# vim: set sw=4 ts=4 sts=4 et : + +set -e + +. ./config + +mkdir -p images +mksquashfs \ + /mnt/gentoo \ + images/rootfs.squashfs \ + -comp gzip \ + -ef squashfs.exclude \ + -no-exports \ + -noappend \ + -wildcards diff --git a/build-uboot.sh b/build-uboot.sh new file mode 100755 index 0000000..a27951f --- /dev/null +++ b/build-uboot.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# vim: set sw=4 ts=4 sts=4 et : + +set -e + +. ./config + +cd u-boot +if [ ! -f .patched ]; then + for x in ../patches/uboot/*.patch; do + printf 'Applying patch %s ...\n' "${x##*/}" + patch -p1 < "${x}" + done + : > .patched +fi +cat configs/rpi_4_defconfig ../u-boot.config > configs/yellow_defconfig +make yellow_defconfig +CROSS_COMPILE=${target}- make +cd .. + +mkdir -p output/efi-part +cp -au u-boot/u-boot.bin output/efi-part diff --git a/build-update.sh b/build-update.sh new file mode 100755 index 0000000..68b659e --- /dev/null +++ b/build-update.sh @@ -0,0 +1,18 @@ +#!/bin/sh +# vim: set sw=4 ts=4 sts=4 et : + +set -e + +. ./config + +cd images +sha256sum firmware.img > digests +sha256sum rootfs.squashfs >> digests +ln ../install-update.sh install +tar -c --zstd -f ../output/update.tar.zstd \ + digests \ + firmware.img \ + rootfs.squashfs \ + install \ + || exit +rm install diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..7f7e20e --- /dev/null +++ b/build.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# vim: set sw=4 ts=4 sts=4 et : + +set -e + +. ./config + +USE=-pam \ +${target}-emerge -1nvj --nodeps sys-libs/libcap +USE='-cramfs -ncurses -nls -pam -readline -su -suid -systemd -udev' \ +${target}-emerge -1nvj --nodeps sys-apps/util-linux + +${target}-emerge -vnuUDj \ + net-misc/openssh \ + net-misc/wget \ + sys-apps/busybox \ + sys-apps/systemd \ + sys-boot/grub \ + sys-boot/raspberrypi-firmware \ + sys-fs/btrfs-progs \ + -- +${target}-emerge -v @preserved-rebuild diff --git a/busybox.symlinks b/busybox.symlinks new file mode 100644 index 0000000..0add1ea --- /dev/null +++ b/busybox.symlinks @@ -0,0 +1,60 @@ +basename +cat +cp +dd +df +echo +env +false +free +fsync +fuser +grep +groups +head +id +install +ip +kill +less +link +ln +ls +lsof +mkdir +mkfifo +mktemp +mv +nice +nproc +pgrep +ping +ping6 +pkill +ppidof +printf +ps +readahead +readlink +realpath +rm +rmdir +sed +seq +sh +sha1sum +sha256sum +sha3sum +sha512sum +sort +stat +stty +sync +tac +tail +tar +tee +truncate +tty +uname +uptime diff --git a/config b/config new file mode 100644 index 0000000..49e40c0 --- /dev/null +++ b/config @@ -0,0 +1,5 @@ +target=aarch64-unknown-linux-gnu +profile=default/linux/arm64/17.0/systemd/merged-usr +kernel_pkg=sys-kernel/raspberrypi-sources +kernel_defconfig=bcm2835 +device_tree=broadcom/bcm2711-rpi-cm4-ha-yellow.dtb diff --git a/config-portage.sh b/config-portage.sh new file mode 100755 index 0000000..4f1b5b1 --- /dev/null +++ b/config-portage.sh @@ -0,0 +1,9 @@ +#!/bin/sh +# vim: set sw=4 ts=4 sts=4 et : + +set -e + +. ./config + +cp -r host-portage/. /etc/portage/ +cp -r portage/. /usr/${target}/etc/portage/ diff --git a/config.txt b/config.txt new file mode 100644 index 0000000..4e6edf6 --- /dev/null +++ b/config.txt @@ -0,0 +1,17 @@ +arm_64bit=1 + +start_x=1 + +bootcode_delay=0 +boot_delay=0 + +gpu_mem=32 + +kernel=u-boot.bin + +enable_uart=1 +dtoverlay=miniuart-bt + +dtparam i2c_arm=on + +device_tree=bcm2711-rpi-cm4-ha-yellow.dtb diff --git a/genimage.cfg b/genimage.cfg new file mode 100644 index 0000000..a91fe70 --- /dev/null +++ b/genimage.cfg @@ -0,0 +1,40 @@ +# vim: set sw=4 ts=4 sts=4 : + +image firmware.img { + vfat { + } + + srcpath = "output/efi-part" + size = 32M +} + +image sdcard.img { + hdimage { + partition-table-type = hybrid + } + + partition "EFI System Partition" { + partition-type = 0xC + partition-type-uuid = "U" + bootable = true + image = "firmware.img" + } + + partition rootfs-a { + partition-type-uuid = "L" + image = "rootfs.squashfs" + size = 512M + } + + partition rootfs-b { + partition-type-uuid = "L" + size = 512M + } + + partition dch-data { + partition-type-uuid = "L" + autoresize = true + } + + size = 4G +} diff --git a/genimage.sh b/genimage.sh new file mode 100755 index 0000000..bf32a37 --- /dev/null +++ b/genimage.sh @@ -0,0 +1,27 @@ +#!/bin/sh +# vim: set sw=4 ts=4 sts=4 et : + +set -e + +cleanup() { + if [ -n "${tmproot}" ]; then + if [ "${tmproot}" != / ]; then + rm -rf "${tmproot}" + fi + unset tmproot + fi +} + +. ./config + +trap cleanup INT TERM QUIT EXIT +tmproot=$(mktemp -d) +tmppath=$(mktemp -d) + +genimage \ + --rootpath "${tmproot}" \ + --tmppath "${tmppath}" \ + --inputpath images/ \ + --outputpath images/ \ + --mkdosfs mkfs.vfat \ + --config genimage.cfg diff --git a/grub.cfg b/grub.cfg new file mode 100644 index 0000000..add5758 --- /dev/null +++ b/grub.cfg @@ -0,0 +1,19 @@ +# vim: set ft=sh : +# vim: set sw=4 ts=4 sts=4 et: + +load_env +regexp --set 1:disk '(.*),.*' $root +for dev in ($disk,gpt*); do + probe --set partuuid --part-uuid $dev + for path in $dev/boot/vmlinuz-*; do + if [ -f $path ]; then + regexp --set 1:kernel '.*/(vmlinuz-.*)' $path + regexp --set 1:kver 'vmlinuz-(.*)' $kernel + menuentry "Gentoo Linux $kver on $dev" --class gnu-linux --id "id-$partuuid-$kver" "$dev" "$kernel" $partuuid { + set root="$2" + linux "/boot/$3" root=PARTUUID=$4 $rootflags + } + fi + done +done + diff --git a/host-portage/env/nobuildpkg b/host-portage/env/nobuildpkg new file mode 100644 index 0000000..1d3a766 --- /dev/null +++ b/host-portage/env/nobuildpkg @@ -0,0 +1 @@ +FEATURES=-buildpkg diff --git a/host-portage/make.conf/15-keywords.conf b/host-portage/make.conf/15-keywords.conf new file mode 100644 index 0000000..e90c927 --- /dev/null +++ b/host-portage/make.conf/15-keywords.conf @@ -0,0 +1 @@ +ACCEPT_KEYWORDS="~${ARCH} ${ARCH}" diff --git a/host-portage/make.conf/20-binpkgs.conf b/host-portage/make.conf/20-binpkgs.conf new file mode 100644 index 0000000..d2fb18f --- /dev/null +++ b/host-portage/make.conf/20-binpkgs.conf @@ -0,0 +1,2 @@ +FEATURES="${FEATURES} binpkg-multi-instance buildpkg" +EMERGE_DEFAULT_OPTS="${EMERGE_DEFAULT_OPTS} --usepkg --binpkg-respect-use=y" diff --git a/host-portage/make.conf/80-quiet.conf b/host-portage/make.conf/80-quiet.conf new file mode 100644 index 0000000..430d5b1 --- /dev/null +++ b/host-portage/make.conf/80-quiet.conf @@ -0,0 +1,2 @@ +EMERGE_DEFAULT_OPTS="${EMERGE_DEFAULT_OPTS} --quiet-build=y --quiet-fail=y" +FEATURES="${FEATURES} -news" diff --git a/host-portage/package.accept_keywords/kernel b/host-portage/package.accept_keywords/kernel new file mode 100644 index 0000000..76aa542 --- /dev/null +++ b/host-portage/package.accept_keywords/kernel @@ -0,0 +1 @@ +sys-kernel/raspberrypi-sources ** diff --git a/host-portage/package.env/kernel b/host-portage/package.env/kernel new file mode 100644 index 0000000..c553338 --- /dev/null +++ b/host-portage/package.env/kernel @@ -0,0 +1,6 @@ +# vim: set ft=gentoo-package-use : + +# Dustin C. Hatch (09 Feb 2023) +# Do not build binary packages for kernel sources +sys-kernel/gentoo-sources nobuildpkg +sys-kernel/raspberrypi-sources nobuildpkg diff --git a/host-portage/package.use/btrfs-progs b/host-portage/package.use/btrfs-progs new file mode 100644 index 0000000..eca7fed --- /dev/null +++ b/host-portage/package.use/btrfs-progs @@ -0,0 +1 @@ +sys-fs/btrfs-progs -man diff --git a/host-portage/package.use/git b/host-portage/package.use/git new file mode 100644 index 0000000..46e62d2 --- /dev/null +++ b/host-portage/package.use/git @@ -0,0 +1 @@ +dev-vcs/git -perl diff --git a/host-portage/package.use/grub b/host-portage/package.use/grub new file mode 100644 index 0000000..e032517 --- /dev/null +++ b/host-portage/package.use/grub @@ -0,0 +1 @@ +sys-boot/grub -* GRUB_PLATFORMS: -* diff --git a/host-portage/package.use/kernel b/host-portage/package.use/kernel new file mode 100644 index 0000000..5f091c9 --- /dev/null +++ b/host-portage/package.use/kernel @@ -0,0 +1,2 @@ +sys-kernel/gentoo-sources symlink +sys-kernel/raspberrypi-sources symlink diff --git a/host-portage/package.use/squashfs-tools b/host-portage/package.use/squashfs-tools new file mode 100644 index 0000000..27ddfb0 --- /dev/null +++ b/host-portage/package.use/squashfs-tools @@ -0,0 +1 @@ +sys-fs/squashfs-tools zstd diff --git a/host-portage/package.use/systemd b/host-portage/package.use/systemd new file mode 100644 index 0000000..c6fa03b --- /dev/null +++ b/host-portage/package.use/systemd @@ -0,0 +1,2 @@ +sys-apps/dbus systemd +sys-apps/systemd -* diff --git a/host-portage/patches/sys-kernel/raspberrypi-sources/0001-ARM-dts-bcm2711-Add-device-tree-for-Home-Assistant-Y.patch b/host-portage/patches/sys-kernel/raspberrypi-sources/0001-ARM-dts-bcm2711-Add-device-tree-for-Home-Assistant-Y.patch new file mode 100644 index 0000000..d2ef2f3 --- /dev/null +++ b/host-portage/patches/sys-kernel/raspberrypi-sources/0001-ARM-dts-bcm2711-Add-device-tree-for-Home-Assistant-Y.patch @@ -0,0 +1,659 @@ +From b28a8f5b591841f88f19cbf9850d713a602d912e Mon Sep 17 00:00:00 2001 +Message-Id: +From: Stefan Agner +Date: Mon, 11 Apr 2022 14:47:59 +0200 +Subject: [PATCH] ARM: dts: bcm2711: Add device tree for Home Assistant Yellow + +Add device tree for Home Assistant Yellow, a Compute Module 4 based I/O +board. + +Signed-off-by: Stefan Agner +--- + arch/arm/boot/dts/Makefile | 3 +- + .../boot/dts/bcm2711-rpi-cm4-ha-yellow.dts | 598 ++++++++++++++++++ + arch/arm64/boot/dts/broadcom/Makefile | 1 + + .../broadcom/bcm2711-rpi-cm4-ha-yellow.dts | 1 + + 4 files changed, 602 insertions(+), 1 deletion(-) + create mode 100644 arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts + create mode 100644 arch/arm64/boot/dts/broadcom/bcm2711-rpi-cm4-ha-yellow.dts + +diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile +index 3dfe451bcb16..d147c3400732 100644 +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -18,7 +18,8 @@ dtb-$(CONFIG_ARCH_BCM2835) += \ + bcm2709-rpi-cm2.dtb \ + bcm2710-rpi-cm3.dtb \ + bcm2711-rpi-cm4.dtb \ +- bcm2711-rpi-cm4s.dtb ++ bcm2711-rpi-cm4s.dtb \ ++ bcm2711-rpi-cm4-ha-yellow.dtb + + dtb-$(CONFIG_ARCH_ALPINE) += \ + alpine-db.dtb +diff --git a/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts b/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts +new file mode 100644 +index 000000000000..61d8c81d3de4 +--- /dev/null ++++ b/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts +@@ -0,0 +1,598 @@ ++// SPDX-License-Identifier: GPL-2.0 ++/dts-v1/; ++#include "bcm2711.dtsi" ++#include "bcm2711-rpi.dtsi" ++//#include "bcm283x-rpi-usb-peripheral.dtsi" ++ ++/ { ++ compatible = "raspberrypi,4-compute-module-ha-yellow", "raspberrypi,4-compute-module", "brcm,bcm2711"; ++ model = "Raspberry Pi Compute Module 4 on Home Assistant Yellow"; ++ ++ chosen { ++ /* 8250 auxiliary UART instead of pl011 */ ++ stdout-path = "serial1:115200n8"; ++ }; ++ ++ leds { ++ led-act { ++ gpios = <&gpio 42 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ led-pwr { ++ label = "PWR"; ++ gpios = <&expgpio 2 GPIO_ACTIVE_LOW>; ++ default-state = "keep"; ++ linux,default-trigger = "default-on"; ++ }; ++ }; ++ ++ wifi_pwrseq: wifi-pwrseq { ++ compatible = "mmc-pwrseq-simple"; ++ reset-gpios = <&expgpio 1 GPIO_ACTIVE_LOW>; ++ }; ++ ++ sd_io_1v8_reg: sd_io_1v8_reg { ++ compatible = "regulator-gpio"; ++ regulator-name = "vdd-sd-io"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-boot-on; ++ regulator-always-on; ++ regulator-settling-time-us = <5000>; ++ gpios = <&expgpio 4 GPIO_ACTIVE_HIGH>; ++ states = <1800000 0x1>, ++ <3300000 0x0>; ++ status = "okay"; ++ }; ++ ++ sd_vcc_reg: sd_vcc_reg { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc-sd"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-boot-on; ++ enable-active-high; ++ gpio = <&expgpio 6 GPIO_ACTIVE_HIGH>; ++ }; ++}; ++ ++&ddc0 { ++ status = "okay"; ++}; ++ ++&ddc1 { ++ status = "okay"; ++}; ++ ++&expgpio { ++ gpio-line-names = "BT_ON", ++ "WL_ON", ++ "PWR_LED_OFF", ++ "ANT1", ++ "VDD_SD_IO_SEL", ++ "CAM_GPIO", ++ "SD_PWR_ON", ++ "ANT2"; ++ ++ ant1: ant1 { ++ gpio-hog; ++ gpios = <3 GPIO_ACTIVE_HIGH>; ++ output-high; ++ }; ++ ++ ant2: ant2 { ++ gpio-hog; ++ gpios = <7 GPIO_ACTIVE_HIGH>; ++ output-low; ++ }; ++}; ++ ++&gpio { ++ /* ++ * Parts taken from rpi_SCH_4b_4p0_reduced.pdf and ++ * the official GPU firmware DT blob. ++ * ++ * Legend: ++ * "FOO" = GPIO line named "FOO" on the schematic ++ * "FOO_N" = GPIO line named "FOO" on schematic, active low ++ */ ++ gpio-line-names = "ID_SDA", ++ "ID_SCL", ++ "SDA1", ++ "SCL1", ++ "GPIO_GCLK", ++ "GPIO5", ++ "GPIO6", ++ "SPI_CE1_N", ++ "SPI_CE0_N", ++ "SPI_MISO", ++ "SPI_MOSI", ++ "SPI_SCLK", ++ "GPIO12", ++ "GPIO13", ++ /* Serial port */ ++ "TXD1", ++ "RXD1", ++ "GPIO16", ++ "GPIO17", ++ "GPIO18", ++ "GPIO19", ++ "GPIO20", ++ "GPIO21", ++ "GPIO22", ++ "GPIO23", ++ "GPIO24", ++ "GPIO25", ++ "GPIO26", ++ "GPIO27", ++ "RGMII_MDIO", ++ "RGMIO_MDC", ++ /* Used by BT module */ ++ "CTS0", ++ "RTS0", ++ "TXD0", ++ "RXD0", ++ /* Used by Wifi */ ++ "SD1_CLK", ++ "SD1_CMD", ++ "SD1_DATA0", ++ "SD1_DATA1", ++ "SD1_DATA2", ++ "SD1_DATA3", ++ /* Shared with SPI flash */ ++ "PWM0_MISO", ++ "PWM1_MOSI", ++ "STATUS_LED_G_CLK", ++ "SPIFLASH_CE_N", ++ "SDA0", ++ "SCL0", ++ "RGMII_RXCLK", ++ "RGMII_RXCTL", ++ "RGMII_RXD0", ++ "RGMII_RXD1", ++ "RGMII_RXD2", ++ "RGMII_RXD3", ++ "RGMII_TXCLK", ++ "RGMII_TXCTL", ++ "RGMII_TXD0", ++ "RGMII_TXD1", ++ "RGMII_TXD2", ++ "RGMII_TXD3"; ++}; ++ ++&hdmi0 { ++ status = "okay"; ++}; ++ ++&hdmi1 { ++ status = "okay"; ++}; ++ ++&pixelvalve0 { ++ status = "okay"; ++}; ++ ++&pixelvalve1 { ++ status = "okay"; ++}; ++ ++&pixelvalve2 { ++ status = "okay"; ++}; ++ ++&pixelvalve4 { ++ status = "okay"; ++}; ++ ++&pwm1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pwm1_0_gpio40 &pwm1_1_gpio41>; ++ status = "okay"; ++}; ++ ++/* SDHCI is used to control the SDIO for wireless */ ++&sdhci { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&emmc_gpio34>; ++ bus-width = <4>; ++ non-removable; ++ mmc-pwrseq = <&wifi_pwrseq>; ++ status = "okay"; ++ ++ brcmf: wifi@1 { ++ reg = <1>; ++ compatible = "brcm,bcm4329-fmac"; ++ }; ++}; ++ ++/* EMMC2 is used to drive the EMMC card */ ++&emmc2 { ++ bus-width = <8>; ++ vqmmc-supply = <&sd_io_1v8_reg>; ++ vmmc-supply = <&sd_vcc_reg>; ++ broken-cd; ++ status = "okay"; ++}; ++ ++&genet { ++ phy-handle = <&phy1>; ++ phy-mode = "rgmii-rxid"; ++ status = "okay"; ++}; ++ ++&genet_mdio { ++ phy1: ethernet-phy@0 { ++ /* No PHY interrupt */ ++ reg = <0x0>; ++ }; ++}; ++ ++&pcie0 { ++ pci@0,0 { ++ device-type = "pci"; ++ #address-cells = <3>; ++ #size-cells = <2>; ++ ranges; ++ ++ reg = <0 0 0 0 0>; ++ }; ++}; ++ ++/* uart0 communicates with the BT module */ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_ctsrts_gpio30 &uart0_gpio32>; ++ uart-has-rtscts; ++ status = "okay"; ++ ++ bluetooth { ++ compatible = "brcm,bcm43438-bt"; ++ max-speed = <2000000>; ++ shutdown-gpios = <&expgpio 0 GPIO_ACTIVE_HIGH>; ++ }; ++}; ++ ++/* uart1 is mapped to the pin header */ ++&uart1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart1_gpio14>; ++ status = "okay"; ++}; ++ ++&vchiq { ++ interrupts = ; ++}; ++ ++&vc4 { ++ status = "okay"; ++}; ++ ++&vec { ++ status = "disabled"; ++}; ++ ++// ============================================= ++// Downstream rpi- changes ++ ++#define BCM2711 ++ ++#include "bcm270x.dtsi" ++#include "bcm271x-rpi-bt.dtsi" ++ ++/ { ++ soc { ++ /delete-node/ pixelvalve@7e807000; ++ /delete-node/ hdmi@7e902000; ++ }; ++}; ++ ++#include "bcm2711-rpi-ds.dtsi" ++#include "bcm283x-rpi-csi0-2lane.dtsi" ++#include "bcm283x-rpi-csi1-4lane.dtsi" ++#include "bcm283x-rpi-i2c0mux_0_44.dtsi" ++ ++/ { ++ chosen { ++ bootargs = "coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1"; ++ }; ++ ++ aliases { ++ serial0 = &uart1; ++ serial1 = &uart0; ++ mmc0 = &emmc2; ++ mmc1 = &mmcnr; ++ mmc2 = &sdhost; ++ i2c3 = &i2c3; ++ i2c4 = &i2c4; ++ i2c5 = &i2c5; ++ i2c6 = &i2c6; ++ i2c20 = &ddc0; ++ i2c21 = &ddc1; ++ spi3 = &spi3; ++ spi4 = &spi4; ++ spi5 = &spi5; ++ spi6 = &spi6; ++ /delete-property/ intc; ++ }; ++ ++ /delete-node/ wifi-pwrseq; ++}; ++ ++&mmcnr { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&sdio_pins>; ++ bus-width = <4>; ++ status = "okay"; ++}; ++ ++&uart0 { ++ pinctrl-0 = <&uart0_pins &bt_pins>; ++ status = "okay"; ++}; ++ ++&uart1 { ++ pinctrl-0 = <&uart1_pins>; ++}; ++ ++&spi0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&spi0_pins &spi0_cs_pins>; ++ cs-gpios = <&gpio 8 1>, <&gpio 7 1>; ++ ++ spidev0: spidev@0{ ++ compatible = "spidev"; ++ reg = <0>; /* CE0 */ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ spi-max-frequency = <125000000>; ++ }; ++ ++ spidev1: spidev@1{ ++ compatible = "spidev"; ++ reg = <1>; /* CE1 */ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ spi-max-frequency = <125000000>; ++ }; ++}; ++ ++&gpio { ++ spi0_pins: spi0_pins { ++ brcm,pins = <9 10 11>; ++ brcm,function = ; ++ }; ++ ++ spi0_cs_pins: spi0_cs_pins { ++ brcm,pins = <8 7>; ++ brcm,function = ; ++ }; ++ ++ spi3_pins: spi3_pins { ++ brcm,pins = <1 2 3>; ++ brcm,function = ; ++ }; ++ ++ spi3_cs_pins: spi3_cs_pins { ++ brcm,pins = <0 24>; ++ brcm,function = ; ++ }; ++ ++ spi4_pins: spi4_pins { ++ brcm,pins = <5 6 7>; ++ brcm,function = ; ++ }; ++ ++ spi4_cs_pins: spi4_cs_pins { ++ brcm,pins = <4 25>; ++ brcm,function = ; ++ }; ++ ++ spi5_pins: spi5_pins { ++ brcm,pins = <13 14 15>; ++ brcm,function = ; ++ }; ++ ++ spi5_cs_pins: spi5_cs_pins { ++ brcm,pins = <12 26>; ++ brcm,function = ; ++ }; ++ ++ spi6_pins: spi6_pins { ++ brcm,pins = <19 20 21>; ++ brcm,function = ; ++ }; ++ ++ spi6_cs_pins: spi6_cs_pins { ++ brcm,pins = <18 27>; ++ brcm,function = ; ++ }; ++ ++ i2c0_pins: i2c0 { ++ brcm,pins = <0 1>; ++ brcm,function = ; ++ brcm,pull = ; ++ }; ++ ++ i2c1_pins: i2c1 { ++ brcm,pins = <2 3>; ++ brcm,function = ; ++ brcm,pull = ; ++ }; ++ ++ i2c3_pins: i2c3 { ++ brcm,pins = <4 5>; ++ brcm,function = ; ++ brcm,pull = ; ++ }; ++ ++ i2c4_pins: i2c4 { ++ brcm,pins = <8 9>; ++ brcm,function = ; ++ brcm,pull = ; ++ }; ++ ++ i2c5_pins: i2c5 { ++ brcm,pins = <12 13>; ++ brcm,function = ; ++ brcm,pull = ; ++ }; ++ ++ i2c6_pins: i2c6 { ++ brcm,pins = <22 23>; ++ brcm,function = ; ++ brcm,pull = ; ++ }; ++ ++ i2s_pins: i2s { ++ brcm,pins = <18 19 20 21>; ++ brcm,function = ; ++ }; ++ ++ sdio_pins: sdio_pins { ++ brcm,pins = <34 35 36 37 38 39>; ++ brcm,function = ; // alt3 = SD1 ++ brcm,pull = <0 2 2 2 2 2>; ++ }; ++ ++ bt_pins: bt_pins { ++ brcm,pins = "-"; // non-empty to keep btuart happy, //4 = 0 ++ // to fool pinctrl ++ brcm,function = <0>; ++ brcm,pull = <2>; ++ }; ++ ++ uart0_pins: uart0_pins { ++ brcm,pins = <32 33>; ++ brcm,function = ; ++ brcm,pull = <0 2>; ++ }; ++ ++ uart1_pins: uart1_pins { ++ brcm,pins; ++ brcm,function; ++ brcm,pull; ++ }; ++ ++ uart2_pins: uart2_pins { ++ brcm,pins = <0 1>; ++ brcm,function = ; ++ brcm,pull = <0 2>; ++ }; ++ ++ uart3_pins: uart3_pins { ++ brcm,pins = <4 5>; ++ brcm,function = ; ++ brcm,pull = <0 2>; ++ }; ++ ++ uart4_pins: uart4_pins { ++ brcm,pins = <8 9>; ++ brcm,function = ; ++ brcm,pull = <0 2>; ++ }; ++ ++ uart5_pins: uart5_pins { ++ brcm,pins = <12 13>; ++ brcm,function = ; ++ brcm,pull = <0 2>; ++ }; ++}; ++ ++&i2c0if { ++ clock-frequency = <100000>; ++}; ++ ++&i2c1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c1_pins>; ++ clock-frequency = <100000>; ++}; ++ ++&i2s { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2s_pins>; ++}; ++ ++// ============================================= ++// Board specific stuff here ++ ++&pcie0 { ++ brcm,enable-l1ss; ++}; ++ ++&sdhost { ++ status = "disabled"; ++}; ++ ++&phy1 { ++ led-modes = <0x00 0x08>; /* link/activity link */ ++}; ++ ++&gpio { ++ audio_pins: audio_pins { ++ brcm,pins = <>; ++ brcm,function = <>; ++ }; ++}; ++ ++&leds { ++ act_led: led-act { ++ label = "led0"; ++ linux,default-trigger = "mmc0"; ++ gpios = <&gpio 42 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ pwr_led: led-pwr { ++ label = "led1"; ++ linux,default-trigger = "default-on"; ++ gpios = <&expgpio 2 GPIO_ACTIVE_LOW>; ++ }; ++}; ++ ++&pwm1 { ++ status = "disabled"; ++}; ++ ++&audio { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&audio_pins>; ++ brcm,disable-headphones = <1>; ++}; ++ ++cam0_reg: &cam1_reg { ++ gpio = <&expgpio 5 GPIO_ACTIVE_HIGH>; ++}; ++ ++/ { ++ __overrides__ { ++ act_led_gpio = <&act_led>,"gpios:4"; ++ act_led_activelow = <&act_led>,"gpios:8"; ++ act_led_trigger = <&act_led>,"linux,default-trigger"; ++ ++ pwr_led_gpio = <&pwr_led>,"gpios:4"; ++ pwr_led_activelow = <&pwr_led>,"gpios:8"; ++ pwr_led_trigger = <&pwr_led>,"linux,default-trigger"; ++ ++ eth_led0 = <&phy1>,"led-modes:0"; ++ eth_led1 = <&phy1>,"led-modes:4"; ++ ++ ant1 = <&ant1>,"output-high?=on", ++ <&ant1>, "output-low?=off", ++ <&ant2>, "output-high?=off", ++ <&ant2>, "output-low?=on"; ++ ant2 = <&ant1>,"output-high?=off", ++ <&ant1>, "output-low?=on", ++ <&ant2>, "output-high?=on", ++ <&ant2>, "output-low?=off"; ++ noant = <&ant1>,"output-high?=off", ++ <&ant1>, "output-low?=on", ++ <&ant2>, "output-high?=off", ++ <&ant2>, "output-low?=on"; ++ ++ sd_poll_once = <&emmc2>, "non-removable?"; ++ spi_dma4 = <&spi0>, "dmas:0=", <&dma40>, ++ <&spi0>, "dmas:8=", <&dma40>; ++ }; ++}; +diff --git a/arch/arm64/boot/dts/broadcom/Makefile b/arch/arm64/boot/dts/broadcom/Makefile +index 9873335d0ed2..8c19b62e189e 100644 +--- a/arch/arm64/boot/dts/broadcom/Makefile ++++ b/arch/arm64/boot/dts/broadcom/Makefile +@@ -15,6 +15,7 @@ dtb-$(CONFIG_ARCH_BCM2835) += bcm2711-rpi-400.dtb + dtb-$(CONFIG_ARCH_BCM2835) += bcm2710-rpi-cm3.dtb + dtb-$(CONFIG_ARCH_BCM2835) += bcm2711-rpi-cm4.dtb + dtb-$(CONFIG_ARCH_BCM2835) += bcm2711-rpi-cm4s.dtb ++dtb-$(CONFIG_ARCH_BCM2835) += bcm2711-rpi-cm4-ha-yellow.dtb + + subdir-y += bcm4908 + subdir-y += northstar2 +diff --git a/arch/arm64/boot/dts/broadcom/bcm2711-rpi-cm4-ha-yellow.dts b/arch/arm64/boot/dts/broadcom/bcm2711-rpi-cm4-ha-yellow.dts +new file mode 100644 +index 000000000000..fdc5ec5bc956 +--- /dev/null ++++ b/arch/arm64/boot/dts/broadcom/bcm2711-rpi-cm4-ha-yellow.dts +@@ -0,0 +1 @@ ++#include "../../../../arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts" +-- +2.37.3 + diff --git a/host-portage/patches/sys-kernel/raspberrypi-sources/0001-ARM-dts-bcm2711-Add-device-tree-for-Home-Assistant-Y.patch2 b/host-portage/patches/sys-kernel/raspberrypi-sources/0001-ARM-dts-bcm2711-Add-device-tree-for-Home-Assistant-Y.patch2 new file mode 100644 index 0000000..05ca786 --- /dev/null +++ b/host-portage/patches/sys-kernel/raspberrypi-sources/0001-ARM-dts-bcm2711-Add-device-tree-for-Home-Assistant-Y.patch2 @@ -0,0 +1,656 @@ +From b28a8f5b591841f88f19cbf9850d713a602d912e Mon Sep 17 00:00:00 2001 +Message-Id: +From: Stefan Agner +Date: Mon, 11 Apr 2022 14:47:59 +0200 +Subject: [PATCH] ARM: dts: bcm2711: Add device tree for Home Assistant Yellow + +Add device tree for Home Assistant Yellow, a Compute Module 4 based I/O +board. + +Signed-off-by: Stefan Agner +--- + arch/arm/boot/dts/Makefile | 3 +- + .../boot/dts/bcm2711-rpi-cm4-ha-yellow.dts | 598 ++++++++++++++++++ + arch/arm64/boot/dts/broadcom/Makefile | 1 + + .../broadcom/bcm2711-rpi-cm4-ha-yellow.dts | 1 + + 4 files changed, 602 insertions(+), 1 deletion(-) + create mode 100644 arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts + create mode 100644 arch/arm64/boot/dts/broadcom/bcm2711-rpi-cm4-ha-yellow.dts + +diff -ruN a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile +--- a/arch/arm/boot/dts/Makefile 2023-02-09 15:33:00.362946319 -0000 ++++ b/arch/arm/boot/dts/Makefile 2023-02-09 15:35:14.619413829 -0000 +@@ -93,7 +93,8 @@ + bcm2711-rpi-400.dtb \ + bcm2711-rpi-4-b.dtb \ + bcm2835-rpi-zero.dtb \ +- bcm2835-rpi-zero-w.dtb ++ bcm2835-rpi-zero-w.dtb \ ++ bcm2711-rpi-cm4-ha-yellow.dtb + dtb-$(CONFIG_ARCH_BCM_5301X) += \ + bcm4708-asus-rt-ac56u.dtb \ + bcm4708-asus-rt-ac68u.dtb \ +diff --git a/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts b/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts +new file mode 100644 +index 000000000000..61d8c81d3de4 +--- /dev/null ++++ b/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts +@@ -0,0 +1,598 @@ ++// SPDX-License-Identifier: GPL-2.0 ++/dts-v1/; ++#include "bcm2711.dtsi" ++#include "bcm2711-rpi.dtsi" ++//#include "bcm283x-rpi-usb-peripheral.dtsi" ++ ++/ { ++ compatible = "raspberrypi,4-compute-module-ha-yellow", "raspberrypi,4-compute-module", "brcm,bcm2711"; ++ model = "Raspberry Pi Compute Module 4 on Home Assistant Yellow"; ++ ++ chosen { ++ /* 8250 auxiliary UART instead of pl011 */ ++ stdout-path = "serial1:115200n8"; ++ }; ++ ++ leds { ++ led-act { ++ gpios = <&gpio 42 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ led-pwr { ++ label = "PWR"; ++ gpios = <&expgpio 2 GPIO_ACTIVE_LOW>; ++ default-state = "keep"; ++ linux,default-trigger = "default-on"; ++ }; ++ }; ++ ++ wifi_pwrseq: wifi-pwrseq { ++ compatible = "mmc-pwrseq-simple"; ++ reset-gpios = <&expgpio 1 GPIO_ACTIVE_LOW>; ++ }; ++ ++ sd_io_1v8_reg: sd_io_1v8_reg { ++ compatible = "regulator-gpio"; ++ regulator-name = "vdd-sd-io"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-boot-on; ++ regulator-always-on; ++ regulator-settling-time-us = <5000>; ++ gpios = <&expgpio 4 GPIO_ACTIVE_HIGH>; ++ states = <1800000 0x1>, ++ <3300000 0x0>; ++ status = "okay"; ++ }; ++ ++ sd_vcc_reg: sd_vcc_reg { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc-sd"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-boot-on; ++ enable-active-high; ++ gpio = <&expgpio 6 GPIO_ACTIVE_HIGH>; ++ }; ++}; ++ ++&ddc0 { ++ status = "okay"; ++}; ++ ++&ddc1 { ++ status = "okay"; ++}; ++ ++&expgpio { ++ gpio-line-names = "BT_ON", ++ "WL_ON", ++ "PWR_LED_OFF", ++ "ANT1", ++ "VDD_SD_IO_SEL", ++ "CAM_GPIO", ++ "SD_PWR_ON", ++ "ANT2"; ++ ++ ant1: ant1 { ++ gpio-hog; ++ gpios = <3 GPIO_ACTIVE_HIGH>; ++ output-high; ++ }; ++ ++ ant2: ant2 { ++ gpio-hog; ++ gpios = <7 GPIO_ACTIVE_HIGH>; ++ output-low; ++ }; ++}; ++ ++&gpio { ++ /* ++ * Parts taken from rpi_SCH_4b_4p0_reduced.pdf and ++ * the official GPU firmware DT blob. ++ * ++ * Legend: ++ * "FOO" = GPIO line named "FOO" on the schematic ++ * "FOO_N" = GPIO line named "FOO" on schematic, active low ++ */ ++ gpio-line-names = "ID_SDA", ++ "ID_SCL", ++ "SDA1", ++ "SCL1", ++ "GPIO_GCLK", ++ "GPIO5", ++ "GPIO6", ++ "SPI_CE1_N", ++ "SPI_CE0_N", ++ "SPI_MISO", ++ "SPI_MOSI", ++ "SPI_SCLK", ++ "GPIO12", ++ "GPIO13", ++ /* Serial port */ ++ "TXD1", ++ "RXD1", ++ "GPIO16", ++ "GPIO17", ++ "GPIO18", ++ "GPIO19", ++ "GPIO20", ++ "GPIO21", ++ "GPIO22", ++ "GPIO23", ++ "GPIO24", ++ "GPIO25", ++ "GPIO26", ++ "GPIO27", ++ "RGMII_MDIO", ++ "RGMIO_MDC", ++ /* Used by BT module */ ++ "CTS0", ++ "RTS0", ++ "TXD0", ++ "RXD0", ++ /* Used by Wifi */ ++ "SD1_CLK", ++ "SD1_CMD", ++ "SD1_DATA0", ++ "SD1_DATA1", ++ "SD1_DATA2", ++ "SD1_DATA3", ++ /* Shared with SPI flash */ ++ "PWM0_MISO", ++ "PWM1_MOSI", ++ "STATUS_LED_G_CLK", ++ "SPIFLASH_CE_N", ++ "SDA0", ++ "SCL0", ++ "RGMII_RXCLK", ++ "RGMII_RXCTL", ++ "RGMII_RXD0", ++ "RGMII_RXD1", ++ "RGMII_RXD2", ++ "RGMII_RXD3", ++ "RGMII_TXCLK", ++ "RGMII_TXCTL", ++ "RGMII_TXD0", ++ "RGMII_TXD1", ++ "RGMII_TXD2", ++ "RGMII_TXD3"; ++}; ++ ++&hdmi0 { ++ status = "okay"; ++}; ++ ++&hdmi1 { ++ status = "okay"; ++}; ++ ++&pixelvalve0 { ++ status = "okay"; ++}; ++ ++&pixelvalve1 { ++ status = "okay"; ++}; ++ ++&pixelvalve2 { ++ status = "okay"; ++}; ++ ++&pixelvalve4 { ++ status = "okay"; ++}; ++ ++&pwm1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pwm1_0_gpio40 &pwm1_1_gpio41>; ++ status = "okay"; ++}; ++ ++/* SDHCI is used to control the SDIO for wireless */ ++&sdhci { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&emmc_gpio34>; ++ bus-width = <4>; ++ non-removable; ++ mmc-pwrseq = <&wifi_pwrseq>; ++ status = "okay"; ++ ++ brcmf: wifi@1 { ++ reg = <1>; ++ compatible = "brcm,bcm4329-fmac"; ++ }; ++}; ++ ++/* EMMC2 is used to drive the EMMC card */ ++&emmc2 { ++ bus-width = <8>; ++ vqmmc-supply = <&sd_io_1v8_reg>; ++ vmmc-supply = <&sd_vcc_reg>; ++ broken-cd; ++ status = "okay"; ++}; ++ ++&genet { ++ phy-handle = <&phy1>; ++ phy-mode = "rgmii-rxid"; ++ status = "okay"; ++}; ++ ++&genet_mdio { ++ phy1: ethernet-phy@0 { ++ /* No PHY interrupt */ ++ reg = <0x0>; ++ }; ++}; ++ ++&pcie0 { ++ pci@0,0 { ++ device-type = "pci"; ++ #address-cells = <3>; ++ #size-cells = <2>; ++ ranges; ++ ++ reg = <0 0 0 0 0>; ++ }; ++}; ++ ++/* uart0 communicates with the BT module */ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_ctsrts_gpio30 &uart0_gpio32>; ++ uart-has-rtscts; ++ status = "okay"; ++ ++ bluetooth { ++ compatible = "brcm,bcm43438-bt"; ++ max-speed = <2000000>; ++ shutdown-gpios = <&expgpio 0 GPIO_ACTIVE_HIGH>; ++ }; ++}; ++ ++/* uart1 is mapped to the pin header */ ++&uart1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart1_gpio14>; ++ status = "okay"; ++}; ++ ++&vchiq { ++ interrupts = ; ++}; ++ ++&vc4 { ++ status = "okay"; ++}; ++ ++&vec { ++ status = "disabled"; ++}; ++ ++// ============================================= ++// Downstream rpi- changes ++ ++#define BCM2711 ++ ++#include "bcm270x.dtsi" ++#include "bcm271x-rpi-bt.dtsi" ++ ++/ { ++ soc { ++ /delete-node/ pixelvalve@7e807000; ++ /delete-node/ hdmi@7e902000; ++ }; ++}; ++ ++#include "bcm2711-rpi-ds.dtsi" ++#include "bcm283x-rpi-csi0-2lane.dtsi" ++#include "bcm283x-rpi-csi1-4lane.dtsi" ++#include "bcm283x-rpi-i2c0mux_0_44.dtsi" ++ ++/ { ++ chosen { ++ bootargs = "coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1"; ++ }; ++ ++ aliases { ++ serial0 = &uart1; ++ serial1 = &uart0; ++ mmc0 = &emmc2; ++ mmc1 = &mmcnr; ++ mmc2 = &sdhost; ++ i2c3 = &i2c3; ++ i2c4 = &i2c4; ++ i2c5 = &i2c5; ++ i2c6 = &i2c6; ++ i2c20 = &ddc0; ++ i2c21 = &ddc1; ++ spi3 = &spi3; ++ spi4 = &spi4; ++ spi5 = &spi5; ++ spi6 = &spi6; ++ /delete-property/ intc; ++ }; ++ ++ /delete-node/ wifi-pwrseq; ++}; ++ ++&mmcnr { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&sdio_pins>; ++ bus-width = <4>; ++ status = "okay"; ++}; ++ ++&uart0 { ++ pinctrl-0 = <&uart0_pins &bt_pins>; ++ status = "okay"; ++}; ++ ++&uart1 { ++ pinctrl-0 = <&uart1_pins>; ++}; ++ ++&spi0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&spi0_pins &spi0_cs_pins>; ++ cs-gpios = <&gpio 8 1>, <&gpio 7 1>; ++ ++ spidev0: spidev@0{ ++ compatible = "spidev"; ++ reg = <0>; /* CE0 */ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ spi-max-frequency = <125000000>; ++ }; ++ ++ spidev1: spidev@1{ ++ compatible = "spidev"; ++ reg = <1>; /* CE1 */ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ spi-max-frequency = <125000000>; ++ }; ++}; ++ ++&gpio { ++ spi0_pins: spi0_pins { ++ brcm,pins = <9 10 11>; ++ brcm,function = ; ++ }; ++ ++ spi0_cs_pins: spi0_cs_pins { ++ brcm,pins = <8 7>; ++ brcm,function = ; ++ }; ++ ++ spi3_pins: spi3_pins { ++ brcm,pins = <1 2 3>; ++ brcm,function = ; ++ }; ++ ++ spi3_cs_pins: spi3_cs_pins { ++ brcm,pins = <0 24>; ++ brcm,function = ; ++ }; ++ ++ spi4_pins: spi4_pins { ++ brcm,pins = <5 6 7>; ++ brcm,function = ; ++ }; ++ ++ spi4_cs_pins: spi4_cs_pins { ++ brcm,pins = <4 25>; ++ brcm,function = ; ++ }; ++ ++ spi5_pins: spi5_pins { ++ brcm,pins = <13 14 15>; ++ brcm,function = ; ++ }; ++ ++ spi5_cs_pins: spi5_cs_pins { ++ brcm,pins = <12 26>; ++ brcm,function = ; ++ }; ++ ++ spi6_pins: spi6_pins { ++ brcm,pins = <19 20 21>; ++ brcm,function = ; ++ }; ++ ++ spi6_cs_pins: spi6_cs_pins { ++ brcm,pins = <18 27>; ++ brcm,function = ; ++ }; ++ ++ i2c0_pins: i2c0 { ++ brcm,pins = <0 1>; ++ brcm,function = ; ++ brcm,pull = ; ++ }; ++ ++ i2c1_pins: i2c1 { ++ brcm,pins = <2 3>; ++ brcm,function = ; ++ brcm,pull = ; ++ }; ++ ++ i2c3_pins: i2c3 { ++ brcm,pins = <4 5>; ++ brcm,function = ; ++ brcm,pull = ; ++ }; ++ ++ i2c4_pins: i2c4 { ++ brcm,pins = <8 9>; ++ brcm,function = ; ++ brcm,pull = ; ++ }; ++ ++ i2c5_pins: i2c5 { ++ brcm,pins = <12 13>; ++ brcm,function = ; ++ brcm,pull = ; ++ }; ++ ++ i2c6_pins: i2c6 { ++ brcm,pins = <22 23>; ++ brcm,function = ; ++ brcm,pull = ; ++ }; ++ ++ i2s_pins: i2s { ++ brcm,pins = <18 19 20 21>; ++ brcm,function = ; ++ }; ++ ++ sdio_pins: sdio_pins { ++ brcm,pins = <34 35 36 37 38 39>; ++ brcm,function = ; // alt3 = SD1 ++ brcm,pull = <0 2 2 2 2 2>; ++ }; ++ ++ bt_pins: bt_pins { ++ brcm,pins = "-"; // non-empty to keep btuart happy, //4 = 0 ++ // to fool pinctrl ++ brcm,function = <0>; ++ brcm,pull = <2>; ++ }; ++ ++ uart0_pins: uart0_pins { ++ brcm,pins = <32 33>; ++ brcm,function = ; ++ brcm,pull = <0 2>; ++ }; ++ ++ uart1_pins: uart1_pins { ++ brcm,pins; ++ brcm,function; ++ brcm,pull; ++ }; ++ ++ uart2_pins: uart2_pins { ++ brcm,pins = <0 1>; ++ brcm,function = ; ++ brcm,pull = <0 2>; ++ }; ++ ++ uart3_pins: uart3_pins { ++ brcm,pins = <4 5>; ++ brcm,function = ; ++ brcm,pull = <0 2>; ++ }; ++ ++ uart4_pins: uart4_pins { ++ brcm,pins = <8 9>; ++ brcm,function = ; ++ brcm,pull = <0 2>; ++ }; ++ ++ uart5_pins: uart5_pins { ++ brcm,pins = <12 13>; ++ brcm,function = ; ++ brcm,pull = <0 2>; ++ }; ++}; ++ ++&i2c0if { ++ clock-frequency = <100000>; ++}; ++ ++&i2c1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c1_pins>; ++ clock-frequency = <100000>; ++}; ++ ++&i2s { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2s_pins>; ++}; ++ ++// ============================================= ++// Board specific stuff here ++ ++&pcie0 { ++ brcm,enable-l1ss; ++}; ++ ++&sdhost { ++ status = "disabled"; ++}; ++ ++&phy1 { ++ led-modes = <0x00 0x08>; /* link/activity link */ ++}; ++ ++&gpio { ++ audio_pins: audio_pins { ++ brcm,pins = <>; ++ brcm,function = <>; ++ }; ++}; ++ ++&leds { ++ act_led: led-act { ++ label = "led0"; ++ linux,default-trigger = "mmc0"; ++ gpios = <&gpio 42 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ pwr_led: led-pwr { ++ label = "led1"; ++ linux,default-trigger = "default-on"; ++ gpios = <&expgpio 2 GPIO_ACTIVE_LOW>; ++ }; ++}; ++ ++&pwm1 { ++ status = "disabled"; ++}; ++ ++&audio { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&audio_pins>; ++ brcm,disable-headphones = <1>; ++}; ++ ++cam0_reg: &cam1_reg { ++ gpio = <&expgpio 5 GPIO_ACTIVE_HIGH>; ++}; ++ ++/ { ++ __overrides__ { ++ act_led_gpio = <&act_led>,"gpios:4"; ++ act_led_activelow = <&act_led>,"gpios:8"; ++ act_led_trigger = <&act_led>,"linux,default-trigger"; ++ ++ pwr_led_gpio = <&pwr_led>,"gpios:4"; ++ pwr_led_activelow = <&pwr_led>,"gpios:8"; ++ pwr_led_trigger = <&pwr_led>,"linux,default-trigger"; ++ ++ eth_led0 = <&phy1>,"led-modes:0"; ++ eth_led1 = <&phy1>,"led-modes:4"; ++ ++ ant1 = <&ant1>,"output-high?=on", ++ <&ant1>, "output-low?=off", ++ <&ant2>, "output-high?=off", ++ <&ant2>, "output-low?=on"; ++ ant2 = <&ant1>,"output-high?=off", ++ <&ant1>, "output-low?=on", ++ <&ant2>, "output-high?=on", ++ <&ant2>, "output-low?=off"; ++ noant = <&ant1>,"output-high?=off", ++ <&ant1>, "output-low?=on", ++ <&ant2>, "output-high?=off", ++ <&ant2>, "output-low?=on"; ++ ++ sd_poll_once = <&emmc2>, "non-removable?"; ++ spi_dma4 = <&spi0>, "dmas:0=", <&dma40>, ++ <&spi0>, "dmas:8=", <&dma40>; ++ }; ++}; +diff --git a/arch/arm64/boot/dts/broadcom/bcm2711-rpi-cm4-ha-yellow.dts b/arch/arm64/boot/dts/broadcom/bcm2711-rpi-cm4-ha-yellow.dts +new file mode 100644 +index 000000000000..fdc5ec5bc956 +--- /dev/null ++++ b/arch/arm64/boot/dts/broadcom/bcm2711-rpi-cm4-ha-yellow.dts +@@ -0,0 +1 @@ ++#include "../../../../arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts" +-- +2.37.3 +diff -ruN a/arch/arm64/boot/dts/broadcom/Makefile b/arch/arm64/boot/dts/broadcom/Makefile +--- a/arch/arm64/boot/dts/broadcom/Makefile 2023-02-09 16:15:32.939847341 -0000 ++++ b/arch/arm64/boot/dts/broadcom/Makefile 2023-02-09 16:16:03.899185742 -0000 +@@ -2,6 +2,7 @@ + dtb-$(CONFIG_ARCH_BCM2835) += bcm2711-rpi-400.dtb \ + bcm2711-rpi-4-b.dtb \ + bcm2711-rpi-cm4-io.dtb \ ++ bcm2711-rpi-cm4-ha-yellow.dtb \ + bcm2837-rpi-3-a-plus.dtb \ + bcm2837-rpi-3-b.dtb \ + bcm2837-rpi-3-b-plus.dtb \ diff --git a/host-portage/patches/sys-kernel/raspberrypi-sources/0001-ARM-dts-bcm283x-add-compatible-picked-up-by-U-Boot.patch b/host-portage/patches/sys-kernel/raspberrypi-sources/0001-ARM-dts-bcm283x-add-compatible-picked-up-by-U-Boot.patch new file mode 100644 index 0000000..6b3a27f --- /dev/null +++ b/host-portage/patches/sys-kernel/raspberrypi-sources/0001-ARM-dts-bcm283x-add-compatible-picked-up-by-U-Boot.patch @@ -0,0 +1,74 @@ +From 2230740c7f74678ca80da55f74ccc24f5aa6bd35 Mon Sep 17 00:00:00 2001 +Message-Id: <2230740c7f74678ca80da55f74ccc24f5aa6bd35.1614676528.git.stefan@agner.ch> +From: Pascal Vizeli +Date: Tue, 2 Jun 2020 21:20:08 +0000 +Subject: [PATCH] ARM: dts: bcm283x: add compatible picked up by U-Boot + +Without brcm,bcm2835-pl011 in compatible U-Boot uses the regular PL011 +driver which seems to crash when enable_uart=1 is not used. Using +brcm,bcm2835-pl011 works around that and does not affect Linux since its +not using that compatible string. + +Signed-off-by: Pascal Vizeli +Signed-off-by: Stefan Agner +--- + arch/arm/boot/dts/bcm2711.dtsi | 8 ++++---- + arch/arm/boot/dts/bcm283x.dtsi | 2 +- + 2 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/arch/arm/boot/dts/bcm2711.dtsi b/arch/arm/boot/dts/bcm2711.dtsi +index b4bca5af95e1..c31b87b5bb3a 100644 +--- a/arch/arm/boot/dts/bcm2711.dtsi ++++ b/arch/arm/boot/dts/bcm2711.dtsi +@@ -127,7 +127,7 @@ rng@7e104000 { + }; + + uart2: serial@7e201400 { +- compatible = "arm,pl011", "arm,primecell"; ++ compatible = "brcm,bcm2835-pl011", "arm,pl011", "arm,primecell"; + reg = <0x7e201400 0x200>; + interrupts = ; + clocks = <&clocks BCM2835_CLOCK_UART>, +@@ -138,7 +138,7 @@ uart2: serial@7e201400 { + }; + + uart3: serial@7e201600 { +- compatible = "arm,pl011", "arm,primecell"; ++ compatible = "brcm,bcm2835-pl011", "arm,pl011", "arm,primecell"; + reg = <0x7e201600 0x200>; + interrupts = ; + clocks = <&clocks BCM2835_CLOCK_UART>, +@@ -149,7 +149,7 @@ uart3: serial@7e201600 { + }; + + uart4: serial@7e201800 { +- compatible = "arm,pl011", "arm,primecell"; ++ compatible = "brcm,bcm2835-pl011", "arm,pl011", "arm,primecell"; + reg = <0x7e201800 0x200>; + interrupts = ; + clocks = <&clocks BCM2835_CLOCK_UART>, +@@ -160,7 +160,7 @@ uart4: serial@7e201800 { + }; + + uart5: serial@7e201a00 { +- compatible = "arm,pl011", "arm,primecell"; ++ compatible = "brcm,bcm2835-pl011", "arm,pl011", "arm,primecell"; + reg = <0x7e201a00 0x200>; + interrupts = ; + clocks = <&clocks BCM2835_CLOCK_UART>, +diff --git a/arch/arm/boot/dts/bcm283x.dtsi b/arch/arm/boot/dts/bcm283x.dtsi +index 346838ee9d21..7f289fbca28c 100644 +--- a/arch/arm/boot/dts/bcm283x.dtsi ++++ b/arch/arm/boot/dts/bcm283x.dtsi +@@ -300,7 +300,7 @@ uart1_ctsrts_gpio42: uart1_ctsrts_gpio42 { + }; + + uart0: serial@7e201000 { +- compatible = "arm,pl011", "arm,primecell"; ++ compatible = "brcm,bcm2835-pl011", "arm,pl011", "arm,primecell"; + reg = <0x7e201000 0x200>; + interrupts = <2 25>; + clocks = <&clocks BCM2835_CLOCK_UART>, +-- +2.30.1 + diff --git a/host-portage/patches/sys-kernel/raspberrypi-sources/0002-ARM-dts-bcm2711-yellow-Mux-UART4-for-SiLabs-radio-mo.patch b/host-portage/patches/sys-kernel/raspberrypi-sources/0002-ARM-dts-bcm2711-yellow-Mux-UART4-for-SiLabs-radio-mo.patch new file mode 100644 index 0000000..2609019 --- /dev/null +++ b/host-portage/patches/sys-kernel/raspberrypi-sources/0002-ARM-dts-bcm2711-yellow-Mux-UART4-for-SiLabs-radio-mo.patch @@ -0,0 +1,60 @@ +From 7eb647452bb1a3294fae8edc5a323070adff922b Mon Sep 17 00:00:00 2001 +Message-Id: <7eb647452bb1a3294fae8edc5a323070adff922b.1662565903.git.stefan@agner.ch> +In-Reply-To: +References: +From: Stefan Agner +Date: Thu, 4 Mar 2021 14:33:09 +0100 +Subject: [PATCH] ARM: dts: bcm2711: yellow: Mux UART4 for SiLabs radio module + +Enable UART4 by default and mux pins including hardware flow control. + +Signed-off-by: Stefan Agner +--- + arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts | 16 ++++++++++++++-- + 1 file changed, 14 insertions(+), 2 deletions(-) + +diff --git a/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts b/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts +index 61d8c81d3de4..8db71876a78c 100644 +--- a/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts ++++ b/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts +@@ -8,6 +8,10 @@ / { + compatible = "raspberrypi,4-compute-module-ha-yellow", "raspberrypi,4-compute-module", "brcm,bcm2711"; + model = "Raspberry Pi Compute Module 4 on Home Assistant Yellow"; + ++ aliases { ++ serial4 = &uart4; ++ }; ++ + chosen { + /* 8250 auxiliary UART instead of pl011 */ + stdout-path = "serial1:115200n8"; +@@ -261,6 +265,14 @@ &uart1 { + status = "okay"; + }; + ++/* uart4 for Zigbee */ ++&uart4 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart4_pins>; ++ uart-has-rtscts; ++ status = "okay"; ++}; ++ + &vchiq { + interrupts = ; + }; +@@ -488,9 +500,9 @@ uart3_pins: uart3_pins { + }; + + uart4_pins: uart4_pins { +- brcm,pins = <8 9>; ++ brcm,pins = <8 9 10 11>; + brcm,function = ; +- brcm,pull = <0 2>; ++ brcm,pull = <0 2 2 0>; + }; + + uart5_pins: uart5_pins { +-- +2.37.3 + diff --git a/host-portage/patches/sys-kernel/raspberrypi-sources/0003-ARM-dts-bcm2711-yellow-Mux-debug-UART5.patch b/host-portage/patches/sys-kernel/raspberrypi-sources/0003-ARM-dts-bcm2711-yellow-Mux-debug-UART5.patch new file mode 100644 index 0000000..79c4a82 --- /dev/null +++ b/host-portage/patches/sys-kernel/raspberrypi-sources/0003-ARM-dts-bcm2711-yellow-Mux-debug-UART5.patch @@ -0,0 +1,50 @@ +From a7b86d8d0d81f841d8399a83f0f59f383d1556ed Mon Sep 17 00:00:00 2001 +Message-Id: +In-Reply-To: +References: +From: Stefan Agner +Date: Thu, 4 Mar 2021 14:44:23 +0100 +Subject: [PATCH] ARM: dts: bcm2711: yellow: Mux debug UART5 + +Signed-off-by: Stefan Agner +--- + arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts b/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts +index 8db71876a78c..d1dea0a214a6 100644 +--- a/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts ++++ b/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts +@@ -10,6 +10,7 @@ / { + + aliases { + serial4 = &uart4; ++ serial5 = &uart5; + }; + + chosen { +@@ -273,6 +274,13 @@ &uart4 { + status = "okay"; + }; + ++/* uart5 default Debug UART */ ++&uart5 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart5_pins>; ++ status = "okay"; ++}; ++ + &vchiq { + interrupts = ; + }; +@@ -308,6 +316,7 @@ soc { + / { + chosen { + bootargs = "coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1"; ++ stdout-path = "serial5:115200n8"; + }; + + aliases { +-- +2.37.3 + diff --git a/host-portage/patches/sys-kernel/raspberrypi-sources/0004-ARM-dts-bcm2711-yellow-Enable-I2C6-by-default.patch b/host-portage/patches/sys-kernel/raspberrypi-sources/0004-ARM-dts-bcm2711-yellow-Enable-I2C6-by-default.patch new file mode 100644 index 0000000..5e27c4e --- /dev/null +++ b/host-portage/patches/sys-kernel/raspberrypi-sources/0004-ARM-dts-bcm2711-yellow-Enable-I2C6-by-default.patch @@ -0,0 +1,35 @@ +From 8ec364f50abcd9f5fa89f421a7ef8f70dfb2564a Mon Sep 17 00:00:00 2001 +Message-Id: <8ec364f50abcd9f5fa89f421a7ef8f70dfb2564a.1662565903.git.stefan@agner.ch> +In-Reply-To: +References: +From: Stefan Agner +Date: Thu, 4 Mar 2021 14:48:48 +0100 +Subject: [PATCH] ARM: dts: bcm2711: yellow: Enable I2C6 by default + +The main I2C bus used on Yellow is I2C6. Enable it by default. + +Signed-off-by: Stefan Agner +--- + arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts b/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts +index d1dea0a214a6..0bdbfdd44aed 100644 +--- a/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts ++++ b/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts +@@ -531,6 +531,12 @@ &i2c1 { + clock-frequency = <100000>; + }; + ++&i2c6 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c6_pins>; ++ status = "okay"; ++}; ++ + &i2s { + pinctrl-names = "default"; + pinctrl-0 = <&i2s_pins>; +-- +2.37.3 + diff --git a/host-portage/patches/sys-kernel/raspberrypi-sources/0005-ARM-dts-bcm2711-yellow-add-I2S-audio-codec.patch b/host-portage/patches/sys-kernel/raspberrypi-sources/0005-ARM-dts-bcm2711-yellow-add-I2S-audio-codec.patch new file mode 100644 index 0000000..d665248 --- /dev/null +++ b/host-portage/patches/sys-kernel/raspberrypi-sources/0005-ARM-dts-bcm2711-yellow-add-I2S-audio-codec.patch @@ -0,0 +1,67 @@ +From 50abc7980f8c575930cc4c928d356763742e81fb Mon Sep 17 00:00:00 2001 +Message-Id: <50abc7980f8c575930cc4c928d356763742e81fb.1662565903.git.stefan@agner.ch> +In-Reply-To: +References: +From: Stefan Agner +Date: Thu, 4 Mar 2021 17:19:01 +0100 +Subject: [PATCH] ARM: dts: bcm2711: yellow: add I2S audio codec + +Add TI PCM5122 I2S audio codec. + +Signed-off-by: Stefan Agner +--- + .../boot/dts/bcm2711-rpi-cm4-ha-yellow.dts | 26 +++++++++++++++++++ + 1 file changed, 26 insertions(+) + +diff --git a/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts b/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts +index 0bdbfdd44aed..f6f42bf45c92 100644 +--- a/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts ++++ b/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts +@@ -535,11 +535,22 @@ &i2c6 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c6_pins>; + status = "okay"; ++ ++ card_codec: pcm5121@4c { ++ #sound-dai-cells = <0>; ++ compatible = "ti,pcm5121"; ++ reg = <0x4c>; ++ AVDD-supply = <&vdd_3v3_reg>; ++ DVDD-supply = <&vdd_3v3_reg>; ++ CPVDD-supply = <&vdd_3v3_reg>; ++ status = "okay"; ++ }; + }; + + &i2s { + pinctrl-names = "default"; + pinctrl-0 = <&i2s_pins>; ++ status = "okay"; + }; + + // ============================================= +@@ -582,6 +593,21 @@ &pwm1 { + status = "disabled"; + }; + ++&sound { ++ compatible = "simple-audio-card"; ++ simple-audio-card,format = "i2s"; ++ simple-audio-card,name = "pcm5121-sound"; ++ status = "okay"; ++ ++ simple-audio-card,cpu { ++ sound-dai = <&i2s>; ++ }; ++ ++ dailink0_slave: simple-audio-card,codec { ++ sound-dai = <&card_codec>; ++ }; ++}; ++ + &audio { + pinctrl-names = "default"; + pinctrl-0 = <&audio_pins>; +-- +2.37.3 + diff --git a/host-portage/patches/sys-kernel/raspberrypi-sources/0006-ARM-dts-bcm2711-yellow-enable-GPIO-keys.patch b/host-portage/patches/sys-kernel/raspberrypi-sources/0006-ARM-dts-bcm2711-yellow-enable-GPIO-keys.patch new file mode 100644 index 0000000..30fe257 --- /dev/null +++ b/host-portage/patches/sys-kernel/raspberrypi-sources/0006-ARM-dts-bcm2711-yellow-enable-GPIO-keys.patch @@ -0,0 +1,72 @@ +From 67751f4575c3837ada1bdec85184c77ea917b83a Mon Sep 17 00:00:00 2001 +Message-Id: <67751f4575c3837ada1bdec85184c77ea917b83a.1662565903.git.stefan@agner.ch> +In-Reply-To: +References: +From: Stefan Agner +Date: Tue, 9 Mar 2021 15:02:53 +0100 +Subject: [PATCH] ARM: dts: bcm2711: yellow: enable GPIO keys + +Signed-off-by: Stefan Agner +--- + .../boot/dts/bcm2711-rpi-cm4-ha-yellow.dts | 31 +++++++++++++++++++ + 1 file changed, 31 insertions(+) + +diff --git a/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts b/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts +index f6f42bf45c92..e2fa42a11cc9 100644 +--- a/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts ++++ b/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts +@@ -4,6 +4,8 @@ + #include "bcm2711-rpi.dtsi" + //#include "bcm283x-rpi-usb-peripheral.dtsi" + ++#include ++ + / { + compatible = "raspberrypi,4-compute-module-ha-yellow", "raspberrypi,4-compute-module", "brcm,bcm2711"; + model = "Raspberry Pi Compute Module 4 on Home Assistant Yellow"; +@@ -18,6 +20,29 @@ chosen { + stdout-path = "serial1:115200n8"; + }; + ++ keys: gpio-keys { ++ compatible = "gpio-keys"; ++ ++ pinctrl-names = "default"; ++ pinctrl-0 = <&gpio_button_pins>; ++ ++ status = "okay"; ++ ++ power { ++ label = "Blue Button"; ++ linux,code = ; ++ gpios = <&gpio 26 GPIO_ACTIVE_LOW>; ++ debounce-interval = <100>; // ms ++ }; ++ ++ user { ++ label = "Red Button"; ++ linux,code = ; ++ gpios = <&gpio 27 GPIO_ACTIVE_LOW>; ++ debounce-interval = <100>; // ms ++ }; ++ }; ++ + leds { + led-act { + gpios = <&gpio 42 GPIO_ACTIVE_HIGH>; +@@ -380,6 +405,12 @@ spidev1: spidev@1{ + }; + + &gpio { ++ gpio_button_pins: gpio_button_pins { ++ brcm,pins = <26 27>; ++ brcm,function = ; ++ brcm,pull = ; ++ }; ++ + spi0_pins: spi0_pins { + brcm,pins = <9 10 11>; + brcm,function = ; +-- +2.37.3 + diff --git a/host-portage/patches/sys-kernel/raspberrypi-sources/0007-ARM-dts-bcm2711-yellow-add-user-LED.patch b/host-portage/patches/sys-kernel/raspberrypi-sources/0007-ARM-dts-bcm2711-yellow-add-user-LED.patch new file mode 100644 index 0000000..f0c55e5 --- /dev/null +++ b/host-portage/patches/sys-kernel/raspberrypi-sources/0007-ARM-dts-bcm2711-yellow-add-user-LED.patch @@ -0,0 +1,43 @@ +From e4db609b1080e4aabb027394966c07e050e02aab Mon Sep 17 00:00:00 2001 +Message-Id: +In-Reply-To: +References: +From: Stefan Agner +Date: Thu, 28 Oct 2021 19:38:04 +0200 +Subject: [PATCH] ARM: dts: bcm2711: yellow: add user LED + +Add yellow user LED. + +Signed-off-by: Stefan Agner +--- + arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts b/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts +index e2fa42a11cc9..6039c7894796 100644 +--- a/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts ++++ b/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts +@@ -336,7 +336,6 @@ soc { + #include "bcm2711-rpi-ds.dtsi" + #include "bcm283x-rpi-csi0-2lane.dtsi" + #include "bcm283x-rpi-csi1-4lane.dtsi" +-#include "bcm283x-rpi-i2c0mux_0_44.dtsi" + + / { + chosen { +@@ -618,6 +617,12 @@ pwr_led: led-pwr { + linux,default-trigger = "default-on"; + gpios = <&expgpio 2 GPIO_ACTIVE_LOW>; + }; ++ ++ user_led: led-user { ++ label = "led2"; ++ linux,default-trigger = "heartbeat"; ++ gpios = <&gpio 44 GPIO_ACTIVE_LOW>; ++ }; + }; + + &pwm1 { +-- +2.37.3 + diff --git a/host-portage/patches/sys-kernel/raspberrypi-sources/0008-ARM-dts-bcm2711-yellow-add-NXP-PCF85063A-RTC.patch b/host-portage/patches/sys-kernel/raspberrypi-sources/0008-ARM-dts-bcm2711-yellow-add-NXP-PCF85063A-RTC.patch new file mode 100644 index 0000000..bcf3868 --- /dev/null +++ b/host-portage/patches/sys-kernel/raspberrypi-sources/0008-ARM-dts-bcm2711-yellow-add-NXP-PCF85063A-RTC.patch @@ -0,0 +1,32 @@ +From 6625adc479a3e89873127a91064a94881449c0d8 Mon Sep 17 00:00:00 2001 +Message-Id: <6625adc479a3e89873127a91064a94881449c0d8.1662565903.git.stefan@agner.ch> +In-Reply-To: +References: +From: Stefan Agner +Date: Fri, 12 Nov 2021 17:33:32 +0100 +Subject: [PATCH] ARM: dts: bcm2711: yellow: add NXP PCF85063A RTC + +Signed-off-by: Stefan Agner +--- + arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts b/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts +index 6039c7894796..f78428ea64f3 100644 +--- a/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts ++++ b/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts +@@ -575,6 +575,11 @@ card_codec: pcm5121@4c { + CPVDD-supply = <&vdd_3v3_reg>; + status = "okay"; + }; ++ ++ pcf85063a: rtc@51 { ++ compatible = "nxp,pcf85063a"; ++ reg = <0x51>; ++ }; + }; + + &i2s { +-- +2.37.3 + diff --git a/host-portage/patches/sys-kernel/raspberrypi-sources/0009-ARM-dts-bcm2711-yellow-enable-USB-host-mode-by-defau.patch b/host-portage/patches/sys-kernel/raspberrypi-sources/0009-ARM-dts-bcm2711-yellow-enable-USB-host-mode-by-defau.patch new file mode 100644 index 0000000..c54dcf2 --- /dev/null +++ b/host-portage/patches/sys-kernel/raspberrypi-sources/0009-ARM-dts-bcm2711-yellow-enable-USB-host-mode-by-defau.patch @@ -0,0 +1,39 @@ +From 1acd279eca810707856e5038438f52d694a62170 Mon Sep 17 00:00:00 2001 +Message-Id: <1acd279eca810707856e5038438f52d694a62170.1662565903.git.stefan@agner.ch> +In-Reply-To: +References: +From: Stefan Agner +Date: Fri, 7 Jan 2022 17:10:00 +0100 +Subject: [PATCH] ARM: dts: bcm2711: yellow: enable USB host mode by default + +The DWC2 controller is disable by default. Enable it since Home +Assistant Yellow has a USB hub and USB ports connected to it. + +Signed-off-by: Stefan Agner +--- + arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts b/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts +index f78428ea64f3..711a09441ad0 100644 +--- a/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts ++++ b/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts +@@ -599,6 +599,15 @@ &sdhost { + status = "disabled"; + }; + ++&usb { ++ compatible = "brcm,bcm2835-usb"; ++ dr_mode = "host"; ++ g-np-tx-fifo-size = <32>; ++ g-rx-fifo-size = <558>; ++ g-tx-fifo-size = <512 512 512 512 512 256 256>; ++ status = "okay"; ++}; ++ + &phy1 { + led-modes = <0x00 0x08>; /* link/activity link */ + }; +-- +2.37.3 + diff --git a/host-portage/patches/sys-kernel/raspberrypi-sources/0010-ARM-dts-bcm2711-yellow-use-generic-activity-trigger-.patch b/host-portage/patches/sys-kernel/raspberrypi-sources/0010-ARM-dts-bcm2711-yellow-use-generic-activity-trigger-.patch new file mode 100644 index 0000000..5579795 --- /dev/null +++ b/host-portage/patches/sys-kernel/raspberrypi-sources/0010-ARM-dts-bcm2711-yellow-use-generic-activity-trigger-.patch @@ -0,0 +1,33 @@ +From 92332ba4302096777ea47e408f3406da0b2ef2c5 Mon Sep 17 00:00:00 2001 +Message-Id: <92332ba4302096777ea47e408f3406da0b2ef2c5.1662565903.git.stefan@agner.ch> +In-Reply-To: +References: +From: Stefan Agner +Date: Wed, 27 Apr 2022 20:36:19 +0200 +Subject: [PATCH] ARM: dts: bcm2711: yellow: use generic activity trigger for + green LED + +Use the generic trigger "activity" for the green LED so that any +system activity is shown. + +Signed-off-by: Stefan Agner +--- + arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts b/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts +index 711a09441ad0..f2f4f1a49592 100644 +--- a/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts ++++ b/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts +@@ -622,7 +622,7 @@ audio_pins: audio_pins { + &leds { + act_led: led-act { + label = "led0"; +- linux,default-trigger = "mmc0"; ++ linux,default-trigger = "activity"; + gpios = <&gpio 42 GPIO_ACTIVE_HIGH>; + }; + +-- +2.37.3 + diff --git a/host-portage/patches/sys-kernel/raspberrypi-sources/0011-ARM-dts-bcm2711-yellow-use-USB-OTG-mode-by-default.patch b/host-portage/patches/sys-kernel/raspberrypi-sources/0011-ARM-dts-bcm2711-yellow-use-USB-OTG-mode-by-default.patch new file mode 100644 index 0000000..1814d54 --- /dev/null +++ b/host-portage/patches/sys-kernel/raspberrypi-sources/0011-ARM-dts-bcm2711-yellow-use-USB-OTG-mode-by-default.patch @@ -0,0 +1,32 @@ +From 59e44006c1e7406bd1fc52aa9b1fc88a67652ddd Mon Sep 17 00:00:00 2001 +Message-Id: <59e44006c1e7406bd1fc52aa9b1fc88a67652ddd.1662565903.git.stefan@agner.ch> +In-Reply-To: +References: +From: Stefan Agner +Date: Tue, 26 Jul 2022 15:53:59 +0200 +Subject: [PATCH] ARM: dts: bcm2711: yellow: use USB OTG mode by default + +OTG seems to work fine, and allows to use the USB-C port as a USB +peripheral (e.g. in U-Boot via UMS command). + +Signed-off-by: Stefan Agner +--- + arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts b/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts +index f2f4f1a49592..f354bfb69093 100644 +--- a/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts ++++ b/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts +@@ -601,7 +601,7 @@ &sdhost { + + &usb { + compatible = "brcm,bcm2835-usb"; +- dr_mode = "host"; ++ dr_mode = "otg"; + g-np-tx-fifo-size = <32>; + g-rx-fifo-size = <558>; + g-tx-fifo-size = <512 512 512 512 512 256 256>; +-- +2.37.3 + diff --git a/host-portage/patches/sys-kernel/raspberrypi-sources/0012-ARM-dts-bcm2711-yellow-Add-LED-overrides.patch b/host-portage/patches/sys-kernel/raspberrypi-sources/0012-ARM-dts-bcm2711-yellow-Add-LED-overrides.patch new file mode 100644 index 0000000..e38be67 --- /dev/null +++ b/host-portage/patches/sys-kernel/raspberrypi-sources/0012-ARM-dts-bcm2711-yellow-Add-LED-overrides.patch @@ -0,0 +1,68 @@ +From f69ef30ade36371215d02546d603143cc13adef2 Mon Sep 17 00:00:00 2001 +Message-Id: +In-Reply-To: +References: +From: Stefan Agner +Date: Sat, 30 Jul 2022 11:21:31 +0200 +Subject: [PATCH] ARM: dts: bcm2711: yellow: Add LED overrides + +Add device tree overrides for all three LEDs. + +Signed-off-by: Stefan Agner +--- + arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts | 17 ++++++++++------- + 1 file changed, 10 insertions(+), 7 deletions(-) + +diff --git a/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts b/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts +index f354bfb69093..2d272a02128b 100644 +--- a/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts ++++ b/arch/arm/boot/dts/bcm2711-rpi-cm4-ha-yellow.dts +@@ -621,20 +621,24 @@ audio_pins: audio_pins { + + &leds { + act_led: led-act { +- label = "led0"; ++ label = "act"; + linux,default-trigger = "activity"; ++ default-state = "off"; + gpios = <&gpio 42 GPIO_ACTIVE_HIGH>; + }; + + pwr_led: led-pwr { +- label = "led1"; ++ label = "pwr"; + linux,default-trigger = "default-on"; ++ default-state = "off"; + gpios = <&expgpio 2 GPIO_ACTIVE_LOW>; + }; + +- user_led: led-user { +- label = "led2"; ++ usr_led: led-usr { ++ label = "usr"; + linux,default-trigger = "heartbeat"; ++ default-state = "off"; ++ panic-indicator; + gpios = <&gpio 44 GPIO_ACTIVE_LOW>; + }; + }; +@@ -670,14 +674,13 @@ cam0_reg: &cam1_reg { + + / { + __overrides__ { +- act_led_gpio = <&act_led>,"gpios:4"; +- act_led_activelow = <&act_led>,"gpios:8"; + act_led_trigger = <&act_led>,"linux,default-trigger"; + +- pwr_led_gpio = <&pwr_led>,"gpios:4"; + pwr_led_activelow = <&pwr_led>,"gpios:8"; + pwr_led_trigger = <&pwr_led>,"linux,default-trigger"; + ++ usr_led_trigger = <&usr_led>,"linux,default-trigger"; ++ + eth_led0 = <&phy1>,"led-modes:0"; + eth_led1 = <&phy1>,"led-modes:4"; + +-- +2.37.3 + diff --git a/install-update.sh b/install-update.sh new file mode 100755 index 0000000..9bf9b88 --- /dev/null +++ b/install-update.sh @@ -0,0 +1,103 @@ +#!/bin/sh +# vim: set sw=4 ts=4 sts=4 et : + +die() { + rc=$? + if [ $rc -eq 0 ]; then + rc=1 + fi + error "$@" + exit $rc +} + +error() { + printf 'ERROR: ' + info "$@" +} + +get_partuuid() { + blkid -o value -s PARTUUID "$1" +} + +info() { + if [ $# -eq 1 ]; then + echo "$1" >&2 + elif [ $# -gt 1 ]; then + printf "$@" >&2 + fi +} + +set_default_boot() { + _rc=0 + mkdir -p newroot || return + mount -oro "$1" newroot || return + _kernel=$(find newroot/boot -name 'vmlinuz-*' -printf '%P\n' \ + | sort -V \ + | tail -n1 + ) + _kver=${_kernel#vmlinuz-} + _partuuid=$(get_partuuid "$1") + _id=id-${_partuuid}-${_kver} + printf 'Setting default boot entry to %s\n' "${_id}" + grub-editenv /boot/efi/EFI/gentoo/grubenv set "default=${_id}" || rc=$? + umount newroot + return $rc +} + +warn() { + printf 'WARNING: ' + info "$@" +} + +write_firmware() { + _rc=0 + _esp=$(findfs PARTLABEL='EFI System Partition') + if [ -z "${_esp}" ]; then + error 'Could not identify EFI System Partition' + return 1 + fi + if ! mountpoint -q /boot/efi; then + mount -o ro "${_esp}" /boot/efi \ + || warn 'Failed to mount EFI System Partition' + fi + if [ -f /boot/efi/EFI/gentoo/grubenv ]; then + info 'Saving current GRUB environment ...' + cp /boot/efi/EFI/gentoo/grubenv . \ + || warn 'Failed to save GRUB environment' + fi + if mountpoint -q /boot/efi; then + umount /boot/efi || return + fi + info 'Writing firmware image to EFI System Partition (%s) ...\n' "${_esp}" + dd if=firmware.img of="${_esp}" bs=1M || _rc=$? + if [ $_rc -eq 0 ]; then + mount -orw "${_esp}" /boot/efi || rc=$? + fi + if [ $_rc -eq 0 ]; then + if [ -f grubenv ]; then + printf 'Restoring GRUB environment ...\n' + cp grubenv /boot/efi/EFI/gentoo/grubenv || _rc=$? + fi + fi + return $_rc +} + +write_rootfs() { + printf 'Writing rootfs image to %s ...\n' "$1" + dd if=rootfs.squashfs of="$1" bs=1M +} + +rc=0 +newroot="$1" + +write_rootfs "${newroot}" || die 'Failed to write new rootfs image to disk' +write_firmware || die 'Failed to write new firmware image to disk' +if ! set_default_boot "${newroot}"; then + rc=$? + error 'Failed to set default boot option' +fi + +if [ $rc -eq 0 ]; then + info 'Successfully installed update' +fi +exit $rc diff --git a/linux.config b/linux.config new file mode 100644 index 0000000..be13c75 --- /dev/null +++ b/linux.config @@ -0,0 +1,46 @@ +CONFIG_BTRFS_FS=y + +CONFIG_OVERLAY_FS=m + +CONFIG_MISC_FILESYSTEMS=y +CONFIG_SQUASHFS=y +CONFIG_SQUASHFS_XATTR=y +CONFIG_SQUASHFS_ZSTD=y + +CONFIG_EFI=y +CONFIG_EFI_STUB=y + +CONFIG_PCI=y +CONFIG_PCIE_BRCMSTB=y +CONFIG_BLK_DEV_NVME=y + +CONFIG_FW_LOADER_COMPRESS=y + +CONFIG_I2C=y +CONFIG_I2C_CHARDEV=m +CONFIG_I2C_MUX=m +CONFIG_I2C_MUX_GPMUX=m +CONFIG_I2C_MUX_PINCTRL=m +CONFIG_I2C_BCM2708=m +CONFIG_I2C_BCM2835=m +CONFIG_I2C_BRCMSTB=m + +CONFIG_RTC_CLASS=y +CONFIG_RTC_DRV_PCF85063=m + +CONFIG_LEDS_TRIGGERS=y +CONFIG_LEDS_TRIGGER_DISK=y +CONFIG_LEDS_TRIGGER_ACTIVITY=y + +CONFIG_WLAN=y +CONFIG_WLAN_VENDOR_BROADCOM=y +CONFIG_CFG80211=m +CONFIG_MAC80211=m +CONFIG_BRCM_FMAC=m +CONFIG_BT=m + +# CONFIG_KSM is not set + +CONFIG_IPV6=y +CONFIG_IPV6_SIT=m +CONFIG_IPV6_SIT_6RD=m diff --git a/overlay/etc/fstab b/overlay/etc/fstab new file mode 100644 index 0000000..f00e1b5 --- /dev/null +++ b/overlay/etc/fstab @@ -0,0 +1,4 @@ +PARTLABEL=dch-data /var btrfs subvol=var,nosuid,noexec,nodev 0 2 +PARTLABEL=dch-data /run/etc btrfs subvol=etc,nosuid,noexec,nodev 0 0 +overlay /run/etc/rw overlay lowerdir=/etc,upperdir=/run/etc/rw,workdir=/run/etc/.work 0 0 +/run/etc/rw/ssh /etc/ssh none bind 0 0 diff --git a/overlay/etc/resolv.conf b/overlay/etc/resolv.conf new file mode 120000 index 0000000..e499f2d --- /dev/null +++ b/overlay/etc/resolv.conf @@ -0,0 +1 @@ +../run/systemd/resolve/resolv.conf \ No newline at end of file diff --git a/overlay/etc/ssh/sshd_config.d/authorized-keys-command.conf b/overlay/etc/ssh/sshd_config.d/authorized-keys-command.conf new file mode 100644 index 0000000..0bdac7d --- /dev/null +++ b/overlay/etc/ssh/sshd_config.d/authorized-keys-command.conf @@ -0,0 +1,2 @@ +AuthorizedKeysCommand /usr/libexec/ssh-authorized-keys %u %t +AuthorizedKeysCommandUser nobody diff --git a/overlay/etc/systemd/network/90-default.network b/overlay/etc/systemd/network/90-default.network new file mode 100644 index 0000000..a61291d --- /dev/null +++ b/overlay/etc/systemd/network/90-default.network @@ -0,0 +1,5 @@ +[Match] +Type=ether + +[Network] +DHCP=yes diff --git a/overlay/usr/bin/system-update b/overlay/usr/bin/system-update new file mode 100755 index 0000000..5e9c798 --- /dev/null +++ b/overlay/usr/bin/system-update @@ -0,0 +1,135 @@ +#!/bin/sh +# vim: set sw=4 ts=4 sts=4 et : + +cleanup() { + cd / + if [ -n "${workdir}" ] && [ "${workdir}" != / ]; then + rm -rf "${workdir}" + fi + unset workdir +} + +die() { + rc=$? + if [ $rc -eq 0 ]; then + rc=1 + fi + error "$@" + exit $rc +} + +error() { + if [ $# -eq 1 ]; then + echo "$1" >&2 + elif [ $# -gt 1 ]; then + printf "$@" >&2 + fi +} + +extract_update() { + zstd -dc update.tar.zstd | tar -x \ + || die 'Could not extract update source' + sha256sum -c digests \ + || die 'Invalid update source: checksum mismatch' +} + +fetch_update() { + wget -O update.tar.zstd "$1" +} + +get_root() { + set -- $(cat /proc/cmdline) + while [ $# -gt 0 ]; do + case "$1" in + root=*) + _root=${1#root=} + ;; + esac + shift + done + echo $(findfs "${_root}") +} + +get_partlabel() { + blkid -o value -s PARTLABEL "$1" +} + +help() { + usage +} + +info() { + if [ $# -eq 1 ]; then + echo "$1" >&2 + elif [ $# -gt 1 ]; then + printf "$@" >&2 + fi +} + +usage() { + printf 'usage: %s source_url\n' "${0##*/}" +} + +while [ $# -gt 0 ]; do + case "$1" in + --help) + help + exit 0 + ;; + *) + if [ -z "${source_url}" ]; then + source_url="$1" + else + usage >&2 + exit 2 + fi + ;; + esac + shift +done + +if [ -z "${source_url}" ]; then + usage >&2 + exit 2 +fi + +root=$(get_root) +partlabel=$(get_partlabel "${root}") + +case "${partlabel}" in +rootfs-a) + newpartlabel=rootfs-b + ;; +rootfs-b) + newpartlabel=rootfs-a + ;; +*) + die \ + 'Unsupported system configuration: invalid rootfs partition label: %s\n' \ + "${partlabel}" >&2 +esac +newroot=$(findfs PARTLABEL="${newpartlabel}") +if [ -z "${newroot}" ]; then + die 'Could not find partition with label %s\n' "${partlabel}" +fi +info 'Current rootfs: %s (%s)\n' "${partlabel}" "${root}" +info 'New rootfs: %s (%s)\n' "${newpartlabel}" "${newroot}" + +trap cleanup INT TERM QUIT EXIT +workdir=$(mktemp -d) +cd "${workdir}" + +fetch_update "${source_url}" || die 'Failed to fetch update source' +extract_update || die 'Failed to extact update source' +./install "${newroot}" || die 'Error installing system update' + +printf 'Do you want to reboot now? [y/N] ' +read confirm +case "${confirm}" in +[yY]|[yY][eE][sS]) + systemctl reboot + ;; +*) + info 'A reboot is required to complete the update' + ;; +esac diff --git a/overlay/usr/lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-compute-module-ha-yellow.bin.xz b/overlay/usr/lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-compute-module-ha-yellow.bin.xz new file mode 120000 index 0000000..97bd3fd --- /dev/null +++ b/overlay/usr/lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-compute-module-ha-yellow.bin.xz @@ -0,0 +1 @@ +../cypress/cyfmac43455-sdio.bin.xz \ No newline at end of file diff --git a/overlay/usr/lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-compute-module-ha-yellow.txt b/overlay/usr/lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-compute-module-ha-yellow.txt new file mode 120000 index 0000000..dfb33d5 --- /dev/null +++ b/overlay/usr/lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-compute-module-ha-yellow.txt @@ -0,0 +1 @@ +brcmfmac43455-sdio.raspberrypi,4-model-b.txt.xz \ No newline at end of file diff --git a/overlay/usr/lib/systemd/system-preset/80-local-default.preset b/overlay/usr/lib/systemd/system-preset/80-local-default.preset new file mode 100644 index 0000000..d0681c5 --- /dev/null +++ b/overlay/usr/lib/systemd/system-preset/80-local-default.preset @@ -0,0 +1,15 @@ +disable ldconfig.service + +disable systemd-userdbd.service +disable systemd-userdbd.socket + +enable systemd-networkd-wait-online.service +enable systemd-networkd.service +enable systemd-networkd.socket + +#enable systemd-time-wait-sync.service + +disable getty@.service + +enable sshd.socket +enable ssh-keygen.service diff --git a/overlay/usr/lib/systemd/system/init-storage.service b/overlay/usr/lib/systemd/system/init-storage.service new file mode 100644 index 0000000..3cfaf18 --- /dev/null +++ b/overlay/usr/lib/systemd/system/init-storage.service @@ -0,0 +1,11 @@ +[Unit] +Description=Initialize persistent data storage +DefaultDependencies=no +Before=local-fs-pre.target + +[Service] +Type=oneshot +ExecStart=/usr/libexec/init-storage +StandardInput=null +StandardOutput=journal +StandardError=journal diff --git a/overlay/usr/lib/systemd/system/ssh-keygen.service b/overlay/usr/lib/systemd/system/ssh-keygen.service new file mode 100644 index 0000000..5072ac1 --- /dev/null +++ b/overlay/usr/lib/systemd/system/ssh-keygen.service @@ -0,0 +1,9 @@ +[Unit] +Description=Generate SSH host keys + +[Service] +Type=oneshot +ExecStart=/usr/bin/ssh-keygen -A + +[Install] +WantedBy=sshd@.service diff --git a/overlay/usr/lib/systemd/system/sshd@.service.d/after-keygen.conf b/overlay/usr/lib/systemd/system/sshd@.service.d/after-keygen.conf new file mode 100644 index 0000000..103820c --- /dev/null +++ b/overlay/usr/lib/systemd/system/sshd@.service.d/after-keygen.conf @@ -0,0 +1,2 @@ +[Unit] +After=ssh-keygen.service diff --git a/overlay/usr/lib/systemd/system/sysinit.target.wants/init-storage.service b/overlay/usr/lib/systemd/system/sysinit.target.wants/init-storage.service new file mode 120000 index 0000000..8ecb074 --- /dev/null +++ b/overlay/usr/lib/systemd/system/sysinit.target.wants/init-storage.service @@ -0,0 +1 @@ +../init-storage.service \ No newline at end of file diff --git a/overlay/usr/libexec/init-storage b/overlay/usr/libexec/init-storage new file mode 100755 index 0000000..e819854 --- /dev/null +++ b/overlay/usr/libexec/init-storage @@ -0,0 +1,57 @@ +#!/bin/sh +# vim: set sw=4 ts=4 sts=4 et : + +cleanup() { + if [ -n "${tmpdir}" ] && [ "${tmpdir}" != / ]; then + if mountpoint -q "${tmpdir}"; then + umount "${tmpdir}" + fi + rm -rf "${tmpdir}" + unset tmpdir + fi +} + +copy_var() { + dev="$1" + + echo 'Copying /var contents to data volume' + mount -o subvol=var "${dev}" "${tmpdir}" + cp -auv /var/. "${tmpdir}" + umount "${tmpdir}" +} + +format_dev() { + dev="$1" + printf 'Creating BTRFS filesystem on %s\n' "${dev}" + mkfs.btrfs "${dev}" || exit + + mount "${dev}" "${tmpdir}" || exit + btrfs subvolume create "${tmpdir}"/etc || exit + mkdir -p "${tmpdir}"/etc/.work "${tmpdir}"/etc/rw || exit + btrfs subvolume create "${tmpdir}"/var || exit + btrfs subvolume create "${tmpdir}"/var/log || exit + umount "${dev}" || exit +} + +has_fs() { + dev="$1" + fstype=$(blkid -o value -s TYPE "${dev}") + [ -n "${fstype}" ] +} + +datapart=$(findfs PARTLABEL=dch-data) +if [ -b "${datapart}" ]; then + printf 'Found data partition: %s\n' "${datapart}" +else + echo 'Could not identify data partition' >&2 + exit 1 +fi + +trap cleanup INT TERM QUIT EXIT +tmpdir=$(mktemp -d -p /run storinit.XXXXXX) + +if ! has_fs "${datapart}"; then + format_dev "${datapart}" +fi + +copy_var "${datapart}" diff --git a/overlay/usr/libexec/ssh-authorized-keys b/overlay/usr/libexec/ssh-authorized-keys new file mode 100755 index 0000000..fdaab3a --- /dev/null +++ b/overlay/usr/libexec/ssh-authorized-keys @@ -0,0 +1,4 @@ +#!/bin/sh +# vim: set sw=4 ts=4 sts=4 et : + +exec wget -q -O - https://sshkeys.pyrocufflink.blue/"$1"/"$2".pub diff --git a/patches/ebuilds/sys-boot/grub/no-efibootmgr.patch b/patches/ebuilds/sys-boot/grub/no-efibootmgr.patch new file mode 100644 index 0000000..649f0be --- /dev/null +++ b/patches/ebuilds/sys-boot/grub/no-efibootmgr.patch @@ -0,0 +1,14 @@ +diff -ruN a/grub-2.06-r5.ebuild b/grub-2.06-r5.ebuild +--- a/grub-2.06-r5.ebuild 2023-02-07 10:43:00.106060206 -0600 ++++ b/grub-2.06-r5.ebuild 2023-02-07 10:43:21.884298259 -0600 +@@ -128,10 +128,6 @@ + ppc64? ( >=sys-apps/ibm-powerpc-utils-1.3.5 ) + " + RDEPEND="${DEPEND} +- kernel_linux? ( +- grub_platforms_efi-32? ( sys-boot/efibootmgr ) +- grub_platforms_efi-64? ( sys-boot/efibootmgr ) +- ) + !sys-boot/grub:0 + nls? ( sys-devel/gettext ) + " diff --git a/patches/uboot/0001-drivers-bcm283x-don-t-explicitly-disable-init.patch b/patches/uboot/0001-drivers-bcm283x-don-t-explicitly-disable-init.patch new file mode 100644 index 0000000..b1e46ea --- /dev/null +++ b/patches/uboot/0001-drivers-bcm283x-don-t-explicitly-disable-init.patch @@ -0,0 +1,54 @@ +From 85fb54b621c1ca79f1ec8634b0597a038338e51d Mon Sep 17 00:00:00 2001 +Message-Id: <85fb54b621c1ca79f1ec8634b0597a038338e51d.1668448114.git.stefan@agner.ch> +From: Stefan Agner +Date: Thu, 14 Apr 2022 12:15:26 +0200 +Subject: [PATCH] drivers: bcm283x: don't explicitly disable init + +It seems that the reason why init doesn't succeed is the lack of clock +support in U-Boot. Setting the default clock of 48MHz for the PL011 +UARTs makes reinitialization work consistently. + +Note that for the first UART the "skip-init" is anyways set in the +device tree. This will only affect probing of UARTs not enabled by +firmware. + +Signed-off-by: Stefan Agner +--- + drivers/serial/serial_bcm283x_pl011.c | 6 ------ + include/configs/rpi.h | 3 +++ + 2 files changed, 3 insertions(+), 6 deletions(-) + +diff --git a/drivers/serial/serial_bcm283x_pl011.c b/drivers/serial/serial_bcm283x_pl011.c +index 7d172cdac0..fcba07f1c5 100644 +--- a/drivers/serial/serial_bcm283x_pl011.c ++++ b/drivers/serial/serial_bcm283x_pl011.c +@@ -51,12 +51,6 @@ static int bcm283x_pl011_serial_probe(struct udevice *dev) + if (ret) + return ret; + +- /* +- * TODO: Reinitialization doesn't always work for now, just skip +- * init always - we know we're already initialized +- */ +- plat->skip_init = true; +- + return pl01x_serial_probe(dev); + } + +diff --git a/include/configs/rpi.h b/include/configs/rpi.h +index 7257659932..7fdf2a891d 100644 +--- a/include/configs/rpi.h ++++ b/include/configs/rpi.h +@@ -33,6 +33,9 @@ + */ + #define CONFIG_SYS_SDRAM_SIZE SZ_128M + ++/* Define PL011 default clock */ ++#define CONFIG_PL011_CLOCK 48000000 ++ + /* Devices */ + /* LCD */ + +-- +2.38.1 + diff --git a/patches/uboot/0001-rpi-Use-CONFIG_OF_BOARD-instead-of-CONFIG_EMBED.patch b/patches/uboot/0001-rpi-Use-CONFIG_OF_BOARD-instead-of-CONFIG_EMBED.patch new file mode 100644 index 0000000..f608ecb --- /dev/null +++ b/patches/uboot/0001-rpi-Use-CONFIG_OF_BOARD-instead-of-CONFIG_EMBED.patch @@ -0,0 +1,83 @@ +From 135d886b4e5077c8fa96a5449a70d81ae9c1c3d0 Mon Sep 17 00:00:00 2001 +Message-Id: <135d886b4e5077c8fa96a5449a70d81ae9c1c3d0.1668448794.git.stefan@agner.ch> +From: Pascal Vizeli +Date: Tue, 10 Dec 2019 09:48:46 +0000 +Subject: [PATCH] rpi: Use CONFIG_OF_BOARD instead of CONFIG_EMBED + +Signed-off-by: Pascal Vizeli +--- + configs/rpi_0_w_defconfig | 2 +- + configs/rpi_2_defconfig | 2 +- + configs/rpi_3_32b_defconfig | 2 +- + configs/rpi_3_defconfig | 2 +- + configs/rpi_defconfig | 2 +- + 5 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/configs/rpi_0_w_defconfig b/configs/rpi_0_w_defconfig +index baa8c37810..f20aa164e5 100644 +--- a/configs/rpi_0_w_defconfig ++++ b/configs/rpi_0_w_defconfig +@@ -23,7 +23,7 @@ CONFIG_CMD_GPIO=y + CONFIG_CMD_MMC=y + CONFIG_CMD_USB=y + CONFIG_CMD_FS_UUID=y +-CONFIG_OF_EMBED=y ++CONFIG_OF_BOARD=y + CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" + CONFIG_SYS_RELOC_GD_ENV_ADDR=y + CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y +diff --git a/configs/rpi_2_defconfig b/configs/rpi_2_defconfig +index baae6d4871..60987ad91a 100644 +--- a/configs/rpi_2_defconfig ++++ b/configs/rpi_2_defconfig +@@ -24,7 +24,7 @@ CONFIG_CMD_GPIO=y + CONFIG_CMD_MMC=y + CONFIG_CMD_USB=y + CONFIG_CMD_FS_UUID=y +-CONFIG_OF_EMBED=y ++CONFIG_OF_BOARD=y + CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" + CONFIG_SYS_RELOC_GD_ENV_ADDR=y + CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y +diff --git a/configs/rpi_3_32b_defconfig b/configs/rpi_3_32b_defconfig +index f51f3de596..e6de8669d0 100644 +--- a/configs/rpi_3_32b_defconfig ++++ b/configs/rpi_3_32b_defconfig +@@ -23,7 +23,7 @@ CONFIG_CMD_GPIO=y + CONFIG_CMD_MMC=y + CONFIG_CMD_USB=y + CONFIG_CMD_FS_UUID=y +-CONFIG_OF_EMBED=y ++CONFIG_OF_BOARD=y + CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" + CONFIG_SYS_RELOC_GD_ENV_ADDR=y + CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y +diff --git a/configs/rpi_3_defconfig b/configs/rpi_3_defconfig +index bc1a318db4..70f4f8ed70 100644 +--- a/configs/rpi_3_defconfig ++++ b/configs/rpi_3_defconfig +@@ -22,7 +22,7 @@ CONFIG_CMD_GPIO=y + CONFIG_CMD_MMC=y + CONFIG_CMD_USB=y + CONFIG_CMD_FS_UUID=y +-CONFIG_OF_EMBED=y ++CONFIG_OF_BOARD=y + CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" + CONFIG_SYS_RELOC_GD_ENV_ADDR=y + CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y +diff --git a/configs/rpi_defconfig b/configs/rpi_defconfig +index 1d356b4b2e..6f345c790b 100644 +--- a/configs/rpi_defconfig ++++ b/configs/rpi_defconfig +@@ -23,7 +23,7 @@ CONFIG_CMD_GPIO=y + CONFIG_CMD_MMC=y + CONFIG_CMD_USB=y + CONFIG_CMD_FS_UUID=y +-CONFIG_OF_EMBED=y ++CONFIG_OF_BOARD=y + CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" + CONFIG_SYS_RELOC_GD_ENV_ADDR=y + CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y +-- +2.38.1 + diff --git a/patches/uboot/0002-drivers-bcm283x-allow-to-spawn-any-PL011-UART.patch b/patches/uboot/0002-drivers-bcm283x-allow-to-spawn-any-PL011-UART.patch new file mode 100644 index 0000000..206eec0 --- /dev/null +++ b/patches/uboot/0002-drivers-bcm283x-allow-to-spawn-any-PL011-UART.patch @@ -0,0 +1,68 @@ +From 921f4b6d8cb3b997dd5c54fd436bb8223046421e Mon Sep 17 00:00:00 2001 +Message-Id: <921f4b6d8cb3b997dd5c54fd436bb8223046421e.1668448114.git.stefan@agner.ch> +In-Reply-To: <85fb54b621c1ca79f1ec8634b0597a038338e51d.1668448114.git.stefan@agner.ch> +References: <85fb54b621c1ca79f1ec8634b0597a038338e51d.1668448114.git.stefan@agner.ch> +From: Stefan Agner +Date: Thu, 14 Apr 2022 12:18:41 +0200 +Subject: [PATCH] drivers: bcm283x: allow to spawn any PL011 UART + +The current code checks pinmux for the first PL011 only. Raspberry Pi 4 +has multiple PL011 UARTs. This code prevents probing of other UARTs in +case the first PL011 UART is not active. + +Furthermore, U-Boot supports pinmuxing, hence the pins should be muxed +at this point anyway. Drop the check entirly. + +This allows to use other UARTs as stdout paths (e.g. stdout-path = +"serial5:115200n8"). + +Signed-off-by: Stefan Agner +--- + drivers/serial/serial_bcm283x_pl011.c | 27 --------------------------- + 1 file changed, 27 deletions(-) + +diff --git a/drivers/serial/serial_bcm283x_pl011.c b/drivers/serial/serial_bcm283x_pl011.c +index fcba07f1c5..98628e1ca4 100644 +--- a/drivers/serial/serial_bcm283x_pl011.c ++++ b/drivers/serial/serial_bcm283x_pl011.c +@@ -11,37 +11,10 @@ + #include + #include "serial_pl01x_internal.h" + +-/* +- * Check if this serial device is muxed +- * +- * The serial device will only work properly if it has been muxed to the serial +- * pins by firmware. Check whether that happened here. +- * +- * Return: true if serial device is muxed, false if not +- */ +-static bool bcm283x_is_serial_muxed(void) +-{ +- int serial_gpio = 15; +- struct udevice *dev; +- +- if (uclass_first_device_err(UCLASS_PINCTRL, &dev)) +- return false; +- +- if (pinctrl_get_gpio_mux(dev, 0, serial_gpio) != BCM2835_GPIO_ALT0) +- return false; +- +- return true; +-} +- + static int bcm283x_pl011_serial_probe(struct udevice *dev) + { +- struct pl01x_serial_plat *plat = dev_get_plat(dev); + int ret; + +- /* Don't spawn the device if it's not muxed */ +- if (!bcm283x_is_serial_muxed()) +- return -ENODEV; +- + /* + * Read the ofdata here rather than in an of_to_plat() method + * since we need the soc simple-bus to be probed so that the 'ranges' +-- +2.38.1 + diff --git a/patches/uboot/0002-rpi-add-NVMe-to-boot-order.patch b/patches/uboot/0002-rpi-add-NVMe-to-boot-order.patch new file mode 100644 index 0000000..b532405 --- /dev/null +++ b/patches/uboot/0002-rpi-add-NVMe-to-boot-order.patch @@ -0,0 +1,44 @@ +From 191b5f4e0408e40f35379fdaab6b37a7ad93e298 Mon Sep 17 00:00:00 2001 +Message-Id: <191b5f4e0408e40f35379fdaab6b37a7ad93e298.1668448794.git.stefan@agner.ch> +In-Reply-To: <135d886b4e5077c8fa96a5449a70d81ae9c1c3d0.1668448794.git.stefan@agner.ch> +References: <135d886b4e5077c8fa96a5449a70d81ae9c1c3d0.1668448794.git.stefan@agner.ch> +From: Stefan Agner +Date: Tue, 29 Dec 2020 23:34:52 +0100 +Subject: [PATCH] rpi: add NVMe to boot order + +The Compute Module 4 I/O Board can support a NVMe. Add NVMe to the boot +order. + +Signed-off-by: Stefan Agner +--- + include/configs/rpi.h | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/include/configs/rpi.h b/include/configs/rpi.h +index cd8fe8b518..7257659932 100644 +--- a/include/configs/rpi.h ++++ b/include/configs/rpi.h +@@ -131,6 +131,12 @@ + #define BOOT_TARGET_MMC(func) + #endif + ++#if CONFIG_IS_ENABLED(CMD_NVME) ++ #define BOOT_TARGET_NVME(func) func(NVME, nvme, 0) ++#else ++ #define BOOT_TARGET_NVME(func) ++#endif ++ + #if CONFIG_IS_ENABLED(CMD_USB) + #define BOOT_TARGET_USB(func) func(USB, usb, 0) + #else +@@ -151,6 +157,7 @@ + + #define BOOT_TARGET_DEVICES(func) \ + BOOT_TARGET_MMC(func) \ ++ BOOT_TARGET_NVME(func) \ + BOOT_TARGET_USB(func) \ + BOOT_TARGET_PXE(func) \ + BOOT_TARGET_DHCP(func) +-- +2.38.1 + diff --git a/patches/uboot/0003-Revert-nvme-Correct-the-prps-per-page-calculation-me.patch b/patches/uboot/0003-Revert-nvme-Correct-the-prps-per-page-calculation-me.patch new file mode 100644 index 0000000..941d2de --- /dev/null +++ b/patches/uboot/0003-Revert-nvme-Correct-the-prps-per-page-calculation-me.patch @@ -0,0 +1,43 @@ +From 644bd3743aa8771ef7ecb7b7239308d6da2a5b35 Mon Sep 17 00:00:00 2001 +Message-Id: <644bd3743aa8771ef7ecb7b7239308d6da2a5b35.1668448794.git.stefan@agner.ch> +In-Reply-To: <135d886b4e5077c8fa96a5449a70d81ae9c1c3d0.1668448794.git.stefan@agner.ch> +References: <135d886b4e5077c8fa96a5449a70d81ae9c1c3d0.1668448794.git.stefan@agner.ch> +From: Stefan Agner +Date: Thu, 23 Sep 2021 23:43:31 +0200 +Subject: [PATCH] Revert "nvme: Correct the prps per page calculation method" + +This reverts commit 859b33c948945f7904f60a2c12a3792d356d51ad. + +If there is more than one PRP List the last entry is a pointer to +the next list. From the NVM Express specification: + +"The last entry within a memory page, as indicated by the memory page +size in the CC.MPS field, shall be a PRP List pointer if there is more +than a single memory page of data to be transferred." + +For the purpose of calculating the number of pages required for PRP +lists we should always assume that the last entry is required for +the next PRP list. + +Signed-off-by: Stefan Agner +Cc: Wesley Sheng +--- + drivers/nvme/nvme.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/nvme/nvme.c b/drivers/nvme/nvme.c +index 6d0d3f3ca2..73db80a294 100644 +--- a/drivers/nvme/nvme.c ++++ b/drivers/nvme/nvme.c +@@ -52,7 +52,7 @@ static int nvme_setup_prps(struct nvme_dev *dev, u64 *prp2, + u64 *prp_pool; + int length = total_len; + int i, nprps; +- u32 prps_per_page = page_size >> 3; ++ u32 prps_per_page = (page_size >> 3) - 1; + u32 num_pages; + + length -= (page_size - offset); +-- +2.38.1 + diff --git a/patches/uboot/0004-usb-xhci-brcm-Make-driver-compatible-with-downstream.patch b/patches/uboot/0004-usb-xhci-brcm-Make-driver-compatible-with-downstream.patch new file mode 100644 index 0000000..8a91721 --- /dev/null +++ b/patches/uboot/0004-usb-xhci-brcm-Make-driver-compatible-with-downstream.patch @@ -0,0 +1,33 @@ +From de29ca70117fb2bfafa8b5699b34e9e94560b785 Mon Sep 17 00:00:00 2001 +Message-Id: +In-Reply-To: <135d886b4e5077c8fa96a5449a70d81ae9c1c3d0.1668448794.git.stefan@agner.ch> +References: <135d886b4e5077c8fa96a5449a70d81ae9c1c3d0.1668448794.git.stefan@agner.ch> +From: Stefan Agner +Date: Thu, 7 Oct 2021 12:02:39 +0200 +Subject: [PATCH] usb: xhci-brcm: Make driver compatible with downstream device + tree + +The downstream device tree uses just "generic-xhci" as compatible +string. Use this string to make U-Boot work with the downstream Kernel. + +Signed-off-by: Stefan Agner +--- + drivers/usb/host/xhci-brcm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/usb/host/xhci-brcm.c b/drivers/usb/host/xhci-brcm.c +index fe17924028..0c6938187b 100644 +--- a/drivers/usb/host/xhci-brcm.c ++++ b/drivers/usb/host/xhci-brcm.c +@@ -82,7 +82,7 @@ static int xhci_brcm_deregister(struct udevice *dev) + } + + static const struct udevice_id xhci_brcm_ids[] = { +- { .compatible = "brcm,generic-xhci" }, ++ { .compatible = "generic-xhci" }, + { } + }; + +-- +2.38.1 + diff --git a/patches/uboot/0005-nvme-improve-readability-of-nvme_setup_prps.patch b/patches/uboot/0005-nvme-improve-readability-of-nvme_setup_prps.patch new file mode 100644 index 0000000..e6aca5b --- /dev/null +++ b/patches/uboot/0005-nvme-improve-readability-of-nvme_setup_prps.patch @@ -0,0 +1,49 @@ +From ab2790f8ff78790ea8a9cb0b05cafc55648ebbc4 Mon Sep 17 00:00:00 2001 +Message-Id: +In-Reply-To: <135d886b4e5077c8fa96a5449a70d81ae9c1c3d0.1668448794.git.stefan@agner.ch> +References: <135d886b4e5077c8fa96a5449a70d81ae9c1c3d0.1668448794.git.stefan@agner.ch> +From: Stefan Agner +Date: Thu, 23 Sep 2021 23:52:44 +0200 +Subject: [PATCH] nvme: improve readability of nvme_setup_prps() + +Improve readability by introducing consts, reuse consts where +appropriate and adding variables with discriptive name. + +Signed-off-by: Stefan Agner +--- + drivers/nvme/nvme.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/drivers/nvme/nvme.c b/drivers/nvme/nvme.c +index 73db80a294..751abc3cd5 100644 +--- a/drivers/nvme/nvme.c ++++ b/drivers/nvme/nvme.c +@@ -47,12 +47,12 @@ static int nvme_wait_csts(struct nvme_dev *dev, u32 mask, u32 val) + static int nvme_setup_prps(struct nvme_dev *dev, u64 *prp2, + int total_len, u64 dma_addr) + { +- u32 page_size = dev->page_size; ++ const u32 page_size = dev->page_size; ++ const u32 prps_per_page = (page_size >> 3) - 1; + int offset = dma_addr & (page_size - 1); + u64 *prp_pool; + int length = total_len; + int i, nprps; +- u32 prps_per_page = (page_size >> 3) - 1; + u32 num_pages; + + length -= (page_size - offset); +@@ -91,8 +91,8 @@ static int nvme_setup_prps(struct nvme_dev *dev, u64 *prp2, + i = 0; + while (nprps) { + if ((i == (prps_per_page - 1)) && nprps > 1) { +- *(prp_pool + i) = cpu_to_le64((ulong)prp_pool + +- page_size); ++ u64 next_prp_list = (u64)prp_pool + page_size; ++ *(prp_pool + i) = cpu_to_le64(next_prp_list); + i = 0; + prp_pool += page_size; + } +-- +2.38.1 + diff --git a/patches/uboot/0006-nvme-Use-pointer-for-CPU-addressed-buffers.patch b/patches/uboot/0006-nvme-Use-pointer-for-CPU-addressed-buffers.patch new file mode 100644 index 0000000..513e7d6 --- /dev/null +++ b/patches/uboot/0006-nvme-Use-pointer-for-CPU-addressed-buffers.patch @@ -0,0 +1,264 @@ +From 2b508d92673738d837576301866dc234d8b008c4 Mon Sep 17 00:00:00 2001 +Message-Id: <2b508d92673738d837576301866dc234d8b008c4.1668448794.git.stefan@agner.ch> +In-Reply-To: <135d886b4e5077c8fa96a5449a70d81ae9c1c3d0.1668448794.git.stefan@agner.ch> +References: <135d886b4e5077c8fa96a5449a70d81ae9c1c3d0.1668448794.git.stefan@agner.ch> +From: Stefan Agner +Date: Thu, 23 Sep 2021 23:58:35 +0200 +Subject: [PATCH] nvme: Use pointer for CPU addressed buffers + +Pass buffers which use CPU addressing as void pointers. This aligns with +DMA APIs which use void pointers as argument. It will avoid unnecessary +type casts when adding support bus address translations. + +Signed-off-by: Stefan Agner +--- + drivers/nvme/nvme.c | 50 ++++++++++++++++++++-------------------- + drivers/nvme/nvme_show.c | 4 ++-- + include/nvme.h | 12 +++++----- + 3 files changed, 33 insertions(+), 33 deletions(-) + +diff --git a/drivers/nvme/nvme.c b/drivers/nvme/nvme.c +index 751abc3cd5..352c94ea91 100644 +--- a/drivers/nvme/nvme.c ++++ b/drivers/nvme/nvme.c +@@ -45,11 +45,11 @@ static int nvme_wait_csts(struct nvme_dev *dev, u32 mask, u32 val) + } + + static int nvme_setup_prps(struct nvme_dev *dev, u64 *prp2, +- int total_len, u64 dma_addr) ++ int total_len, void *buffer) + { + const u32 page_size = dev->page_size; + const u32 prps_per_page = (page_size >> 3) - 1; +- int offset = dma_addr & (page_size - 1); ++ int offset = (uintptr_t)buffer & (page_size - 1); + u64 *prp_pool; + int length = total_len; + int i, nprps; +@@ -63,10 +63,10 @@ static int nvme_setup_prps(struct nvme_dev *dev, u64 *prp2, + } + + if (length) +- dma_addr += (page_size - offset); ++ buffer += (page_size - offset); + + if (length <= page_size) { +- *prp2 = dma_addr; ++ *prp2 = (u64)buffer; + return 0; + } + +@@ -96,11 +96,11 @@ static int nvme_setup_prps(struct nvme_dev *dev, u64 *prp2, + i = 0; + prp_pool += page_size; + } +- *(prp_pool + i++) = cpu_to_le64(dma_addr); +- dma_addr += page_size; ++ *(prp_pool + i++) = cpu_to_le64((u64)buffer); ++ buffer += page_size; + nprps--; + } +- *prp2 = (ulong)dev->prp_pool; ++ *prp2 = (u64)dev->prp_pool; + + flush_dcache_range((ulong)dev->prp_pool, (ulong)dev->prp_pool + + num_pages * page_size); +@@ -447,42 +447,42 @@ static int nvme_alloc_sq(struct nvme_dev *dev, u16 qid, + } + + int nvme_identify(struct nvme_dev *dev, unsigned nsid, +- unsigned cns, dma_addr_t dma_addr) ++ unsigned int cns, void *buffer) + { + struct nvme_command c; + u32 page_size = dev->page_size; +- int offset = dma_addr & (page_size - 1); ++ int offset = (uintptr_t)buffer & (page_size - 1); + int length = sizeof(struct nvme_id_ctrl); + int ret; + + memset(&c, 0, sizeof(c)); + c.identify.opcode = nvme_admin_identify; + c.identify.nsid = cpu_to_le32(nsid); +- c.identify.prp1 = cpu_to_le64(dma_addr); ++ c.identify.prp1 = cpu_to_le64((u64)buffer); + + length -= (page_size - offset); + if (length <= 0) { + c.identify.prp2 = 0; + } else { +- dma_addr += (page_size - offset); +- c.identify.prp2 = cpu_to_le64(dma_addr); ++ buffer += (page_size - offset); ++ c.identify.prp2 = cpu_to_le64((u64)buffer); + } + + c.identify.cns = cpu_to_le32(cns); + +- invalidate_dcache_range(dma_addr, +- dma_addr + sizeof(struct nvme_id_ctrl)); ++ invalidate_dcache_range((uintptr_t)buffer, ++ (uintptr_t)buffer + sizeof(struct nvme_id_ctrl)); + + ret = nvme_submit_admin_cmd(dev, &c, NULL); + if (!ret) +- invalidate_dcache_range(dma_addr, +- dma_addr + sizeof(struct nvme_id_ctrl)); ++ invalidate_dcache_range((uintptr_t)buffer, ++ (uintptr_t)buffer + sizeof(struct nvme_id_ctrl)); + + return ret; + } + + int nvme_get_features(struct nvme_dev *dev, unsigned fid, unsigned nsid, +- dma_addr_t dma_addr, u32 *result) ++ void *buffer, u32 *result) + { + struct nvme_command c; + int ret; +@@ -490,7 +490,7 @@ int nvme_get_features(struct nvme_dev *dev, unsigned fid, unsigned nsid, + memset(&c, 0, sizeof(c)); + c.features.opcode = nvme_admin_get_features; + c.features.nsid = cpu_to_le32(nsid); +- c.features.prp1 = cpu_to_le64(dma_addr); ++ c.features.prp1 = cpu_to_le64((u64)buffer); + c.features.fid = cpu_to_le32(fid); + + ret = nvme_submit_admin_cmd(dev, &c, result); +@@ -510,13 +510,13 @@ int nvme_get_features(struct nvme_dev *dev, unsigned fid, unsigned nsid, + } + + int nvme_set_features(struct nvme_dev *dev, unsigned fid, unsigned dword11, +- dma_addr_t dma_addr, u32 *result) ++ void *buffer, u32 *result) + { + struct nvme_command c; + + memset(&c, 0, sizeof(c)); + c.features.opcode = nvme_admin_set_features; +- c.features.prp1 = cpu_to_le64(dma_addr); ++ c.features.prp1 = cpu_to_le64((u64)buffer); + c.features.fid = cpu_to_le32(fid); + c.features.dword11 = cpu_to_le32(dword11); + +@@ -567,7 +567,7 @@ static int nvme_set_queue_count(struct nvme_dev *dev, int count) + u32 q_count = (count - 1) | ((count - 1) << 16); + + status = nvme_set_features(dev, NVME_FEAT_NUM_QUEUES, +- q_count, 0, &result); ++ q_count, NULL, &result); + + if (status < 0) + return status; +@@ -619,7 +619,7 @@ static int nvme_get_info_from_identify(struct nvme_dev *dev) + if (!ctrl) + return -ENOMEM; + +- ret = nvme_identify(dev, 0, 1, (dma_addr_t)(long)ctrl); ++ ret = nvme_identify(dev, 0, 1, ctrl); + if (ret) { + free(ctrl); + return -EIO; +@@ -704,7 +704,7 @@ static int nvme_blk_probe(struct udevice *udev) + ns->dev = ndev; + /* extract the namespace id from the block device name */ + ns->ns_id = trailing_strtol(udev->name); +- if (nvme_identify(ndev, ns->ns_id, 0, (dma_addr_t)(long)id)) { ++ if (nvme_identify(ndev, ns->ns_id, 0, id)) { + free(id); + return -EIO; + } +@@ -738,7 +738,7 @@ static ulong nvme_blk_rw(struct udevice *udev, lbaint_t blknr, + u64 prp2; + u64 total_len = blkcnt << desc->log2blksz; + u64 temp_len = total_len; +- uintptr_t temp_buffer = (uintptr_t)buffer; ++ void *temp_buffer = buffer; + + u64 slba = blknr; + u16 lbas = 1 << (dev->max_transfer_shift - ns->lba_shift); +@@ -872,7 +872,7 @@ int nvme_init(struct udevice *udev) + char name[20]; + + memset(id, 0, sizeof(*id)); +- if (nvme_identify(ndev, i, 0, (dma_addr_t)(long)id)) { ++ if (nvme_identify(ndev, i, 0, id)) { + ret = -EIO; + goto free_id; + } +diff --git a/drivers/nvme/nvme_show.c b/drivers/nvme/nvme_show.c +index 72cbac82bc..ac9b5cc9bd 100644 +--- a/drivers/nvme/nvme_show.c ++++ b/drivers/nvme/nvme_show.c +@@ -114,7 +114,7 @@ int nvme_print_info(struct udevice *udev) + if (!ctrl) + return -ENOMEM; + +- if (nvme_identify(dev, 0, 1, (dma_addr_t)(long)ctrl)) { ++ if (nvme_identify(dev, 0, 1, ctrl)) { + ret = -EIO; + goto free_ctrl; + } +@@ -129,7 +129,7 @@ int nvme_print_info(struct udevice *udev) + goto free_ctrl; + } + +- if (nvme_identify(dev, ns->ns_id, 0, (dma_addr_t)(long)id)) { ++ if (nvme_identify(dev, ns->ns_id, 0, id)) { + ret = -EIO; + goto free_id; + } +diff --git a/include/nvme.h b/include/nvme.h +index 2cdf8ce320..8ff823cd81 100644 +--- a/include/nvme.h ++++ b/include/nvme.h +@@ -18,12 +18,12 @@ struct nvme_dev; + * @dev: NVMe controller device + * @nsid: 0 for controller, namespace id for namespace to identify + * @cns: 1 for controller, 0 for namespace +- * @dma_addr: dma buffer address to store the identify result ++ * @buffer: dma buffer address to store the identify result + * @return: 0 on success, -ETIMEDOUT on command execution timeout, + * -EIO on command execution fails + */ + int nvme_identify(struct nvme_dev *dev, unsigned nsid, +- unsigned cns, dma_addr_t dma_addr); ++ unsigned int cns, void *buffer); + + /** + * nvme_get_features - retrieve the attributes of the feature specified +@@ -33,13 +33,13 @@ int nvme_identify(struct nvme_dev *dev, unsigned nsid, + * @dev: NVMe controller device + * @fid: feature id to provide data + * @nsid: namespace id the command applies to +- * @dma_addr: data structure used as part of the specified feature ++ * @buffer: data structure used as part of the specified feature + * @result: command-specific result in the completion queue entry + * @return: 0 on success, -ETIMEDOUT on command execution timeout, + * -EIO on command execution fails + */ + int nvme_get_features(struct nvme_dev *dev, unsigned fid, unsigned nsid, +- dma_addr_t dma_addr, u32 *result); ++ void *buffer, u32 *result); + + /** + * nvme_set_features - specify the attributes of the feature indicated +@@ -49,13 +49,13 @@ int nvme_get_features(struct nvme_dev *dev, unsigned fid, unsigned nsid, + * @dev: NVMe controller device + * @fid: feature id to provide data + * @dword11: command-specific input parameter +- * @dma_addr: data structure used as part of the specified feature ++ * @buffer: data structure used as part of the specified feature + * @result: command-specific result in the completion queue entry + * @return: 0 on success, -ETIMEDOUT on command execution timeout, + * -EIO on command execution fails + */ + int nvme_set_features(struct nvme_dev *dev, unsigned fid, unsigned dword11, +- dma_addr_t dma_addr, u32 *result); ++ void *buffer, u32 *result); + + /** + * nvme_scan_namespace - scan all namespaces attached to NVMe controllers +-- +2.38.1 + diff --git a/patches/uboot/0007-nvme-translate-virtual-addresses-into-the-bus-s-addr.patch b/patches/uboot/0007-nvme-translate-virtual-addresses-into-the-bus-s-addr.patch new file mode 100644 index 0000000..126988e --- /dev/null +++ b/patches/uboot/0007-nvme-translate-virtual-addresses-into-the-bus-s-addr.patch @@ -0,0 +1,176 @@ +From c70926d8b8ad11b8e489e92a8ca9ca93fb201595 Mon Sep 17 00:00:00 2001 +Message-Id: +In-Reply-To: <135d886b4e5077c8fa96a5449a70d81ae9c1c3d0.1668448794.git.stefan@agner.ch> +References: <135d886b4e5077c8fa96a5449a70d81ae9c1c3d0.1668448794.git.stefan@agner.ch> +From: Stefan Agner +Date: Fri, 24 Sep 2021 00:27:39 +0200 +Subject: [PATCH] nvme: translate virtual addresses into the bus's address + space + +So far we've been content with passing physical/CPU addresses when +configuring memory addresses into NVMe controllers, but not all +platforms have buses with transparent mappings. Specifically the +Raspberry Pi 4 might introduce an offset to memory accesses incoming +from its PCIe port. + +Introduce nvme_virt_to_bus() and nvme_bus_to_virt() to cater with these +limitations, and make sure we don't break non DM users. +For devices where PCIe's view of host memory doesn't match the memory +as seen by the CPU. + +A similar change has been introduced for XHCI controller with +commit 1a474559d90a ("xhci: translate virtual addresses into the bus's +address space"). + +Signed-off-by: Stefan Agner +--- + drivers/nvme/nvme.c | 31 +++++++++++++++++-------------- + drivers/nvme/nvme.h | 8 ++++++++ + 2 files changed, 25 insertions(+), 14 deletions(-) + +diff --git a/drivers/nvme/nvme.c b/drivers/nvme/nvme.c +index 352c94ea91..fdfc49677b 100644 +--- a/drivers/nvme/nvme.c ++++ b/drivers/nvme/nvme.c +@@ -66,7 +66,7 @@ static int nvme_setup_prps(struct nvme_dev *dev, u64 *prp2, + buffer += (page_size - offset); + + if (length <= page_size) { +- *prp2 = (u64)buffer; ++ *prp2 = nvme_virt_to_bus(dev, buffer); + return 0; + } + +@@ -91,16 +91,16 @@ static int nvme_setup_prps(struct nvme_dev *dev, u64 *prp2, + i = 0; + while (nprps) { + if ((i == (prps_per_page - 1)) && nprps > 1) { +- u64 next_prp_list = (u64)prp_pool + page_size; +- *(prp_pool + i) = cpu_to_le64(next_prp_list); ++ u64 next = nvme_virt_to_bus(dev, prp_pool + page_size); ++ *(prp_pool + i) = cpu_to_le64(next); + i = 0; + prp_pool += page_size; + } +- *(prp_pool + i++) = cpu_to_le64((u64)buffer); ++ *(prp_pool + i++) = cpu_to_le64(nvme_virt_to_bus(dev, buffer)); + buffer += page_size; + nprps--; + } +- *prp2 = (u64)dev->prp_pool; ++ *prp2 = nvme_virt_to_bus(dev, dev->prp_pool); + + flush_dcache_range((ulong)dev->prp_pool, (ulong)dev->prp_pool + + num_pages * page_size); +@@ -353,6 +353,7 @@ static int nvme_configure_admin_queue(struct nvme_dev *dev) + int result; + u32 aqa; + u64 cap = dev->cap; ++ u64 dma_addr; + struct nvme_queue *nvmeq; + /* most architectures use 4KB as the page size */ + unsigned page_shift = 12; +@@ -393,8 +394,10 @@ static int nvme_configure_admin_queue(struct nvme_dev *dev) + dev->ctrl_config |= NVME_CC_IOSQES | NVME_CC_IOCQES; + + writel(aqa, &dev->bar->aqa); +- nvme_writeq((ulong)nvmeq->sq_cmds, &dev->bar->asq); +- nvme_writeq((ulong)nvmeq->cqes, &dev->bar->acq); ++ dma_addr = nvme_virt_to_bus(dev, nvmeq->sq_cmds); ++ nvme_writeq(dma_addr, &dev->bar->asq); ++ dma_addr = nvme_virt_to_bus(dev, nvmeq->cqes); ++ nvme_writeq(dma_addr, &dev->bar->acq); + + result = nvme_enable_ctrl(dev); + if (result) +@@ -420,7 +423,7 @@ static int nvme_alloc_cq(struct nvme_dev *dev, u16 qid, + + memset(&c, 0, sizeof(c)); + c.create_cq.opcode = nvme_admin_create_cq; +- c.create_cq.prp1 = cpu_to_le64((ulong)nvmeq->cqes); ++ c.create_cq.prp1 = cpu_to_le64(nvme_virt_to_bus(dev, nvmeq->cqes)); + c.create_cq.cqid = cpu_to_le16(qid); + c.create_cq.qsize = cpu_to_le16(nvmeq->q_depth - 1); + c.create_cq.cq_flags = cpu_to_le16(flags); +@@ -437,7 +440,7 @@ static int nvme_alloc_sq(struct nvme_dev *dev, u16 qid, + + memset(&c, 0, sizeof(c)); + c.create_sq.opcode = nvme_admin_create_sq; +- c.create_sq.prp1 = cpu_to_le64((ulong)nvmeq->sq_cmds); ++ c.create_sq.prp1 = cpu_to_le64(nvme_virt_to_bus(dev, nvmeq->sq_cmds)); + c.create_sq.sqid = cpu_to_le16(qid); + c.create_sq.qsize = cpu_to_le16(nvmeq->q_depth - 1); + c.create_sq.sq_flags = cpu_to_le16(flags); +@@ -458,14 +461,14 @@ int nvme_identify(struct nvme_dev *dev, unsigned nsid, + memset(&c, 0, sizeof(c)); + c.identify.opcode = nvme_admin_identify; + c.identify.nsid = cpu_to_le32(nsid); +- c.identify.prp1 = cpu_to_le64((u64)buffer); ++ c.identify.prp1 = cpu_to_le64(nvme_virt_to_bus(dev, buffer)); + + length -= (page_size - offset); + if (length <= 0) { + c.identify.prp2 = 0; + } else { + buffer += (page_size - offset); +- c.identify.prp2 = cpu_to_le64((u64)buffer); ++ c.identify.prp2 = cpu_to_le64(nvme_virt_to_bus(dev, buffer)); + } + + c.identify.cns = cpu_to_le32(cns); +@@ -490,7 +493,7 @@ int nvme_get_features(struct nvme_dev *dev, unsigned fid, unsigned nsid, + memset(&c, 0, sizeof(c)); + c.features.opcode = nvme_admin_get_features; + c.features.nsid = cpu_to_le32(nsid); +- c.features.prp1 = cpu_to_le64((u64)buffer); ++ c.features.prp1 = cpu_to_le64(nvme_virt_to_bus(dev, buffer)); + c.features.fid = cpu_to_le32(fid); + + ret = nvme_submit_admin_cmd(dev, &c, result); +@@ -516,7 +519,7 @@ int nvme_set_features(struct nvme_dev *dev, unsigned fid, unsigned dword11, + + memset(&c, 0, sizeof(c)); + c.features.opcode = nvme_admin_set_features; +- c.features.prp1 = cpu_to_le64((u64)buffer); ++ c.features.prp1 = cpu_to_le64(nvme_virt_to_bus(dev, buffer)); + c.features.fid = cpu_to_le32(fid); + c.features.dword11 = cpu_to_le32(dword11); + +@@ -771,7 +774,7 @@ static ulong nvme_blk_rw(struct udevice *udev, lbaint_t blknr, + c.rw.slba = cpu_to_le64(slba); + slba += lbas; + c.rw.length = cpu_to_le16(lbas - 1); +- c.rw.prp1 = cpu_to_le64(temp_buffer); ++ c.rw.prp1 = cpu_to_le64(nvme_virt_to_bus(dev, temp_buffer)); + c.rw.prp2 = cpu_to_le64(prp2); + status = nvme_submit_sync_cmd(dev->queues[NVME_IO_Q], + &c, NULL, IO_TIMEOUT); +diff --git a/drivers/nvme/nvme.h b/drivers/nvme/nvme.h +index bc1d612dde..f52103c009 100644 +--- a/drivers/nvme/nvme.h ++++ b/drivers/nvme/nvme.h +@@ -7,8 +7,11 @@ + #ifndef __DRIVER_NVME_H__ + #define __DRIVER_NVME_H__ + ++#include + #include + ++#define nvme_to_dev(_dev) _dev->udev ++ + struct nvme_id_power_state { + __le16 max_power; /* centiwatts */ + __u8 rsvd2; +@@ -705,4 +708,9 @@ int nvme_init(struct udevice *udev); + */ + int nvme_shutdown(struct udevice *udev); + ++static inline dma_addr_t nvme_virt_to_bus(struct nvme_dev *dev, void *addr) ++{ ++ return dev_phys_to_bus(nvme_to_dev(dev)->parent, virt_to_phys(addr)); ++} ++ + #endif /* __DRIVER_NVME_H__ */ +-- +2.38.1 + diff --git a/podman-build.sh b/podman-build.sh new file mode 100755 index 0000000..ebe298e --- /dev/null +++ b/podman-build.sh @@ -0,0 +1,26 @@ +#!/bin/sh +# vim: set sw=4 ts=4 sts=4 et : + +set -e + +. ./config + +cid=$(podman run \ + --tmpfs /var/tmp \ + --tmpfs /usr/${target}/tmp \ + -v portage:/var/db/repos/gentoo \ + -v packages:/var/cache/binpkgs \ + -v distfiles:/var/cache/distfiles \ + -v packages:/usr/${target}/var/cache/binpkgs \ + -v ${PWD}:/tmp/build:rw,z \ + -w /tmp/build \ + -d \ + -e FEATURES='-ipc-sandbox -network-sandbox -pid-sandbox' \ + cross-${target} \ + python -c 'from signal import *;signal(SIGTERM, lambda x, y: None);pause()' +) + +podman exec -it ${cid} ./build-all.sh "${target}" + +podman stop ${cid} +podman rm ${cid} diff --git a/portage/env/nobuildpkg b/portage/env/nobuildpkg new file mode 100644 index 0000000..1d3a766 --- /dev/null +++ b/portage/env/nobuildpkg @@ -0,0 +1 @@ +FEATURES=-buildpkg diff --git a/portage/make.conf/10-common.conf b/portage/make.conf/10-common.conf new file mode 100644 index 0000000..e10cb85 --- /dev/null +++ b/portage/make.conf/10-common.conf @@ -0,0 +1 @@ +ACCEPT_KEYWORDS="${ARCH} ~${ARCH}" diff --git a/portage/make.conf/20-binpkgs.conf b/portage/make.conf/20-binpkgs.conf new file mode 100644 index 0000000..d2fb18f --- /dev/null +++ b/portage/make.conf/20-binpkgs.conf @@ -0,0 +1,2 @@ +FEATURES="${FEATURES} binpkg-multi-instance buildpkg" +EMERGE_DEFAULT_OPTS="${EMERGE_DEFAULT_OPTS} --usepkg --binpkg-respect-use=y" diff --git a/portage/make.conf/30-default-use.conf b/portage/make.conf/30-default-use.conf new file mode 100644 index 0000000..77072de --- /dev/null +++ b/portage/make.conf/30-default-use.conf @@ -0,0 +1 @@ +USE='-man -doc minimal pam zstd' diff --git a/portage/make.conf/80-quiet.conf b/portage/make.conf/80-quiet.conf new file mode 100644 index 0000000..677144a --- /dev/null +++ b/portage/make.conf/80-quiet.conf @@ -0,0 +1,2 @@ +EMERGE_DEFAULT_OPTS="${EMERGE_DEFAULT_OPTS} --quiet-build=y" +FEATURES="${FEATURES} -news" diff --git a/portage/package.env/linux-firmware b/portage/package.env/linux-firmware new file mode 100644 index 0000000..f05fdca --- /dev/null +++ b/portage/package.env/linux-firmware @@ -0,0 +1 @@ +sys-kernel/linux-formware nobinpkg diff --git a/portage/package.license/firmware b/portage/package.license/firmware new file mode 100644 index 0000000..f57df1a --- /dev/null +++ b/portage/package.license/firmware @@ -0,0 +1,2 @@ +sys-boot/raspberrypi-firmware raspberrypi-videocore-bin +sys-kernel/linux-firmware linux-fw-redistributable diff --git a/portage/package.use/busybox b/portage/package.use/busybox new file mode 100644 index 0000000..6be3f3e --- /dev/null +++ b/portage/package.use/busybox @@ -0,0 +1 @@ +sys-apps/busybox savedconfig diff --git a/portage/package.use/firmware b/portage/package.use/firmware new file mode 100644 index 0000000..9965958 --- /dev/null +++ b/portage/package.use/firmware @@ -0,0 +1 @@ +sys-kernel/linux-firmware compress savedconfig diff --git a/portage/package.use/grub b/portage/package.use/grub new file mode 100644 index 0000000..9ea0163 --- /dev/null +++ b/portage/package.use/grub @@ -0,0 +1 @@ +sys-boot/grub -* GRUB_PLATFORMS: -* efi-64 diff --git a/portage/savedconfig/sys-apps/busybox b/portage/savedconfig/sys-apps/busybox new file mode 100644 index 0000000..378e46b --- /dev/null +++ b/portage/savedconfig/sys-apps/busybox @@ -0,0 +1,1190 @@ +# +# Automatically generated make config: don't edit +# Busybox version: 1.34.1 +# Sun Feb 12 18:57:50 2023 +# +CONFIG_HAVE_DOT_CONFIG=y + +# +# Settings +# +# CONFIG_DESKTOP is not set +# CONFIG_EXTRA_COMPAT is not set +# CONFIG_FEDORA_COMPAT is not set +# CONFIG_INCLUDE_SUSv2 is not set +CONFIG_LONG_OPTS=y +# CONFIG_SHOW_USAGE is not set +# CONFIG_FEATURE_VERBOSE_USAGE is not set +# CONFIG_FEATURE_COMPRESS_USAGE is not set +CONFIG_LFS=y +CONFIG_PAM=y +CONFIG_FEATURE_DEVPTS=y +# CONFIG_FEATURE_UTMP is not set +# CONFIG_FEATURE_WTMP is not set +# CONFIG_FEATURE_PIDFILE is not set +CONFIG_PID_FILE_PATH="" +# CONFIG_BUSYBOX is not set +# CONFIG_FEATURE_SHOW_SCRIPT is not set +# CONFIG_FEATURE_INSTALLER is not set +CONFIG_INSTALL_NO_USR=y +CONFIG_FEATURE_SUID=y +# CONFIG_FEATURE_SUID_CONFIG is not set +# CONFIG_FEATURE_SUID_CONFIG_QUIET is not set +# CONFIG_FEATURE_PREFER_APPLETS is not set +CONFIG_BUSYBOX_EXEC_PATH="/proc/self/exe" +# CONFIG_SELINUX is not set +# CONFIG_FEATURE_CLEAN_UP is not set +# CONFIG_FEATURE_SYSLOG_INFO is not set +# CONFIG_FEATURE_SYSLOG is not set + +# +# Build Options +# +# CONFIG_STATIC is not set +# CONFIG_PIE is not set +# CONFIG_NOMMU is not set +# CONFIG_BUILD_LIBBUSYBOX is not set +# CONFIG_FEATURE_LIBBUSYBOX_STATIC is not set +# CONFIG_FEATURE_INDIVIDUAL is not set +# CONFIG_FEATURE_SHARED_BUSYBOX is not set +CONFIG_CROSS_COMPILER_PREFIX="" +CONFIG_SYSROOT="" +CONFIG_EXTRA_CFLAGS="" +CONFIG_EXTRA_LDFLAGS="" +CONFIG_EXTRA_LDLIBS="" +# CONFIG_USE_PORTABLE_CODE is not set +# CONFIG_STACK_OPTIMIZATION_386 is not set +# CONFIG_STATIC_LIBGCC is not set + +# +# Installation Options ("make install" behavior) +# +CONFIG_INSTALL_APPLET_SYMLINKS=y +# CONFIG_INSTALL_APPLET_HARDLINKS is not set +# CONFIG_INSTALL_APPLET_SCRIPT_WRAPPERS is not set +# CONFIG_INSTALL_APPLET_DONT is not set +# CONFIG_INSTALL_SH_APPLET_SYMLINK is not set +# CONFIG_INSTALL_SH_APPLET_HARDLINK is not set +# CONFIG_INSTALL_SH_APPLET_SCRIPT_WRAPPER is not set +CONFIG_PREFIX="./_install" + +# +# Debugging Options +# +# CONFIG_DEBUG is not set +# CONFIG_DEBUG_PESSIMIZE is not set +# CONFIG_DEBUG_SANITIZE is not set +# CONFIG_UNIT_TEST is not set +# CONFIG_WERROR is not set +# CONFIG_WARN_SIMPLE_MSG is not set +CONFIG_NO_DEBUG_LIB=y +# CONFIG_DMALLOC is not set +# CONFIG_EFENCE is not set + +# +# Library Tuning +# +# CONFIG_FEATURE_USE_BSS_TAIL is not set +# CONFIG_FLOAT_DURATION is not set +# CONFIG_FEATURE_RTMINMAX is not set +# CONFIG_FEATURE_RTMINMAX_USE_LIBC_DEFINITIONS is not set +CONFIG_FEATURE_BUFFERS_USE_MALLOC=y +# CONFIG_FEATURE_BUFFERS_GO_ON_STACK is not set +# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set +CONFIG_PASSWORD_MINLEN=6 +CONFIG_MD5_SMALL=1 +CONFIG_SHA3_SMALL=1 +# CONFIG_FEATURE_FAST_TOP is not set +# CONFIG_FEATURE_ETC_NETWORKS is not set +# CONFIG_FEATURE_ETC_SERVICES is not set +CONFIG_FEATURE_EDITING=y +CONFIG_FEATURE_EDITING_MAX_LEN=1024 +CONFIG_FEATURE_EDITING_VI=y +CONFIG_FEATURE_EDITING_HISTORY=255 +CONFIG_FEATURE_EDITING_SAVEHISTORY=y +# CONFIG_FEATURE_EDITING_SAVE_ON_EXIT is not set +CONFIG_FEATURE_REVERSE_SEARCH=y +CONFIG_FEATURE_TAB_COMPLETION=y +CONFIG_FEATURE_USERNAME_COMPLETION=y +CONFIG_FEATURE_EDITING_FANCY_PROMPT=y +CONFIG_FEATURE_EDITING_WINCH=y +# CONFIG_FEATURE_EDITING_ASK_TERMINAL is not set +# CONFIG_LOCALE_SUPPORT is not set +CONFIG_UNICODE_SUPPORT=y +# CONFIG_UNICODE_USING_LOCALE is not set +# CONFIG_FEATURE_CHECK_UNICODE_IN_ENV is not set +CONFIG_SUBST_WCHAR=63 +CONFIG_LAST_SUPPORTED_WCHAR=767 +# CONFIG_UNICODE_COMBINING_WCHARS is not set +# CONFIG_UNICODE_WIDE_WCHARS is not set +# CONFIG_UNICODE_BIDI_SUPPORT is not set +# CONFIG_UNICODE_NEUTRAL_TABLE is not set +# CONFIG_UNICODE_PRESERVE_BROKEN is not set +CONFIG_FEATURE_NON_POSIX_CP=y +CONFIG_FEATURE_VERBOSE_CP_MESSAGE=y +CONFIG_FEATURE_USE_SENDFILE=y +CONFIG_FEATURE_COPYBUF_KB=4 +# CONFIG_FEATURE_SKIP_ROOTFS is not set +CONFIG_MONOTONIC_SYSCALL=y +CONFIG_IOCTL_HEX2STR_ERROR=y +# CONFIG_FEATURE_HWIB is not set + +# +# Applets +# + +# +# Archival Utilities +# +CONFIG_FEATURE_SEAMLESS_XZ=y +# CONFIG_FEATURE_SEAMLESS_LZMA is not set +# CONFIG_FEATURE_SEAMLESS_BZ2 is not set +CONFIG_FEATURE_SEAMLESS_GZ=y +# CONFIG_FEATURE_SEAMLESS_Z is not set +# CONFIG_AR is not set +# CONFIG_FEATURE_AR_LONG_FILENAMES is not set +# CONFIG_FEATURE_AR_CREATE is not set +# CONFIG_UNCOMPRESS is not set +# CONFIG_GUNZIP is not set +# CONFIG_ZCAT is not set +# CONFIG_FEATURE_GUNZIP_LONG_OPTIONS is not set +# CONFIG_BUNZIP2 is not set +# CONFIG_BZCAT is not set +# CONFIG_UNLZMA is not set +# CONFIG_LZCAT is not set +# CONFIG_LZMA is not set +# CONFIG_UNXZ is not set +# CONFIG_XZCAT is not set +# CONFIG_XZ is not set +# CONFIG_BZIP2 is not set +CONFIG_BZIP2_SMALL=0 +# CONFIG_FEATURE_BZIP2_DECOMPRESS is not set +# CONFIG_CPIO is not set +# CONFIG_FEATURE_CPIO_O is not set +# CONFIG_FEATURE_CPIO_P is not set +# CONFIG_DPKG is not set +# CONFIG_DPKG_DEB is not set +# CONFIG_GZIP is not set +# CONFIG_FEATURE_GZIP_LONG_OPTIONS is not set +CONFIG_GZIP_FAST=0 +# CONFIG_FEATURE_GZIP_LEVELS is not set +# CONFIG_FEATURE_GZIP_DECOMPRESS is not set +# CONFIG_LZOP is not set +# CONFIG_UNLZOP is not set +# CONFIG_LZOPCAT is not set +# CONFIG_LZOP_COMPR_HIGH is not set +# CONFIG_RPM is not set +# CONFIG_RPM2CPIO is not set +CONFIG_TAR=y +CONFIG_FEATURE_TAR_LONG_OPTIONS=y +CONFIG_FEATURE_TAR_CREATE=y +CONFIG_FEATURE_TAR_AUTODETECT=y +CONFIG_FEATURE_TAR_FROM=y +# CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY is not set +# CONFIG_FEATURE_TAR_OLDSUN_COMPATIBILITY is not set +CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y +# CONFIG_FEATURE_TAR_TO_COMMAND is not set +CONFIG_FEATURE_TAR_UNAME_GNAME=y +CONFIG_FEATURE_TAR_NOPRESERVE_TIME=y +# CONFIG_FEATURE_TAR_SELINUX is not set +# CONFIG_UNZIP is not set +# CONFIG_FEATURE_UNZIP_CDF is not set +# CONFIG_FEATURE_UNZIP_BZIP2 is not set +# CONFIG_FEATURE_UNZIP_LZMA is not set +# CONFIG_FEATURE_UNZIP_XZ is not set +# CONFIG_FEATURE_LZMA_FAST is not set + +# +# Coreutils +# +CONFIG_BASENAME=y +CONFIG_CAT=y +CONFIG_FEATURE_CATN=y +CONFIG_FEATURE_CATV=y +# CONFIG_CHGRP is not set +# CONFIG_CHMOD is not set +# CONFIG_CHOWN is not set +# CONFIG_FEATURE_CHOWN_LONG_OPTIONS is not set +# CONFIG_CHROOT is not set +# CONFIG_CKSUM is not set +# CONFIG_CRC32 is not set +# CONFIG_COMM is not set +CONFIG_CP=y +# CONFIG_FEATURE_CP_LONG_OPTIONS is not set +# CONFIG_FEATURE_CP_REFLINK is not set +# CONFIG_CUT is not set +# CONFIG_FEATURE_CUT_REGEX is not set +# CONFIG_DATE is not set +# CONFIG_FEATURE_DATE_ISOFMT is not set +# CONFIG_FEATURE_DATE_NANO is not set +# CONFIG_FEATURE_DATE_COMPAT is not set +CONFIG_DD=y +CONFIG_FEATURE_DD_SIGNAL_HANDLING=y +CONFIG_FEATURE_DD_THIRD_STATUS_LINE=y +CONFIG_FEATURE_DD_IBS_OBS=y +CONFIG_FEATURE_DD_STATUS=y +CONFIG_DF=y +CONFIG_FEATURE_DF_FANCY=y +# CONFIG_DIRNAME is not set +# CONFIG_DOS2UNIX is not set +# CONFIG_UNIX2DOS is not set +CONFIG_DU=y +CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K=y +CONFIG_ECHO=y +CONFIG_FEATURE_FANCY_ECHO=y +CONFIG_ENV=y +# CONFIG_EXPAND is not set +# CONFIG_UNEXPAND is not set +# CONFIG_EXPR is not set +# CONFIG_EXPR_MATH_SUPPORT_64 is not set +# CONFIG_FACTOR is not set +CONFIG_FALSE=y +# CONFIG_FOLD is not set +CONFIG_HEAD=y +CONFIG_FEATURE_FANCY_HEAD=y +# CONFIG_HOSTID is not set +CONFIG_ID=y +CONFIG_GROUPS=y +CONFIG_INSTALL=y +CONFIG_FEATURE_INSTALL_LONG_OPTIONS=y +CONFIG_LINK=y +CONFIG_LN=y +# CONFIG_LOGNAME is not set +CONFIG_LS=y +CONFIG_FEATURE_LS_FILETYPES=y +CONFIG_FEATURE_LS_FOLLOWLINKS=y +CONFIG_FEATURE_LS_RECURSIVE=y +CONFIG_FEATURE_LS_WIDTH=y +CONFIG_FEATURE_LS_SORTFILES=y +CONFIG_FEATURE_LS_TIMESTAMPS=y +CONFIG_FEATURE_LS_USERNAME=y +CONFIG_FEATURE_LS_COLOR=y +CONFIG_FEATURE_LS_COLOR_IS_DEFAULT=y +# CONFIG_MD5SUM is not set +CONFIG_SHA1SUM=y +CONFIG_SHA256SUM=y +CONFIG_SHA512SUM=y +CONFIG_SHA3SUM=y + +# +# Common options for md5sum, sha1sum, sha256sum, sha512sum, sha3sum +# +CONFIG_FEATURE_MD5_SHA1_SUM_CHECK=y +CONFIG_MKDIR=y +CONFIG_MKFIFO=y +# CONFIG_MKNOD is not set +CONFIG_MKTEMP=y +CONFIG_MV=y +CONFIG_NICE=y +# CONFIG_NL is not set +# CONFIG_NOHUP is not set +CONFIG_NPROC=y +# CONFIG_OD is not set +# CONFIG_PASTE is not set +# CONFIG_PRINTENV is not set +CONFIG_PRINTF=y +# CONFIG_PWD is not set +CONFIG_READLINK=y +CONFIG_FEATURE_READLINK_FOLLOW=y +CONFIG_REALPATH=y +CONFIG_RM=y +CONFIG_RMDIR=y +CONFIG_SEQ=y +# CONFIG_SHRED is not set +# CONFIG_SHUF is not set +# CONFIG_SLEEP is not set +# CONFIG_FEATURE_FANCY_SLEEP is not set +CONFIG_SORT=y +CONFIG_FEATURE_SORT_BIG=y +# CONFIG_FEATURE_SORT_OPTIMIZE_MEMORY is not set +# CONFIG_SPLIT is not set +# CONFIG_FEATURE_SPLIT_FANCY is not set +CONFIG_STAT=y +CONFIG_FEATURE_STAT_FORMAT=y +CONFIG_FEATURE_STAT_FILESYSTEM=y +CONFIG_STTY=y +# CONFIG_SUM is not set +CONFIG_SYNC=y +CONFIG_FEATURE_SYNC_FANCY=y +CONFIG_FSYNC=y +CONFIG_TAC=y +CONFIG_TAIL=y +CONFIG_FEATURE_FANCY_TAIL=y +CONFIG_TEE=y +CONFIG_FEATURE_TEE_USE_BLOCK_IO=y +CONFIG_TEST=y +CONFIG_TEST1=y +# CONFIG_TEST2 is not set +CONFIG_FEATURE_TEST_64=y +CONFIG_TIMEOUT=y +CONFIG_TOUCH=y +CONFIG_FEATURE_TOUCH_SUSV3=y +CONFIG_TR=y +CONFIG_FEATURE_TR_CLASSES=y +CONFIG_FEATURE_TR_EQUIV=y +CONFIG_TRUE=y +CONFIG_TRUNCATE=y +CONFIG_TTY=y +CONFIG_UNAME=y +CONFIG_UNAME_OSNAME="GNU/Linux" +# CONFIG_BB_ARCH is not set +# CONFIG_UNIQ is not set +# CONFIG_UNLINK is not set +# CONFIG_USLEEP is not set +# CONFIG_UUDECODE is not set +# CONFIG_BASE32 is not set +# CONFIG_BASE64 is not set +# CONFIG_UUENCODE is not set +# CONFIG_WC is not set +# CONFIG_FEATURE_WC_LARGE is not set +# CONFIG_WHO is not set +# CONFIG_W is not set +# CONFIG_USERS is not set +# CONFIG_WHOAMI is not set +# CONFIG_YES is not set + +# +# Common options +# +# CONFIG_FEATURE_VERBOSE is not set + +# +# Common options for cp and mv +# +CONFIG_FEATURE_PRESERVE_HARDLINKS=y + +# +# Common options for df, du, ls +# +CONFIG_FEATURE_HUMAN_READABLE=y + +# +# Console Utilities +# +# CONFIG_CHVT is not set +# CONFIG_CLEAR is not set +# CONFIG_DEALLOCVT is not set +# CONFIG_DUMPKMAP is not set +# CONFIG_FGCONSOLE is not set +# CONFIG_KBD_MODE is not set +# CONFIG_LOADFONT is not set +# CONFIG_SETFONT is not set +# CONFIG_FEATURE_SETFONT_TEXTUAL_MAP is not set +CONFIG_DEFAULT_SETFONT_DIR="" +# CONFIG_FEATURE_LOADFONT_PSF2 is not set +# CONFIG_FEATURE_LOADFONT_RAW is not set +# CONFIG_LOADKMAP is not set +# CONFIG_OPENVT is not set +# CONFIG_RESET is not set +# CONFIG_RESIZE is not set +# CONFIG_FEATURE_RESIZE_PRINT is not set +# CONFIG_SETCONSOLE is not set +# CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS is not set +# CONFIG_SETKEYCODES is not set +# CONFIG_SETLOGCONS is not set +# CONFIG_SHOWKEY is not set + +# +# Debian Utilities +# +# CONFIG_PIPE_PROGRESS is not set +# CONFIG_RUN_PARTS is not set +# CONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS is not set +# CONFIG_FEATURE_RUN_PARTS_FANCY is not set +# CONFIG_START_STOP_DAEMON is not set +# CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS is not set +# CONFIG_FEATURE_START_STOP_DAEMON_FANCY is not set +# CONFIG_WHICH is not set + +# +# klibc-utils +# +# CONFIG_MINIPS is not set +# CONFIG_NUKE is not set +# CONFIG_RESUME is not set +# CONFIG_RUN_INIT is not set + +# +# Editors +# +# CONFIG_AWK is not set +# CONFIG_FEATURE_AWK_LIBM is not set +# CONFIG_FEATURE_AWK_GNU_EXTENSIONS is not set +# CONFIG_CMP is not set +# CONFIG_DIFF is not set +# CONFIG_FEATURE_DIFF_LONG_OPTIONS is not set +# CONFIG_FEATURE_DIFF_DIR is not set +# CONFIG_ED is not set +# CONFIG_PATCH is not set +CONFIG_SED=y +# CONFIG_VI is not set +CONFIG_FEATURE_VI_MAX_LEN=0 +# CONFIG_FEATURE_VI_8BIT is not set +# CONFIG_FEATURE_VI_COLON is not set +# CONFIG_FEATURE_VI_COLON_EXPAND is not set +# CONFIG_FEATURE_VI_YANKMARK is not set +# CONFIG_FEATURE_VI_SEARCH is not set +# CONFIG_FEATURE_VI_REGEX_SEARCH is not set +# CONFIG_FEATURE_VI_USE_SIGNALS is not set +# CONFIG_FEATURE_VI_DOT_CMD is not set +# CONFIG_FEATURE_VI_READONLY is not set +# CONFIG_FEATURE_VI_SETOPTS is not set +# CONFIG_FEATURE_VI_SET is not set +# CONFIG_FEATURE_VI_WIN_RESIZE is not set +# CONFIG_FEATURE_VI_ASK_TERMINAL is not set +# CONFIG_FEATURE_VI_UNDO is not set +# CONFIG_FEATURE_VI_UNDO_QUEUE is not set +CONFIG_FEATURE_VI_UNDO_QUEUE_MAX=0 +# CONFIG_FEATURE_VI_VERBOSE_STATUS is not set +# CONFIG_FEATURE_ALLOW_EXEC is not set + +# +# Finding Utilities +# +# CONFIG_FIND is not set +# CONFIG_FEATURE_FIND_PRINT0 is not set +# CONFIG_FEATURE_FIND_MTIME is not set +# CONFIG_FEATURE_FIND_MMIN is not set +# CONFIG_FEATURE_FIND_PERM is not set +# CONFIG_FEATURE_FIND_TYPE is not set +# CONFIG_FEATURE_FIND_EXECUTABLE is not set +# CONFIG_FEATURE_FIND_XDEV is not set +# CONFIG_FEATURE_FIND_MAXDEPTH is not set +# CONFIG_FEATURE_FIND_NEWER is not set +# CONFIG_FEATURE_FIND_INUM is not set +# CONFIG_FEATURE_FIND_EXEC is not set +# CONFIG_FEATURE_FIND_EXEC_PLUS is not set +# CONFIG_FEATURE_FIND_USER is not set +# CONFIG_FEATURE_FIND_GROUP is not set +# CONFIG_FEATURE_FIND_NOT is not set +# CONFIG_FEATURE_FIND_DEPTH is not set +# CONFIG_FEATURE_FIND_PAREN is not set +# CONFIG_FEATURE_FIND_SIZE is not set +# CONFIG_FEATURE_FIND_PRUNE is not set +# CONFIG_FEATURE_FIND_QUIT is not set +# CONFIG_FEATURE_FIND_DELETE is not set +# CONFIG_FEATURE_FIND_EMPTY is not set +# CONFIG_FEATURE_FIND_PATH is not set +# CONFIG_FEATURE_FIND_REGEX is not set +# CONFIG_FEATURE_FIND_CONTEXT is not set +# CONFIG_FEATURE_FIND_LINKS is not set +CONFIG_GREP=y +# CONFIG_EGREP is not set +# CONFIG_FGREP is not set +CONFIG_FEATURE_GREP_CONTEXT=y +# CONFIG_XARGS is not set +# CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION is not set +# CONFIG_FEATURE_XARGS_SUPPORT_QUOTES is not set +# CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT is not set +# CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM is not set +# CONFIG_FEATURE_XARGS_SUPPORT_REPL_STR is not set +# CONFIG_FEATURE_XARGS_SUPPORT_PARALLEL is not set +# CONFIG_FEATURE_XARGS_SUPPORT_ARGS_FILE is not set + +# +# Init Utilities +# +# CONFIG_BOOTCHARTD is not set +# CONFIG_FEATURE_BOOTCHARTD_BLOATED_HEADER is not set +# CONFIG_FEATURE_BOOTCHARTD_CONFIG_FILE is not set +# CONFIG_HALT is not set +# CONFIG_POWEROFF is not set +# CONFIG_REBOOT is not set +# CONFIG_FEATURE_WAIT_FOR_INIT is not set +# CONFIG_FEATURE_CALL_TELINIT is not set +CONFIG_TELINIT_PATH="" +# CONFIG_INIT is not set +# CONFIG_LINUXRC is not set +# CONFIG_FEATURE_USE_INITTAB is not set +# CONFIG_FEATURE_KILL_REMOVED is not set +CONFIG_FEATURE_KILL_DELAY=0 +# CONFIG_FEATURE_INIT_SCTTY is not set +# CONFIG_FEATURE_INIT_SYSLOG is not set +# CONFIG_FEATURE_INIT_QUIET is not set +# CONFIG_FEATURE_INIT_COREDUMPS is not set +CONFIG_INIT_TERMINAL_TYPE="" +# CONFIG_FEATURE_INIT_MODIFY_CMDLINE is not set + +# +# Login/Password Management Utilities +# +# CONFIG_FEATURE_SHADOWPASSWDS is not set +# CONFIG_USE_BB_PWD_GRP is not set +# CONFIG_USE_BB_SHADOW is not set +# CONFIG_USE_BB_CRYPT is not set +# CONFIG_USE_BB_CRYPT_SHA is not set +# CONFIG_ADD_SHELL is not set +# CONFIG_REMOVE_SHELL is not set +# CONFIG_ADDGROUP is not set +# CONFIG_FEATURE_ADDUSER_TO_GROUP is not set +# CONFIG_ADDUSER is not set +# CONFIG_FEATURE_CHECK_NAMES is not set +CONFIG_LAST_ID=0 +CONFIG_FIRST_SYSTEM_ID=0 +CONFIG_LAST_SYSTEM_ID=0 +# CONFIG_CHPASSWD is not set +CONFIG_FEATURE_DEFAULT_PASSWD_ALGO="" +# CONFIG_CRYPTPW is not set +# CONFIG_MKPASSWD is not set +# CONFIG_DELUSER is not set +# CONFIG_DELGROUP is not set +# CONFIG_FEATURE_DEL_USER_FROM_GROUP is not set +# CONFIG_GETTY is not set +# CONFIG_LOGIN is not set +# CONFIG_LOGIN_SESSION_AS_CHILD is not set +# CONFIG_LOGIN_SCRIPTS is not set +# CONFIG_FEATURE_NOLOGIN is not set +# CONFIG_FEATURE_SECURETTY is not set +# CONFIG_PASSWD is not set +# CONFIG_FEATURE_PASSWD_WEAK_CHECK is not set +# CONFIG_SU is not set +# CONFIG_FEATURE_SU_SYSLOG is not set +# CONFIG_FEATURE_SU_CHECKS_SHELLS is not set +# CONFIG_FEATURE_SU_BLANK_PW_NEEDS_SECURE_TTY is not set +# CONFIG_SULOGIN is not set +# CONFIG_VLOCK is not set + +# +# Linux Ext2 FS Progs +# +# CONFIG_CHATTR is not set +# CONFIG_FSCK is not set +# CONFIG_LSATTR is not set +# CONFIG_TUNE2FS is not set + +# +# Linux Module Utilities +# +# CONFIG_MODPROBE_SMALL is not set +# CONFIG_DEPMOD is not set +# CONFIG_INSMOD is not set +# CONFIG_LSMOD is not set +# CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT is not set +# CONFIG_MODINFO is not set +# CONFIG_MODPROBE is not set +# CONFIG_FEATURE_MODPROBE_BLACKLIST is not set +# CONFIG_RMMOD is not set + +# +# Options common to multiple modutils +# +# CONFIG_FEATURE_CMDLINE_MODULE_OPTIONS is not set +# CONFIG_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED is not set +# CONFIG_FEATURE_2_4_MODULES is not set +# CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set +# CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set +# CONFIG_FEATURE_INSMOD_LOADINKMEM is not set +# CONFIG_FEATURE_INSMOD_LOAD_MAP is not set +# CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL is not set +# CONFIG_FEATURE_CHECK_TAINTED_MODULE is not set +# CONFIG_FEATURE_INSMOD_TRY_MMAP is not set +# CONFIG_FEATURE_MODUTILS_ALIAS is not set +# CONFIG_FEATURE_MODUTILS_SYMBOLS is not set +CONFIG_DEFAULT_MODULES_DIR="" +CONFIG_DEFAULT_DEPMOD_FILE="" + +# +# Linux System Utilities +# +# CONFIG_ACPID is not set +# CONFIG_FEATURE_ACPID_COMPAT is not set +# CONFIG_BLKDISCARD is not set +# CONFIG_BLKID is not set +# CONFIG_FEATURE_BLKID_TYPE is not set +# CONFIG_BLOCKDEV is not set +# CONFIG_CAL is not set +# CONFIG_CHRT is not set +# CONFIG_DMESG is not set +# CONFIG_FEATURE_DMESG_PRETTY is not set +# CONFIG_EJECT is not set +# CONFIG_FEATURE_EJECT_SCSI is not set +# CONFIG_FALLOCATE is not set +# CONFIG_FATATTR is not set +# CONFIG_FBSET is not set +# CONFIG_FEATURE_FBSET_FANCY is not set +# CONFIG_FEATURE_FBSET_READMODE is not set +# CONFIG_FDFORMAT is not set +# CONFIG_FDISK is not set +# CONFIG_FDISK_SUPPORT_LARGE_DISKS is not set +# CONFIG_FEATURE_FDISK_WRITABLE is not set +# CONFIG_FEATURE_AIX_LABEL is not set +# CONFIG_FEATURE_SGI_LABEL is not set +# CONFIG_FEATURE_SUN_LABEL is not set +# CONFIG_FEATURE_OSF_LABEL is not set +# CONFIG_FEATURE_GPT_LABEL is not set +# CONFIG_FEATURE_FDISK_ADVANCED is not set +# CONFIG_FINDFS is not set +# CONFIG_FLOCK is not set +# CONFIG_FDFLUSH is not set +# CONFIG_FREERAMDISK is not set +# CONFIG_FSCK_MINIX is not set +# CONFIG_FSFREEZE is not set +# CONFIG_FSTRIM is not set +# CONFIG_GETOPT is not set +# CONFIG_FEATURE_GETOPT_LONG is not set +# CONFIG_HEXDUMP is not set +# CONFIG_HD is not set +# CONFIG_XXD is not set +# CONFIG_HWCLOCK is not set +# CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS is not set +# CONFIG_IONICE is not set +# CONFIG_IPCRM is not set +# CONFIG_IPCS is not set +# CONFIG_LAST is not set +# CONFIG_FEATURE_LAST_FANCY is not set +# CONFIG_LOSETUP is not set +# CONFIG_LSPCI is not set +# CONFIG_LSUSB is not set +# CONFIG_MDEV is not set +# CONFIG_FEATURE_MDEV_CONF is not set +# CONFIG_FEATURE_MDEV_RENAME is not set +# CONFIG_FEATURE_MDEV_RENAME_REGEXP is not set +# CONFIG_FEATURE_MDEV_EXEC is not set +# CONFIG_FEATURE_MDEV_LOAD_FIRMWARE is not set +# CONFIG_FEATURE_MDEV_DAEMON is not set +# CONFIG_MESG is not set +# CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP is not set +# CONFIG_MKE2FS is not set +# CONFIG_MKFS_EXT2 is not set +# CONFIG_MKFS_MINIX is not set +# CONFIG_FEATURE_MINIX2 is not set +# CONFIG_MKFS_REISER is not set +# CONFIG_MKDOSFS is not set +# CONFIG_MKFS_VFAT is not set +# CONFIG_MKSWAP is not set +# CONFIG_FEATURE_MKSWAP_UUID is not set +# CONFIG_MORE is not set +# CONFIG_MOUNT is not set +# CONFIG_FEATURE_MOUNT_FAKE is not set +# CONFIG_FEATURE_MOUNT_VERBOSE is not set +# CONFIG_FEATURE_MOUNT_HELPERS is not set +# CONFIG_FEATURE_MOUNT_LABEL is not set +# CONFIG_FEATURE_MOUNT_NFS is not set +# CONFIG_FEATURE_MOUNT_CIFS is not set +# CONFIG_FEATURE_MOUNT_FLAGS is not set +# CONFIG_FEATURE_MOUNT_FSTAB is not set +# CONFIG_FEATURE_MOUNT_OTHERTAB is not set +# CONFIG_MOUNTPOINT is not set +# CONFIG_NOLOGIN is not set +# CONFIG_NOLOGIN_DEPENDENCIES is not set +# CONFIG_NSENTER is not set +# CONFIG_PIVOT_ROOT is not set +# CONFIG_RDATE is not set +# CONFIG_RDEV is not set +# CONFIG_READPROFILE is not set +# CONFIG_RENICE is not set +# CONFIG_REV is not set +# CONFIG_RTCWAKE is not set +# CONFIG_SCRIPT is not set +# CONFIG_SCRIPTREPLAY is not set +# CONFIG_SETARCH is not set +# CONFIG_LINUX32 is not set +# CONFIG_LINUX64 is not set +# CONFIG_SETPRIV is not set +# CONFIG_FEATURE_SETPRIV_DUMP is not set +# CONFIG_FEATURE_SETPRIV_CAPABILITIES is not set +# CONFIG_FEATURE_SETPRIV_CAPABILITY_NAMES is not set +# CONFIG_SETSID is not set +# CONFIG_SWAPON is not set +# CONFIG_FEATURE_SWAPON_DISCARD is not set +# CONFIG_FEATURE_SWAPON_PRI is not set +# CONFIG_SWAPOFF is not set +# CONFIG_FEATURE_SWAPONOFF_LABEL is not set +# CONFIG_SWITCH_ROOT is not set +# CONFIG_TASKSET is not set +# CONFIG_FEATURE_TASKSET_FANCY is not set +# CONFIG_FEATURE_TASKSET_CPULIST is not set +# CONFIG_UEVENT is not set +# CONFIG_UMOUNT is not set +# CONFIG_FEATURE_UMOUNT_ALL is not set +# CONFIG_UNSHARE is not set +# CONFIG_WALL is not set +# CONFIG_FEATURE_MOUNT_LOOP is not set +# CONFIG_FEATURE_MOUNT_LOOP_CREATE is not set +# CONFIG_FEATURE_MTAB_SUPPORT is not set +# CONFIG_VOLUMEID is not set +# CONFIG_FEATURE_VOLUMEID_BCACHE is not set +# CONFIG_FEATURE_VOLUMEID_BTRFS is not set +# CONFIG_FEATURE_VOLUMEID_CRAMFS is not set +# CONFIG_FEATURE_VOLUMEID_EROFS is not set +# CONFIG_FEATURE_VOLUMEID_EXFAT is not set +# CONFIG_FEATURE_VOLUMEID_EXT is not set +# CONFIG_FEATURE_VOLUMEID_F2FS is not set +# CONFIG_FEATURE_VOLUMEID_FAT is not set +# CONFIG_FEATURE_VOLUMEID_HFS is not set +# CONFIG_FEATURE_VOLUMEID_ISO9660 is not set +# CONFIG_FEATURE_VOLUMEID_JFS is not set +# CONFIG_FEATURE_VOLUMEID_LFS is not set +# CONFIG_FEATURE_VOLUMEID_LINUXRAID is not set +# CONFIG_FEATURE_VOLUMEID_LINUXSWAP is not set +# CONFIG_FEATURE_VOLUMEID_LUKS is not set +# CONFIG_FEATURE_VOLUMEID_MINIX is not set +# CONFIG_FEATURE_VOLUMEID_NILFS is not set +# CONFIG_FEATURE_VOLUMEID_NTFS is not set +# CONFIG_FEATURE_VOLUMEID_OCFS2 is not set +# CONFIG_FEATURE_VOLUMEID_REISERFS is not set +# CONFIG_FEATURE_VOLUMEID_ROMFS is not set +# CONFIG_FEATURE_VOLUMEID_SQUASHFS is not set +# CONFIG_FEATURE_VOLUMEID_SYSV is not set +# CONFIG_FEATURE_VOLUMEID_UBIFS is not set +# CONFIG_FEATURE_VOLUMEID_UDF is not set +# CONFIG_FEATURE_VOLUMEID_XFS is not set + +# +# Miscellaneous Utilities +# +# CONFIG_ADJTIMEX is not set +# CONFIG_ASCII is not set +# CONFIG_BBCONFIG is not set +# CONFIG_FEATURE_COMPRESS_BBCONFIG is not set +# CONFIG_BC is not set +# CONFIG_DC is not set +# CONFIG_FEATURE_DC_BIG is not set +# CONFIG_FEATURE_DC_LIBM is not set +# CONFIG_FEATURE_BC_INTERACTIVE is not set +# CONFIG_FEATURE_BC_LONG_OPTIONS is not set +# CONFIG_BEEP is not set +CONFIG_FEATURE_BEEP_FREQ=0 +CONFIG_FEATURE_BEEP_LENGTH_MS=0 +# CONFIG_CHAT is not set +# CONFIG_FEATURE_CHAT_NOFAIL is not set +# CONFIG_FEATURE_CHAT_TTY_HIFI is not set +# CONFIG_FEATURE_CHAT_IMPLICIT_CR is not set +# CONFIG_FEATURE_CHAT_SWALLOW_OPTS is not set +# CONFIG_FEATURE_CHAT_SEND_ESCAPES is not set +# CONFIG_FEATURE_CHAT_VAR_ABORT_LEN is not set +# CONFIG_FEATURE_CHAT_CLR_ABORT is not set +# CONFIG_CONSPY is not set +# CONFIG_CROND is not set +# CONFIG_FEATURE_CROND_D is not set +# CONFIG_FEATURE_CROND_CALL_SENDMAIL is not set +# CONFIG_FEATURE_CROND_SPECIAL_TIMES is not set +CONFIG_FEATURE_CROND_DIR="" +# CONFIG_CRONTAB is not set +# CONFIG_DEVFSD is not set +# CONFIG_DEVFSD_MODLOAD is not set +# CONFIG_DEVFSD_FG_NP is not set +# CONFIG_DEVFSD_VERBOSE is not set +# CONFIG_FEATURE_DEVFS is not set +# CONFIG_DEVMEM is not set +# CONFIG_FBSPLASH is not set +# CONFIG_FLASH_ERASEALL is not set +# CONFIG_FLASH_LOCK is not set +# CONFIG_FLASH_UNLOCK is not set +# CONFIG_FLASHCP is not set +# CONFIG_HDPARM is not set +# CONFIG_FEATURE_HDPARM_GET_IDENTITY is not set +# CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF is not set +# CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF is not set +# CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET is not set +# CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF is not set +# CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA is not set +# CONFIG_HEXEDIT is not set +# CONFIG_I2CGET is not set +# CONFIG_I2CSET is not set +# CONFIG_I2CDUMP is not set +# CONFIG_I2CDETECT is not set +# CONFIG_I2CTRANSFER is not set +# CONFIG_INOTIFYD is not set +CONFIG_LESS=y +CONFIG_FEATURE_LESS_MAXLINES=9999999 +CONFIG_FEATURE_LESS_BRACKETS=y +CONFIG_FEATURE_LESS_FLAGS=y +CONFIG_FEATURE_LESS_TRUNCATE=y +CONFIG_FEATURE_LESS_MARKS=y +CONFIG_FEATURE_LESS_REGEXP=y +CONFIG_FEATURE_LESS_WINCH=y +CONFIG_FEATURE_LESS_ASK_TERMINAL=y +CONFIG_FEATURE_LESS_DASHCMD=y +CONFIG_FEATURE_LESS_LINENUMS=y +CONFIG_FEATURE_LESS_RAW=y +CONFIG_FEATURE_LESS_ENV=y +# CONFIG_LSSCSI is not set +# CONFIG_MAKEDEVS is not set +# CONFIG_FEATURE_MAKEDEVS_LEAF is not set +# CONFIG_FEATURE_MAKEDEVS_TABLE is not set +# CONFIG_MAN is not set +# CONFIG_MICROCOM is not set +# CONFIG_MIM is not set +# CONFIG_MT is not set +# CONFIG_NANDWRITE is not set +# CONFIG_NANDDUMP is not set +# CONFIG_PARTPROBE is not set +# CONFIG_RAIDAUTORUN is not set +CONFIG_READAHEAD=y +# CONFIG_RFKILL is not set +# CONFIG_RUNLEVEL is not set +# CONFIG_RX is not set +# CONFIG_SETFATTR is not set +# CONFIG_SETSERIAL is not set +# CONFIG_STRINGS is not set +# CONFIG_TIME is not set +# CONFIG_TS is not set +# CONFIG_TTYSIZE is not set +# CONFIG_UBIATTACH is not set +# CONFIG_UBIDETACH is not set +# CONFIG_UBIMKVOL is not set +# CONFIG_UBIRMVOL is not set +# CONFIG_UBIRSVOL is not set +# CONFIG_UBIUPDATEVOL is not set +# CONFIG_UBIRENAME is not set +# CONFIG_VOLNAME is not set +# CONFIG_WATCHDOG is not set +# CONFIG_FEATURE_WATCHDOG_OPEN_TWICE is not set + +# +# Networking Utilities +# +CONFIG_FEATURE_IPV6=y +# CONFIG_FEATURE_UNIX_LOCAL is not set +CONFIG_FEATURE_PREFER_IPV4_ADDRESS=y +# CONFIG_VERBOSE_RESOLUTION_ERRORS is not set +# CONFIG_FEATURE_TLS_SHA1 is not set +# CONFIG_ARP is not set +# CONFIG_ARPING is not set +# CONFIG_BRCTL is not set +# CONFIG_FEATURE_BRCTL_FANCY is not set +# CONFIG_FEATURE_BRCTL_SHOW is not set +# CONFIG_DNSD is not set +# CONFIG_ETHER_WAKE is not set +# CONFIG_FTPD is not set +# CONFIG_FEATURE_FTPD_WRITE is not set +# CONFIG_FEATURE_FTPD_ACCEPT_BROKEN_LIST is not set +# CONFIG_FEATURE_FTPD_AUTHENTICATION is not set +# CONFIG_FTPGET is not set +# CONFIG_FTPPUT is not set +# CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS is not set +# CONFIG_HOSTNAME is not set +# CONFIG_DNSDOMAINNAME is not set +# CONFIG_HTTPD is not set +# CONFIG_FEATURE_HTTPD_RANGES is not set +# CONFIG_FEATURE_HTTPD_SETUID is not set +# CONFIG_FEATURE_HTTPD_BASIC_AUTH is not set +# CONFIG_FEATURE_HTTPD_AUTH_MD5 is not set +# CONFIG_FEATURE_HTTPD_CGI is not set +# CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR is not set +# CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV is not set +# CONFIG_FEATURE_HTTPD_ENCODE_URL_STR is not set +# CONFIG_FEATURE_HTTPD_ERROR_PAGES is not set +# CONFIG_FEATURE_HTTPD_PROXY is not set +# CONFIG_FEATURE_HTTPD_GZIP is not set +# CONFIG_FEATURE_HTTPD_ETAG is not set +# CONFIG_FEATURE_HTTPD_LAST_MODIFIED is not set +# CONFIG_FEATURE_HTTPD_DATE is not set +# CONFIG_FEATURE_HTTPD_ACL_IP is not set +# CONFIG_IFCONFIG is not set +# CONFIG_FEATURE_IFCONFIG_STATUS is not set +# CONFIG_FEATURE_IFCONFIG_SLIP is not set +# CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ is not set +# CONFIG_FEATURE_IFCONFIG_HW is not set +# CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS is not set +# CONFIG_IFENSLAVE is not set +# CONFIG_IFPLUGD is not set +# CONFIG_IFUP is not set +# CONFIG_IFDOWN is not set +CONFIG_IFUPDOWN_IFSTATE_PATH="" +# CONFIG_FEATURE_IFUPDOWN_IP is not set +# CONFIG_FEATURE_IFUPDOWN_IPV4 is not set +# CONFIG_FEATURE_IFUPDOWN_IPV6 is not set +# CONFIG_FEATURE_IFUPDOWN_MAPPING is not set +# CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP is not set +# CONFIG_INETD is not set +# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO is not set +# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD is not set +# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME is not set +# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME is not set +# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN is not set +# CONFIG_FEATURE_INETD_RPC is not set +CONFIG_IP=y +# CONFIG_IPADDR is not set +# CONFIG_IPLINK is not set +# CONFIG_IPROUTE is not set +# CONFIG_IPTUNNEL is not set +# CONFIG_IPRULE is not set +# CONFIG_IPNEIGH is not set +CONFIG_FEATURE_IP_ADDRESS=y +CONFIG_FEATURE_IP_LINK=y +CONFIG_FEATURE_IP_ROUTE=y +CONFIG_FEATURE_IP_ROUTE_DIR="/etc/iproute2" +CONFIG_FEATURE_IP_TUNNEL=y +CONFIG_FEATURE_IP_RULE=y +CONFIG_FEATURE_IP_NEIGH=y +# CONFIG_FEATURE_IP_RARE_PROTOCOLS is not set +# CONFIG_IPCALC is not set +# CONFIG_FEATURE_IPCALC_LONG_OPTIONS is not set +# CONFIG_FEATURE_IPCALC_FANCY is not set +# CONFIG_FAKEIDENTD is not set +# CONFIG_NAMEIF is not set +# CONFIG_FEATURE_NAMEIF_EXTENDED is not set +# CONFIG_NBDCLIENT is not set +# CONFIG_NC is not set +# CONFIG_NETCAT is not set +# CONFIG_NC_SERVER is not set +# CONFIG_NC_EXTRA is not set +# CONFIG_NC_110_COMPAT is not set +CONFIG_NETSTAT=y +CONFIG_FEATURE_NETSTAT_WIDE=y +CONFIG_FEATURE_NETSTAT_PRG=y +# CONFIG_NSLOOKUP is not set +# CONFIG_FEATURE_NSLOOKUP_BIG is not set +# CONFIG_FEATURE_NSLOOKUP_LONG_OPTIONS is not set +# CONFIG_NTPD is not set +# CONFIG_FEATURE_NTPD_SERVER is not set +# CONFIG_FEATURE_NTPD_CONF is not set +# CONFIG_FEATURE_NTP_AUTH is not set +CONFIG_PING=y +CONFIG_PING6=y +CONFIG_FEATURE_FANCY_PING=y +# CONFIG_PSCAN is not set +# CONFIG_ROUTE is not set +# CONFIG_SLATTACH is not set +CONFIG_SSL_CLIENT=y +# CONFIG_TC is not set +# CONFIG_FEATURE_TC_INGRESS is not set +# CONFIG_TCPSVD is not set +# CONFIG_UDPSVD is not set +# CONFIG_TELNET is not set +# CONFIG_FEATURE_TELNET_TTYPE is not set +# CONFIG_FEATURE_TELNET_AUTOLOGIN is not set +# CONFIG_FEATURE_TELNET_WIDTH is not set +# CONFIG_TELNETD is not set +# CONFIG_FEATURE_TELNETD_STANDALONE is not set +# CONFIG_FEATURE_TELNETD_INETD_WAIT is not set +# CONFIG_TFTP is not set +# CONFIG_FEATURE_TFTP_PROGRESS_BAR is not set +# CONFIG_FEATURE_TFTP_HPA_COMPAT is not set +# CONFIG_TFTPD is not set +# CONFIG_FEATURE_TFTP_GET is not set +# CONFIG_FEATURE_TFTP_PUT is not set +# CONFIG_FEATURE_TFTP_BLOCKSIZE is not set +# CONFIG_TFTP_DEBUG is not set +CONFIG_TLS=y +# CONFIG_TRACEROUTE is not set +# CONFIG_TRACEROUTE6 is not set +# CONFIG_FEATURE_TRACEROUTE_VERBOSE is not set +# CONFIG_FEATURE_TRACEROUTE_USE_ICMP is not set +# CONFIG_TUNCTL is not set +# CONFIG_FEATURE_TUNCTL_UG is not set +# CONFIG_VCONFIG is not set +CONFIG_WGET=y +CONFIG_FEATURE_WGET_LONG_OPTIONS=y +CONFIG_FEATURE_WGET_STATUSBAR=y +# CONFIG_FEATURE_WGET_FTP is not set +# CONFIG_FEATURE_WGET_AUTHENTICATION is not set +CONFIG_FEATURE_WGET_TIMEOUT=y +CONFIG_FEATURE_WGET_HTTPS=y +# CONFIG_FEATURE_WGET_OPENSSL is not set +# CONFIG_WHOIS is not set +# CONFIG_ZCIP is not set +# CONFIG_UDHCPD is not set +# CONFIG_FEATURE_UDHCPD_BASE_IP_ON_MAC is not set +# CONFIG_FEATURE_UDHCPD_WRITE_LEASES_EARLY is not set +CONFIG_DHCPD_LEASES_FILE="" +# CONFIG_DUMPLEASES is not set +# CONFIG_DHCPRELAY is not set +# CONFIG_UDHCPC is not set +# CONFIG_FEATURE_UDHCPC_ARPING is not set +# CONFIG_FEATURE_UDHCPC_SANITIZEOPT is not set +CONFIG_UDHCPC_DEFAULT_SCRIPT="" +# CONFIG_UDHCPC6 is not set +# CONFIG_FEATURE_UDHCPC6_RFC3646 is not set +# CONFIG_FEATURE_UDHCPC6_RFC4704 is not set +# CONFIG_FEATURE_UDHCPC6_RFC4833 is not set +# CONFIG_FEATURE_UDHCPC6_RFC5970 is not set +CONFIG_UDHCPC_DEFAULT_INTERFACE="" +# CONFIG_FEATURE_UDHCP_PORT is not set +CONFIG_UDHCP_DEBUG=0 +CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=0 +# CONFIG_FEATURE_UDHCP_RFC3397 is not set +# CONFIG_FEATURE_UDHCP_8021Q is not set +CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="" + +# +# Print Utilities +# +# CONFIG_LPD is not set +# CONFIG_LPR is not set +# CONFIG_LPQ is not set + +# +# Mail Utilities +# +# CONFIG_MAKEMIME is not set +# CONFIG_POPMAILDIR is not set +# CONFIG_FEATURE_POPMAILDIR_DELIVERY is not set +# CONFIG_REFORMIME is not set +# CONFIG_FEATURE_REFORMIME_COMPAT is not set +# CONFIG_SENDMAIL is not set +CONFIG_FEATURE_MIME_CHARSET="" + +# +# Process Utilities +# +CONFIG_FREE=y +CONFIG_FUSER=y +# CONFIG_IOSTAT is not set +CONFIG_KILL=y +# CONFIG_KILLALL is not set +# CONFIG_KILLALL5 is not set +CONFIG_LSOF=y +# CONFIG_MPSTAT is not set +# CONFIG_NMETER is not set +CONFIG_PGREP=y +CONFIG_PKILL=y +CONFIG_PIDOF=y +CONFIG_FEATURE_PIDOF_SINGLE=y +CONFIG_FEATURE_PIDOF_OMIT=y +# CONFIG_PMAP is not set +# CONFIG_POWERTOP is not set +# CONFIG_FEATURE_POWERTOP_INTERACTIVE is not set +CONFIG_PS=y +CONFIG_FEATURE_PS_WIDE=y +CONFIG_FEATURE_PS_LONG=y +# CONFIG_FEATURE_PS_TIME is not set +# CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS is not set +# CONFIG_FEATURE_PS_ADDITIONAL_COLUMNS is not set +# CONFIG_PSTREE is not set +# CONFIG_PWDX is not set +# CONFIG_SMEMCAP is not set +# CONFIG_BB_SYSCTL is not set +# CONFIG_TOP is not set +# CONFIG_FEATURE_TOP_INTERACTIVE is not set +# CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE is not set +# CONFIG_FEATURE_TOP_CPU_GLOBAL_PERCENTS is not set +# CONFIG_FEATURE_TOP_SMP_CPU is not set +# CONFIG_FEATURE_TOP_DECIMALS is not set +# CONFIG_FEATURE_TOP_SMP_PROCESS is not set +# CONFIG_FEATURE_TOPMEM is not set +CONFIG_UPTIME=y +# CONFIG_FEATURE_UPTIME_UTMP_SUPPORT is not set +# CONFIG_WATCH is not set +CONFIG_FEATURE_SHOW_THREADS=y + +# +# Runit Utilities +# +# CONFIG_CHPST is not set +# CONFIG_SETUIDGID is not set +# CONFIG_ENVUIDGID is not set +# CONFIG_ENVDIR is not set +# CONFIG_SOFTLIMIT is not set +# CONFIG_RUNSV is not set +# CONFIG_RUNSVDIR is not set +# CONFIG_FEATURE_RUNSVDIR_LOG is not set +# CONFIG_SV is not set +CONFIG_SV_DEFAULT_SERVICE_DIR="" +# CONFIG_SVC is not set +# CONFIG_SVOK is not set +# CONFIG_SVLOGD is not set +# CONFIG_CHCON is not set +# CONFIG_GETENFORCE is not set +# CONFIG_GETSEBOOL is not set +# CONFIG_LOAD_POLICY is not set +# CONFIG_MATCHPATHCON is not set +# CONFIG_RUNCON is not set +# CONFIG_SELINUXENABLED is not set +# CONFIG_SESTATUS is not set +# CONFIG_SETENFORCE is not set +# CONFIG_SETFILES is not set +# CONFIG_FEATURE_SETFILES_CHECK_OPTION is not set +# CONFIG_RESTORECON is not set +# CONFIG_SETSEBOOL is not set + +# +# Shells +# +CONFIG_SH_IS_ASH=y +# CONFIG_SH_IS_HUSH is not set +# CONFIG_SH_IS_NONE is not set +# CONFIG_BASH_IS_ASH is not set +# CONFIG_BASH_IS_HUSH is not set +CONFIG_BASH_IS_NONE=y +CONFIG_SHELL_ASH=y +CONFIG_ASH=y +# CONFIG_ASH_OPTIMIZE_FOR_SIZE is not set +# CONFIG_ASH_INTERNAL_GLOB is not set +# CONFIG_ASH_BASH_COMPAT is not set +# CONFIG_ASH_BASH_SOURCE_CURDIR is not set +# CONFIG_ASH_BASH_NOT_FOUND_HOOK is not set +CONFIG_ASH_JOB_CONTROL=y +# CONFIG_ASH_ALIAS is not set +# CONFIG_ASH_RANDOM_SUPPORT is not set +# CONFIG_ASH_EXPAND_PRMT is not set +# CONFIG_ASH_IDLE_TIMEOUT is not set +# CONFIG_ASH_MAIL is not set +CONFIG_ASH_ECHO=y +CONFIG_ASH_PRINTF=y +CONFIG_ASH_TEST=y +# CONFIG_ASH_HELP is not set +# CONFIG_ASH_GETOPTS is not set +CONFIG_ASH_CMDCMD=y +# CONFIG_CTTYHACK is not set +# CONFIG_HUSH is not set +# CONFIG_SHELL_HUSH is not set +# CONFIG_HUSH_BASH_COMPAT is not set +# CONFIG_HUSH_BRACE_EXPANSION is not set +# CONFIG_HUSH_BASH_SOURCE_CURDIR is not set +# CONFIG_HUSH_LINENO_VAR is not set +# CONFIG_HUSH_INTERACTIVE is not set +# CONFIG_HUSH_SAVEHISTORY is not set +# CONFIG_HUSH_JOB is not set +# CONFIG_HUSH_TICK is not set +# CONFIG_HUSH_IF is not set +# CONFIG_HUSH_LOOPS is not set +# CONFIG_HUSH_CASE is not set +# CONFIG_HUSH_FUNCTIONS is not set +# CONFIG_HUSH_LOCAL is not set +# CONFIG_HUSH_RANDOM_SUPPORT is not set +# CONFIG_HUSH_MODE_X is not set +# CONFIG_HUSH_ECHO is not set +# CONFIG_HUSH_PRINTF is not set +# CONFIG_HUSH_TEST is not set +# CONFIG_HUSH_HELP is not set +# CONFIG_HUSH_EXPORT is not set +# CONFIG_HUSH_EXPORT_N is not set +# CONFIG_HUSH_READONLY is not set +# CONFIG_HUSH_KILL is not set +# CONFIG_HUSH_WAIT is not set +# CONFIG_HUSH_COMMAND is not set +# CONFIG_HUSH_TRAP is not set +# CONFIG_HUSH_TYPE is not set +# CONFIG_HUSH_TIMES is not set +# CONFIG_HUSH_READ is not set +# CONFIG_HUSH_SET is not set +# CONFIG_HUSH_UNSET is not set +# CONFIG_HUSH_ULIMIT is not set +# CONFIG_HUSH_UMASK is not set +# CONFIG_HUSH_GETOPTS is not set +# CONFIG_HUSH_MEMLEAK is not set + +# +# Options common to all shells +# +CONFIG_FEATURE_SH_MATH=y +CONFIG_FEATURE_SH_MATH_64=y +CONFIG_FEATURE_SH_MATH_BASE=y +CONFIG_FEATURE_SH_EXTRA_QUIET=y +# CONFIG_FEATURE_SH_STANDALONE is not set +# CONFIG_FEATURE_SH_NOFORK is not set +# CONFIG_FEATURE_SH_READ_FRAC is not set +# CONFIG_FEATURE_SH_HISTFILESIZE is not set +# CONFIG_FEATURE_SH_EMBEDDED_SCRIPTS is not set + +# +# System Logging Utilities +# +# CONFIG_KLOGD is not set +# CONFIG_FEATURE_KLOGD_KLOGCTL is not set +# CONFIG_LOGGER is not set +# CONFIG_LOGREAD is not set +# CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING is not set +# CONFIG_SYSLOGD is not set +# CONFIG_FEATURE_ROTATE_LOGFILE is not set +# CONFIG_FEATURE_REMOTE_LOG is not set +# CONFIG_FEATURE_SYSLOGD_DUP is not set +# CONFIG_FEATURE_SYSLOGD_CFG is not set +# CONFIG_FEATURE_SYSLOGD_PRECISE_TIMESTAMPS is not set +CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE=0 +# CONFIG_FEATURE_IPC_SYSLOG is not set +CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=0 +# CONFIG_FEATURE_KMSG_SYSLOG is not set diff --git a/portage/savedconfig/sys-kernel/linux-firmware b/portage/savedconfig/sys-kernel/linux-firmware new file mode 100644 index 0000000..2a59d62 --- /dev/null +++ b/portage/savedconfig/sys-kernel/linux-firmware @@ -0,0 +1,13 @@ +brcm/brcmfmac43455-sdio.AW-CM256SM.txt +brcm/brcmfmac43455-sdio.MINIX-NEO Z83-4.txt +brcm/brcmfmac43455-sdio.Raspberry Pi Foundation-Raspberry Pi 4 Model B.txt +brcm/brcmfmac43455-sdio.Raspberry Pi Foundation-Raspberry Pi Compute Module 4.txt +brcm/brcmfmac43455-sdio.acepc-t8.txt +brcm/brcmfmac43455-sdio.beagle,am5729-beagleboneai.txt +brcm/brcmfmac43455-sdio.bin +brcm/brcmfmac43455-sdio.clm_blob +brcm/brcmfmac43455-sdio.raspberrypi,3-model-a-plus.txt +brcm/brcmfmac43455-sdio.raspberrypi,3-model-b-plus.txt +brcm/brcmfmac43455-sdio.raspberrypi,4-model-b.txt +cypress/cyfmac43455-sdio.bin +cypress/cyfmac43455-sdio.clm_blob diff --git a/post-build.sh b/post-build.sh new file mode 100755 index 0000000..cace20e --- /dev/null +++ b/post-build.sh @@ -0,0 +1,13 @@ +#!/bin/sh +# vim: set sw=4 ts=4 sts=4 et : + +set -e + +. ./config + +cp -auv \ + /usr/${target}/boot/*.bin \ + /usr/${target}/boot/*.dat \ + /usr/${target}/boot/*.elf \ + config.txt \ + output/efi-part/ diff --git a/prepare.sh b/prepare.sh new file mode 100755 index 0000000..0d8158c --- /dev/null +++ b/prepare.sh @@ -0,0 +1,38 @@ +#!/bin/sh +# vim: set sw=4 ts=4 sts=4 et : + +set -e + +. ./config + +# Ensure we have a Portage repo +if [ ! -f /var/db/repos/gentoo/metadata/timestamp ]; then + emerge-webrsync +fi + +# Migrate to the merged-usr layout +mkdir -p /usr/${target}/bin +emerge -bknv --quiet-build=y merge-usr +merge-usr --root=/usr/${target} + +if [ ! -d /usr/${target}/etc/portage/make.conf ]; then + mv /usr/${target}/etc/portage/make.conf \ + /usr/${target}/etc/portage/make.conf.orig + mkdir /usr/${target}/etc/portage/make.conf + mv /usr/${target}/etc/portage/make.conf.orig \ + /usr/${target}/etc/portage/make.conf/10-base.conf +fi + +if [ ! -d /etc/portage/make.conf ]; then + mv /etc/portage/make.conf \ + /etc/portage/make.conf.orig + mkdir /etc/portage/make.conf + mv /etc/portage/make.conf.orig \ + /etc/portage/make.conf/10-base.conf +fi + +# Set the Portage profile +ln -snf \ + /var/db/repos/gentoo/profiles/${profile} \ + /usr/${target}/etc/portage/make.profile + diff --git a/setup-local-repo.sh b/setup-local-repo.sh new file mode 100755 index 0000000..0914150 --- /dev/null +++ b/setup-local-repo.sh @@ -0,0 +1,29 @@ +#!/bin/sh +# vim: set sw=4 ts=4 sts=4 et : + +set -e + +. ./config + +mkdir -p /var/db/repos/x-portage/profiles /var/db/repos/x-portage/metadata +echo x-portage > /var/db/repos/x-portage/profiles/repo_name +echo 'masters = gentoo' > /var/db/repos/x-portage/metadata/layout.conf +mkdir -p /usr/${target}/etc/portage/repos.conf +cat > /usr/${target}/etc/portage/repos.conf/x-portage.conf <