AnsweredAssumed Answered

spi spi1.1: peripheral_request() error?

Question asked by zhangzhihua on Aug 13, 2013
Latest reply on Aug 13, 2013 by Aaronwu

Hi,

我想在BF518板子上使用SPI控制一块外围芯片,但是系统启动时出现如下错误:

peripheral_request: Peripheral 38 function 2 is already reserved by bfin-uart !

spi spi1.1: peripheral_request() error

bfin-spi bfin-spi.1: can't setup spi1.1, status -16

取消uart1的驱动后正常运行,现在的问题是我板子上UART1和SPI必须同时使用,如何处理?

完整的boot log 如下:

bfin> bootm 1000000

## Booting kernel from Legacy Image at 01000000 ...

   Image Name:   bf518-2.6.34.7-ADI-2010R1

   Created:      2013-08-13   0:58:04 UTC

   Image Type:   Blackfin Linux Kernel Image (gzip compressed)

   Data Size:    4745252 Bytes = 4.5 MiB

   Load Address: 00001000

   Entry Point:  001db900

   Verifying Checksum ... OK

   Uncompressing Kernel Image ... OK

Starting Kernel at = 001db900

Linux version 2.6.34.7-ADI-2010R1 (root@ubuntu) (gcc version 4.3.5 (ADI-2010R1-R

C4) ) #51 Mon Aug 12 17:57:52 PDT 2013

register early platform devices

bootconsole [early_shadow0] enabled

bootconsole [early_BFuart0] enabled

early printk enabled on early_BFuart0

Board Memory: 32MB

Kernel Managed Memory: 32MB

Memory map:

  fixedcode = 0x00000400-0x00000490

  text      = 0x00001000-0x00144a08

  rodata    = 0x00144a08-0x001ae914

  bss       = 0x001af000-0x001bff88

  data      = 0x001bff88-0x001d2000

    stack   = 0x001d0000-0x001d2000

  init      = 0x001d2000-0x0089e000

  available = 0x0089e000-0x01f00000

  DMA Zone  = 0x01f00000-0x02000000

Hardware Trace Active and Enabled

Boot Mode: 3

Blackfin support (C) 2004-2010 Analog Devices, Inc.

Compiled for ADSP-BF518 Rev 0.0

Warning: Compiled for Rev 0, but running on Rev 2

Blackfin Linux support by http://blackfin.uclinux.org/

Processor Speed: 400 MHz core clock and 80 MHz System Clock

NOMPU: setting up cplb tables

Instruction Cache Enabled for CPU0

  External memory: cacheable in instruction cache

Data Cache Enabled for CPU0

  External memory: cacheable (write-back) in data cache

Built 1 zonelists in Zone order, mobility grouping off.  Total pages: 7874

Kernel command line: root=/dev/mtdblock3 rw rootfstype=jffs2 clkin_hz=25000000 e

arlyprintk=serial,uart0,57600 console=ttyBF0,57600

PID hash table entries: 128 (order: -3, 512 bytes)

Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)

Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)

Memory available: 22632k/32768k RAM, (6960k init code, 1294k kernel code, 566k d

ata, 1024k dma, 292k reserved)

Hierarchical RCU implementation.

NR_IRQS:159

Configuring Blackfin Priority Driven Interrupts

console [ttyBF0] enabled, bootconsole disabled

console [ttyBF0] enabled, bootconsole disabled

Calibrating delay loop... 794.62 BogoMIPS (lpj=1589248)

Security Framework initialized

Mount-cache hash table entries: 512

Blackfin Scratchpad data SRAM: 4 KB

Blackfin L1 Data A SRAM: 16 KB (16 KB free)

Blackfin L1 Data B SRAM: 16 KB (16 KB free)

Blackfin L1 Instruction SRAM: 32 KB (26 KB free)

NET: Registered protocol family 16

Blackfin DMA Controller

ezbrd_init(): registering device resources

bio: create slab <bio-0> at 0

bfin-spi bfin-spi.0: Blackfin on-chip SPI Controller Driver, Version 1.0, regs_b

ase@ffc00500, dma channel@7

spi spi1.1: Warning: SPI CPHA not set: Slave Select not under software control!

See Documentation/blackfin/bfin-spi-notes.txt

