How to use the Jetson Nano's Pinmux spreadsheet?

hi all,

your issue seems like u-boot not able to read the SD-card.

** Bad device mmc 1 **
Hit any key to stop autoboot:  0 
Card did not respond to voltage select!
Card did not respond to voltage select!

may I know what’s the modification you had done,
please also confirm you had flash the board with correct configuration.
for example,

$ sudo ./flash.sh jetson-nano-qspi-sd mmcblk0p1

@jerrychang

I think also it comes from u-boot.

I modified the pinmux to enable spi on pin 19, 21, 23, 24.
I tried various configuration as the doc is unclear. Column L (allowed pin direction)indicates B (bidirectionnal). So I tried bidirectional, but also with combination of inputs and outputs (throw errors).
What should it be? do we define here if we want to be master or slave, or do we put bidirectionnal (to define the port as spi) and then we can put slave or master later? (I didn’t check yet how SPI is implemented in software)
What is the combox box “Boot device” (emmc or qspi) on the top right? Is it already implemented?

Concerning u-boot, I checked a little bit. Among the different modifications, there was a modification in the latest release r32.2 where it disables the SD card before doing the pinmux config due to a hardware problem. And TZ3 is set to OUT0 to disable a loadswitch.

http://nv-tegra.nvidia.com/gitweb/?p=3rdparty/u-boot.git;a=commitdiff;h=923180505bee083cb2366f49190d74267bd06721

Now with this code, when we do not modify the pinmux, the board can boot. I am wondering if changing the pinmux on SPI do not create another hardware problem of some kind.

But maybe this issue is not related. I don’t have time now to go in further details about u-boot.

Did anybody manage to test SPI with R32.2 release? Could you please check with the hardware team if they can test it?

Thank you.

Hi,

I modified the pinmux to enable spi on pin 19, 21, 23, 24.
How are you updating pinmux? Can you please share steps and file name?

Thanks,
Shubhi

To enable SPI, you should modify pinmux settings in u-boot:
In u-boot source code, pinmux-config-p3450-porg.h header file is present which is generated from pinmux xlsm.
Update this header file with your pin settings.
For pins 19, 21, 23, 24: They are configured as GPIO. To configure them as SPI, you will see following differences after updating xlsm and generate new header file.

  1. You should not see GPIO PORT C0-C3 under gpio_config
  • GPIO_INIT(C, 0, IN),
  • GPIO_INIT(C, 1, IN),
  • GPIO_INIT(C, 2, IN),
  • GPIO_INIT(C, 3, IN),
  1. Pinmux config will be changed according to your settings:
    Ex. For pin SPI1_MISO:
    These are the settings:
    PINCFG(SPI1_MISO_PC1, SPI1, DOWN, NORMAL, INPUT, DISABLE, DEFAULT),

Please let me know in what pin configuration, board is not booting up. And your detailed steps.

Thanks,
Shubhi

@shgarg

I use “Jetson_Nano_DeveloperKit_Users_Pinmux_Configuration.xlsm” version 1.0, 4/15/2019 and Configuration Application Note (rev 1.0) from Nvidia’s download center. yes, I did configure column AR. For AS and AT, as I wrote, I am not sure.

do you have a working jetson nano developper kit with SPI enabled and r32.2?

Can you send me your files (the 2 *.dtsi, the *.csv, the generated *.dtb)?

Thank you

Hi,
Do not update any pin settings in kernel. Kernel settings do not get applied. Please update u-boot pinmux file.I have attached files you have asked but do not update kernel pinmux dtsi, gpio dtsi, final kernel dtb. You should update file in u-boot according to my earlier comment. Please check settings in attached header file.
Extension is .txt just to attach files here, please rename to .dtsi

pinmux-config-p3450-porg.h (16.2 KB)
tegra210-porg-pinmux-p3448-0000-a02.txt (38.1 KB)
tegra210-porg-gpio-p3448-0000-a02.txt (2.11 KB)
tegra210-p3448-0000-p3449-0000-a02.txt (209 KB)

Thank you for your *.h file.

The header of your file is different from mine.
When I check GitHub - NVIDIA/tegra-pinmux-scripts: Scripts to auto-generate pin mux drivers and board configuration tables for Tegra SoCs and boards, the last update of the “board-to-uboot.py” script dates from 2016. So probably you use a newer one.

* THIS FILE IS AUTO-GENERATED - DO NOT EDIT!
 *
 * To generate this file, use the tegra-pinmux-scripts tool available from
 * https://github.com/NVIDIA/tegra-pinmux-scripts
 * Run "board-to-uboot.py p3450-porg".
 */

Your h file:

* To generate this file, use the tegra-pinmux-scripts tool available from
 * https://github.com/NVIDIA/tegra-pinmux-scripts
 * Run "board-to-uboot.py nano".
 * Used the T210_P3448_SKU0_pinmux sheet, tab B00-B01 as of 2 May 2019, v18.

They are also differences in the code. so probably you also have another spreadsheet too.
With SPI lines identical, I can boot with a u-boot made with your file, but cannot boot with one made with my file.

However, when I boot with your file I don’t see SPI in /dev.

When will be the next synched release of all documents?

