From fe73c2659a198fa9d548da70c86ab4bab02a5d2b Mon Sep 17 00:00:00 2001 From: Ricardo Pardini Date: Sat, 6 Jul 2024 20:17:45 +0200 Subject: [PATCH] nanopi-r5s: u-boot: pci enum in preboot; disable armbian-led-state - pci enum in preboot; required for working m.2 when booting some older kernels - this board has an overlay (DEFAULT_OVERLAYS="nanopi-r5s-leds") to drive the LEDs, disable armbian-led-state service --- config/boards/nanopi-r5s.csc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/config/boards/nanopi-r5s.csc b/config/boards/nanopi-r5s.csc index eac8b1b94f51..231ab89d6863 100644 --- a/config/boards/nanopi-r5s.csc +++ b/config/boards/nanopi-r5s.csc @@ -35,10 +35,18 @@ function post_family_tweaks__nanopir5s_udev_network_interfaces() { EOF } +# We've an overlay (DEFAULT_OVERLAYS="nanopi-r5s-leds") to drive the LEDs. Disable armbian-led-state service. +function pre_customize_image__nanopi-r5s_leds_kernel_only() { + display_alert "$BOARD" "Disabling armbian-led-state service since we have DEFAULT_OVERLAYS='${DEFAULT_OVERLAYS}'" "info" + chroot_sdcard systemctl --no-reload disable armbian-led-state +} + +# For UMS/RockUSB to work in u-boot, &usb_host0_xhci { dr_mode = "otg" } is required. See 0002-usb-otg-mode.patch +# Attention: the Power USB-C port is NOT the OTG port; instead, the USB-A closest to the edge is the OTG port. function post_config_uboot_target__extra_configs_for_nanopi-r5s() { - display_alert "u-boot for ${BOARD}" "u-boot: enable preboot & flash all LEDs in preboot" "info" + display_alert "u-boot for ${BOARD}" "u-boot: enable preboot & flash all LEDs and do PCI/NVMe enumeration in preboot" "info" run_host_command_logged scripts/config --enable CONFIG_USE_PREBOOT - run_host_command_logged scripts/config --set-str CONFIG_PREBOOT "'led led-power on; led led-lan1 on; led led-lan2 on; led led-wan on; sleep 0.1; led led-lan1 off; led led-lan2 off; led led-wan off'" # double quotes required due to run_host_command_logged's quirks + run_host_command_logged scripts/config --set-str CONFIG_PREBOOT "'led led-power on; led led-lan1 on; led led-lan2 on; led led-wan on; pci enum; nvme scan; led led-lan1 off; led led-lan2 off; led led-wan off'" # double quotes required due to run_host_command_logged's quirks display_alert "u-boot for ${BOARD}" "u-boot: enable EFI debugging command" "info" run_host_command_logged scripts/config --enable CMD_EFIDEBUG