Hello,
I have received the GMI driver for External Bus of the Colibri T20 from Toradex ARM support.
I have been able to integrate it into the kernel and am able to access it at /dev/gmi
as a character special file. I have also written a small utility to read/write and issue ioctl calls to the driver.
I am trying to use LPC1768 (an ARM based micro-controller) to send character data (ASCII encoded) to the T20 external bus. The LPC1768 sends “Hello”, in an infinite loop. The LPC1768 is send its data at 72MHz. What I should be expecting to see when I read from the /dev/gmi
is the characters that were sent. Instead what I see is garbage data. This seems to be because there is a mismatch in operating frequency.
Question 1)
What is the default frequency at which the external bus is operating when the driver is loaded?
How do I find out the frequency of the external data bus on T20?
Question 2)
How do I configure the frequency of the external bus.
Question 3)
The following lines in the driver source code seem to have something to do with the frequency:
case GMI_IOCTL_SPEED_LO:
pr_info("gmi-chardev: ioctl(): GMI_IOCTL_SPEED_LO\n");
inst_info->timing0_default = 0xD0A073A8;
inst_info->timing0_read = 0xD0A073A8;
//inst_info->timing1_default = 0x00101010;
//inst_info->timing1_read = 0x00101010;
inst_info->timing1_default = 0x00141010;
inst_info->timing1_read = 0x00141010;
//snor_tegra_writel(c, c->timing0_default, TEGRA_SNOR_TIMING0_REG);
//snor_tegra_writel(c, c->timing1_default, TEGRA_SNOR_TIMING1_REG);
break;
case GMI_IOCTL_SPEED_MED:
pr_info("gmi-chardev: ioctl(): GMI_IOCTL_SPEED_MED\n");
inst_info->timing0_default = 0xA0A05585;
inst_info->timing0_read = 0xA0A05585;
inst_info->timing1_default = 0x00050406;
inst_info->timing1_read = 0x00050406;
//snor_tegra_writel(c, c->timing0_default, TEGRA_SNOR_TIMING0_REG);
//snor_tegra_writel(c, c->timing1_default, TEGRA_SNOR_TIMING1_REG);
break;
case GMI_IOCTL_SPEED_HI:
pr_info("gmi-chardev: ioctl(): GMI_IOCTL_SPEED_HI\n");
inst_info->timing0_default = 0xA0A02020;
inst_info->timing0_read = 0xA0A02020;
inst_info->timing1_default = 0x00040200;
inst_info->timing1_read = 0x00040200;
//snor_tegra_writel(c, c->timing0_default, TEGRA_SNOR_TIMING0_REG);
//snor_tegra_writel(c, c->timing1_default, TEGRA_SNOR_TIMING1_REG);
break;
What do the values for timing0_default, timing0_read, timing1_default, timing1_read
represent. If they represent timing, then are they in millisec or usec or Hz? Also why are three modes (HI, MED, LO) provided?
Question 4)
What voltage levels define logic 1 and 0 on the external bus?
Attachments:
- The source code for the driver. link
- Code for the utility I am using to read data from the bus. link
I hope someone from the Toradex team can answer these questions because I cannot find answers to these questions elsewhere.
Your help is greatly appreciated.
Thank you.