scottellis / spike

Writing a Linux SPI driver for OMAP3 systems
http://www.jumpnowtek.com
16 stars 9 forks source link

[DM3730]: spike driver part 2 code not working #7

Open honey-speaks-tech opened 11 years ago

honey-speaks-tech commented 11 years ago

Hi all,

I have tried to workout the sample for Part 2 for our DM3730 based kit. I have connected the MOSI and MISO pin of DM3730 from the expansion interface board. But the loopback Rx buffer is still showing zeros only. Could you please tell me what is the problem? I have only modified the SPI bus number to 1, chip select as CS0 and SPI mode as SPI_MODE_1. I have also modified the pin mux configuration in the board-omap3devkit.c

Thanks, alaipayuthe

scottellis commented 11 years ago

Which Gumstix expansion board are you using?

On 11/30/2012 02:36 AM, alaipayuthe wrote:

Hi all,

I have tried to workout the sample for Part 2 for our DM3730 based kit. I have connected the MOSI and MISO pin of DM3730 from the expansion interface board. But the loopback Rx buffer is still showing zeros only. Could you please tell me what is the problem? I have only modified the SPI bus number to 1 and SPI mode as SPI_MODE_1.

Thanks, alaipayuthe

— Reply to this email directly or view it on GitHub https://github.com/scottellis/spike/issues/7.

honey-speaks-tech commented 11 years ago

Hi all,

Our board is DM3730 based Embest Devkit 8500. On further digging into the issue by using an oscilloscope, I found that no signals found on SPI pins like MOSI, MISO, SPI_CLK, SPI_CS0 etc. So I guess the issue might be with my Pin Mux configuration. I am a newbie in this field. So could you guide me in correcting my mux configuration with Linux kernel. I have used omap_mux_init_signal() API to configure it in my board-omap3devkit8500.c

Thanks, alaipayuthe

scottellis commented 11 years ago

This is the muxing for the SPI1 pins on the Gumstix. It's done in u-boot.

--- from /board/overo/overo.h

 MUX_VAL(CP(MCSPI1_CLK),        (IEN  | PTD | DIS | M0)) /*McSPI1_CLK*/\
 MUX_VAL(CP(MCSPI1_SIMO),    (IEN  | PTD | DIS | M0)) /*McSPI1_SIMO */\
 MUX_VAL(CP(MCSPI1_SOMI),    (IEN  | PTD | DIS | M0)) /*McSPI1_SOMI */\
 MUX_VAL(CP(MCSPI1_CS0),        (IEN  | PTD | EN  | M0)) /*McSPI1_CS0*/\
 MUX_VAL(CP(MCSPI1_CS1),        (IDIS | PTD | EN  | M0)) /*McSPI1_CS1*/\

Those flags translate to the following

--- from /arch/arm/include/asm/arch-omap3/mux.h

/*

define IEN (1 << 8)

define IDIS (0 << 8)

define PTU (1 << 4)

define PTD (0 << 4)

define EN (1 << 3)

define DIS (0 << 3)

define M0 0

define M1 1

define M2 2

define M3 3

define M4 4

define M5 5

define M6 6

define M7 7

It's important to mux the SPI CLK as an input, even though that sounds strange.

On 12/03/2012 01:43 AM, alaipayuthe wrote:

Hi all,

Our board is DM3730 based Embest Devkit 8500. On further digging into the issue by using an oscilloscope, I found that no signals found on SPI pins like MOSI, MISO, SPI_CLK, SPI_CS0 etc. So I guess the issue might be with my Pin Mux configuration. I am a newbie in this field. So could you guide me in correcting my mux configuration with Linux kernel. I have used omap_mux_init_signal() API to configure it in my board-omap3devkit8500.c

Thanks, alaipayuthe

— Reply to this email directly or view it on GitHub https://github.com/scottellis/spike/issues/7#issuecomment-10943034.