* November spi changes
@ 2013-12-25  8:02 Antony Pavlov
  2014-01-06  9:20 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Antony Pavlov @ 2013-12-25  8:02 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox
Hi!
I'm working on adding SPI driver for Atheros 933x.
I'm using this code for registering spi flash:
=========================================================
static struct flash_platform_data spi_boot_flash_data = {
	.name		= "spi",
	.type		= "s25sl032p",
};
static struct spi_board_info spi_devs[] __initdata = {
	{
		/* boot: Spansion S25FL032P SPI flash */
		.name		= "m25p80",
		.max_speed_hz	= 104 * 1000 * 1000,
		.bus_num	= 0,
		.chip_select	= 0,
		.mode		= SPI_MODE_3,
		.platform_data	= &spi_boot_flash_data,
	},
};
...
	spi_register_board_info(spi_devs, ARRAY_SIZE(spi_devs));
=========================================================
If I rebase Atheros 933x over barebox-2013.11.0 then this code
works fine.
If I rebase Atheros 933x over barebox-2013.12.0 then I get
"Ooops" in get_param_by_name(dev=spi, name=size)
=========================================
Board: TP Link WR720N
m25p80 m25p800: s25sl032p (4096 Kbytes)
register_device: already registered spi
Ooops, TLB miss on load or ifetch!
...
### ERROR ### Please RESET the board ###
=========================================
Changing this
=========================================================
static struct flash_platform_data spi_boot_flash_data = {
	.name		= "spi",
	.type		= "s25sl032p",
};
=========================================================
to
=========================================================
static struct flash_platform_data spi_boot_flash_data = {
	.name		= "spi0",
	.type		= "s25sl032p",
};
=========================================================
solves the problem.
Sascha, please, comment this message.
-- 
Best regards,
  Antony Pavlov
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply	[flat|nested] 2+ messages in thread- * Re: November spi changes
  2013-12-25  8:02 November spi changes Antony Pavlov
@ 2014-01-06  9:20 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2014-01-06  9:20 UTC (permalink / raw)
  To: Antony Pavlov; +Cc: barebox
Hi Antony,
> 
> If I rebase Atheros 933x over barebox-2013.12.0 then I get
> "Ooops" in get_param_by_name(dev=spi, name=size)
> 
> =========================================
> Board: TP Link WR720N
> m25p80 m25p800: s25sl032p (4096 Kbytes)
> register_device: already registered spi
This seems to be your problem,
> 
> Ooops, TLB miss on load or ifetch!
This probably results from add_mtd_device() failling to check the return
value of register_device() properly.
> =========================================================
> static struct flash_platform_data spi_boot_flash_data = {
> 	.name		= "spi",
> 	.type		= "s25sl032p",
> };
> =========================================================
> 
> to
> 
> =========================================================
> static struct flash_platform_data spi_boot_flash_data = {
> 	.name		= "spi0",
> 	.type		= "s25sl032p",
> };
> =========================================================
The .name field defines the device filename under /dev. I would use
something like "spiflash0" here. "spi" or "spi0" sounds more like a spi
bus and in fact the it's already used by the spi bus.
Sascha
-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply	[flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-01-06  9:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-25  8:02 November spi changes Antony Pavlov
2014-01-06  9:20 ` Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox