Confused about EIM device tree configuration

Hello,

I’m trying to get the EIM interface working on a Colibri-iMX6ULL 512MB IT but I got a bit confused about what to do. I build the Kernel and enabled the Freescale EIM Driver and looked at the device tree imx6ull-colibri-eval-v3.dtsi.

My question is: how can I configure the device tree correctly so that I can use the EIM interface. I want to communicate to a FPGA with 6 adresses and 8 data SRAM. Do I need to add this to the device tree:

&weim {
	status = "okay";
	/* weim memory map: 32MB on CS0, 32MB on CS1, 32MB on CS2, 32MB on CS3 */
	ranges = <0 0 0x08000000 0x02000000
	          1 0 0x0a000000 0x02000000
	          2 0 0x0c000000 0x02000000
              3 0 0x0e000000 0x02000000>;
	/* FPGA on CS0 */
	sram@0,0 {
		compatible = "cypress,cy7c1019dv33-10zsxi, mtd-ram";
		reg = <0 0 0x00010000>;
		#address-cells = <1>;
		#size-cells = <1>;
		bank-width = <2>;
		fsl,weim-cs-timing = <0x00020081 0x00000000 0x04000000
				0x00000000 0x04000040 0x00000000>;
	};
};

Also, do I need to edit anything regarding iomux or is that not necessairy for the iMX6ULL? And if I have to, how would I do that?

Kind regards,

Remo

Update:

Currently I was able to enable the EIM driver and confirmed it was on. (I have not changed any iomux settings in the device tree) However when I tried read an address with devmem2, I received an error:

root@colibri-imx6ull:~# devmem2 0x08000000
/dev/mem opened.
Memory mapped at address 0x76f47000.
Bus error

What am I doing wrong here?

Hello @rjjong1 ,

The Bus error usually occurs when you are trying to access a reserved memory. Could you maybe re-check your permissions?

As far as the discussion of EIM, there is another thread in the community that has been talking in detail about this:

And could you also mention the BSP version you are using right now (output of uname -a ) ?

Best Regards,
Janani

Hello @saijanani.tx ,

Thank you for your response.

I’m not sure how I can recheck my permission, but since I’m the root I suppose I have those. Also while I was building the Kernel Configuration, I checked if CONFIG_DEVMEM was enabled and CONFIG_STRICT_DEVMEM was disabled, which it was. This means I should be able to write to those addresses right?
This is my BSP version output: Linux colibri-imx6ull-06998482 5.4.154-39314-g45da8a2ce789-dirty #1 SMP Mon Nov 15 17:37:05 CET 2021 armv7l armv7l armv7l GNU/Linux

I had read this post, but I think the EIM interface, for me, is simply not working yet. But when I look for the weim driver it says it is working…

$ dmesg | grep -i eim
OUTPUT:
# imx-weim 21b8000.weim: Driver registered.

I read something about a the EIM slow clock, which has to be enabled, but I’m not sure how or what that means. Chapter 21.3 in IMX6ULL Reference Manual.

Best regards,

Remo

I was able to finally get some response from the EIM interface. I allocated the wrong physical address for the EIM interface to use. I had it mixed up with the iMX6’s memory map.

iMX6ULL EIM Memory map starts at 0x50000000 and the iMX6 EIM memory map starts at 0x08000000. When I changed this, it all seemed to work fine. (while at the same time disabling all conflicting iomuxc pins and configuring the weim driver in the device tree)

iomuxc configuration:

pinctrl_weim: weimgrp {
       fsl,pins = <
                MX6UL_PAD_CSI_DATA00__EIM_AD00    0x0b0b1
                MX6UL_PAD_CSI_DATA01__EIM_AD01    0x0b0b1
                MX6UL_PAD_CSI_DATA02__EIM_AD02    0x0b0b1
                MX6UL_PAD_CSI_DATA03__EIM_AD03    0x0b0b1
                MX6UL_PAD_CSI_DATA04__EIM_AD04    0x0b0b1
                MX6UL_PAD_CSI_DATA05__EIM_AD05    0x0b0b1
                MX6UL_PAD_CSI_DATA06__EIM_AD06    0x0b0b1
                MX6UL_PAD_CSI_DATA07__EIM_AD07    0x0b0b1
                MX6UL_PAD_CSI_MCLK__EIM_CS0_B     0x0b0b1
                MX6UL_PAD_CSI_PIXCLK__EIM_OE      0x0b0b1
                MX6UL_PAD_CSI_VSYNC__EIM_RW       0x0b0b1
                MX6UL_PAD_CSI_HSYNC__EIM_LBA_B    0x0b0b1
                MX6UL_PAD_LCD_DATA08__EIM_DATA00  0x1b0b1
                MX6UL_PAD_LCD_DATA09__EIM_DATA01  0x1b0b1
                MX6UL_PAD_LCD_DATA10__EIM_DATA02  0x1b0b1
                MX6UL_PAD_LCD_DATA11__EIM_DATA03  0x1b0b1
                MX6UL_PAD_LCD_DATA12__EIM_DATA04  0x1b0b1
                MX6UL_PAD_LCD_DATA13__EIM_DATA05  0x1b0b1
                MX6UL_PAD_LCD_DATA14__EIM_DATA06  0x1b0b1
                MX6UL_PAD_LCD_DATA15__EIM_DATA07  0x1b0b1
       >;
};

weim driver configuration:

&weim {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_weim>;
        #address-cells = <2>;
        #size-cells = <1>;
        status = "okay";
        ranges = <0 0 0x50000000 0x08000000>;

        sram@0,0 {
                compatible = "cypress,cy7c1019dv33-10zsxi, mtd-ram";
                reg = <0 0 0x00004000>;
                #address-cells = <1>;
                #size-cells = <1>;
                bank-width = <2>;
                fsl,weim-cs-timing = <0x00010081 0x00000000 0x04000000
                                0x00000000 0x04000040 0x00000000>;
        };
};

Test results with memtester and devmem2

root@colibri-imx6ull-06998482:~# memtester -p 0x50000000 16K 1
memtester version 4.3.0 (32-bit)
Copyright (C) 2001-2012 Charles Cazabon.
Licensed under the GNU General Public License version 2 (only).

pagesize is 4096
pagesizemask is 0xfffff000
want 0MB (16384 bytes)
Loop 1/1:
  Stuck Address       : testing   0FAILURE: possible bad address line at physical address 0x50000000.
Skipping to next test...
  Random Value        : ok
  Compare XOR         : ok
  Compare SUB         : ok
  Compare MUL         : ok
  Compare DIV         : ok
  Compare OR          : ok
  Compare AND         : ok
  Sequential Increment: ok
  Solid Bits          : ok         
  Block Sequential    : ok         
  Checkerboard        : ok         
  Bit Spread          : ok         
  Bit Flip            : ok         
  Walking Ones        : ok         
  Walking Zeroes      : ok         

Done.

root@colibri-imx6ull-06998482:~# devmem2 0x50000000
/dev/mem opened.
Memory mapped at address 0x76f95000.
Read at address  0x50000000 (0x76f95000): 0x00000000