From 8a01bcea6ce68bc27cf0baf913088e94cf3806ae Mon Sep 17 00:00:00 2001 From: Ricardo Pardini Date: Fri, 28 Jun 2024 18:18:53 +0200 Subject: [PATCH] nanopi-r5s: make u-boot fancy (ums, rockusb, leds, tcp networking stuff) - use preboot to flash all leds for 100ms, then leave power LED on --- config/boards/nanopi-r5s.csc | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/config/boards/nanopi-r5s.csc b/config/boards/nanopi-r5s.csc index c13c904392..eac8b1b94f 100644 --- a/config/boards/nanopi-r5s.csc +++ b/config/boards/nanopi-r5s.csc @@ -34,3 +34,39 @@ function post_family_tweaks__nanopir5s_udev_network_interfaces() { SUBSYSTEM=="net", ACTION=="add", KERNELS=="0001:01:00.0", NAME:="lan2" EOF } + +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" + 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 + + display_alert "u-boot for ${BOARD}" "u-boot: enable EFI debugging command" "info" + run_host_command_logged scripts/config --enable CMD_EFIDEBUG + run_host_command_logged scripts/config --enable CMD_NVEDIT_EFI + + display_alert "u-boot for ${BOARD}" "u-boot: enable more compression support" "info" + run_host_command_logged scripts/config --enable CONFIG_LZO + run_host_command_logged scripts/config --enable CONFIG_BZIP2 + run_host_command_logged scripts/config --enable CONFIG_ZSTD + + display_alert "u-boot for ${BOARD}" "u-boot: enable gpio LED support" "info" + run_host_command_logged scripts/config --enable CONFIG_LED + run_host_command_logged scripts/config --enable CONFIG_LED_GPIO + + display_alert "u-boot for ${BOARD}" "u-boot: enable networking cmds" "info" + run_host_command_logged scripts/config --enable CONFIG_CMD_NFS + run_host_command_logged scripts/config --enable CONFIG_CMD_WGET + run_host_command_logged scripts/config --enable CONFIG_CMD_DNS + run_host_command_logged scripts/config --enable CONFIG_PROT_TCP + run_host_command_logged scripts/config --enable CONFIG_PROT_TCP_SACK + + # UMS, RockUSB, gadget stuff + declare -a enable_configs=("CONFIG_CMD_USB_MASS_STORAGE" "CONFIG_USB_GADGET" "USB_GADGET_DOWNLOAD" "CONFIG_USB_FUNCTION_ROCKUSB" "CONFIG_USB_FUNCTION_ACM" "CONFIG_CMD_ROCKUSB" "CONFIG_CMD_USB_MASS_STORAGE") + for config in "${enable_configs[@]}"; do + display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: enable ${config}" "info" + run_host_command_logged scripts/config --enable "${config}" + done + # Auto-enabled by the above, force off... + run_host_command_logged scripts/config --disable USB_FUNCTION_FASTBOOT + +}