AP7000 libertas_spi
Thiago A. Corrêa
thiago.correa at gmail.com
Wed Aug 4 15:01:41 EDT 2010
Hi,
I'm trying to connect a Marvel 88w8686 based module from USI
(MR-09-REF2) to the Atmel AVR32 AP7000 on SPI1, cs0 but so far without
success.
I'm using the driver from the kernel 2.6.34. It looks like the
driver sends a message to the module, but doesn't get a reply back.
We have measured it on the scope and the MISO line really stays
still, while the clock, MOSI and CS all get some brief action.
Perhaps someone can with experience can give me a hint?
My board init code follows:
#ifdef CONFIG_BOARD_EVA1_LIBERTAS
static int eva1_libertas_setup(struct spi_device *spi);
static struct libertas_spi_platform_data libertas_spi_platform_data_info =
{
.use_dummy_writes = 1,
.setup = eva1_libertas_setup,
};
static struct spi_board_info __initdata spi1_board_info[] = {
{
.modalias = "libertas_spi",
.max_speed_hz = 13000000,
.bus_num = 1,
.chip_select = 0,
.mode = SPI_MODE_0,
.platform_data = &libertas_spi_platform_data_info
},
};
#endif
and I add this to my postcore_init call:
#ifdef CONFIG_BOARD_EVA1_LIBERTAS
at32_reserve_pin(GPIO_PIN_PB(3), 0); /* IRQ for Libertas */
spi1_board_info[0].irq = gpio_to_irq(GPIO_PIN_PB(3));
at32_add_device_spi(1, spi1_board_info, ARRAY_SIZE(spi1_board_info));
#endif
When I load the kernel with those changes I get this dmesg output:
Linux version 2.6.34 (root at localhost) (gcc version 4.2.2-atmel.1.0.8)
#1 Wed Aug 4 15:03:00 BRT 2010
CPU: AT32AP700x chip revision C
CPU: AP7 [01] core revision 0 (AVR32B arch revision 1)
CPU: MMU configuration: Shared TLB
CPU: features: dsp simd ocd perfctr java
CPU: Running at 140.000 MHz
Physical memory:
10000000-13ffffff
Reserved memory:
10000000-10249bbb: Kernel code
10249bbc-1033db4f: Kernel data
Exception vectors start at 90016000
CPU: Paging enabled
Node 0: start_pfn = 0x10000, low = 0x14000
On node 0 totalpages: 16384
free_area_init_node: node 0, pgdat 9032805c, node_mem_map 90340000
Normal zone: 128 pages used for memmap
Normal zone: 0 pages reserved
Normal zone: 16256 pages, LIFO batch:3
Node 0: mem_map starts at 90340000
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256
Kernel command line: console=ttyS0 root=/dev/mmcblk0p1 rw rootwait
PID hash table entries: 256 (order: -2, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 61648k/61648k available (2254k kernel code, 3888k reserved,
191k data, 88k init)
SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Hierarchical RCU implementation.
NR_IRQS:288
avr32_comparator: irq 0, 140.000 MHz
Calibrating delay using timer specific routine.. 282.36 BogoMIPS (lpj=564722)
Mount-cache hash table entries: 512
smc smc.0: Atmel Static Memory Controller at 0xfff03400
NET: Registered protocol family 16
pio0: base 0xffe02800, irq 13 chains 96..127
pio1: base 0xffe02c00, irq 14 chains 128..159
pio2: base 0xffe03000, irq 15 chains 160..191
pio3: base 0xffe03400, irq 16 chains 192..223
pio4: base 0xffe03800, irq 17 chains 224..255
pdc pdc.0: Atmel Peripheral DMA Controller enabled
at32_eic at32_eic.0: External Interrupt Controller at 0xfff00100, IRQ 19
at32_eic at32_eic.0: Handling 4 external IRQs, starting with IRQ 64
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
cfg80211: Calling CRDA to update world regulatory domain
Switching to clocksource avr32_counter
Switched to NOHz mode on CPU #0
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
NET: Registered protocol family 1
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
msgmni has been set to 120
alg: No test for stdrng (krng)
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)
io scheduler noop registered
io scheduler cfq registered (default)
atmel_usart.0: ttyS0 at MMIO 0xffe01000 (irq = 7) is a ATMEL_SERIAL
console [ttyS0] enabled
atmel_usart.1: ttyS1 at MMIO 0xffe00c00 (irq = 6) is a ATMEL_SERIAL
atmel_usart.2: ttyS2 at MMIO 0xffe01800 (irq = 9) is a ATMEL_SERIAL
atmel_usart.3: ttyS3 at MMIO 0xffe01400 (irq = 8) is a ATMEL_SERIAL
physmap platform flash device: 00800000 at 00000000
physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank
Intel/Sharp Extended Query Table at 0x0041
atmel Features: 86
erase region 0: offset=0x0,size=0x10000,blocks=127
erase region 1: offset=0x7f0000,size=0x2000,blocks=8
RedBoot partition parsing not available
Using physmap partition information
Creating 3 MTD partitions on "physmap-flash.0":
0x000000000000-0x000000020000 : "u-boot"
0x000000020000-0x0000007f0000 : "root"
0x0000007f0000-0x000000800000 : "env"
atmel_spi atmel_spi.0: Atmel SPI Controller at 0xffe00000 (irq 3)
atmel_spi atmel_spi.0: registered master spi0
spi spi0.0: setup: 7000000 Hz bpw 8 mode 0x0 -> csr0 00000502
spi spi0.0: setup mode 0, 8 bits/w, 8000000 Hz max --> 0
atmel_spi atmel_spi.0: new message 93c19d7c submitted for spi0.0
atmel_spi atmel_spi.0: start message 93c19d7c for spi0.0
mtd_dataflash spi0.0: activate 3, mr 000e0011
mtd_dataflash spi0.0: start xfer 93c19d34: len 1 tx
93c43380/13c43380 rx (null)/ffffffff
mtd_dataflash spi0.0: next xfer 93c19d58: len 3 tx (null)/ffffffff
rx 93c43381/13c43381
mtd_dataflash spi0.0: DEactivate 3, mr 000f0011
atmel_spi atmel_spi.0: xfer complete: 4 bytes transferred
atmel_spi atmel_spi.0: new message 93c19d7c submitted for spi0.0
atmel_spi atmel_spi.0: start message 93c19d7c for spi0.0
mtd_dataflash spi0.0: activate 3, mr 000e0011
mtd_dataflash spi0.0: start xfer 93c19d34: len 1 tx
93c43380/13c43380 rx (null)/ffffffff
mtd_dataflash spi0.0: next xfer 93c19d58: len 1 tx (null)/ffffffff
rx 93c43381/13c43381
mtd_dataflash spi0.0: DEactivate 3, mr 000f0011
atmel_spi atmel_spi.0: xfer complete: 2 bytes transferred
atmel_spi atmel_spi.0: registered child spi0.0
atmel_spi atmel_spi.1: Atmel SPI Controller at 0xffe00400 (irq 4)
atmel_spi atmel_spi.1: registered master spi1
spi spi1.0: setup: 11666666 Hz bpw 8 mode 0x0 -> csr0 00000302
spi spi1.0: setup mode 0, 8 bits/w, 13000000 Hz max --> 0
atmel_spi atmel_spi.1: registered child spi1.0
MACB_mii_bus: probed
eth0: Atmel MACB at 0xfff01800 irq 25 (00:1c:70:00:1c:69)
eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=0:01, irq=-1)
Atmel at76x USB Wireless LAN Driver 0.17 loading
usbcore: registered new interface driver at76c50x-usb
libertas_spi: Libertas SPI driver
libertas_spi spi1.0: DEactivate 34, mr 000f0011
libertas_spi spi1.0: setup: 11666666 Hz bpw 16 mode 0x0 -> csr0 00000382
libertas_spi spi1.0: setup mode 0, 16 bits/w, 13000000 Hz max --> 0
atmel_spi atmel_spi.1: new message 93c19de8 submitted for spi1.0
atmel_spi atmel_spi.1: start message 93c19de8 for spi1.0
libertas_spi spi1.0: activate 34, mr 000e0011
libertas_spi spi1.0: start xfer 93c19e38: len 2 tx 93c19e5e/13c19e5e
rx (null)/ffffffff
libertas_spi spi1.0: next xfer 93c19e14: len 2 tx 93c19e76/13c19e76
rx (null)/ffffffff
libertas_spi spi1.0: DEactivate 34, mr 000f0011
atmel_spi atmel_spi.1: xfer complete: 4 bytes transferred
atmel_spi atmel_spi.1: new message 93c19db4 submitted for spi1.0
atmel_spi atmel_spi.1: start message 93c19db4 for spi1.0
libertas_spi spi1.0: activate 34, mr 000e0011
libertas_spi spi1.0: start xfer 93c19e28: len 2 tx 93c19e4e/13c19e4e
rx (null)/ffffffff
libertas_spi spi1.0: start xfer 93c19de0: len 2 tx (null)/ffffffff
rx 93c19e76/13c19e76
libertas_spi spi1.0: DEactivate 34, mr 000f0011
atmel_spi atmel_spi.1: xfer complete: 4 bytes transferred
libertas: Can't read bus mode register.
libertas_spi: probe of spi1.0 failed with error -5
usbcore: registered new interface driver rt2500usb
usbcore: registered new interface driver rt73usb
usbcore: registered new interface driver rt2800usb
116x: driver isp116x-hcd, 03 Nov 2005
isp116x-hcd isp116x-hcd.0: ISP116x Host Controller
isp116x-hcd isp116x-hcd.0: new USB bus registered, assigned bus number 1
isp116x-hcd isp116x-hcd.0: irq 64, io base 0x08000002
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
usbcore: registered new interface driver usbserial
USB Serial support registered for generic
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial Driver core
USB Serial support registered for FTDI USB Serial Device
usbcore: registered new interface driver ftdi_sio
ftdi_sio: v1.5.0:USB FTDI Serial Converters Driver
USB Serial support registered for Moschip 2 port adapter
mos7720: 1.0.0.4F:Moschip USB Serial Driver
usbcore: registered new interface driver moschip7720
USB Serial support registered for Moschip 7840/7820 USB Serial Driver
mos7840: 1.3.2:Moschip 7840/7820 USB Serial Driver
usbcore: registered new interface driver mos7840
mice: PS/2 mouse device common for all mice
at32ap700x_rtc at32ap700x_rtc.0: rtc core: registered at32ap700x_rtc as rtc0
at32ap700x_rtc at32ap700x_rtc.0: Atmel RTC for AT32AP700x at fff00080 irq 21
at32_wdt at32_wdt.0: AT32AP700X WDT at 0xfff000b0, timeout 2 sec (nowayout=0)
Registered led device: led0:red
dw_dmac.0: DesignWare DMA Controller, 3 channels
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
TCP cubic registered
Initializing XFRM netlink socket
NET: Registered protocol family 10
IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
NET: Registered protocol family 15
lib80211: common routines for IEEE802.11 drivers
lib80211_crypt: registered algorithm 'NULL'
cpufreq: AT32AP CPU frequency driver
at32ap700x_rtc at32ap700x_rtc.0: setting system clock to 1970-01-01
00:00:00 UTC (0)
atmel_mci atmel_mci.0: Using dma0chan0 for DMA transfers
atmel_mci atmel_mci.0: Atmel MCI controller at 0xfff02400 irq 28, 1 slots
Waiting for root device /dev/mmcblk0p1...
mmc0: host does not support reading read-only switch. assuming write-enable.
mmc0: new SD card at address ad41
mmcblk0: mmc0:ad41 SD02G 1.83 GiB
mmcblk0: p1
EXT2-fs (mmcblk0p1): warning: mounting unchecked fs, running e2fsck is
recommended
VFS: Mounted root (ext2 filesystem) on device 179:1.
Freeing init memory: 88K (90000000 - 90016000)
eth0: link up (100/Full)
Kind Regards,
Thiago A. Correa
More information about the libertas-dev
mailing list