求助 Marvell PXA3xx ACLink 驱动

kenlo 2010-05-19 05:06:38
大家好, 我来自台湾, 如果有些用词不一样请多见谅.
目前的案子使用 PXA310 SoC, 将公板上的 WM9713 换成 WM9715, SDATA_IN 也换成 GPIO26 这只接脚, 之前用 WinCE 6.0 时一切正常, 最近开始用同一块板子 porting Linux, 但是读取 Codec register 会失败, 但是写入 Codec register 则一切正常.
我 trace 了好久, 发现这两个 OS 在 cold reset 之后 ACLink 的 GSR 不太一样, WinCE GSR:0x003C0164, Linux GSR:0x017cf1e7.

以下为本人初步推论:

1. 硬体线路应该没问题, 因为 WinCE 6.0 可以正常读写.
2. Linux 的部份我查了好久还是查不出原因, 所有的 Pin Define 都跟 WinCE 6.0 一模一样, codec reset 设置方式也几乎相同.

请问有没有高手(牛人)能指点一下, 附上错误讯息:

Starting kernel at 0x80800000...

Uncompressing Linux........................................................................................................... done, booting the kernel.
Linux version 2.6.21 (root@localhost.localdomain) (gcc version 4.1.1) #186 PREEMPT Wed May 19 14:34:25 CST 2010
CPU: XScale-V3 based processor [69056892] revision 2 (ARMv5TE), cr=0000397f
Machine: Intel PXA3xx Development Platform (aka Zylonite)
Memory policy: ECC disabled, Data cache writeback
Run Mode Clock: 312MHz
Turbo Mode Clock: 624MHz
High Speed I/O Bus Clock: 208MHz
CPU0: D VIVT undefined 5 cache
CPU0: I cache: 32768 bytes, associativity 4, 32 byte lines, 256 sets
CPU0: D cache: 32768 bytes, associativity 4, 32 byte lines, 256 sets
Built 1 zonelists. Total pages: 16256
Kernel command line: root=/dev/mtdblock2 rootfstype=jffs2 console=ttyS0,38400 mem=64M
PID hash table entries: 256 (order: 8, 1024 bytes)
Console: colour dummy device 80x30
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 64MB = 64MB total
Memory: 61440KB available (3056K code, 262K data, 120K init)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: failed, enabling work-around
NET: Registered protocol family 16
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Bluetooth: Core ver 2.11
NET: Registered protocol family 31
Bluetooth: HCI device and connection manager initialized
Bluetooth: HCI socket layer initialized
Time: pxa_timer clocksource has been installed.
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
Intel(c) Memory Management - Heterogeneous Memory Allocation
Intel(c) Memory Management - Page Attribute Manipulation
Intel(c) Memory Management is now Enabled
Register device ipmc successgul.
<6>Initialize IPM performance perfiler.
NetWinder Floating Point Emulator V0.97 (double precision)
JFFS2 version 2.2. (NAND) (C) 2001-2006 Red Hat, Inc.
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered (default)
i2c /dev entries driver
I2C: i2c-0: PXA I2C adapter
I2C: i2c-1: PXA I2C adapter
lp3972 unavailable!
lp3972(chip id:0xff) detected.
pxa2xx-fb pxa2xx-fb: machine LCCR3 setting contains illegal bits: 00300000
Console: switching to colour frame buffer device 60x40
Load PXA Overlay driver successfully!
2D Graphics Driver for Monahans Linux
Register MVED driver: major=245, minor=0
pxa2xx-uart.0: ttyS0 at MMIO 0x40100000 (irq = 22) is a FFUART
pxa2xx-uart.1: ttyS1 at MMIO 0x40200000 (irq = 21) is a BTUART
pxa2xx-uart.2: ttyS2 at MMIO 0x40700000 (irq = 20) is a STUART
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
loop: loaded (max 8 devices)
PPP generic driver version 2.4.2
PPP Deflate Compression module registered
PPP BSD Compression module registered
NET: Registered protocol family 24
Linux video capture interface: v2.00
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx
Try to allocate dma buffer(len:2144)for data buffer + 2*descriptor + command buffer
NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung NAND 256MiB 3,3V 8-bit)
Creating 5 MTD partitions on "NAND 256MiB 3,3V 8-bit":
0x00000000-0x00060000 : "Bootloader"
0x00060000-0x00260000 : "Kernel"
0x00260000-0x03260000 : "Filesystem"
0x03260000-0x0efa0000 : "MassStorage"
0x0efa0000-0x0f020000 : "BBT"
usbmon: debugfs is not available
pxa3xx-ohci pxa3xx-ohci: PXA3xx OHCI
pxa3xx-ohci pxa3xx-ohci: new USB bus registered, assigned bus number 1
pxa3xx-ohci pxa3xx-ohci: irq 3, io mem 0x4c000000
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 3 ports detected
usbcore: registered new interface driver cdc_acm
drivers/usb/class/cdc-acm.c: v0.25:USB Abstract Control Model driver for USB modems and ISDN adapters
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usbcore: registered new interface driver usbhid
drivers/usb/input/hid-core.c: v2.6:USB HID core driver
usbcore: registered new interface driver cdc_ether
usbcore: registered new interface driver cdc_subset
mice: PS/2 mouse device common for all mice
touch_codec_zy_init()
touch_codec_zy_probe()
AC97 read from 0x0 error!!
(AC97 GCR:0x00000002, GSR:0x017cf1e7)
AC97 read from 0x0 error!!
[<c002b838>] (show_stack+0x0/0x40) from [<c020818c>] (codec_cold_reset+0x10c/0x15c)
[<c0208080>] (codec_cold_reset+0x0/0x15c) from [<c0208874>] (register_codec+0x60/0x1d0)
r5 = C032BE58 r4 = 00000000
[<c0208814>] (register_codec+0x0/0x1d0) from [<c01c8bfc>] (touch_codec_zy_probe+0x2c/0x248)
r6 = C033DEAC r5 = C032BE58 r4 = C035E398
[<c01c8bd0>] (touch_codec_zy_probe+0x0/0x248) from [<c015f9f8>] (platform_drv_probe+0x20/0x24)
r5 = C033DEAC r4 = C032BE60
[<c015f9d8>] (platform_drv_probe+0x0/0x24) from [<c015deac>] (really_probe+0xd0/0x190)
[<c015dddc>] (really_probe+0x0/0x190) from [<c015e024>] (driver_probe_device+0xb8/0xc8)
r8 = 00000000 r7 = C033DEAC r6 = C032BE60 r5 = C033DEAC
r4 = C3F8EC20
[<c015df6c>] (driver_probe_device+0x0/0xc8) from [<c015e188>] (__driver_attach+0x84/0xe4)
r6 = C015E104 r5 = C032BE60 r4 = C032BF38
[<c015e104>] (__driver_attach+0x0/0xe4) from [<c015d2f4>] (bus_for_each_dev+0x48/0x80)
r5 = C040DF14 r4 = 00000000
[<c015d2ac>] (bus_for_each_dev+0x0/0x80) from [<c015dcf8>] (driver_attach+0x20/0x28)
r7 = 00000000 r6 = C0336E10 r5 = C033DEC0 r4 = C033DEAC
[<c015dcd8>] (driver_attach+0x0/0x28) from [<c015d650>] (bus_add_driver+0x64/0x184)
[<c015d5ec>] (bus_add_driver+0x0/0x184) from [<c015e4a0>] (driver_register+0x94/0x9c)
r8 = 00000000 r7 = 00000001 r6 = C040C000 r5 = C00202C4
r4 = C033DEAC
[<c015e40c>] (driver_register+0x0/0x9c) from [<c015fca0>] (platform_driver_register+0x6c/0x88)
r4 = C0020844
[<c015fc34>] (platform_driver_register+0x0/0x88) from [<c001bd6c>] (touch_codec_zy_init+0x20/0x30)
[<c001bd4c>] (touch_codec_zy_init+0x0/0x30) from [<c000891c>] (init+0x98/0x1bc)
[<c0008884>] (init+0x0/0x1bc) from [<c0050214>] (do_exit+0x0/0x90c)
r7 = 00000000 r6 = 00000000 r5 = 00000000 r4 = 00000000
Kernel panic - not syncing: Codec cold reset error!!
...全文
272 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
kenlo 2010-05-26
  • 打赏
  • 举报
