This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SPI2 and spidev drvier on IPNC RDK3.5



Hi everyone:

The ipnc_psp_arago package 04.04.00.02 on DM385 platform, with my customized board.

spi1 cs 0, connect to NOR Flash, it is worked successfully, use MTD driver.
spi2 cs 1, connect to LCD, I want test it, use spidev on user space.

I ensure have enable kernel driver for "McSPI driver for OMAP/TI81XX" and "User mode SPI device driver support" .

my "arch/arm/mach-omap2/board-dm385-ipnc.c" spi setting is :
struct spi_board_info __initdata dm385_spi_slave_info[] = {
{
.modalias = "m25p80",
.platform_data = &dm385_spi_flash,
.irq = -1,
.max_speed_hz = 75000000,
.bus_num = 1,
.chip_select = 0,
},
{
.modalias = "spidev",
.irq = -1,
.max_speed_hz = 75000000,
.bus_num = 2,
.chip_select = 1,
},
};

my boot log:

[    0.000000] Linux version 2.6.37 (vic@Hogwarts) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #47 Mon Jan 13 12:10:34 CST 2014
[    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=50c53c7d
[    0.000000] CPU: VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine: dm385ipnc
[    0.000000] vram size = 8388608 at 0x0
[    0.000000] ti81xx_reserve: ### Reserved DDR region @83300000
[    0.000000] reserved size = 8388608 at 0x0
[    0.000000] FB: Reserving 8388608 bytes SDRAM for VRAM
[    0.000000] Memory policy: ECC disabled, Data cache writeback
[    0.000000] OMAP chip is DM385 1.0
[    0.000000] SRAM: Mapped pa 0x402f1000 to va 0xfe400000 size: 0xf000
[    0.000000] On node 0 totalpages: 11008
[    0.000000] free_area_init_node: node 0, pgdat c05b9684, node_mem_map c05f8000
[    0.000000]   Normal zone: 104 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 10904 pages, LIFO batch:1
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0 
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 10904
[    0.000000] Kernel command line: console=ttyO0,115200n8 root=/dev/ram0 mem=52M vram=8M notifyk.vpssm3_sva=0xAFD00000
[    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Memory: 42MB 1MB = 43MB total
[    0.000000] Memory: 37412k/37412k available, 15836k reserved, 0K highmem
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
[    0.000000]     DMA     : 0xffc00000 - 0xffe00000   (   2 MB)
[    0.000000]     vmalloc : 0xc3800000 - 0xf8000000   ( 840 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xc3400000   (  52 MB)
[    0.000000]     modules : 0xbf800000 - 0xc0000000   (   8 MB)
[    0.000000]       .init : 0xc0008000 - 0xc0288000   (2560 kB)
[    0.000000]       .text : 0xc0288000 - 0xc057ead0   (3035 kB)
[    0.000000]       .data : 0xc0580000 - 0xc05b9d40   ( 232 kB)
[    0.000000] SLUB: Genslabs=11, HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:375
[    0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
[    0.000000] Total of 128 interrupts on 1 active controller
[    0.000000] GPMC revision 6.0
[    0.000000] Trying to install interrupt handler for IRQ368
[    0.000000] Trying to install interrupt handler for IRQ369
[    0.000000] Trying to install interrupt handler for IRQ370
[    0.000000] Trying to install interrupt handler for IRQ371
[    0.000000] Trying to install interrupt handler for IRQ372
[    0.000000] Trying to install interrupt handler for IRQ373
[    0.000000] Trying to install interrupt handler for IRQ374
[    0.000000] Trying to install type control for IRQ375
[    0.000000] Trying to set irq flags for IRQ375
[    0.000000] OMAP clockevent source: GPTIMER1 at 20000000 Hz
[    0.000000] Console: colour dummy device 80x30
[    0.000000] Calibrating delay loop... 399.76 BogoMIPS (lpj=1998848)
[    0.220000] pid_max: default: 32768 minimum: 301
[    0.220000] Security Framework initialized
[    0.220000] Mount-cache hash table entries: 512
[    0.220000] CPU: Testing write buffer coherency: ok
[    0.220000] devtmpfs: initialized
[    0.220000] TI81XX: Map 0x83300000 to 0xfe500000 for dram barrier
[    0.220000] TI81XX: Map 0x40300000 to 0xfe600000 for sram barrier
[    0.220000] omap_voltage_early_init: voltage driver support not added
[    0.220000] regulator: core version 0.5
[    0.220000] regulator: dummy: 
[    0.220000] NET: Registered protocol family 16
[    0.220000] omap_voltage_domain_lookup: Voltage driver init not yet happened.Faulting!
[    0.220000] omap_voltage_add_dev: VDD specified does not exist!
[    0.220000] OMAP GPIO hardware version 0.1
[    0.220000] OMAP GPIO hardware version 0.1
[    0.220000] OMAP GPIO hardware version 0.1
[    0.220000] OMAP GPIO hardware version 0.1
[    0.220000] Debugfs: Only enabling/disabling deep sleep and wakeup timer is supported now
[    0.220000] registered ti81xx_vpss device
[    0.220000] registered ti81xx_vidout device
[    0.220000] registered ti81xx_fb device
[    0.220000] registered ti81xx_vin device
[    0.220000] PWM0 init success.
[    0.230000] PWM1 init success.
[    0.230000] PWM2 init success.
[    0.240000] bio: create slab <bio-0> at 0
[    0.240000] SCSI subsystem initialized
[    0.240000] usbcore: registered new interface driver usbfs
[    0.240000] usbcore: registered new interface driver hub
[    0.240000] usbcore: registered new device driver usb
[    0.240000] USBSS revision 4ea2080b
[    0.240000] registerd cppi-dma Intr @ IRQ 17
[    0.240000] Cppi41 Init Done
[    0.240000] omap_i2c omap_i2c.1: bus 1 rev4.0 at 100 kHz
[    0.260000] omap_i2c omap_i2c.2: bus 2 rev4.0 at 100 kHz
[    0.260000] Advanced Linux Sound Architecture Driver Version 1.0.23.
[    0.260000] Switching to clocksource gp timer
[    0.270000] musb-hdrc: version 6.0, otg (peripheral+host), debug=0
[    0.270000] musb-hdrc musb-hdrc.0: dma type: dma-cppi41
[    0.270000] MUSB controller-0 revision 4ea20800
[    0.270000] TxFifo Empty intr enabled
[    0.270000] musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
[    0.270000] musb-hdrc: MHDRC RTL version 2.0 
[    0.270000] musb-hdrc: setup fifo_mode 4
[    0.270000] musb-hdrc: 28/31 max ep, 16384/16384 memory
[    0.270000] musb-hdrc musb-hdrc.0: USB OTG mode controller at c381e000 using DMA, IRQ 18
[    0.270000] Registered /proc/driver/musb_hdrc.0
[    0.270000] musb-hdrc musb-hdrc.1: dma type: dma-cppi41
[    0.270000] MUSB controller-1 revision 4ea20800
[    0.270000] TxFifo Empty intr enabled
[    0.270000] musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
[    0.270000] musb-hdrc: MHDRC RTL version 2.0 
[    0.270000] musb-hdrc: setup fifo_mode 4
[    0.270000] musb-hdrc: 28/31 max ep, 16384/16384 memory
[    0.270000] musb-hdrc musb-hdrc.1: USB OTG mode controller at c3828800 using DMA, IRQ 19
[    0.270000] Registered /proc/driver/musb_hdrc.1
[    0.270000] NET: Registered protocol family 2
[    0.270000] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.270000] TCP established hash table entries: 2048 (order: 2, 16384 bytes)
[    0.270000] TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
[    0.270000] TCP: Hash tables configured (established 2048 bind 2048)
[    0.270000] TCP reno registered
[    0.270000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.270000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.270000] NET: Registered protocol family 1
[    0.270000] RPC: Registered udp transport module.
[    0.270000] RPC: Registered tcp transport module.
[    0.270000] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.290000] PMU: registered new PMU device of type 0
[    0.290000] omap-iommu omap-iommu.0: ducati registered
[    0.290000] omap-iommu omap-iommu.1: sys registered
[    0.300000] msgmni has been set to 73
[    0.300000] io scheduler noop registered
[    0.300000] io scheduler deadline registered
[    0.300000] io scheduler cfq registered (default)
[    0.300000] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[    0.300000] omap_uart.0: ttyO0 at MMIO 0x48020000 (irq = 72) is a OMAP UART0
[    0.910000] console [ttyO0] enabled
[    0.920000] omap_uart.1: ttyO1 at MMIO 0x48022000 (irq = 73) is a OMAP UART1
[    0.920000] omap_uart.2: ttyO2 at MMIO 0x48024000 (irq = 74) is a OMAP UART2
[    0.930000] loop: module loaded
[    0.940000] m25p80 spi1.0: found s25fl064k, expected w25q128
[    0.940000] m25p80 spi1.0: s25fl064k (8192 Kbytes)
[    0.950000] Creating 4 MTD partitions on "spi_flash":
[    0.950000] 0x000000000000-0x00000000c000 : "ubl"
[    0.960000] 0x00000000c000-0x000000010000 : "cfg"
[    0.970000] 0x000000010000-0x000000400000 : "kernel"
[    0.970000] 0x000000400000-0x000000800000 : "usr"
[    0.980000] rtc-s35390a 1-0030: rtc core: registered rtc-s35390a as rtc0
[    0.990000] i2c /dev entries driver
[    0.990000] Linux video capture interface: v2.00
[    1.000000] OMAP Watchdog Timer Rev 0x00: initial timeout 60 sec
[    1.010000] notify_init: notify driver created for remote proc id 1 at physical Address 0xafd00000
[    1.020000] asoc: tlv320aic3x-hifi <-> davinci-mcasp.1 mapping ok
[    1.030000] ALSA device list:
[    1.030000]   #0: TI81XX EVM
[    1.030000] TCP cubic registered
[    1.040000] NET: Registered protocol family 17
[    1.040000] lib80211: common routines for IEEE802.11 drivers
[    1.050000] lib80211_crypt: registered algorithm 'NULL'
[    1.050000] lib80211_crypt: registered algorithm 'WEP'
[    1.050000] lib80211_crypt: registered algorithm 'CCMP'
[    1.050000] lib80211_crypt: registered algorithm 'TKIP'
[    1.050000] Registering the dns_resolver key type
[    1.050000] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
[    1.060000] omap_voltage_late_init: Voltage driver support not added
[    1.070000] Power Management for TI81XX.
[    1.080000] rtc-s35390a 1-0030: setting system clock to 2014-01-13 12:17:45 UTC (1389615465)
[    1.090000] Freeing init memory: 2560K
[    1.160000] mmc0: new high speed SDHC card at address f53b
[    1.170000] mmcblk0: mmc0:f53b SD04G 3.82 GiB 
[    1.170000]  mmcblk0: p1 p2 p3
[    1.190000] g_ether gadget: using random self ethernet address
[    1.200000] g_ether gadget: using random host ethernet address
[    1.210000] usb0: MAC 62:70:cd:b2:8d:8e
[    1.210000] usb0: HOST MAC aa:29:f9:c2:e5:84
[    1.220000] g_ether gadget: Ethernet Gadget, version: Memorial Day 2008
[    1.220000] g_ether gadget: g_ether ready
[    1.230000] musb-hdrc musb-hdrc.0: MUSB HDRC host driver
[    1.230000] musb-hdrc musb-hdrc.0: new USB bus registered, assigned bus number 1
[    1.240000] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    1.250000] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.260000] usb usb1: Product: MUSB HDRC host driver
[    1.260000] usb usb1: Manufacturer: Linux 2.6.37 musb-hcd
[    1.270000] usb usb1: SerialNumber: musb-hdrc.0
[    1.270000] hub 1-0:1.0: USB hub found
[    1.280000] hub 1-0:1.0: 1 port detected
[    1.700000] g_ether gadget: high speed config #1: CDC Ethernet (EEM)
[    1.700000] musb-hdrc periph: enabled ep1in for bulk IN, dma, maxpacket 512
[    1.700000] musb-hdrc periph: enabled ep1out for bulk OUT, dma, maxpacket 512
[    1.710000] musb-hdrc periph: enabled ep1in for bulk IN, dma, maxpacket 512
[    1.710000] musb-hdrc periph: enabled ep1out for bulk OUT, dma, maxpacket 512

my question is :
why can't find any about spidev info on dmesg and no create spi node on /dev.

Can anyone help me this problems ?

  • Hi all

    this issue is spi probe can't get dma channel on omap2_mcspi.c, so there is no put spi master to kernel.

    I add the dma resource (DM385 Datasheet P166.) at arch/arm/mach-omap2/devices.c:

    static struct resource omap2_mcspi2_resources[] = {
    {
    .start = OMAP2_MCSPI2_BASE,
    .end = OMAP2_MCSPI2_BASE + 0xff,
    .flags = IORESOURCE_MEM,
    },
    {
    //SPI1XEVT1: SPI1 Transmit 1
    .start = 44,
    .end = 44,
    .flags = IORESOURCE_DMA,
    },
    {
    //SPI1REVT1: SPI1 Receive 1
    .start = 45,
    .end = 45,
    .flags = IORESOURCE_DMA,
    },
    };

    now, spi2 and spidev is normal work.