没有合适的资源?快使用搜索试试~ 我知道了~
UDA1341中文使用说明
4星 · 超过85%的资源 需积分: 9 178 下载量 192 浏览量
2009-08-11
00:55:51
上传
评论 1
收藏 251KB PDF 举报
温馨提示
试读
40页
该篇文章详细的讲述了UDA1341声卡芯片的使用说明,帮助读者迅速掌握该芯片的使用特点
资源推荐
资源详情
资源评论
UDA1341TS 声卡驱动程序往 2.6.11 内核的移植总结
关键词: UDA1341 linux2.6.11.1 驱动移植
注:这个驱动的移植主要是是将原来的 2..4.18 内核中的 1341 驱动程序直接往 2.
6.11 上移植的,没有采用 ALSA。移植过程中也曾经参考过一些资料,具体是哪
位大虾的资料忘记了,在此感谢文中所参考的资料的大虾们
硬件环境:SBC-2410X 开发板(CPU:S3C2410X)
内核版本:2.6.11.1
运行环境:
Debian2.6.8
交叉编译环境:
gcc-3.3.4-glibc-2.3.3
第一部分 声卡 UDA1341TS 驱动程序播放部分的移植
一、从网上将 Linux 内核源代码下载到本机上,并将其解压:
#tar jxf linux-2.6.11.1.tar.bz2
二、打开内核顶层目录中的 Makefile 文件,这个文件中需要修改的内容包
括以下两个方面。
(1)指定目标平台。
移植前:
ARCH ?= $(SUBARCH)
移植后:
ARCH :=arm
(2)指定交叉编译器。
移植前:
CROSS_COMPILE ?=
移植后:
CROSS_COMPILE :=/opt/crosstool/arm-s3c2410-linux-gnu/gcc-3.3.4-gli
bc-2.3.3/bin/arm-s3c2410-linux-gnu-
注:这里假设编译器就放在本机的那个目录下。
三、添加并修改驱动程序源代码,这涉及到以下几个方面。
(1)、将开发板配带的声卡驱动程序 s3c2410-uda1341.c 源程序放到 so
und/oss/
目录下。
#cp s3c2410-uda1341.c ./sound/oss
(2)、在 s3c2410-uda1341.c 驱动程序里面添加所用到的头文件:
#include
#include
#include
#include
注:因为在修改驱动程序里需要用到有关的寄存器,而以上几个头文件中定
义了相关的寄存器。
添加:
static struct s3c2410_dma_client s3c2410_dma_client_out ={
.name ="I2SSDO",
};
static struct s3c2410_dma_client s3c2410_dma_client_in={
.name ="I2SSDI",
};
static void audio_dmaout_done_callback(s3c2410_dma_chan_t *r_value,void
*buf_id, int size,s3c2410_dma_buffresult_t result);
static void audio_dmain_done_callback(s3c2410_dma_chan_t *r_value,void
*buf_id, int size,s3c2410_dma_buffresult_t result);
注:在 2.6.11 的内核接口函数中(s3c2410_dma_request(),s3c2410_dma_set_
buffdone_fn()),需要用到以上结构以及函数作为入口参数。
添加:sbc_gpio_con_set()、sbc_gpio_pullup_set()、sbc_gpio_function_set()的
声明以及实现代码用以替代 2.4.18 代码中的 write_gpio_bit()、set_gpio_ctrl
()
函数,因为在 2.4.18 中这两个函数都是用指针的方式对 CPU 寄存器进行设置,
而在 2.6.11 的驱动程序里面用了__raw_writel()的方式对寄存器设置进行了封
装。
由于在
2.6.11 内核中 dma 接口函数的修改,在驱动程序移植过程中用了 2.
6.11
的许多函数对 2.4.18 中的函数进行了替换,主要有:
用
dma_free_coherent()替代了 consistent_free(),用 s3c2410_dma_ctr
l(s->dma_ch,S3C2410_DMAOP_FLUSH)
替代了 s3c2410_dma_flush_all
(s->dma_ch)
,用 dma_alloc_coherent()替代了 consistent_alloc(),用 s3c241
0_dma_enqueue()
替代了 s3c2410_dma_queue_buffer(),用 s3c2410_dma
_request()
替代了 s3c2410_request_dma()。
移植代码过程中还对许多函数进行了修改,主要修改的函数有:
audio_set_dsp_speed(),init_s3c2410_iis_bus_rx(),init_s3c2410_ii
s_bus_tx()
:用__raw_writel()函数对 CPU 寄存器进行了设置;audio_init_d
ma():
采用以下函数对系统的 DMA 通道进行初始化设置,用 s3c2410_dma_d
evconfig()
设置 CPU 中的 DISRC、DISRCC、DIDST、DIDSTC 寄存器,
用 s3c2410_dma_config()设置 CPU 的 DCON 寄存器,用 s3c2410_dma_s
et_buffdone_fn()
设置 DMA 回调函数(注意回调函数的修改)、用 s3c2410
_dma_setflags()
设置 DMA 的 flags。
注:具体修改详见驱动程序。
(3)、在 include/asm/arch-s3c2410/regs-iis.h 文件中添加如下宏定义:
#define S3C2410_IISREG(x) ((x)+S3C2410_VA_IIS)
#define S3C2410_SBC_IISCON S3C2410_IISREG(0X00)
#define S3C2410_SBC_IISMOD S3C2410_IISREG(0x04)
#define S3C2410_SBC_IISPSR S3C2410_IISREG(0x08)
#define S3C2410_SBC_IISFCON S3C2410_IISREG(0x0c)
#define S3C2410_SBC_IISFIFO S3C2410_IISREG(0x10)
注:以上所定义的宏,都被驱动程序所用到。
(4)、修改 arch/arm/mach-s3c2410/s3c2410.c,在 s3c2410_iodesc 结
构中添加:IODESC_ENT(IIS),
IODESC_ENT(GPIO)
注:由于网卡的硬件连接上用到了系统的 IIS 总线,以上添加的语句就是为
了将 CPU 的 IIS 寄存器的物理地址映射到所指向的虚拟地址上去,上面的结构
还定义了网卡虚拟地址所占用的区间,并指定了该区间所指向的域(的属性)。
(5)、修改 sound/oss/目录下的 Kconfig 文件,在最后添加如下内容:
config SBC2410_SND_UDA1341
tristate "S3C2410 UDA1341 driver (SBC2410)"
depends on SOUND_PRIME!=n && SOUND && ARM && AR
CH_SMDK2410
help
Say Y here if you have an SMDK2410 and want to use its Phili
ps
UDA1341 audio chip.
(6)、修改 sound/oss/目录下的 Makefile 文件,在最后添加如下内容:
obj-$(CONFIG_SBC2410_SND_UDA1341) +=s3c2410-uda1341.o
四、配置、编译内核。在内核顶层目录当中键入:
#make smdk2410_defconfig
由于 2.6 的内核默认就支持了 S3C2410,所以就有一个默认的内核配置文
件。里面只是包括了一个简单的配置,要使声卡编译进内核,还要进行手工配置。
#make menuconfig
Sound --->
Open Sound System --->
[*] S3C2410 UDA1341 driver (SBC2410)
将刚才添加的声卡驱动程序静态添加到内核当中。
最后进行内核编译。
#make
然后将镜像下载到开发板中去,启动信息如下:
VIVI version 0.1.4 (root@embed4) (gcc version 2.95.3 20010315 (release)) #0.1.
4 ?. 3.. 29 17:27:26 CST 2005GDLC
MMU table base address = 0x33DFC000
Succeed memory mapping.
NAND device: Manufacture ID: 0xec, Chip ID: 0x76 (Samsung K9D1208V0M)
Could not found stored vivi parameters. Use default vivi parameters.
Press Return to start the LINUX now, any other key for vivi
Copy linux kernel from 0x00030000 to 0x30008000, size = 0x00100000 ... don
e
zImage magic = 0x016f2818
Setup linux parameters at 0x30000100
linux command line is: "console=ttySAC0 root=/dev/nfs nfsroot=192.168.0.1:/frie
ndly-arm/root ip=192.168.0.69:192.168.0.1:192"MACH_TYPE = 193
NOW, Booting Linux......
Uncompressing Linux........................................................... done, booting the kerne
l.
Linux version 2.6.11.1 (root@embed4) (gcc version 3.3.4) #172 Tue Apr 26 17:
56:38 CST 2005
CPU: ARM920Tid(wb) [41129200] revision 0 (ARMv4T)
CPU0: D VIVT write-back cache
CPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
CPU0: D cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
Machine: SMDK2410
ATAG_INITRD is deprecated; please update your bootloader.
Memory policy: ECC disabled, Data cache writeback
CPU S3C2410A (id 0x32410002)
S3C2410: core 200.000 MHz, memory 100.000 MHz, peripheral 50.000 MHz
S3C2410 Clock control, (c) 2004 Simtec Electronics
Built 1 zonelists
Kernel command line: console=ttySAC0 root=/dev/nfs nfsroot=192.168.0.1:/friend
ly-arm/root ip=192.168.0.69:192.168.0.1:192.16firq: clearing subpending status 00
000002
PID hash table entries: 512 (order: 9, 8192 bytes)
timer tcon=00000000, tcnt a2c1, tcfg 00000200,00000000, usec 00001eb8
Console: colour dummy device 80x30
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 64MB = 64MB total
Memory: 62976KB available (1483K code, 269K data, 96K init)
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
S3C2410: Initialising architecture
S3C2410 DMA Driver, (c) 2003-2004 Simtec Electronics
DMA channel 0 at c4800000, irq 33
DMA channel 1 at c4800040, irq 34
DMA channel 2 at c4800080, irq 35
DMA channel 3 at c48000c0, irq 36
devfs: 2004-01-31 Richard Gooch (rgooch@atnf.csiro.au)
devfs: devfs_debug: 0x0
devfs: boot_options: 0x1
leds initialized
s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2410
s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2410
s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2410
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
Cirrus Logic CS8900A driver for Linux (Modified for SMDK2410)
eth0: CS8900A rev E at 0xe0000300 irq=53, no eeprom , addr: 08: 0:3E:26:0
A:5B
S3C2410 NAND Driver, (c) 2004 Simtec Electronics
s3c2410-nand: mapped registers at c4880000
80 ns is too big for current clock rate 100000000
80 ns is too big for current clock rate 100000000
剩余39页未读,继续阅读
蒙古黑人
- 粉丝: 0
- 资源: 10
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
前往页