回复
問題已解決, 關鍵是在於 PXA310 的 default MFP 有衝突到 (undocument).
kenlo 2010-05-24
  • 打赏
  • 举报
回复
除錯 = 調試 = debug
暫存器 = 寄存器 = register
忘了改成你們的習慣用語.
kenlo 2010-05-24
  • 打赏
  • 举报
回复
我把程式移值到 boot loader, 並寫了幾個除錯指令, 結果一樣是錯的, 暫存器狀態與 driver 中一樣:
[AC97] GCR:0x00000002 GSR:0x017071e7
[AC97] POCR:0x00000000 PICR:0x00000000
[AC97] MCCR:0x00000000 MCSR:0x00000014
[AC97] PCDR:0xFFFFFFFF MCDR:0x0000FFFF
[AC97] MOCR:0x00000000 MICR:0x00000000
[AC97] MOSR:0x00000004 MISR:0x00000014
[AC97] MODR:0x0000FFFF PISR:0x00000014
目前看到是 MIC-IN 與 PCM-IN FIFO Error.
WinCE 則不會有此情形.
朝 DMA 的部份追查中.
alex_gogo 2010-05-20
  • 打赏
  • 举报
回复
如果不写入ox26呢?能够正常读写ID的信息么?
kenlo 2010-05-19
  • 打赏
  • 举报
回复
1.有, GSR = GSR_SDONE|GSR_RDCS; (RDCS = bit15)
2.bootloader 倒是一个方向, 谢谢您的建议.
3.很简单, 写入 0x26 powerdown Codec, 之后再写入任何暂存器都会失败, 这表示写入是有作用的.
alex_gogo 2010-05-19
  • 打赏
  • 举报
回复
1:不知道在读取codec register之前有没有清除GSR的bit 15.
2:不知道在bootloader中有没有条件可以测试WM9715。bootloader中的环境干净直观一些。
3:另外,你怎么确定写入正常(在不能回读确认的情况下)?

4,441

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 内核源代码研究区
社区管理员
  • 内核源代码研究区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