We are using beaglebone black based custom board,
We have interfaced Numonyx m25980(1MBIT) chip with Am335x processor's SPI0.
I have added followoing lines in device tree
&spi0{ status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&spi0_pins>; /* DO is MOSI, D1 is MISO */ ti,pindir-d0-out-d1-in = <1>; m25p80@0 { #address-cells = <1>; #size-cells = <1>; compatible = "st,m25p80"; reg = <0>; spi-max-frequency = <1000000>; /*m25p,fast-read;*/ partition@12 { label = "spi-nor"; reg = <0x0 0x100000>; /* 1M */ }; }; };
i get following message in the kernel bootlog,
[ 0.157847] bus: 'spi': registered [ 0.157860] device class 'spi_master': registering [ 0.158319] bus: 'platform': add driver omap_hwspinlock [ 0.174404] device: '480ca000.spinlock': device_add [ 0.174428] bus: 'platform': add device 480ca000.spinlock [ 0.174630] bus: 'platform': driver_probe_device: matched device 480ca000.spinlock with driver omap_hwspinlock [ 0.174648] bus: 'platform': really_probe: probing driver omap_hwspinlock with device 480ca000.spinlock [ 0.174676] omap_hwspinlock 480ca000.spinlock: no default pinctrl state [ 0.174787] driver: '480ca000.spinlock': driver_bound: bound to device 'omap_hwspinlock' [ 0.174802] bus: 'platform': really_probe: bound device 480ca000.spinlock to driver omap_hwspinlock [ 0.177347] device: '48030000.spi': device_add [ 0.177371] bus: 'platform': add device 48030000.spi [ 0.413592] bus: 'spi': add driver m25p80 [ 0.633426] device class 'spidev': registering [ 0.633581] bus: 'spi': add driver spidev [ 0.633757] bus: 'platform': add driver omap2_mcspi [ 0.633867] bus: 'platform': driver_probe_device: matched device 48030000.spi with driver omap2_mcspi [ 0.633882] bus: 'platform': really_probe: probing driver omap2_mcspi with device 48030000.spi [ 0.633994] omap2_mcspi 48030000.spi: no sleep pinctrl state [ 0.634008] omap2_mcspi 48030000.spi: no idle pinctrl state [ 0.634123] device: 'spi1': device_add [ 0.634973] device: 'spi1.0': device_add [ 0.635006] bus: 'spi': add device spi1.0 [ 0.635284] bus: 'spi': driver_probe_device: matched device spi1.0 with driver m25p80 [ 0.635300] bus: 'spi': really_probe: probing driver m25p80 with device spi1.0 [ 0.635331] m25p80 spi1.0: no default pinctrl state [ 0.635495] m25p80 spi1.0: found mr25h256, expected m25p80 [ 0.635519] m25p80 spi1.0: mr25h256 (32 Kbytes) [ 0.635544] 1 ofpart partitions found on MTD device spi1.0 [ 0.635554] Creating 1 MTD partitions on "spi1.0": [ 0.635569] 0x000000000000-0x000000100000 : "spi-nor" [ 0.635581] mtd: partition "spi-nor" extends beyond the end of device "spi1.0" -- size truncated to 0x8000 [ 0.636180] driver: 'spi1.0': driver_bound: bound to device 'm25p80' [ 0.636196] bus: 'spi': really_probe: bound device spi1.0 to driver m25p80 [ 0.636500] device: 'spi1.1': device_add [ 0.636529] bus: 'spi': add device spi1.1 [ 0.636769] driver: '48030000.spi': driver_bound: bound to device 'omap2_mcspi' [ 0.636790] bus: 'platform': really_probe: bound device 48030000.spi to driver omap2_mcspi
when i erase it using following command it works fine but it erases only 32 kibytes
I can see message related to size truncation in the bootlog above but how do i avoid it ?
# flash_erase /dev/mtd12 0 0
Erasing 32 Kibyte @ 0 -- 100 % complete
I think driver is trying to match "m25p80"(from dts) with id in struct spi_device_id m25p_ids[] in m25p80.c.
Do i have to add entry for numonyx m25p80 chip in "struct spi_device_id m25p_ids[]" in m25p80.c file ?
Any suggestions/corrections ?
Thank you,
Regards,
Ankur