I have verified this on 4 Jetson Nano modules (2 with SD Card and 2 with eMMC). The rootfs and Image are identical on all 4 modules. The device tree has a small modification for the SD Card vs eMMC (see attached file).
The u-boot finds a spi flash “mx25u3235f” on the Jetson Nano with SD Card. And u-boot fails to find the spi flash on the Jetson Nano with eMMC. The scope shows no activity on the spi0 pins on the Jetson Nano with eMMC. Attached are the u-boot log, sysfs pinmux settings, and gpio settings for both. The ksz8795-switch uses the spi driver to read/write registers, and when it fails the chip IDs are all zero.
From the Jetson Nano pinmux spread sheet it looks like the SPI pins are set to GPIOs by default. I tried to change the pins to sfio with the following device tree changes, but that didn’t work either.
ShaneCCC thanks for your help! Finally got spi0 working on Jetson Nano with eMMC for both linux 4.9 and linux 5.10. And it still works on Jetson Nano with SD Card.
For linux 4.9 I used the following three fixes: device tree fix (above), patch to drivers/gpio/gpio-tegra.c (link above), and the following commands to fix the spi0 pinmuxes.
devmem2 0x70003050 h 0xe044
devmem2 0x70003054 h 0xe044
devmem2 0x70003058 h 0xe044
devmem2 0x7000305c h 0xe048
devmem2 0x70003060 h 0xe048
These fixes didn’t work on the upstream linux 5.10. The gpios and pinmuxes in the device tree are not recognized, and report the error of “no hogging state specified, bailing out”. To get Jetson Nano eMMC spi0 working on the upstream linux required one fix shown below at the end of tegra_gpio_probe() in drivers/gpio/gpio-tegra.c.
This is a better solution for linux 5.10 as it clears all gpios, not just the SPI0 gpios. It can be placed in tegra_gpio_probe() after the call to devm_platform_ioremap_resource() in drivers/gpio/gpio-tegra.c.