LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-29-2013, 03:14 AM   #1
biyabani
Member
 
Registered: Mar 2013
Posts: 65

Rep: Reputation: Disabled
How to create driver for EEPROM (AT25256A) using SPI interface with LPC3250


Hi,
I am working on ARM9 based LPC3250 controller with kernel version 2.6.34 using FDI3250 board. In my board LPC3250 has interfaced with EEPROM (AT25256A) using SPI protocol.
I want to make driver for slave and want to perform read and write operations from EEPROM. For that i have made below changes in kernel

1.changes done in kernel menuconfig for SPI driver are:

Enabled device drivers -> misc devices -> EEPROM support -> SPI EEPROM from most vendors

2.Added slave registration on board file
/home/mohan/bani/projects/lpc32x0/kernel/linux-2.6.34/arch/arm/mach-lpc32xx/fdi3250.c

/* AT25 driver registration */
static int __init fdi3250_spi_devices_register(void)
{
#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
static struct spi_board_info info[] = {
{
.modalias = "spidev",
.max_speed_hz = 5000000,
.bus_num = 0,
.chip_select = 0,
.controller_data = &spi0_chip_info,
},
};

#else
static struct spi_eeprom eeprom = {
.name = "at25256a",
.byte_len = 0x8000,
.page_size = 64,
.flags = EE_ADDR2,
};

static struct spi_board_info info[] = {
{
.modalias = "at25",
.max_speed_hz = 5000000,
.bus_num = 0,
.chip_select = 0,
.platform_data = &eeprom,
.controller_data = &spi0_chip_info,
},
};
#endif
return spi_register_board_info(info, ARRAY_SIZE(info));
}

Then i have ported the uImage in kernel and after kernel booting i mount the sysfs using below commands

mkdir /sys
mount -t sysfs sysfs sys

After that i found that EEPROM folder has not created at below path
/sys/bus/spi/device/spi0.0

From the observations what i have to conclude? is driver installed successfully or not?
If not installed what other changes i have do to make install?
If installed then what could be the other problems?

Please help me.


Thanks & Regards,
MOHAMMAD BIYABANI.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] SPI interface in mpc83xx NishaK Linux - Kernel 5 02-28-2013 06:49 AM
SPI bus for upgrading EEprom ravi_chobey Linux - Embedded & Single-board computer 1 11-08-2012 07:59 PM
Can i register a ssc driver (a serial interface device) to be a spi driver ? 5883 Programming 0 03-04-2012 07:14 PM
SPI interface with AT91SAM9261 sunr2007 Linux - Embedded & Single-board computer 0 08-03-2009 04:43 AM
TV card, no sound, eeprom invalid, no eeprom present (err=-121) cncman Linux - Hardware 1 08-05-2006 08:24 AM


All times are GMT -5. The time now is 08:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration