This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM6442: TMDS64EVM board SPI0 EEPROM 93LC46B

Part Number: AM6442
Other Parts Discussed in Thread: TMDS64EVM

Tool/software:

Hi Team,

I am using TMDS64EVM board to access the SPI interface with the EEPROM 93LC46B. But i can't able to access through RT-LINUX with A53 core_1. I suspect driver missing and tried in multiples way to add it.

How to add a driver for that EEPROM 93LC46B to access through SPI interface?

1) While checking in board power up and Kernel in rootfs side to detect the EEPROM chip is active are not ?

root@am64xx-evm:~# dmesg | grep -i 93
[    1.039359] NFS: Registering the id_resolver key type
[    1.149304] usbcore: registered new interface driver usbhid
[    1.149316] usbhid: USB HID core driver
[    4.293660] systemd[1]: Queued start job for default target Graphical Interface.
[    4.687093] systemd[1]: Mounting POSIX Message Queue File System...
[    4.930293] systemd[1]: Starting Journal Service...
[    5.093390] systemd-journald[123]: Collecting audit messages is enabled.
[    5.141093] systemd[1]: Started RPC Bind.
[    9.693915] omap-mailbox 29020000.mailbox: omap mailbox rev 0x66fc9100
[   10.316066] remoteproc remoteproc3: Booting fw image am64-main-r5f1_0-fw, size 93260
[   10.931855] gpio-mux mux-controller: 2-way mux-controller registered
[ 4078.249384] audit: type=1006 audit(1736364651.829:2): pid=1834 uid=0 old-auid=4294967295 auid=0 tty=(none) old-ses=4294967295 ses=1 res=1

2) Checking EEPROM driver in SPI side in kernel it's not showing?

root@am64xx-evm:~# ls /sys/bus/spi/devices/
spi0.0  spi1.0
root@am64xx-evm:~# ls /sys/bus/spi/devices/spi0.0
driver  driver_override  modalias  mtd  of_node  power  spi-nor  statistics  subsystem  uevent

4) Checking EEPROM driver in NVMEM side in kernel it's not showing?

root@am64xx-evm:~# ls /sys/bus/nvmem/devices/
0-00507  mtd0  mtd1  mtd2  mtd3  mtd4  mtd5  mtd6

5) For accessing it tried in multiple ways 

  1. Device driver - MISC device - EEPROM support - Microware EEPROM 93xx46 support <M> enable. 
  2. Device driver - NVMEM - Microware EEPROM 93xx46 support <M> enable (option is not their changed in kconfig, Makefile also but no use option is disable only)

