[SOLVED] SPI support ? (xu4)

Test and fix the Kernel 5.4 features
Post Reply
Max56
Posts: 35
Joined: Fri Aug 17, 2018 7:28 pm
languages_spoken: english / french
ODROIDs: C2/XU4
Has thanked: 3 times
Been thanked: 2 times
Contact:

[SOLVED] SPI support ? (xu4)

Post by Max56 »

Hello,

On XU4 with Upstream Release (5.4.77-217) - Ubuntu 20.04

following https://wiki.odroid.com/odroid-xu4/appl ... e/gpio/spi guide :

odroid@odroid:~/build-SkyDroneVcsGpioToKey-Desktop-Debug$ sudo modprobe spidev
odroid@odroid:~/build-SkyDroneVcsGpioToKey-Desktop-Debug$ sudo modprobe spi_s3c64xx
odroid@odroid:~/build-SkyDroneVcsGpioToKey-Desktop-Debug$ lsmod | grep spi
spi_s3c64xx 20480 0
spidev 20480 0
odroid@odroid:~/build-SkyDroneVcsGpioToKey-Desktop-Debug$ ls /dev/spidev*
ls: cannot access '/dev/spidev*': No such file or directory

dmesg | grep spi is empty

Spi is not supported now on 5.4 kernel ? or am I missing somthing to do ?

Thanks

Max

User avatar
odroid
Site Admin
Posts: 36385
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1431 times
Been thanked: 980 times
Contact:

Re: SPI support ? (xu4)

Post by odroid »

It should work.
We will check the wiki page.
These users thanked the author odroid for the post:
Max56 (Wed Dec 23, 2020 10:11 pm)

joshua.yang
Posts: 475
Joined: Fri Sep 22, 2017 5:54 pm
languages_spoken: Korean, English
ODROIDs: XU4, XU4Q + Cloudshell2, H2, N2
Has thanked: 32 times
Been thanked: 130 times
Contact:

Re: SPI support ? (xu4)

Post by joshua.yang »

Hi.

I updated the SPI wiki page to lead people to see the Device Tree Overlay documents.
If you have the 5.4.z kernel, DTBO must be used to enable a GPIO ALT function.

Please refer to the following pages.
* Introduction of Device Tree Overlay: https://wiki.odroid.com/common/applicat ... ee_overlay
* How to enable SPI/I2C/UART using Device Tree Overlay: https://wiki.odroid.com/common/applicat ... _with_dtbo
These users thanked the author joshua.yang for the post:
Max56 (Wed Dec 23, 2020 10:11 pm)

Vas17
Posts: 4
Joined: Wed Dec 23, 2020 6:33 pm
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: SPI support ? (xu4)

Post by Vas17 »

Hi,

I followed your directions but I can't get /dev/spidev1.0.
Could you help me to activate the SPI on my XU4 board with kernel 5.4 (Ubuntu 20.04) ?

Thanks
Val

User avatar
odroid
Site Admin
Posts: 36385
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1431 times
Been thanked: 980 times
Contact:

Re: SPI support ? (xu4)

Post by odroid »

Can you show us your modified config.ini file?

Vas17
Posts: 4
Joined: Wed Dec 23, 2020 6:33 pm
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: SPI support ? (xu4)

Post by Vas17 »

Here is my config.ini file :

Code: Select all

[generic]
# Mac address configuration
macaddr=00:1e:06:61:7a:39