Hardware Trace:

   0 Target : <0x00143170> { _dump_stack + 0x0 }

     Source : <0x00005afa> { _peripheral_request + 0x256 } CALL pcrel

   1 Target : <0x00005aec> { _peripheral_request + 0x248 }

     Source : <0x000059da> { _peripheral_request + 0x136 } IF !CC JUMP pcrel

   2 Target : <0x000059d8> { _peripheral_request + 0x134 }

     Source : <0xffa0158c> { _strcmp + 0x14 } RTS

   3 Target : <0xffa0158a> { _strcmp + 0x12 }

     Source : <0xffa01582> { _strcmp + 0xa } IF !CC JUMP pcrel

   4 Target : <0xffa01578> { _strcmp + 0x0 }

     Source : <0x000056da> { _cmp_label + 0x1e } CALL pcrel

   5 Target : <0x000056bc> { _cmp_label + 0x0 }

     Source : <0x000059d4> { _peripheral_request + 0x130 } JUMP.L

   6 Target : <0x000059cc> { _peripheral_request + 0x128 }

     Source : <0x0000591a> { _peripheral_request + 0x76 } IF !CC JUMP pcrel

   7 Target : <0x000058ca> { _peripheral_request + 0x26 }

     Source : <0x000058c4> { _peripheral_request + 0x20 } IF CC JUMP pcrel

   8 Target : <0x000058c0> { _peripheral_request + 0x1c }

     Source : <0x000058b2> { _peripheral_request + 0xe } IF CC JUMP pcrel

   9 Target : <0x000058a4> { _peripheral_request + 0x0 }

     Source : <0x000dedfe> { _bfin_spi_setup + 0x22e } CALL pcrel

  10 Target : <0x000dedd6> { _bfin_spi_setup + 0x206 }

     Source : <0x000decb2> { _bfin_spi_setup + 0xe2 } IF CC JUMP pcrel

  11 Target : <0x000deca8> { _bfin_spi_setup + 0xd8 }

     Source : <0x000dec9a> { _bfin_spi_setup + 0xca } IF CC JUMP pcrel (BP)

  12 Target : <0x000dec92> { _bfin_spi_setup + 0xc2 }

     Source : <0x000ded78> { _bfin_spi_setup + 0x1a8 } IF CC JUMP pcrel

  13 Target : <0x000ded70> { _bfin_spi_setup + 0x1a0 }

     Source : <0x000dec76> { _bfin_spi_setup + 0xa6 } IF CC JUMP pcrel (BP)

  14 Target : <0x000dec64> { _bfin_spi_setup + 0x94 }

     Source : <0x000def2a> { _bfin_spi_setup + 0x35a } JUMP.S

  15 Target : <0x000def2a> { _bfin_spi_setup + 0x35a }

     Source : <0x00143274> { _printk + 0x14 } RTS

Stack info:

SP: [0x0101bd8c] <0x0101bd8c> /* kernel dynamic memory */

FP: (0x0101bfe4)

Memory from 0x0101bd80 to 0101c000

0101bd80: ff0a000f  0101bd8c  0019051d [ff0a000f] 00005afe  00000026  00008426

005f5e10

0101bda0: 001c1a2c  001cb80c  00143270  010603a0  0000ffff  001cb80c  000dee02

010603a0

0101bdc0: 0103cb80  0103d0bc  00000000  001c1a2c  001cb85c  00000000  01005558

00190590

0101bde0: 010603c0  0103cb80  00000001  001c1a2c  000ddd68  0103cb80  001c1a2c

0103d000

0101be00: 00000000  001c1a2c  00000001  000ddcd8  010604a0  00000001  00000000

00000000

0101be20: 000dde90  0103cb80  0103087c  00000001  001440fc  0103d0e4  0103d000

000ddf42

0101be40: 0103087c  01030800  00000000  00000000  00000001  0103d000  001e2aba

0103d0bc

0101be60: 0103d0e4  001c1a24  00000000  00076cf4  001c1a2c  001be15c  00000000

00000000

0101be80: 00000000  001cb85c  01037180 <000c4e64> 001c1a2c  001be15c  001cb85c

001c1a60

0101bea0: 0101bef8  001cb85c  00000000  001774e4  010121c4  00000000  00000000

000c4fa8

0101bec0: 001c1a2c  001cb85c  001cb85c  001c1a60  00000000  0101bed8  01037180 <

000c4844>

0101bee0: 000c4f44  001c9e44  00000000  00000000  009fffff  000a6602  010055d8

01037570

0101bf00: 000c4d3a  001cb848  00000000  00000000  00000000  000c4242  0101bf38

000c427c

0101bf20: 000c4f44  000c429a  00000100  00152b24  00000000  001774e4 <0017dc98>

