Enable SPI1 on BBB Wireless Debian 10 Kernel 6.1

Dear all,

I am trying to enable SPI1 on the BBB wireless.

When I added only uboot_overlay_addr5=/lib/firmware/BB-SPIDEV1-00A0.dtbo, both spidev0.0 and spidev0.1 appear under /dev/.

I don’t know why I’m getting SPIDEV0 although I enabled SPI1 but at least I see a SPI device.

The big problem occurs when I enabled both SPI0 and SPI1 in /boot/uEnv.txt with all else unchanged.
( In /boot/uEnv.txt like this:

uboot_overlay_addr4=/lib/firmware/BB-SPIDEV0-00A0.dtbo
uboot_overlay_addr5=/lib/firmware/BB-SPIDEV1-00A0.dtbo

I don’t see any SPI device under /dev/. Seems like enabling SPI0 somehow disabled all SPIs.

Here is the serial message from booting: looks like both SPIDEV overlays are loaded.

U-Boot 2019.04-g923f8b8 (Jan 02 2022 - 19:05:15 +0000)

CPU  : AM335X-GP rev 2.1
I2C:   ready
DRAM:  512 MiB
No match for driver 'omap_hsmmc'
No match for driver 'omap_hsmmc'
Some drivers were not found
Reset Source: Power-on reset has occurred.
RTC 32KCLK Source: External.
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
Loading Environment from EXT4... ** File not found /boot/uboot.env **

** Unable to read "/boot/uboot.env" from mmc0:1 **
Board: BeagleBone Black
<ethaddr> not set. Validating first E-fuse MAC
BeagleBone Black:
Model: BeagleBoard.org BeagleBone Black Wireless:
BeagleBone Cape EEPROM: no EEPROM at address: 0x54
BeagleBone Cape EEPROM: no EEPROM at address: 0x55
BeagleBone Cape EEPROM: no EEPROM at address: 0x56
BeagleBone Cape EEPROM: no EEPROM at address: 0x57
Net:   eth0: MII MODE
Could not get PHY for cpsw: addr 0
cpsw, usb_ether
Press SPACE to abort autoboot in 0 seconds
board_name=[BBBW] ...
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
gpio: pin 56 (gpio 56) value is 0
gpio: pin 55 (gpio 55) value is 0
gpio: pin 54 (gpio 54) value is 0
gpio: pin 53 (gpio 53) value is 1
switch to partitions #0, OK
mmc0 is current device
gpio: pin 54 (gpio 54) value is 1
Checking for: /uEnv.txt ...
Checking for: /boot.scr ...
Checking for: /boot/boot.scr ...
Checking for: /boot/uEnv.txt ...
gpio: pin 55 (gpio 55) value is 1
2178 bytes read in 35 ms (60.5 KiB/s)
Loaded environment from /boot/uEnv.txt
Checking if uname_r is set in /boot/uEnv.txt...
gpio: pin 56 (gpio 56) value is 1
Running uname_boot ...
loading /boot/vmlinuz-6.1.12-bone-rt-r15 ...
10240512 bytes read in 686 ms (14.2 MiB/s)
debug: [enable_uboot_overlays=1] ...
debug: [enable_uboot_cape_universal=1] ...
debug: [uboot_base_dtb_univ=am335x-boneblack-uboot-univ.dtb] ...
uboot_overlays: [uboot_base_dtb=am335x-boneblack-uboot-univ.dtb] ...
uboot_overlays: Switching too: dtb=am335x-boneblack-uboot-univ.dtb ...
loading /boot/dtbs/6.1.12-bone-rt-r15/am335x-boneblack-uboot-univ.dtb ...
203340 bytes read in 60 ms (3.2 MiB/s)
uboot_overlays: [fdt_buffer=0x60000] ...
uboot_overlays: loading /boot/dtbs/6.1.12-bone-rt-r15/overlays/BB-ADC-00A0.dtbo ...
645 bytes read in 98 ms (5.9 KiB/s)
uboot_overlays: loading /lib/firmware/BB-SPIDEV0-00A0.dtbo ...
1495 bytes read in 280 ms (4.9 KiB/s)
uboot_overlays: loading /lib/firmware/BB-SPIDEV1-00A0.dtbo ...
1495 bytes read in 358 ms (3.9 KiB/s)
uboot_overlays: loading /boot/dtbs/6.1.12-bone-rt-r15/overlays/BB-BONE-eMMC1-01-00A0.dtbo ...
1519 bytes read in 107 ms (13.7 KiB/s)
uboot_overlays: uboot loading of [BB-HDMI-TDA998x-00A0.dtbo] disabled by /boot/uEnv.txt [disable_uboot                                                                                                                                       _overlay_video=1]...
uboot_overlays: uboot loading of [BB-BBBW-WL1835-00A0.dtbo] disabled by /boot/uEnv.txt [disable_uboot_                                                                                                                                       overlay_wireless=1]...
loading /boot/initrd.img-6.1.12-bone-rt-r15 ...
7333428 bytes read in 507 ms (13.8 MiB/s)
debug: [console=ttyS0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk0p1 ro rootfstype=                                                                                                                                       ext4 rootwait coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet] ...
debug: [bootz 0x82000000 0x88080000:6fe634 88000000] ...
## Flattened Device Tree blob at 88000000
   Booting using the fdt blob at 0x88000000
   Loading Ramdisk to 8f901000, end 8ffff634 ... OK
   Loading Device Tree to 8f86c000, end 8f900fff ... OK

Starting kernel ...

Here is my /boot/uEnv.txt file, in case it’s useful:

Thank you very much for any insight!

#Docs: http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0

uname_r=6.1.12-bone-rt-r15
#uuid=
#dtb=

###U-Boot Overlays###
###Documentation: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays
###Master Enable
enable_uboot_overlays=1
###
###Overide capes with eeprom
#uboot_overlay_addr0=/lib/firmware/BB-I2C1-00A0.dtbo
#uboot_overlay_addr1=/lib/firmware/BB-SPIDEV0-00A0.dtbo
#uboot_overlay_addr2=/lib/firmware/BB-PWM1-00A0.dtbo
#uboot_overlay_addr3=/lib/firmware/BB-PWM2-00A0.dtbo
###
###Additional custom capes
uboot_overlay_addr4=/lib/firmware/BB-SPIDEV0-00A0.dtbo
uboot_overlay_addr5=/lib/firmware/BB-SPIDEV1-00A0.dtbo
#uboot_overlay_addr6=/lib/firmware/<file6>.dtbo
#uboot_overlay_addr7=/lib/firmware/<file7>.dtbo
###
###Custom Cape
#dtb_overlay=/lib/firmware/<file8>.dtbo
###
###Disable auto loading of virtual capes (emmc/video/wireless/adc)
#disable_uboot_overlay_emmc=1

# According to Beaglebone forum, we need to disable hdmi output to use spi1
disable_uboot_overlay_video=1
disable_uboot_overlay_audio=1
disable_uboot_overlay_wireless=1
#disable_uboot_overlay_adc=1
###
###PRUSS OPTIONS
###pru_rproc (4.14.x-ti kernel)
#uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-14-TI-00A0.dtbo
###pru_rproc (4.19.x-ti kernel)
#uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-19-TI-00A0.dtbo
###pru_uio (4.14.x-ti, 4.19.x-ti & mainline/bone kernel)
#uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo
###
###Cape Universal Enable
enable_uboot_cape_universal=1
###
###Debug: disable uboot autoload of Cape
#disable_uboot_overlay_addr0=1
#disable_uboot_overlay_addr1=1
#disable_uboot_overlay_addr2=1
#disable_uboot_overlay_addr3=1
###
###U-Boot fdt tweaks... (60000 = 384KB)
#uboot_fdt_buffer=0x60000
###U-Boot Overlays###

cmdline=coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet

#In the event of edid real failures, uncomment this next line:
#cmdline=coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet video=HDMI-A-1:1024x768@60e

##enable Generic eMMC Flasher:
##make sure, these tools are installed: dosfstools rsync
#cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh

Here is the result from running /opt/scripts/tools/version.sh, in case it is needed:

eeprom:[A335BNLTBWA51712EW001740]
model:[TI_AM335x_BeagleBone_Black]
dogtag:[BeagleBoard.org Debian Buster Console Image 2020-04-06]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot SPL 2019.04-g923f8b8 (Jan 02 2022 - 19:05:15 +0000)]:[location: dd MBR]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2019.04-g923f8b8]:[location: dd MBR]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot SPL 2019.04-g923f8b8 (Jan 02 2022 - 19:05:15 +0000)]:[location: dd MBR]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2019.04-g923f8b8]:[location: dd MBR]
UBOOT: Booted Device-Tree:[am335x-boneblack-uboot-univ.dts]
UBOOT: Loaded Overlay:[BB-ADC-00A0.kernel]
UBOOT: Loaded Overlay:[BB-BONE-eMMC1-01-00A0.kernel]
UBOOT: Loaded Overlay:[BB-SPIDEV0-00A0]
UBOOT: Loaded Overlay:[BB-SPIDEV1-00A0]
kernel:[6.1.12-bone-rt-r15]
/boot/uEnv.txt Settings:
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_addr4=/lib/firmware/BB-SPIDEV0-00A0.dtbo]
uboot_overlay_options:[uboot_overlay_addr5=/lib/firmware/BB-SPIDEV1-00A0.dtbo]
uboot_overlay_options:[disable_uboot_overlay_video=1]
uboot_overlay_options:[disable_uboot_overlay_audio=1]
uboot_overlay_options:[disable_uboot_overlay_wireless=1]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade <pkg>]
pkg:[bb-cape-overlays]:[4.14.20210821.0-0~buster+20210821]
pkg:[bb-customizations]:[1.20221108.0-0~buster+20221108]
pkg:[bb-usb-gadgets]:[1.20220816.0-0~buster+20220816]
pkg:[bb-wl18xx-firmware]:[1.20221201.0-0~buster+20221201]
pkg:[kmod]:[26-1]
WARNING:pkg:[librobotcontrol]:[NOT_INSTALLED]
pkg:[firmware-ti-connectivity]:[20190717-2rcnee1~buster+20200305]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal bluetooth netdev gpio pwm eqep remoteproc admin spi iio i2c docker tisdk weston-launch xenomai cloud9ide]
cmdline:[console=ttyS0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet]
dmesg | grep remote
[    2.296462] remoteproc remoteproc0: wkup_m3 is available
[    2.889896] remoteproc remoteproc0: powering up wkup_m3
[    2.889928] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 217148
[    2.890165] remoteproc remoteproc0: remote processor wkup_m3 is now up
[   36.111272] remoteproc remoteproc1: 4a334000.pru is available
[   36.127766] remoteproc remoteproc2: 4a338000.pru is available
dmesg | grep pru
[   36.111272] remoteproc remoteproc1: 4a334000.pru is available
[   36.127766] remoteproc remoteproc2: 4a338000.pru is available
dmesg | grep pinctrl-single
[    2.318788] pinctrl-single 44e10800.pinmux: 142 pins, size 568
dmesg | grep gpio-of-helper
[    2.804419] gpio-of-helper ocp:cape-universal: Allocated GPIO id=0 name='P8_03'
[    2.804640] gpio-of-helper ocp:cape-universal: Allocated GPIO id=1 name='P8_04'
[    2.804842] gpio-of-helper ocp:cape-universal: Allocated GPIO id=2 name='P8_05'
[    2.805051] gpio-of-helper ocp:cape-universal: Allocated GPIO id=3 name='P8_06'
[    2.805461] gpio-of-helper ocp:cape-universal: Allocated GPIO id=4 name='P8_07'
[    2.805669] gpio-of-helper ocp:cape-universal: Allocated GPIO id=5 name='P8_08'
[    2.805849] gpio-of-helper ocp:cape-universal: Allocated GPIO id=6 name='P8_09'
[    2.806061] gpio-of-helper ocp:cape-universal: Allocated GPIO id=7 name='P8_10'
[    2.806255] gpio-of-helper ocp:cape-universal: Allocated GPIO id=8 name='P8_11'
[    2.806457] gpio-of-helper ocp:cape-universal: Allocated GPIO id=9 name='P8_12'
[    2.806509] gpio-of-helper ocp:cape-universal: Failed to get gpio property of 'P8_13'
[    2.806517] gpio-of-helper ocp:cape-universal: Failed to create gpio entry
[    2.924439] gpio-of-helper ocp:cape-universal: Allocated GPIO id=0 name='P8_03'
[    2.924630] gpio-of-helper ocp:cape-universal: Allocated GPIO id=1 name='P8_04'
[    2.924768] gpio-of-helper ocp:cape-universal: Allocated GPIO id=2 name='P8_05'
[    2.924905] gpio-of-helper ocp:cape-universal: Allocated GPIO id=3 name='P8_06'
[    2.925124] gpio-of-helper ocp:cape-universal: Allocated GPIO id=4 name='P8_07'
[    2.925262] gpio-of-helper ocp:cape-universal: Allocated GPIO id=5 name='P8_08'
[    2.925407] gpio-of-helper ocp:cape-universal: Allocated GPIO id=6 name='P8_09'
[    2.925537] gpio-of-helper ocp:cape-universal: Allocated GPIO id=7 name='P8_10'
[    2.925686] gpio-of-helper ocp:cape-universal: Allocated GPIO id=8 name='P8_11'
[    2.925819] gpio-of-helper ocp:cape-universal: Allocated GPIO id=9 name='P8_12'
[    2.926061] gpio-of-helper ocp:cape-universal: Allocated GPIO id=10 name='P8_13'
[    2.926272] gpio-of-helper ocp:cape-universal: Allocated GPIO id=11 name='P8_14'
[    2.926477] gpio-of-helper ocp:cape-universal: Allocated GPIO id=12 name='P8_15'
[    2.926667] gpio-of-helper ocp:cape-universal: Allocated GPIO id=13 name='P8_16'
[    2.926853] gpio-of-helper ocp:cape-universal: Allocated GPIO id=14 name='P8_17'
[    2.927326] gpio-of-helper ocp:cape-universal: Allocated GPIO id=15 name='P8_18'
[    2.927546] gpio-of-helper ocp:cape-universal: Allocated GPIO id=16 name='P8_19'
[    2.927756] gpio-of-helper ocp:cape-universal: Allocated GPIO id=17 name='P8_20'
[    2.927948] gpio-of-helper ocp:cape-universal: Allocated GPIO id=18 name='P8_21'
[    2.928134] gpio-of-helper ocp:cape-universal: Allocated GPIO id=19 name='P8_22'
[    2.928326] gpio-of-helper ocp:cape-universal: Allocated GPIO id=20 name='P8_23'
[    2.928521] gpio-of-helper ocp:cape-universal: Allocated GPIO id=21 name='P8_24'
[    2.928712] gpio-of-helper ocp:cape-universal: Allocated GPIO id=22 name='P8_25'
[    2.928914] gpio-of-helper ocp:cape-universal: Allocated GPIO id=23 name='P8_26'
[    2.929099] gpio-of-helper ocp:cape-universal: Allocated GPIO id=24 name='P8_27'
[    2.929293] gpio-of-helper ocp:cape-universal: Allocated GPIO id=25 name='P8_28'
[    2.929470] gpio-of-helper ocp:cape-universal: Allocated GPIO id=26 name='P8_29'
[    2.929669] gpio-of-helper ocp:cape-universal: Allocated GPIO id=27 name='P8_30'
[    2.929865] gpio-of-helper ocp:cape-universal: Allocated GPIO id=28 name='P8_31'
[    2.930046] gpio-of-helper ocp:cape-universal: Allocated GPIO id=29 name='P8_32'
[    2.930248] gpio-of-helper ocp:cape-universal: Allocated GPIO id=30 name='P8_33'
[    2.930439] gpio-of-helper ocp:cape-universal: Allocated GPIO id=31 name='P8_34'
[    2.930623] gpio-of-helper ocp:cape-universal: Allocated GPIO id=32 name='P8_35'
[    2.930816] gpio-of-helper ocp:cape-universal: Allocated GPIO id=33 name='P8_36'
[    2.930995] gpio-of-helper ocp:cape-universal: Allocated GPIO id=34 name='P8_37'
[    2.931713] gpio-of-helper ocp:cape-universal: Allocated GPIO id=35 name='P8_38'
[    2.931923] gpio-of-helper ocp:cape-universal: Allocated GPIO id=36 name='P8_39'
[    2.932117] gpio-of-helper ocp:cape-universal: Allocated GPIO id=37 name='P8_40'
[    2.932310] gpio-of-helper ocp:cape-universal: Allocated GPIO id=38 name='P8_41'
[    2.932504] gpio-of-helper ocp:cape-universal: Allocated GPIO id=39 name='P8_42'
[    2.932692] gpio-of-helper ocp:cape-universal: Allocated GPIO id=40 name='P8_43'
[    2.932879] gpio-of-helper ocp:cape-universal: Allocated GPIO id=41 name='P8_44'
[    2.933056] gpio-of-helper ocp:cape-universal: Allocated GPIO id=42 name='P8_45'
[    2.933252] gpio-of-helper ocp:cape-universal: Allocated GPIO id=43 name='P8_46'
[    2.933446] gpio-of-helper ocp:cape-universal: Allocated GPIO id=44 name='P9_11'
[    2.933658] gpio-of-helper ocp:cape-universal: Allocated GPIO id=45 name='P9_12'
[    2.934316] gpio-of-helper ocp:cape-universal: Allocated GPIO id=46 name='P9_13'
[    2.934544] gpio-of-helper ocp:cape-universal: Allocated GPIO id=47 name='P9_14'
[    2.934742] gpio-of-helper ocp:cape-universal: Allocated GPIO id=48 name='P9_15'
[    2.934935] gpio-of-helper ocp:cape-universal: Allocated GPIO id=49 name='P9_16'
[    2.935334] gpio-of-helper ocp:cape-universal: Allocated GPIO id=50 name='P9_17'
[    2.935560] gpio-of-helper ocp:cape-universal: Allocated GPIO id=51 name='P9_18'
[    2.935756] gpio-of-helper ocp:cape-universal: Allocated GPIO id=52 name='P9_19'
[    2.935950] gpio-of-helper ocp:cape-universal: Allocated GPIO id=53 name='P9_20'
[    2.936150] gpio-of-helper ocp:cape-universal: Allocated GPIO id=54 name='P9_21'
[    2.936331] gpio-of-helper ocp:cape-universal: Allocated GPIO id=55 name='P9_22'
[    2.936540] gpio-of-helper ocp:cape-universal: Allocated GPIO id=56 name='P9_23'
[    2.937594] gpio-of-helper ocp:cape-universal: Allocated GPIO id=57 name='P9_24'
[    2.938702] gpio-of-helper ocp:cape-universal: Allocated GPIO id=58 name='P9_25'
[    2.938944] gpio-of-helper ocp:cape-universal: Allocated GPIO id=59 name='P9_26'
[    2.939287] gpio-of-helper ocp:cape-universal: Allocated GPIO id=60 name='P9_27'
[    2.939590] gpio-of-helper ocp:cape-universal: Allocated GPIO id=61 name='P9_28'
[    2.939882] gpio-of-helper ocp:cape-universal: Allocated GPIO id=62 name='P9_29'
[    2.940216] gpio-of-helper ocp:cape-universal: Allocated GPIO id=63 name='P9_30'
[    2.940426] gpio-of-helper ocp:cape-universal: Allocated GPIO id=64 name='P9_31'
[    2.940638] gpio-of-helper ocp:cape-universal: Allocated GPIO id=65 name='P9_41'
[    2.940835] gpio-of-helper ocp:cape-universal: Allocated GPIO id=66 name='P9_91'
[    2.941121] gpio-of-helper ocp:cape-universal: Allocated GPIO id=67 name='P9_42'
[    2.941342] gpio-of-helper ocp:cape-universal: Allocated GPIO id=68 name='P9_92'
[    2.941352] gpio-of-helper ocp:cape-universal: ready
lsusb
Bus 001 Device 002: ID 7392:a812 Edimax Technology Co., Ltd
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
END

It turns out that the SPI problem was (seems like) due to something inside the minimum image.
As my colleague suggested, I tried using the Debian Buster IoT image and SPI (both 0 and 1) were enabled out of the box.
I upgraded the kernel from 4.19 to 6.1 and SPIs were still fine.