; HDMI configuration
; Uncomment only ONE line! Leave all commented for automatic selection.
; Uncomment only the setenv line!
; ---------------------------------------
; ODROID-VU forced resolution
; setenv videoconfig "video=HDMI-A-1:1280x800@60"
; -----------------------------------------------
; ODROID-VU forced EDID
; setenv videoconfig "drm_kms_helper.edid_firmware=edid/1280x800.bin"
; -----------------------------------------------
; 1920x1200 60hz without monitor data using generic information
; setenv videoconfig "drm_kms_helper.edid_firmware=edid/1920x1200_60hz.bin"
; -----------------------------------------------
; 1920x1200 30hz without monitor data using generic information
; setenv videoconfig "drm_kms_helper.edid_firmware=edid/1920x1200_30hz.bin"
; -----------------------------------------------
; 1920x1080 (1080P) with monitor provided EDID information. (1080p-edid)
; setenv videoconfig "video=HDMI-A-1:1920x1080@60"
; -----------------------------------------------
; 1920x1080 (1080P) without monitor data using generic information (1080p-noedid)
; setenv videoconfig "drm_kms_helper.edid_firmware=edid/1920x1080.bin"
; -----------------------------------------------
; 1920x1080 50hz (1080P) with monitor provided EDID information. (1080p 50hz-edid)
; setenv videoconfig "video=HDMI-A-1:1920x1080@50"
; -----------------------------------------------
; 1920x1080 50hz (1080P) without monitor data using generic information (1080p 50hz-noedid)
; setenv videoconfig "drm_kms_helper.edid_firmware=edid/1920x1080_50hz.bin"
; -----------------------------------------------
; 1920x1080 24Hz (1080P) without monitor data using generic information (1080p 24hz-noedid)
; setenv videoconfig "drm_kms_helper.edid_firmware=edid/1920x1080_24hz.bin"
; -----------------------------------------------
; 1920x1080 23.976Hz (1080P) without monitor data using generic information (1080p 23.976hz-noedid)
; setenv videoconfig "drm_kms_helper.edid_firmware=edid/1920x1080_23_976hz.bin"
; -----------------------------------------------
; 1920x800 60hz without monitor data using generic information
; setenv videoconfig "drm_kms_helper.edid_firmware=edid/1920x800.bin"
; -----------------------------------------------
; 1792x1344 60hz without monitor data using generic information
; setenv videoconfig "drm_kms_helper.edid_firmware=edid/1792x1344.bin"
; -----------------------------------------------
; 1680x1050 without monitor data using generic information
; setenv videoconfig "drm_kms_helper.edid_firmware=edid/1680x1050.bin"
; -----------------------------------------------
; 1600x1200 without monitor data using generic information
; setenv videoconfig "drm_kms_helper.edid_firmware=edid/1600x1200.bin"
; -----------------------------------------------
; 1600x900 without monitor data using generic information
; setenv videoconfig "drm_kms_helper.edid_firmware=edid/1600x900.bin"
; -----------------------------------------------
; 1400x1050 60hz without monitor data using generic information
; setenv videoconfig "drm_kms_helper.edid_firmware=edid/1400x1050.bin"
; -----------------------------------------------
; 1440x900 with monitor provided EDID information.
; setenv videoconfig "video=HDMI-A-1:1440x900@60"
; -----------------------------------------------
; 1440x900 without monitor data using generic information
; setenv videoconfig "drm_kms_helper.edid_firmware=edid/1440x900.bin"
; -----------------------------------------------
; 1366x768 without monitor data using generic information
; setenv videoconfig "drm_kms_helper.edid_firmware=edid/1366x768.bin"
; -----------------------------------------------
; 1360x768 without monitor data using generic information
; setenv videoconfig "drm_kms_helper.edid_firmware=edid/1360x768.bin"
; -----------------------------------------------
; 1280x1024 without monitor data using generic information
; setenv videoconfig "drm_kms_helper.edid_firmware=edid/1280x1024.bin"
; -----------------------------------------------
; 1280x768 60hz without monitor data using generic information
; setenv videoconfig "drm_kms_helper.edid_firmware=edid/1280x768.bin"
; -----------------------------------------------
; 1280x720 (720P) with monitor provided EDID information. (720p-edid)
; setenv videoconfig "video=HDMI-A-1:1280x720@60"
; -----------------------------------------------
; 1280x720 (720P) without monitor data using generic information (720p-noedid)
; setenv videoconfig "drm_kms_helper.edid_firmware=edid/1280x720.bin"
; -----------------------------------------------
; 1152x864 75hz without monitor data using generic information
; setenv videoconfig "drm_kms_helper.edid_firmware=edid/1152x864_75hz.bin"
; -----------------------------------------------
; 1024x768 without monitor data using generic information
; setenv videoconfig "drm_kms_helper.edid_firmware=edid/1024x768.bin"
; -----------------------------------------------
; 1024x600 without monitor data using generic information (ODROID VU7+)
; setenv videoconfig "drm_kms_helper.edid_firmware=edid/1024x600.bin"
; -----------------------------------------------
; 800x600 without monitor data using generic information
; setenv videoconfig "drm_kms_helper.edid_firmware=edid/800x600.bin"
; -----------------------------------------------
; 848x480 60hz without monitor data using generic information
; setenv videoconfig "drm_kms_helper.edid_firmware=edid/848x480.bin"
; -----------------------------------------------
; 800x480 without monitor data using generic information (ODROID 7")
; setenv videoconfig "drm_kms_helper.edid_firmware=edid/800x480.bin"
; -----------------------------------------------
; 720x576 without monitor data using generic information
; setenv videoconfig "drm_kms_helper.edid_firmware=edid/720x576.bin"
; -----------------------------------------------
; 720x480 without monitor data using generic information
; setenv videoconfig "drm_kms_helper.edid_firmware=edid/720x480.bin"
; -----------------------------------------------
; 640x480 without monitor data using generic information
; setenv videoconfig "drm_kms_helper.edid_firmware=edid/640x480.bin"
; -----------------------------------------------
; 480x800 without monitor data using generic information
; setenv videoconfig "drm_kms_helper.edid_firmware=edid/480x800.bin"
; -----------------------------------------------
; 480x320 without monitor data using generic information
; setenv videoconfig "drm_kms_helper.edid_firmware=edid/480x320.bin"

; voutm : hdmi or dvi
; hdmi / dvi
vout=hdmi

; HPD enable/disable option
; false / true
HPD=true

; Enable/Disable CEC
cecenable=false

; Hardkernel ODROID-VU7 support
; By default VU7 support is disabled
disable_vu7=false

; DRAM Frequency
; Sets the LPDDR3 memory frequency (MHz)
; 933 / 825 / 728 / 633
ddr_freq=825


; Device Tree Overlay
overlay_resize=16384
overlay_profile=spi
overlays="spi0 i2c0 i2c1 uart0"

[overlay_custom]
overlays="i2c0 i2c1"

[overlay_hktft32]
overlays="hktft32 ads7846"

[overlay_hktft35]
overlays="hktft35 sx865x-i2c1"

[overlay_hktft_cs_ogst]
overlays="hktft-cs-ogst"

[overlay_spi]
overlays="spi0"
Thanks
Val

joshua.yang
Posts: 475
Joined: Fri Sep 22, 2017 5:54 pm
languages_spoken: Korean, English
ODROIDs: XU4, XU4Q + Cloudshell2, H2, N2
Has thanked: 32 times
Been thanked: 130 times
Contact:

Re: SPI support ? (xu4)

Post by joshua.yang »

Vas17 wrote:
Thu Dec 24, 2020 12:30 am
Here is my config.ini file :

Code: Select all

...

; Device Tree Overlay
overlay_resize=16384
overlay_profile=spi
overlays="spi0 i2c0 i2c1 uart0"

[overlay_custom]
overlays="i2c0 i2c1"

[overlay_hktft32]
overlays="hktft32 ads7846"

[overlay_hktft35]
overlays="hktft35 sx865x-i2c1"

[overlay_hktft_cs_ogst]
overlays="hktft-cs-ogst"

[overlay_spi]
overlays="spi0"
Hi.

Do you need /dev/spidev1.0? In fact, XU4 has only one SPI bus on the GPIO header.
Check the /dev directory, there will be /dev/spidev0.0 with your settings.

Vas17
Posts: 4
Joined: Wed Dec 23, 2020 6:33 pm
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: SPI support ? (xu4)

Post by Vas17 »

Hi,
There is no spidev0.0 or spidev1.0 in the /dev/ folder.

Code: Select all

ls /dev/spidev*
ls: cannot access 'spidev*' : No such file or directory

joshua.yang
Posts: 475
Joined: Fri Sep 22, 2017 5:54 pm
languages_spoken: Korean, English
ODROIDs: XU4, XU4Q + Cloudshell2, H2, N2
Has thanked: 32 times
Been thanked: 130 times
Contact:

Re: SPI support ? (xu4)

Post by joshua.yang »

Vas17 wrote:
Thu Dec 24, 2020 5:29 pm
Hi,
There is no spidev0.0 or spidev1.0 in the /dev/ folder.

Code: Select all

ls /dev/spidev*
ls: cannot access 'spidev*' : No such file or directory
Hi.

To make sure, re-installing the U-Boot bootloader may help. Try sudo apt install --reinstall linux-odroid-5422 uboot bootini.
If the config.ini file is edited properly and U-Boot has DTBO functionality, you can see those *.dtbo loading messages via the UART port.

config.ini allows spi0, i2c0, i2c1, uart0 by default without any edits.

Code: Select all

reading zImage
6404752 bytes read in 227 ms (26.9 MiB/s)
reading uInitrd
10310290 bytes read in 363 ms (27.1 MiB/s)
reading exynos5422-odroidxu4.dtb
87167 bytes read in 8 ms (10.4 MiB/s)
reading overlays/spi0.dtbo
691 bytes read in 5 ms (134.8 KiB/s)
reading overlays/i2c0.dtbo
224 bytes read in 4 ms (54.7 KiB/s)
reading overlays/i2c1.dtbo
226 bytes read in 5 ms (43.9 KiB/s)
reading overlays/uart0.dtbo
227 bytes read in 5 ms (43.9 KiB/s)
Kernel image @ 0x40008000 [ 0x000000 - 0x61ba90 ]
## Loading init Ramdisk from Legacy Image at 42000000 ...
   Image Name:   uInitrd
   Image Type:   ARM Linux RAMDisk Image (uncompressed)
   Data Size:    10310226 Bytes = 9.8 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 44000000
   Booting using the fdt blob at 0x44000000
   reserving fdt memory region: addr=44000000 size=2c000
   Using Device Tree in place at 44000000, end 4402efff

Starting kernel ...
These users thanked the author joshua.yang for the post:
Max56 (Mon Jan 04, 2021 5:38 pm)

Max56
Posts: 35
Joined: Fri Aug 17, 2018 7:28 pm
languages_spoken: english / french
ODROIDs: C2/XU4
Has thanked: 3 times
Been thanked: 2 times
Contact:

Re: SPI support ? (xu4)

Post by Max56 »

Hello,

Thanks Joshua,
after editing config.ini, reinstalling packages and rebooting, I'm getting spidev0.0 in /dev

Max

Vas17
Posts: 4
Joined: Wed Dec 23, 2020 6:33 pm
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: [SOLVED] SPI support ? (xu4)

Post by Vas17 »

Hi,
Thanks Joshua for your support, after this command

Code: Select all

sudo apt install --reinstall linux-odroid-5422 uboot bootini
,
there is /dev/spidev0.0
Val

Post Reply

Return to “Linux Kernel 5.4 Development Party”

Who is online

Users browsing this forum: No registered users and 0 guests