Hi,
You are not seeing SPI in /dev because there are no devices connected in SPI which are enabled in DT. You should connect a slave under spi@7000d400 (for 40 pin SPI1: 19,21,23,24) and configure slave in DT to get node under /dev

The differences you are seeing are my local changes. Please do not bother about it. The *.h generates using tegra-pinmux-scripts is latest. Update SPI configurations according to your uses and to enable SPI, remove GPIO lines from PORT C0 to C3 in *.h and use this updated file.

Please let me know if you are facing any issues.

Thanks,
Shubhi

Do you have a documentation on how to configure a slave in DT?

Hi,
You can refer this document:

spi-bus.txt (3.86 KB)

Ok.

I’ll just use the UART on jetson nano for now, and wait until Nvidia publishes a complete working procedure on how to use SPI.

Thank you.

Hi,

I tried using the Jetson Nano Pinmux spreadsheet to enable SPI on the nano.

For this I tried to follow this guide:
https://developer.download.nvidia.com/assets/embedded/secure/jetson/Nano/docs/customizing_the_jetson_nano_40-pin_expansion_header_v1.2.pdf?C8Q9f2qtsw61-u7QCWekpVyYplSRlFo1_JbhNRNWn2X3MfbMztivStTbbs2MlbI_aSuh3EzfO5UB_HnfyjLO7DX1ag7Dn500qHg5mG5IeGGRffZgrANlOHku_l6h09Pk-zvO11qrw6-Sb1Apj4HPU4WXsxzfrbn0J5UV32tGobVgbxqo3RnYkg76O6PSKD55-NNeNrBLNKAFgxXvEJKkLUDM5w

But in Step 3 from “Update the U-Boot Pinmux”, I got the Error:

$ ./csv-to-board.py p3450-porg
ERROR: Header row not found

The steps before worked and I have 2 .dtsi files and a .csv file in which SPI has been activated.

  • tegra210-jetson-nano-sd-gpio-default.dtsi
  • tegra210-jetson-nano-sd-pinmux.dtsi
  • jetson-nano-sd.csv

How do I have to continue now to enable SPI?

hi, did you manage to enable SPI with this procedure?

Hi ADV-LUT,

The link you have mentioned is no more available.
Are you able to enable SPI ? If not, can you please share the steps you have used so that I can help you out.

Thanks & Regards,
Shubhi

Hi Shubhi,
Maybe you can help me.

I’m struggling as many others with enabling SPI on Jetson Nano.

I took pinmux-config-p3450-porg.h file from your prev post, however I do not see any file in U-boot that will include it.

Am I on correct U-boot branch?

$ git lg -5                                                     
* 0536cf2a27 (HEAD -> mybranch_2020-01-24-1579905969, tag: tegra-l4t-r32.3.1, origin/l4t/l4t-r32.3.1-v2016.07) fdt: Add support to delete&copy (clone) DTB nodes
* 2359455c3b t210: QSPI: Add timeout for xfer_status loop read
* a5a3f95227 t210: qspi: Fix QSPI clock and tap delays
* 82878c4a79 T210: QSPI: Fix claim_bus's use of the wrong bus/device.
$ git remote -v
origin  git://nv-tegra.nvidia.com/3rdparty/u-boot.git (fetch)
origin  git://nv-tegra.nvidia.com/3rdparty/u-boot.git (push)

the file board/nvidia/p3450-porg/p3450-porg.c doesn’t include it

#include <common.h>
#include <i2c.h>
#include <libfdt.h>
#include <pca953x.h>
#include <asm/arch/gpio.h>
#include <asm/arch/pinmux.h>
#include "../p2571/max77620_init.h"

#define ETH_ALEN 6

void pin_mux_mmc(void)
{
...

and I cannot find any reference to p3450_porg_gpio_inits in u-boot code.

I made some syntax errors in header just to proof my concerns and the u-boot compiles without errors. So, could you point me correct direction?

Thank you in advance,

Max 73!

Hello Max,

With the latest release R32.3.1, the way to configure IOs is to use:

https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/hw_setup_jetson_io.html

However there are still issues with this tool if you start from the SD card image from nvidia.

You should move the base dtb file you want to use in ‘boot/dtb’ folder which you have to create.

Hi,

I think, u-boot support is no longer there to enable SPI. You can directly enable it using kernel dtb node by making status = “okay” and configure pinmux registers for SPI.
MOSI (addr: 0x70003050 val: 0xe000)
MISO (addr: 0x70003054 val: 0xe040)
SCK (addr: 0x70003058 val: 0xe000)
CS0 (addr: 0x7000305c val: 0xe008)
CS1 (addr: 0x70003060 val: 0xe008)
GPIO (addr: 0x6000d008 val: 0x00)

Write corresponding values to SPI register addresses as shown above directly on device after flash. This will enable SPI.
We have Jetson_IO python tool coming up which configures pinmux dynamically on device. I do not have steps on how to use this tool as of now but can provide later.
Please try the above method and let me know if you face any issues.

Thanks,
Shubhi

Is it possible to get something other than an excel spreadsheet to generate the .dtsi? I don’t have Excel.

3 Likes

That would be really nice. The spreadsheet is a joke.

3 Likes