Hi
I'm porting BLE of wilink8 to atmel sama5d31.
But I have issue(log:Can't init device hci0: Connection timed out (110)) when bring up the bluetooth by command "hciconfig hci0 up".
Please see the complete log :
Starting kernel ...
Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0x0
Linux version 3.10.0+ (root@ubuntu) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #18 Tue Feb 16 09:56:10 CST 2016
CPU: ARMv7 Processor [410fc051] revision 1 (ARMv7), cr=10c53c7d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine: Atmel SAMA5 (Device Tree), model: Atmel SAMA5D31-EK
bootconsole [earlycon0] enabled
Memory policy: ECC disabled, Data cache writeback
AT91: Detected soc type: sama5d3
AT91: Detected soc subtype: sama5d36
AT91: sram at 0x300000 of 0x20000 mapped at 0xfef58000
CPU: All CPU(s) started in SVC mode.
Clocks: CPU 528 MHz, master 132 MHz, main 12.000 MHz
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 32512
Kernel command line: console=ttyS0,115200 earlyprintk mtdparts=atmel_nand:256k(bootstrap)ro,512k(uboot)ro,256K(env),256k(evn_redundent),256k(spare),512k(dtb),6M(kernel)ro,-(rootfs) rootfstype=ubifs ubi.mtd=7 root=ubi0:rootfs
PID hash table entries: 512 (order: -1, 2048 bytes)
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 128MB = 128MB total
Memory: 123916k/123916k available, 7156k reserved, 0K highmem
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
vmalloc : 0xc8800000 - 0xff000000 ( 872 MB)
lowmem : 0xc0000000 - 0xc8000000 ( 128 MB)
modules : 0xbf000000 - 0xc0000000 ( 16 MB)
.text : 0xc0008000 - 0xc054ce84 (5396 kB)
.init : 0xc054d000 - 0xc0577854 ( 171 kB)
.data : 0xc0578000 - 0xc05aad80 ( 204 kB)
.bss : 0xc05aad80 - 0xc05c844c ( 118 kB)
NR_IRQS:16 nr_irqs:16 16
sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 4294967286ms
Console: colour dummy device 80x30
Calibrating delay loop... 262.96 BogoMIPS (lpj=1314816)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
Setting up static identity map for 0xc04042e0 - 0xc0404338
devtmpfs: initialized
pinctrl core: initialized pinctrl subsystem
regulator-dummy: no parameters
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
No ATAGs?
AT91: Power Management (with slow clock mode)
gpio-at91 fffff200.gpio: at address fefff200
gpio-at91 fffff400.gpio: at address fefff400
gpio-at91 fffff600.gpio: at address fefff600
gpio-at91 fffff800.gpio: at address fefff800
gpio-at91 fffffa00.gpio: at address fefffa00
pinctrl-at91 pinctrl.2: initialized AT91 pinctrl driver
bio: create slab <bio-0> at 0
at_hdmac ffffe600.dma-controller: Atmel AHB DMA Controller ( cpy slave ), 8 channels
at_hdmac ffffe800.dma-controller: Atmel AHB DMA Controller ( cpy slave ), 8 channels
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
at91_i2c f0018000.i2c: using dma0chan0 (tx) and dma0chan1 (rx) for DMA transfers
at91_i2c f0018000.i2c: AT91 i2c bus driver.
Linux video capture interface: v2.00
Bluetooth: Core ver 2.16
NET: Registered protocol family 31
Bluetooth: HCI device and connection manager initialized
Bluetooth: HCI socket layer initialized
Bluetooth: L2CAP socket layer initialized
Bluetooth: SCO socket layer initialized
cfg80211: Calling CRDA to update world regulatory domain
Switching to clocksource tcb_clksrc
NET: Registered protocol family 2
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
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
msgmni has been set to 242
io scheduler noop registered (default)
f0020000.serial: ttyS2 at MMIO 0xf0020000 (irq = 22) is a ATMEL_SERIAL
ffffee00.serial: ttyS0 at MMIO 0xffffee00 (irq = 34) is a ATMEL_SERIAL
console [ttyS0] enabled, bootconsole disabled
console [ttyS0] enabled, bootconsole disabled
brd: module loaded
loop: module loaded
ssc f0008000.ssc: Atmel SSC device at 0xc8858000 (irq 19)
(stk) :sysfs entries created
(stk) : debugfs entries created
(hci_tty): inside hci_tty_init
(hci_tty): allocated 252, 0
atmel_nand_nfc 70000000.nfc: NFC is probed.
atmel_nand: Use On Flash BBT
atmel_nand 60000000.nand: Using dma0chan2 for DMA transfers.
NAND device: Manufacturer ID: 0xc8, Chip ID: 0xd1 (Unknown NAND 128MiB 3,3V 8-bit), 128MiB, page size: 2048, OOB size: 64
atmel_nand 60000000.nand: NAND chip is not ONFI compliant, assume ecc_bits is 2 in 512 bytes
atmel_nand 60000000.nand: WARNING: Be Caution! Using different PMECC parameters from Nand ONFI ECC reqirement.
atmel_nand 60000000.nand: Initialize PMECC params, cap: 4, sector: 512
atmel_nand 60000000.nand: Using NFC Sram read and write
Bad block table found at page 65472, version 0x01
Bad block table found at page 65408, version 0x01
nand_read_bbt: bad block at 0x000003d20000
8 cmdlinepart partitions found on MTD device atmel_nand
Creating 8 MTD partitions on "atmel_nand":
0x000000000000-0x000000040000 : "bootstrap"
0x000000040000-0x0000000c0000 : "uboot"
0x0000000c0000-0x000000100000 : "env"
0x000000100000-0x000000140000 : "evn_redundent"
0x000000140000-0x000000180000 : "spare"
0x000000180000-0x000000200000 : "dtb"
0x000000200000-0x000000800000 : "kernel"
0x000000800000-0x000008000000 : "rootfs"
atmel_spi f0004000.spi: version: 0x213
atmel_spi f0004000.spi: Using dma0chan3 (tx) and dma0chan4 (rx) for DMA transfers
atmel_spi f0004000.spi: Atmel SPI Controller at 0xf0004000 (irq 18)
atmel_spi f0004000.spi: master is unqueued, this is deprecated
m25p80 spi32766.0: found n25q032, expected at25df321a
m25p80 spi32766.0: n25q032 (4096 Kbytes)
CAN device driver interface
at91_can f8010000.can: device registered (reg_base=c888a000, irq=25)
macb f802c000.ethernet (unregistered net_device): invalid hw address, using random
libphy: MACB_mii_bus: probed
macb f802c000.ethernet eth0: Cadence rev 0x0001010c
macb f802c000.ethernet eth0: Cadence MACB at 0xf802c000 irq 28 (ce:a5:de:92:4b:12)
macb f802c000.ethernet eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=f802c000.etherne:00, irq=-1)
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
at91_ohci 600000.ohci: can't request vbus gpio 121
at91_ohci 600000.ohci: AT91 OHCI
at91_ohci 600000.ohci: new USB bus registered, assigned bus number 1
at91_ohci 600000.ohci: irq 42, io mem 0x00600000
usb usb1: New USB device found, idVendor=1d6b, idProduct=0001
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: AT91 OHCI
usb usb1: Manufacturer: Linux 3.10.0+ ohci_hcd
usb usb1: SerialNumber: at91
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 3 ports detected
usbcore: registered new interface driver cdc_acm
cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
usbcore: registered new interface driver usbserial
usbcore: registered new interface driver ftdi_sio
usbserial: USB Serial support registered for FTDI USB Serial Device
atmel_usba_udc 500000.gadget: MMIO registers at 0xf8030000 mapped at c8890000
atmel_usba_udc 500000.gadget: FIFO at 0x00500000 mapped at ca200000
g_hid gadget: HID Gadget, version: 2010/03/16
g_hid gadget: g_hid ready
at91_rtc fffffeb0.rtc: rtc core: registered fffffeb0.rtc as rtc0
at91_rtc fffffeb0.rtc: AT91 Real Time Clock driver.
i2c /dev entries driver
i2c-core: driver [hsm_imager] using legacy suspend method
i2c-core: driver [hsm_imager] using legacy resume method
soc-camera-pdrv soc-camera-pdrv.0: Probing soc-camera-pdrv.0
Morris -----hsm_probe In
Morris ----- 4
Bluetooth: HCI UART driver ver 2.2
leds-gpio leds.3: pins are not configured from the driver
(stc): chnl_id list empty :4
(stk) : st_kim_start(stk) :ldisc_install = 1atmel_aes f8038000.aes: version: 0x135
atmel_aes f8038000.aes: Atmel AES - Using dma1chan0, dma1chan1 for DMA transfers
atmel_tdes f803c000.tdes: version: 0x701
atmel_tdes f803c000.tdes: using dma1chan2, dma1chan3 for DMA transfers
atmel_tdes f803c000.tdes: Atmel DES/TDES
atmel_sha f8034000.sha: version: 0x410
atmel_sha f8034000.sha: using dma1chan4 for DMA transfers
atmel_sha f8034000.sha: Atmel SHA1/SHA256/SHA224/SHA384/SHA512
hidraw: raw HID events driver (C) Jiri Kosina
usbcore: registered new interface driver usbkbd
iio iio:device0: Resolution used: 12 bits
iio iio:device0: ADC Touch screen is disabled.
g_hid gadget: high-speed config #1: HID Gadget
sii902x 1-0039: failed set termination to default
sii902x: probe of 1-0039 failed with error -22
TCP: cubic registered
NET: Registered protocol family 10
sit: IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
can: controller area network core (rev 20120528 abi 9)
NET: Registered protocol family 29
can: raw protocol (rev 20120528)
can: broadcast manager protocol (rev 20120528 t)
can: netlink gateway (rev 20130117) max_hops=1
VFP support v0.3: implementor 41 architecture 2 part 30 variant 5 rev 1
UBI: attaching mtd7 to ubi0
UBI: scanning is finished
UBI: attached mtd7 (name "rootfs", size 120 MiB) to ubi0
UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
UBI: VID header offset: 2048 (aligned 2048), data offset: 4096
UBI: good PEBs: 955, bad PEBs: 5, corrupted PEBs: 0
UBI: user volume: 1, internal volumes: 1, max. volumes count: 128
UBI: max/mean erase counter: 2/0, WL threshold: 4096, image sequence number: 1920410959
UBI: available PEBs: 0, total reserved PEBs: 955, PEBs reserved for bad PEB handling: 15
UBI: background thread "ubi_bgt0d" started, PID 663
input: gpio_keys.7 as /devices/gpio_keys.7/input/input0
at91_rtc fffffeb0.rtc: setting system clock to 2007-01-01 00:34:28 UTC (1167611668)
atmel_mci f0000000.mmc: version: 0x505
atmel_mci f0000000.mmc: using dma0chan5 for DMA transfers
atmel_mci f0000000.mmc: Atmel MCI controller at 0xf0000000 irq 17, 1 slots
atmel_mci f8000000.mmc: version: 0x505
atmel_mci f8000000.mmc: using dma1chan5 for DMA transfers
atmel_mci f8000000.mmc: Atmel MCI controller at 0xf8000000 irq 24, 1 slots
UBIFS: recovery needed
UBIFS: recovery deferred
UBIFS: mounted UBI device 0, volume 0, name "rootfs", R/O mode
UBIFS: LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
UBIFS: FS size: 117452800 bytes (112 MiB, 925 LEBs), journal size 9023488 bytes (8 MiB, 72 LEBs)
UBIFS: reserved for root: 0 bytes (0 KiB)
UBIFS: media format: w4/r0 (latest is w4/r0), UUID 71DFD343-A3BE-4A3E-B7EA-76FC6C0D3EB3, small LPT model
VFS: Mounted root (ubifs filesystem) readonly on device 0:12.
devtmpfs: mounted
Freeing unused kernel memory: 168K (c054d000 - c0577000)
(stk) :ldisc installation timeout
(stk) :ldisc_install = 0UBIFS: completing deferred recovery
UBIFS: background thread "ubifs_bgt0_0" started, PID 678
UBIFS: deferred recovery completed
Starting logging: OK
Populating /dev using udev: udevd[691]: starting version 182
done
Starting portmap: done
Initializing random number generator... (stk) : timed out waiting for ldisc to be un-installed
(stk) :ldisc_install = 1done.
ALSA: Restoring mixer settings...
Starting network...
/usr/sbin/alsactl: load_state:1696: No soundcards found...
(stk) :ldisc installation timeout
(stk) :ldisc_install = 0Starting sshd: OK
(stk) : timed out waiting for ldisc to be un-installed
(stk) :ldisc_install = 1UIM SYSFS Node Found at /sys/./devices/kim.8/install
Starting uim-sysfs daemon.
uim:@ main
uim:install = /sys/./devices/kim.8/(stc): st_tty_open in
(stk) :line discipline installedstall
uim:dev_name = /sys/./devices/kim.8/dev_name
uim:baud_rate = /sys/./devices/kim.8/baud_rate
uim:flow_cntrl = /sys/./devices/kim.8/flow_cntrl
uim:install set previously...
uim:@ st_uart_config
uim: signal received, opening /dev/ttyS2
uim:@ set_baud_rate
uim:set_baud_rate() done
uim:Installed N_TI_WL Line displine
uim:begin polling...
enable barcode_trigger
(stk) : waiting for ver info- timed out
(stk) :kim: failed to read local ver(stk) :download firmware failed
(stk) :ldisc_install = 0uim:po(stc): st_tty_close ll broke due to event 10(PRI:2/ERR:8)
uim:read 0 from install
uim:@ st_uart_config
uim:Un-Installed N_TI_WL Line displine
uim:begin polling...
(stk) :ldisc_install = 1uim:poll broke du(stc): st_tty_open e t
(stk) :line discipline installedo event 10(PRI:2/ERR:8)
uim:(stk) :TIInit_11.8.32.btsread 1 from install
uim:@ st_uart_config
uim: signal received, opening /dev/ttyS2
uim:@ set_baud_rate
uim:set_baud_rate() done
uim:Installed N_TI_WL Line displine
uim:begin polling...
Welcome to Buildroot
buildroot login:
(stc): add_channel_to_table: id 4
(stc): add_channel_to_table: id 2
(stc): add_channel_to_table: id 3
(stc): remove_channel_from_table: id 3
(stc): remove_channel_from_table: id 2
(stc): remove_channel_from_table: id 4
(stc): all chnl_ids unregistered
(stk) :ldisc_install = 0uim:po(stc): st_tty_close ll broke due to event 10(PRI:2/ERR:8)
uim:read 0 from install
uim:@ st_uart_config
uim:Un-Installed N_TI_WL Line displine
uim:begin polling...
Welcome to Buildroot
buildroot login: root
# hciconfig -a
hci0: Type: BR/EDR Bus: UART
BD Address: 00:00:00:00:00:00 ACL MTU: 0:0 SCO MTU: 0:0
DOWN
RX bytes:0 acl:0 sco:0 events:0 errors:0
TX bytes:0 acl:0 sco:0 commands:0 errors:0
# hciconfig hci0 up
(stc): chnl_id list empty :4 (stk) : st_kim_start
(stk) :ldisc_install = 1uim:poll broke due to event (stc): st_tty_open 1
(stk) :line discipline installed0(PRI:2/ERR:8)
uim:read 1 fr(stk) :TIInit_11.8.32.btsom install
uim:@ st_uart_config
uim: signal received, opening /dev/ttyS2
uim:@ set_baud_rate
uim:set_baud_rate() done
uim:Installed N_TI_WL Line displine
uim:begin polling...
(stc): add_channel_to_table: id 4
(stc): add_channel_to_table: id 2
(stc): add_channel_to_table: id 3
(stc): remove_channel_from_table: id 3
(stc): remove_channel_from_table: id 2
(stc): remove_channel_from_table: id 4
(stc): all chnl_ids unregistered
(stk) :ldisc_install = 0uim:pol(stc): st_tty_close l broke due to event 10(PRI:2/ERR:8)
uim:read 0 from install
uim:@ st_uart_config
uim:Un-Installed N_TI_WL Line displine
uim:begin polling...
Can't init device hci0: Connection timed out (110)
#
Also provide my build environment for reference.
Processor : Atmel Sama5d31
Wireless module : wilink8
Linux version : 3.10
Bluetooth stack : Bluez4.98
Download build utils from : git://git.ti.com/ti-bt/build-utils.git
Modify for BT as below.
1.Kernel config :
+#enable ti shared transport support support
+CONFIG_TI_ST=y
+CONFIG_ST_HCI=y
2.DTS
sama5d31ek.dts
+ kim {
+ compatible = "kim";
+ nshutdown_gpio = <121>; /* PD25 */
+ dev_name = "/dev/ttyS2";
+ flow_cntrl = <0>;
+ baud_rate = <115200>;
+ };
+ btwilink {
+ compatible = "btwilink";
+ };
sama5d3xmb.dtsi:
usart1: serial@f0020000 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usart1 &pinctrl_usart1_rts_cts>;
status = "okay";
};
sama5d3.dtsi
usart1: serial@f0020000 {
compatible = "atmel,at91sam9260-usart";
reg = <0xf0020000 0x100>;
interrupts = <13 IRQ_TYPE_LEVEL_HIGH 5>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usart1>;
status = "disabled";
};
usart1 {
pinctrl_usart1: usart1-0 {
atmel,pins =
<AT91_PIOB 28 AT91_PERIPH_A AT91_PINCTRL_NONE /* PB28 periph A */ ->config to RXD
AT91_PIOB 29 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PB29 periph A with pullup */-> config to TXD
};
pinctrl_usart1_rts_cts: usart1_rts_cts-0 {
atmel,pins =
<AT91_PIOB 26 AT91_PERIPH_A AT91_PINCTRL_NONE /* PB26 periph A, conflicts with GRX7 */ ->config to CTS
AT91_PIOB 27 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PB27 periph A, conflicts with G125CKO */ ->config yo RTS
};
};
Above was information of my implement,please kindly share any information with me.
If need more information please let me know.
Thanks!