Files
Arch-R/config/a_boot.ini
Douglas Teles 32941a378a Fix joypad, FN button, and audio on original R36S
Some R36S boards have SARADC ADC values in the R33S range (140-190),
causing a_boot.ini to load the R33S DTB — which has no analog sticks,
no THUMBL/THUMBR buttons, and no FN (BTN_MODE).

Fix: add GPIO2_PA2 (THUMBL) check in a_boot.ini when hwrev=r33s.
R36S has a pull-up on this pin (L3 button), R33S does not.

Audio: R36S original has an external speaker amplifier on GPIO3_PC4.
The mainline rk817_codec.c does not support the BSP-only spk-ctl-gpios
property. Fix: add simple-audio-amplifier node to the R36S DTS with
aux-devs routing through the sound card.

Also set CONFIG_SND_SOC_SIMPLE_AMPLIFIER=y (was =m).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 19:26:10 -03:00

70 lines
2.3 KiB
INI

odroidgoa-uboot-config
########################################################################
# Arch R Boot Configuration — Variant A (BSP U-Boot)
#
# For: Original R36S, OGA, OGA v1.1, OGS, R33S, RG351V, RG351M,
# GameForce Chi, MagicX XU10
#
# BSP U-Boot reads this file directly.
# hwrev is set by BSP's hwrev.c from SARADC ch0 before this runs.
#
# We ALWAYS load our DTB from partition (not U-Boot embedded) because
# our DTBs have archr-* compatible strings for joypad/panel drivers.
########################################################################
# Memory addresses
setenv loadaddr "0x02000000"
setenv dtb_loadaddr "0x01f00000"
setenv dtbo_loadaddr "0x01e00000"
# Load kernel
load mmc 1:1 ${loadaddr} KERNEL
# Map hwrev to board DTB (always load from partition)
if test ${hwrev} = 'v10-go3'; then
load mmc 1:1 ${dtb_loadaddr} dtbs/rk3326-odroid-go3.dtb
elif test ${hwrev} = 'r33s'; then
# Some R36S boards have ADC in R33S range (140-190).
# Differentiate: R36S has THUMBL button on GPIO2_PA2 (c2) with pull-up.
# R33S doesn't wire this pin → floats LOW.
gpio input c2
if test $? -eq 1; then
load mmc 1:1 ${dtb_loadaddr} dtbs/rk3326-gameconsole-r36s.dtb
else
load mmc 1:1 ${dtb_loadaddr} dtbs/rk3326-gameconsole-r33s.dtb
fi
elif test ${hwrev} = 'chi'; then
load mmc 1:1 ${dtb_loadaddr} dtbs/rk3326-gameforce-chi.dtb
elif test ${hwrev} = 'rg351v'; then
gpio input b6
if test $? -eq 0; then
load mmc 1:1 ${dtb_loadaddr} dtbs/rk3326-anbernic-rg351v.dtb
else
load mmc 1:1 ${dtb_loadaddr} dtbs/rk3326-gameconsole-r36s.dtb
fi
elif test ${hwrev} = 'v11'; then
load mmc 1:1 ${dtb_loadaddr} dtbs/rk3326-odroid-go2-v11.dtb
elif test ${hwrev} = 'v10'; then
load mmc 1:1 ${dtb_loadaddr} dtbs/rk3326-odroid-go2.dtb
elif test ${hwrev} = 'xu10'; then
load mmc 1:1 ${dtb_loadaddr} dtbs/rk3326-magicx-xu10.dtb
else
load mmc 1:1 ${dtb_loadaddr} dtbs/rk3326-odroid-go2.dtb
fi
# Apply panel overlay
if load mmc 1:1 ${dtbo_loadaddr} overlays/mipi-panel.dtbo; then
fdt addr ${dtb_loadaddr}
fdt resize 8192
fdt apply ${dtbo_loadaddr}
fi
# Boot
setenv bootargs "boot=LABEL=BOOT disk=LABEL=STORAGE rw console=ttyS2,115200 console=tty0 quiet loglevel=0 vt.global_cursor_default=0 consoleblank=0 fsck.mode=skip"
booti ${loadaddr} - ${dtb_loadaddr}
# Power off if boot fails
sleep 15
poweroff