<font size=2 face="sans-serif">Ok i see.. :)</font>
<br><font size=2 face="sans-serif">thanks a lot.</font>
<br>
<br>
<br>
<br><font size=1 color=#5f5f5f face="sans-serif">Von:
</font><font size=1 face="sans-serif">Franck Jullien <franck.jullien@gmail.com></font>
<br><font size=1 color=#5f5f5f face="sans-serif">An:
</font><font size=1 face="sans-serif">christian.buettner@rafi.de,
</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Kopie:
</font><font size=1 face="sans-serif">barebox@lists.infradead.org</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Datum:
</font><font size=1 face="sans-serif">30.07.2012 10:33</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Betreff:
</font><font size=1 face="sans-serif">Re: Re: Re:
nor flash board init code</font>
<br>
<hr noshade>
<br>
<br>
<br><tt><font size=2>2012/7/30 <christian.buettner@rafi.de>:<br>
> Whooosch and it worked!<br>
><br>
> devinfo<br>
> devices:<br>
> ...<br>
> `---- mem1<br>
> `---- 0x00000000-0xfffffffe: /dev/mem<br>
> `---- i2c-imx2<br>
> `---- imx_spi0<br>
> `---- m25p0<br>
> `---- fec_imx0<br>
> `---- miidev0<br>
> ...<br>
><br>
> barebox:/ devinfo m25p0<br>
> resources:<br>
> driver: none<br>
><br>
> no parameters available<br>
> barebox:/<br>
><br>
> But why is driver in devinfo = none?<br>
><br>
<br>
It used to work. You need to find why it doesn't work anymore ;)<br>
<br>
> christian<br>
><br>
><br>
> Von: Franck Jullien <franck.jullien@gmail.com><br>
> An: christian.buettner@rafi.de,<br>
> Kopie: barebox@lists.infradead.org<br>
> Datum: 30.07.2012 10:07<br>
> Betreff: Re: Re: nor flash board init code<br>
> ________________________________<br>
><br>
><br>
><br>
> Hi,<br>
><br>
> 2012/7/30 <christian.buettner@rafi.de><br>
>><br>
>> Thanks for the code!<br>
>><br>
>> Here is my approach:<br>
>><br>
>> const struct flash_platform_data tx53_flash = {<br>
>> .type = "mx25l8005",<br>
>> .name = "spi_flash",<br>
>> };<br>
>><br>
>><br>
>> //MX25L8005MC-15G<br>
>> static const struct spi_board_info mx53_spi_board_info[] = {<br>
>> {<br>
>> .name
= "mx25l8005",<br>
><br>
><br>
> Here sould be the driver name: .name = "m25p",<br>
><br>
>><br>
>> .max_speed_hz
= 70000000,<br>
>> .bus_num
= 0,<br>
>> .chip_select
= 0,<br>
>> .bits_per_word
= 8,<br>
>> .mode
= SPI_MODE_0,<br>
>> .platform_data
= &tx53_flash,<br>
>> },<br>
>> };<br>
>><br>
>> static struct spi_imx_master tx53_spi = {<br>
>> .num_chipselect
= 1,<br>
>> };<br>
>><br>
>><br>
>> init_devices {<br>
>><br>
>> ...<br>
>> spi_register_board_info(mx53_spi_board_info,<br>
>>
ARRAY_SIZE(mx53_spi_board_info));<br>
>><br>
>> add_generic_device("m25p",-1,"m25p",MX53_ECSPI1_BASE_ADDR,64
*<br>
>> 1024,IORESOURCE_MEM,&mx53_spi_board_info);<br>
><br>
> You have to add the SPI master device here. The m25p device will be<br>
> probed automagically (AFAIR).<br>
><br>
><br>
>><br>
>> ...<br>
>> }<br>
>><br>
>><br>
>> When the m25p80.c driver probes i get no spi instance:<br>
>><br>
>> static int m25p_probe(struct device_d *dev) {<br>
>> struct spi_device *spi = (struct spi_device
*)dev->type_data;<br>
>> const struct spi_device_id
*id = NULL;<br>
>> ...<br>
>> }<br>
>><br>
>> struct spi_device *spi is always null<br>
>><br>
>> Whats wrong here?<br>
>><br>
>> christian<br>
>><br>
>><br>
>><br>
>> Von: Franck Jullien <franck.jullien@gmail.com><br>
>> An: christian.buettner@rafi.de,<br>
>> Kopie: barebox@lists.infradead.org<br>
>> Datum: 27.07.2012 13:33<br>
>> Betreff: Re: nor flash board init code<br>
>> ________________________________<br>
>><br>
>><br>
>><br>
>> 2012/7/25 <christian.buettner@rafi.de><br>
>> ><br>
>> > hi all,<br>
>> > is there any example board init code to load the mx25l8005
spi nor-flash<br>
>> > through the imx53 (TX53 from KARO)?<br>
>> > I want to use the m25p80 driver to read and write.<br>
>> ><br>
>> > christian<br>
>> > _______________________________________________<br>
>> > barebox mailing list<br>
>> > barebox@lists.infradead.org<br>
>> > </font></tt><a href=http://lists.infradead.org/mailman/listinfo/barebox><tt><font size=2>http://lists.infradead.org/mailman/listinfo/barebox</font></tt></a><tt><font size=2><br>
>> ><br>
>><br>
>> Hi Christian,<br>
>><br>
>> This is what I use with the Altera SPI controller + an SPI flash
device:<br>
>><br>
>><br>
>> </font></tt><a href="http://www.elec4fun.fr/index.php?option=com_content&view=article&id=10&Itemid=153"><tt><font size=2>http://www.elec4fun.fr/index.php?option=com_content&view=article&id=10&Itemid=153</font></tt></a><tt><font size=2><br>
>><br>
>> static struct spi_altera_master altera_spi_0_data = {<br>
>> .num_chipselect = 1,<br>
>> .spi_mode = 0, /* SPI
mode of the EPCS flash controller */<br>
>> .databits = 8, /* Data
length of the EPCS flash controller */<br>
>> .speed = 20000000, /* EPCS flash controller
speed */<br>
>> };<br>
>><br>
>><br>
>> static struct flash_platform_data epcs_flash = {<br>
>> .name = "epcs", /*
Cdev name, optional */<br>
>> .type = "m25p40", /* Device
type, required for non JEDEC chips */<br>
>> };<br>
>><br>
>> static struct spi_board_info generic_spi_board_info[] = {<br>
>> {<br>
>> .name = "m25p",<br>
>> .max_speed_hz = 20000000,<br>
>> .bus_num = 0,<br>
>> .chip_select = 0,<br>
>> .bits_per_word = 8,<br>
>> .mode = SPI_MODE_0,<br>
>> .platform_data = &epcs_flash,<br>
>> }<br>
>> };<br>
>><br>
>> static int myboard_devices_init(void) {<br>
>><br>
>> ...<br>
>><br>
>> spi_register_board_info(myboard_spi_board_info,<br>
>> ARRAY_SIZE(myboard_spi_board_info));<br>
>><br>
>> add_generic_device("altera_spi", -1, NULL, NIOS_SOPC_EPCS_BASE,
0x18,<br>
>>
IORESOURCE_MEM, &altera_spi_0_data);<br>
>><br>
>> ...<br>
>><br>
>> Franck.<br>
>><br>
><br>
> Franck.<br>
><br>
</font></tt>
<br>