001e2910

0101bf40: 000c51dc  001cb848  001af00c  001cb85c  00000000  00000000  001af00c

001a0000

0101bf60: 0018cc9c  000c5e0a  001cb848  001af00c  001a0000  00000000  00000000

0018cc9c

0101bf80: 00152b24 <00001028><00001028> 001eabf8  00000000  001c0000  00030a78

001c421c

0101bfa0: 001eab60  00000000  001d2120  001eabf8  001eadc8  00000000  00000000

00000000

0101bfc0: 00000000  001eab60  001eab60  00000000  001d2194  001eab60  001eab60

00000000

0101bfe0: 00000000 (00000000)<000014ae> 00000000  00000000  00000000  ffffffff

00000006

Return addresses in stack:

    address : <0x000c4e64> { _really_probe + 0x64 }

    address : <0x000c4844> { _bus_for_each_dev + 0x44 }

    address : <0x0017dc98> /* kernel dynamic memory */

    address : <0x00001028> { _do_one_initcall + 0x28 }

    address : <0x00001028> { _do_one_initcall + 0x28 }

   frame  1 : <0x000014ae> { _kernel_thread_helper + 0x6 }

peripheral_request: Peripheral 38 function 2 is already reserved by bfin-uart !

spi spi1.1: peripheral_request() error

bfin-spi bfin-spi.1: can't setup spi1.1, status -16

bfin-spi bfin-spi.1: Blackfin on-chip SPI Controller Driver, Version 1.0, regs_b

ase@ffc03400, dma channel@5

i2c-bfin-twi i2c-bfin-twi.0: Blackfin BF5xx on-chip I2C TWI Contoller, regs_base

@ffc01400

NET: Registered protocol family 2

IP route cache hash table entries: 1024 (order: 0, 4096 bytes)

TCP established hash table entries: 1024 (order: 1, 8192 bytes)

TCP bind hash table entries: 1024 (order: 0, 4096 bytes)

TCP: Hash tables configured (established 1024 bind 1024)

TCP reno registered

UDP hash table entries: 256 (order: 0, 4096 bytes)

UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)

NET: Registered protocol family 1

JFFS2 version 2.2. (NAND) 漏 2001-2006 Red Hat, Inc.

msgmni has been set to 44

io scheduler noop registered (default)

bfin-otp: initialized

bfin-uart: Blackfin serial driver

bfin-uart.0: ttyBF0 at MMIO 0xffc00400 (irq = 29) is a BFIN-UART

bfin-uart.1: ttyBF1 at MMIO 0xffc02000 (irq = 31) is a BFIN-UART

brd: module loaded

physmap platform flash device: 00300000 at 20000000

physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank

NOR chip too large to fit in mapping. Attempting to cope...

Amd/Fujitsu Extended Query Table at 0x0040

number of CFI chips: 1

Reducing visibility of 4096KiB chip to 3072KiB

cmdlinepart partition parsing not available

RedBoot partition parsing not available

Using physmap partition information

Creating 1 MTD partitions on "physmap-flash.0":

0x000000000000-0x000000300000 : "file system(nor)"

m25p80 spi0.2: found m25p128, expected m25p64

m25p80 spi0.2: m25p128 (16384 Kbytes)

Creating 3 MTD partitions on "m25p80":

0x000000000000-0x000000040000 : "bootloader(spi)"

0x000000040000-0x000000200000 : "linux kernel(spi)"

0x000000200000-0x000001000000 : "file system(spi)"

bfin_mii_bus: probed

bfin_mac: attached PHY driver [Generic PHY] (mii_bus:phy_addr=0:03, irq=-1, mdc_

clk=2500000Hz(mdc_div=15)@sclk=80MHz)

bfin_mac bfin_mac.0: Blackfin on-chip Ethernet MAC driver, Version 1.1

rtc-bfin rtc-bfin: rtc core: registered rtc-bfin as rtc0

i2c /dev entries driver

bfin-wdt: initialized: timeout=20 sec (nowayout=0)

dma_alloc_init: dma_page @ 0x01931000 - 256 pages at 0x01f00000

TCP cubic registered

NET: Registered protocol family 17

Distributed Switch Architecture driver version 0.1

eth0[0]: detected a KSZ8893M switch

dsa slave smi: probed

rtc-bfin rtc-bfin: setting system clock to 2022-09-14 05:08:15 UTC (1663132095)

Freeing unused kernel memory: 6960k freed

Outcomes