SPI is not accessible

71 views
Skip to first unread message

Yuefan

unread,
Apr 9, 2012, 1:20:57 PM4/9/12
to pandaboard
Hi,

I am doing a project which needs one spi out and it will be connected
to a slave chip,. My board is pandaboard, and I compiled uboot and 3.2
linux kernel, now it is working. But the problem now is when I went to
the file of Boad_omap4panda.c under the folder arch/arm/mach-omap2,
and did the following changes, there is no /dev/spi things like that
meaning that I am not able to access it. Could someone help me ??
thanks



#include <plat/mcspi.h>
#include <linux/spi/spi.h>
static struct spi_board_info panda_spi_board_info[] __initdata = {
{
.modalias = "testtttt",
.bus_num = 1,
.chip_select = 0,
.max_speed_hz = 24000000,
.mode = SPI_MODE_1,
.irq = -1,

},
};

spi_register_board_info(panda_spi_board_info,
ARRAY_SIZE(panda_spi_board_info)); //this function is called
in the omap4_panda_init

Yuefan

unread,
Apr 9, 2012, 5:24:20 PM4/9/12
to pandaboard
Anyone can help me? thanks in advance !!

Bharathi Subramanian

unread,
Apr 10, 2012, 7:11:30 AM4/10/12
to panda...@googlegroups.com
> Anyone can help me? thanks in advance !!

It might be an pin mux related issue. Please search in this list
archives, there were few discussions related to SPI in past.

HTH :)
--
Bharathi Subramanian

Yuefan

unread,
Apr 10, 2012, 1:35:15 PM4/10/12
to pandaboard
Hi Bharathi

I searched it in the list archives and I followed what they told us to
do, and it didnt work at all, can you send me any instructions ?
thanks

On Apr 10, 1:11 pm, Bharathi Subramanian <bharathi.l...@gmail.com>
wrote:

Bharathi Subramanian

unread,
Apr 11, 2012, 3:18:42 AM4/11/12
to panda...@googlegroups.com
Hi,

If you can put down your modifications in sequence and current issue,
it may help to give proper suggestion.

Bye :)
--
Bharathi Subramanian

Yuefan

unread,
Apr 11, 2012, 5:04:48 AM4/11/12
to pandaboard
Hi,
I did the following things:

1. I compiled 2012.04 uboot without any change, then I got uImage and
MLO

2. I downloaded kernel 3.2.13 and modified the board_omap4panda.c

I included two more libs

#include <linux/spi/spi.h>
#include <plat/mcspi.h>


then in order to get the device in the file system, I added these code


static struct omap2_mcspi_device_config spidev_mcspi_config = {
.turbo_mode = 0,
.single_channel = 1, /* 0: slave, 1: master */
};

static struct spi_board_info panda_spi_board_info[] __initdata = {
{
.modalias = "spidev",
.bus_num = 1,
.chip_select = 0,
.max_speed_hz = 1000,
.mode = SPI_MODE_0,
.controller_data = &spidev_mcspi_config,
},
};

static int __init omap4_panda_spi_init(void){
spi_register_board_info(panda_spi_board_info,
ARRAY_SIZE(panda_spi_board_info));

omap_mux_init_signal("mcspi1_clk.mcspi1_clk", OMAP_PIN_INPUT
| OMAP_MUX_MODE0);
omap_mux_init_signal("mcspi1_somi.mcspi1_somi", OMAP_PIN_INPUT |
OMAP_MUX_MODE0);
omap_mux_init_signal("mcspi1_simo.mcspi1_simo", OMAP_PIN_OUTPUT
| OMAP_MUX_MODE0);
omap_mux_init_signal("mcspi1_cs0.mcspi1_cs0",
OMAP_PIN_OUTPUT| OMAP_MUX_MODE0);

return 0;
}


finally, I call the inital function in the
static void __init omap4_panda_init(void){


omap4_panda_spi_init();

}

I am using angstrom minimal file system.

Thanks



On Apr 11, 9:18 am, Bharathi Subramanian <bharathi.l...@gmail.com>
wrote:

Yuefan

unread,
Apr 11, 2012, 8:06:24 AM4/11/12
to pandaboard
can someone help me!?

Yuefan

unread,
Apr 11, 2012, 2:05:42 PM4/11/12
to pandaboard
Please help me

Yuefan

unread,
Apr 11, 2012, 6:48:48 PM4/11/12
to pandaboard
Hi all,

I check the debug mode, and from the console I saw chipselect0 is
already in use, not able to create /dev/spidev,

can someone know whats happening and how to solve it?

aaron...@gmail.com

unread,
May 26, 2014, 8:14:33 AM5/26/14
to panda...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages