Project

General

Profile

MitySOM-5CSX-H6-4YA Linux kernel 5.15 QSPI NOR Flash access

Added by Mathew Jones over 2 years ago

Hi,
We’re using the MitySOM-5CSX-H6-4YA and previously we used the Linux kernel 3.16.0 as supplied by CriticalLink, but this time we need to use a more recent kernel (5.13 or later).
I've taken the kernel 5.15.30-lts source from Altera socfpga Github) and have so far built the kernel, modules and device tree blob (DTB).
For the kernel config and the DTB, as there was nothing in the 5.15.30-lts source for the MitySOM-5CSX I based both on source files from kernel 4.9.78-lts as they seem to be the latest from CriticalLink.

The problem I have is that if I boot with kernel 5.15.30-lts I cannot erase or write to a QSPI NOR Flash partition/block (the kernel hangs), but I can read it OK.
Booting kernel 4.9.78-lts I can read, write and erase the QSPI NOR Flash.

Is it possible that I'm missing some kernel configuration settings?
I've seen that 3.16.0 has SPI_CADENCE_QSPI [=y] but neither 4.9.78-lts nor 5.15.30-lts have this parameter.
Also, 3.16.0 and 4.9.78-lts have MTD_M25P80 [=y] but 5.15.30-lts does not have this parameter.


Replies (5)

RE: MitySOM-5CSX-H6-4YA Linux kernel 5.15 QSPI NOR Flash access - Added by Zachary Miller over 2 years ago

Hi Matthew,

It looks like CONFIG_MTD_M25P80 has been superseded by CONFIG_MTD_SPI_NOR, which should already be enabled in the stock 5CSx defconfig from our socfpga-4.9.78-ltsi branch.

Could you post your kernel config and device tree sources? I was able to read, write, and erase on both NOR chips using the following components:

  • Altera's socfpga-5.15.30-lts kernel sources
  • Stock mitysom5csx_devkit_defconfig from Critical Link's socfpga-4.9.78-ltsi kernel branch, except that I enabled CONFIG_ARCH_INTEL_SOCFPGA in menuconfig (it was renamed from CONFIG_ARCH_SOCFPGA at some point)
  • Stock socfpga_mitysom5csx-h6-4ya_devkit.dts, socfpga_mitysom5csx.dtsi, and socfpga_mitysom5cs.dtsi from Critical Link's socfpga-4.9.78-ltsi kernel branch

RE: MitySOM-5CSX-H6-4YA Linux kernel 5.15 QSPI NOR Flash access - Added by Mathew Jones over 2 years ago

Hi,
Thanks Zachary,
Yes CONFIG_MTD_SPI_NOR is set to [y] (as is ARCH_INTEL_SOCFPGA, which initially caught me out as it's was no longer ARCH_SOCFPGA).

I've attached a zip file containing our 5.15.30-lts kernel config and the device tree source files used.

My steps before building the kernel/modules/DTB were essentially:
  • Copy 4.9.78-lts "arch/arm/configs/mitysom5csx_devkit_defconfig" into 5.15.30-lts (arch/arm/configs/)
  • Copy the following 5 DTS files from 4.9.78-lts (arch/arm/boot/dts/) into 5.15.30-lts:
    • socfpga_mitysom5csx-h6-4ya_devkit.dts
    • socfpga_mitysom5csx.dtsi
    • socfpga_mitysom5cs.dtsi
    • socfpga.dtsi
    • skeleton.dtsi
  • Edit the DTS Makefile (/arch/arm/boot/dts/Makefile) to add socfpga_mitysom5csx-h6-4ya_devkit.dtb
  • Edit socfpga_mitysom5cs.dtsi & socfpga_mitysom5csx-h6-4ya_devkit.dts to remove two warnings:
arch/arm/boot/dts/socfpga_mitysom5cs.dtsi:167.12-170.6: Warning (i2c_bus_reg): /soc/i2c@ffc04000/temp@4C: I2C bus unit address format error, expected "4c" 
arch/arm/boot/dts/socfpga_mitysom5csx-h6-4ya_devkit.dts:51.13-54.7: Warning (i2c_bus_reg): /soc/i2c@ffc05000/ltc2945@6F: I2C bus unit address format error, expected "6f"
  • I did change some of the settings in the kernel config, which were network/packet filtering related.

RE: MitySOM-5CSX-H6-4YA Linux kernel 5.15 QSPI NOR Flash access - Added by Zachary Miller over 2 years ago

Hi Matthew,

Give it a try with the socfpga.dtsi from Altera's socfpga-5.15.30-lts branch instead (you won't need skeleton.dtsi anymore either). The compatible string for the QSPI controller changed, but the driver also still accepts the old one, resulting in slightly different device configuration. In my testing, that made the difference between write/erase working or not.

As an extra sanity check, I did also test a kernel built with your .config and using my working device tree, and read/write/erase all worked fine.

RE: MitySOM-5CSX-H6-4YA Linux kernel 5.15 QSPI NOR Flash access - Added by Mathew Jones over 2 years ago

Hi
That works with socfpga.dtsi from 5.15.30-lts (and no skeleton.dtsi required).
I can now erase, write and read the QSPI NOR Flash.
Thanks a lot.

    (1-5/5)
    Go to top
    Add picture from clipboard (Maximum size: 1 GB)