6) How to access the EEPROM 93LC46B with SPI0, explain with steps?

  • Hi 

    Did your check your Device tree? Ex: https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/arch/arm64/boot/dts/ti/k3-am642-evm.dts?h=ti-linux-6.12.y

    It should be defined there, example below

    &main_spi0 {
    	status = "okay";
    	pinctrl-names = "default";
    	pinctrl-0 = <&main_spi0_pins_default>;
    	ti,pindir-d0-out-d1-in;
    	eeprom@0 {
    		compatible = "microchip,93lc46b";
    		reg = <0>;
    		spi-max-frequency = <1000000>;
    		spi-cs-high;
    		data-size = <16>;
    	};
    };

    For checking if EEPROM driver is loaded and bound you can try:
    dmesg | grep spi

    Let me know if this helps

    thank you,
    Paula
  • Hi paula,

    1) Inside dts file found the same

    &main_spi0 {
      status = "okay";
      pinctrl-names = "default";
      pinctrl-0 = <&main_spi0_pins_default>;
      ti,pindir-d0-out-d1-in;
      eeprom@0 {
        compatible = "microchip,93lc46b";
        reg = <0>;
        spi-max-frequency = <1000000>;
        spi-cs-high;
        data-size = <16>;
      };
    };

    After building the kernel using make Linux command in ti-processor-sdk-linux-rt-am64xx-evm-11.00.09.04_1.

     Adding that k3-am642-evm.dtb file in kernel rootfs and checked this command you provided. But I got the MTD partition list here.

    root@am64xx-evm:~# dmesg | grep spi
    [    1.603795] 9 fixed-partitions partitions found on MTD device fc40000.spi.0
    [    1.603824] Creating 9 MTD partitions on "fc40000.spi.0":
    [    1.603832] 0x000000000000-0x000000100000 : "ospi.tiboot3"
    [    1.606380] 0x000000100000-0x000000300000 : "ospi.tispl"
    [    1.608237] 0x000000300000-0x000000700000 : "ospi.u-boot"
    [    1.610003] 0x000000700000-0x000000740000 : "ospi.env"
    [    1.611774] 0x000000740000-0x000000780000 : "ospi.env.backup"
    [    1.613592] 0x000000780000-0x000000800000 : "ospi.dtb"
    [    1.615289] 0x000000800000-0x000001c00000 : "ospi.kernel"
    [    1.617211] 0x000001c00000-0x000003fc0000 : "ospi.rootfs"
    [    1.618967] 0x000003fc0000-0x000004000000 : "ospi.phypattern"
    [    1.621002] cadence-qspi fc40000.spi: Pattern not found. Skipping calibration.

    2) Normally checked inside the drivers/SPI 

    asmgen2@asmgen2-OptiPlex-3070:~/ti-processor-sdk-linux-rt-am64xx-evm-11.00.09.04_1/board-support/ti-linux-kernel-6.12.17+git-ti-rt/drivers$ ls spi
    atmel-quadspi.c         spi-bcm63xx-hsspi.c    spidev.ko        spi-fsl-spi.c         spi-loopback-test.c        spi-omap2-mcspi.c      spi-rockchip-sfc.c          spi-synquacer.c
    built-in.a              spi-bcmbca-hsspi.c     spidev.mod       spi-fsl-spi.h         spi-lp8841-rtc.c           spi-omap2-mcspi.ko     spi-rpc-if.c                spi-tegra114.c
    internals.h             spi-bcm-qspi.c         spidev.mod.c     spi-geni-qcom.c       spi-mem.c                  spi-omap2-mcspi.mod    spi-rspi.c                  spi-tegra20-sflash.c
    Kconfig                 spi-bcm-qspi.h         spidev.mod.o     spi-gpio.c            spi-mem.o                  spi-omap2-mcspi.mod.c  spi-rzv2m-csi.c             spi-tegra20-slink.c
    Makefile                spi-bitbang.c          spidev.o         spi-gxp.c             spi-meson-spicc.c          spi-omap2-mcspi.mod.o  spi-s3c64xx.c               spi-tegra210-quad.c
    modules.order           spi-bitbang-txrx.h     spi-dln2.c       spi-hisi-kunpeng.c    spi-meson-spifc.c          spi-omap2-mcspi.o      spi-sc18is602.c             spi-test.h
    spi-airoha-snfi.c       spi-brcmstb-qspi.c     spi-dw-bt1.c     spi-hisi-sfc-v3xx.c   spi-microchip-core.c       spi-omap-uwire.c       spi-sh.c                    spi-ti-qspi.c
    spi-altera-core.c       spi-butterfly.c        spi-dw-core.c    spi-img-spfi.c        spi-microchip-core-qspi.c  spi-orion.c            spi-sh-hspi.c               spi-tle62x0.c
    spi-altera-dfl.c        spi.c                  spi-dw-dma.c     spi-imx.c             spi-mpc512x-psc.c          spi-pci1xxxx.c         spi-sh-msiof.c              spi-topcliff-pch.c
    spi-altera-platform.c   spi-cadence.c          spi-dw.h         spi-ingenic.c         spi-mpc52xx.c              spi-pic32.c            spi-sh-sci.c                spi-uniphier.c
    spi-amd.c               spi-cadence-quadspi.c  spi-dw-mmio.c    spi-intel.c           spi-mpc52xx-psc.c          spi-pic32-sqi.c        spi-sifive.c                spi-wpcm-fiu.c
    spi-amlogic-spifc-a1.c  spi-cadence-quadspi.o  spi-dw-pci.c     spi-intel.h           spi-mt65xx.c               spi-pl022.c            spi-slave-mt27xx.c          spi-xcomm.c
    spi-ar934x.c            spi-cadence-xspi.c     spi-ep93xx.c     spi-intel-pci.c       spi-mt7621.c               spi-ppc4xx.c           spi-slave-system-control.c  spi-xilinx.c
    spi-armada-3700.c       spi-cavium.c           spi-falcon.c     spi-intel-platform.c  spi-mtk-nor.c              spi-pxa2xx.c           spi-slave-time.c            spi-xlp.c
    spi-aspeed-smc.c        spi-cavium.h           spi-fsi.c        spi-iproc-qspi.c      spi-mtk-snfi.c             spi-pxa2xx-dma.c       spi-sn-f-ospi.c             spi-xtensa-xtfpga.c
    spi-at91-usart.c        spi-cavium-octeon.c    spi-fsl-cpm.c    spi-jcore.c           spi-mux.c                  spi-pxa2xx.h           spi-sprd-adi.c              spi-zynqmp-gqspi.c
    spi-ath79.c             spi-cavium-thunderx.c  spi-fsl-cpm.h    spi-lantiq-ssc.c      spi-mxic.c                 spi-pxa2xx-pci.c       spi-sprd.c                  spi-zynq-qspi.c
    spi-atmel.c             spi-ch341.c            spi-fsl-dspi.c   spi-ljca.c            spi-mxs.c                  spi-pxa2xx-platform.c  spi-stm32.c
    spi-au1550.c            spi-clps711x.c         spi-fsl-espi.c   spi-lm70llp.c         spi-npcm-fiu.c             spi-qcom-qspi.c        spi-stm32-qspi.c
    spi-axi-spi-engine.c    spi-coldfire-qspi.c    spi-fsl-lib.c    spi-loongson-core.c   spi-npcm-pspi.c            spi-qup.c              spi-st-ssc4.c
    spi-bcm2835aux.c        spi-cs42l43.c          spi-fsl-lib.h    spi-loongson.h        spi-nxp-fspi.c             spi-rb4xx.c            spi-sun4i.c
    spi-bcm2835.c           spi-davinci.c          spi-fsl-lpspi.c  spi-loongson-pci.c    spi.o                      spi-realtek-rtl.c      spi-sun6i.c
    spi-bcm63xx.c           spidev.c               spi-fsl-qspi.c   spi-loongson-plat.c   spi-oc-tiny.c              spi-rockchip.c         spi-sunplus-sp7021.c

    3) And also checked inside of drivers/nvmem

    asmgen2@asmgen2-OptiPlex-3070:~/ti-processor-sdk-linux-rt-am64xx-evm-11.00.09.04_1/board-support/ti-linux-kernel-6.12.17+git-ti-rt/drivers$ ls nvmem
    apple-efuses.c  imx-iim.c        kconfig           layouts.c         meson-mx-efuse.c  nvmem-rmem.ko     qfprom.c          rockchip-otp.c         stm32-bsec-optee-ta.h  vf610-ocotp.c
    bcm-ocotp.c     imx-ocotp.c      Kconfig           layouts.o         microchip-otpc.c  nvmem-rmem.mod    qoriq-efuse.c     sc27xx-efuse.c         stm32-romem.c          zynqmp_nvmem.c
    brcm_nvram.c    imx-ocotp-ele.c  Kconfig.save      lpc18xx_eeprom.c  modules.order     nvmem-rmem.mod.c  rave-sp-eeprom.c  sec-qfprom.c           sunplus-ocotp.c
    built-in.a      imx-ocotp-scu.c  lan9662-otpc.c    lpc18xx_otp.c     mtk-efuse.c       nvmem-rmem.mod.o  rmem.c            snvs_lpgpr.c           sunxi_sid.c
    core.c          internals.h      layerscape-sfp.c  Makefile          mxs-ocotp.c       nvmem-rmem.o      rmem.o            sprd-efuse.c           u-boot-env.c
    core.o          jz4780-efuse.c   layouts           meson-efuse.c     nintendo-otp.c    qcom-spmi-sdam.c  rockchip-efuse.c  stm32-bsec-optee-ta.c  uniphier-efuse.c

    4) Please refer it once any drivers are missing for EEPROM in (SPI  or NVMEM) ?

  • Hi paula,

    1) I have enough data in k3-am642-evm.dts file.

    &main_spi0 {
      bootph-all;
      status = "okay";
      pinctrl-names = "default";
      pinctrl-0 = <&main_spi0_pins_default>;
      ti,pindir-d0-out-d1-in;
      eeprom@0 {
        compatible = "microchip,93lc46b";
        reg = <0>;
        spi-max-frequency = <1000000>;
        spi-cs-high;
        data-size = <16>;
      };
    };

    2) checked this file also k3-am64-main.dtsi

    main_spi0: spi@20100000 {
        compatible = "ti,am654-mcspi", "ti,omap4-mcspi";
        reg = <0x00 0x20100000 0x00 0x400>;
        interrupts = <GIC_SPI 172 IRQ_TYPE_LEVEL_HIGH>;
        #address-cells = <1>;
        #size-cells = <0>;
        power-domains = <&k3_pds 141 TI_SCI_PD_EXCLUSIVE>;
        clocks = <&k3_clks 141 0>;
        dmas = <&main_pktdma 0xc300 0>, <&main_pktdma 0x4300 0>;
        dma-names = "tx0", "rx0";
        status = "disabled";
      };

    Refer it once it may help full for you to resolve the issue.

  • Hi Dinesh, I need to understand the request better. What you need is to get access the information from EEPROM 93LC46B?. If not, please let me know what the issue is or the results you are expecting

    thank you,

    Paula

  • Hi Paula,

    Need access the EEPROM with SPI0 interface which is connected to near the processor and simply read/write needs to be done with the EEPROM.

  • Hi Dinesh, I currently don't have a setup with me to test, but it seems you see MTD device SPI0. If so, something along the lines below steps, from 3.2.2.17. SPI — Processor SDK AM64X Documentation, might help you

    1) Check MTD devices

    cat /proc/mtd

    2) Read/Write MTD device. In below steps example, from documentation, the idea is to test If SPI driver and MTD interface are working correctly by checking that test.img and test1.img have the same checksum.

    cd /tmp

    # Step 1: Read 8 KiB from /dev/mtd2 (e.g., U-Boot environment)
    dd if=/dev/mtd2 of=test.img bs=8k count=1

    # Step 2: Check checksum of original image
    md5sum test.img

    # Step 3: Erase target partition (e.g., /dev/mtd4)
    flash_eraseall /dev/mtd4

    # Step 4: Write image to /dev/mtd4
    dd if=test.img of=/dev/mtd4 bs=8k count=1

    # Step 5: Read back from /dev/mtd4
    dd if=/dev/mtd4 of=test1.img bs=8k count=1

    # Step 6: Verify checksum
    md5sum test1.img

    Let me know if this helps

    Paula

  • Hi paula,

    I am asking about EEPROM 93LC46B interfacing with SPI0. Simply read/write needs to be done with this EEPROM. Steps required.

    TMDS64EVM Board.

  • Hi Dinesh, you can use U-BOOT i2c commands in bash for that.

    For reading:

    • i2c md <device_address> <data_address> <length>
    • Example: => i2c md 50 0.2 FE
    • md is "memory display" which is the read operation
    • I2C device address for EEPROM is 0x50
    • 0.2 is the starting memory address in EEPROM, in this case offset 0 and .2 implies 2-byte internal addressing
    • 0xFE is the number of bytes to read

    Similarly for writing:

    • i2c mw <device_address> <data_address> <data_value> <count>
    • Example: => i2c mw 50 0.2 55 1
    • mw is "memory write"
    • I2C Device address and starting address are similar to reading
    • Data value and finally number of bytes to write are the last two parameters

    Hope this helps,

    Paula

  • Hi Paula,

    Thanks for your information.

    I am asking about SPI EEPROM not I2C EEPROM. Please find in below snapshot marked with RED color.

  • Sorry you are right Dinesh, please ignore U-Boot I2C read/write instructions.

    • Device driver - MISC device - EEPROM support - Microware EEPROM 93xx46 support <M> enable. 
    • Device driver - NVMEM - Microware EEPROM 93xx46 support <M> enable (option is not their changed in kconfig, Makefile also but no use option is disable only)

    Just to clarify were you able to enable EEPROM in Kernel Config Menu or not? 

    By the way did you try "dd" commands as mentioned in two posts above. Just curious if you tried them

    thank you,

    Paula