External Memory Bus in Non-Multiplexed mode (Colibri T20)

I have been trying to make use of the external memory bus on the the Colibri T20.

I have the GMI driver (source code) from Toradex for the same which provides operations such as open, read, write, seek, release, ioctl etc.



A look at the T20 data-sheet (pg. 27 of datasheet) reveals that the T20 can be operated in multiplexed and non-multiplexed modes. I am interested in non-multiplexed mode, so here are some of my questions:

  1. Is the default mode of operation non-multiplexed mode?

  2. It seems that the bus is operating in 32-bit data mode by default. Is this correct?

  3. The IOCTL call GMI_IOCTL_WIDTH_16 does not change the data width from 32 to 16 bit since I am still able to read bits on data lines D16 to D31. How do I restrict the data width to 16 bits?

  4. dmesg | grep -m 1 gmi gives gmi-chardev: map.phys=3489660928, map.size=33554432.

Similarly, when I calculate size of file using lseek(fd,0,SEEK_END) - lseek(fd,0,SEEK_SET) I get 33554432(Note: 33554432 = 2^25). Does this represent the addressable space of the bus? If so, why is the address space limited to 25bits as compared to 28bits as mentioned in the T20 data sheet?

  1. Do the positional offsets in the GMI character device file correspond to physical addresses of the device connected on the external memory bus?


I will be extremely thankful if someone can clarify these questions.

“1) Is the default mode of operation non-multiplexed mode?”

Yes

“2) It seems that the bus is operating in 32-bit data mode by default. Is this correct?”

For T20, yes - the t20 GMI patch configures 32-bit bus width

“3) How do I restrict the data width to 16 bits?”

In ‘arch/arm/mach-tegra/board-colibri_t20.h’, the patch uncomments #define GMI_32BIT. You can simply comment it back out.

“4) Does this represent the addressable space of the bus? If so, why is the address space limited to 25bits as compared to 28bits as mentioned in the T20 data sheet?”

The size may be adjusted in ‘arch/arm/mach-tegra/board-colibri_t20.c’ (up to the limit of the maximum spec in the T20 TRM/datasheet). This is the relevant code from the T20 GMI patch - note the size set to SZ_32M:

+#if defined(CONFIG_MTD_NOR_TEGRA) || defined(CONFIG_GMI_BUS_TEGRA)
+static void colibri_t20_nor_init(void)
+{
+    pr_err("NOR Init size %x\n", SZ_32M);
+
+	//#if defined(CONFIG_GMI_BUS_TEGRA)
+    //tegra_nor_device.name = "gmi-dma";
+	//#endif
+
+	tegra_nor_device.resource[2].end = TEGRA_NOR_FLASH_BASE + SZ_32M - 1;
+	tegra_nor_device.dev.platform_data = &nor_data;
+	platform_device_register(&tegra_nor_device);
+}
+#endif

“5) Do the positional offsets in the GMI character device file correspond to physical addresses of the device connected on the external memory bus?”

Yes

Thank you very much for the answers, I now have adequate information to interface my device to the external bus.

Just a final question, which is relavent to the work I am doing:

Is it possible to configure the driver to operate in 8-bit data mode?

@adwaitpatil 8-bit data mode should be possible; but some tweaking of the driver and/or board configuration is likely necessary. I haven’t tested it.