In short, I'm trying to connect to a device using the SPI bus, and can't even get it to show up as a device in linux.
What I've done:
- Following the document:1028364B_DM37x_Linux_Mainstream_UG.pdf
- Install and run the Ubuntu VM 1029082_Ubuntu_16.04 DM37x Mainstream Linux 1.0-1.ova (I've just started a new version straight from the downloaded copy so I know it's completely clean)
- In ~/logic/buildroot/, 'make menuconfig' and enable anything labelled 'spi'
~/logic/buildroot$ grep -i spi .config
BR2_PACKAGE_SPIDEV_TEST=y
BR2_PACKAGE_SPI_TOOLS=y
BR2_PACKAGE_PYTHON_SPIDEV=y
- in ~/logic/linux-stable, make menuconfig and do the same
~/logic/linux-stable$ grep -i spi .config
CONFIG_SPI=y
CONFIG_SPI_MASTER=y
CONFIG_SPI_BITBANG=m
CONFIG_SPI_GPIO=m
CONFIG_SPI_SPIDEV=m
(etc)
- then 'make linux-rebuild' and then 'make'
- everything builds properly, because in ~/logic/buildroot/output/images, the following files have today's date:
logicpd-torpedo-37xx-devkit.dtb, rootfs.tar, zImage
- but the following files still have the default (March 2017) that came with the VM:
MLO, u-boot.img
-- (Do these two need to be rebuilt, and if so how?)
- Do the section 3.2.1 'create_sdcard.sh' stuff and copy abovementioned files to the SD card in the right order.
- Boot the Zoomboard, do the nand unlock/erase/etc steps.
So all of that works, BUT, there's just no /dev/spi.
'modprobe spidev' and spidev shows up in 'lsmod', but there's still no /dev/spi.
So what else do I have to do to get /dev/spi to show up?
Further, once I do this:
# mount -t debugfs none /sys/kernel/debug/
# cd /sys/kernel/debug/pinctrl/48002030.pinmux/
# grep -i mcspi ./*
./pingroups:group: pinmux_mcspi1_pins
./pinmux-functions:function: pinmux_mcspi1_pins, groups = [ pinmux_mcspi1_pins ]
./pinmux-pins:pin 204 (480021c8.0): 48098000.spi (GPIO UNCLAIMED) function pinmux_mcspi1_pins group pinmux_mcspi1_pins
./pinmux-pins:pin 205 (480021ca.0): 48098000.spi (GPIO UNCLAIMED) function pinmux_mcspi1_pins group pinmux_mcspi1_pins
./pinmux-pins:pin 206 (480021cc.0): 48098000.spi (GPIO UNCLAIMED) function pinmux_mcspi1_pins group pinmux_mcspi1_pins
./pinmux-pins:pin 207 (480021ce.0): 48098000.spi (GPIO UNCLAIMED) function pinmux_mcspi1_pins group pinmux_mcspi1_pins
So the pinmux is showing them as GPIO UNCLAIMED. Shouldn't that be showing them as SPI if they are indeed enabled?
ALSO, here's a thing I've noticed. In the buildroot menuconfig, I enabled bash as the default shell.
~/logic/buildroot$ grep -i bash .config
BR2_SYSTEM_BIN_SH_BASH=y
BR2_SYSTEM_BIN_SH="BASH"
BR2_PACKAGE_BASH=y
But when I boot into the Zoomboard, it's using 'ash' (because in /root/ there's a file called .ash_history and no file called .bash_history).
I don't mind using ash, but that's not the point. The point is, maybe the compilation steps aren't working properly? If it's ignoring my ash->bash change in the menuconfig, maybe it's also ignoring my spidev change? The kernel is compiling fine, because otherwise I wouldn't have spidev.ko available. But maybe the buildroot/.config is stuffing up somewhere?
Does it have something to do with devicetree? i don't even know what one is, frankly, and in all the documentation that i've downloaded from the site here the only real mention of it that i can see are the few lines in sections 2.5/2.6. Section 2.6 of the userguide says to append it to the zImage to create zImage_dtb, but then that isn't copied to the SD card anyway, so that can't be making a difference.