Chinaunix首页 | 论坛 | 博客
  • 博客访问: 278030
  • 博文数量: 95
  • 博客积分: 2047
  • 博客等级: 大尉
  • 技术积分: 1022
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-14 16:18
文章分类

全部博文(95)

文章存档

2013年(1)

2011年(94)

我的朋友

分类: 嵌入式

2011-08-13 17:07:21

上次用将29内核的6410驱动移植到android的27内核,结果发现很多驱动程序29内核都没有做,仅仅移植了一个网卡驱动就异常痛苦

感觉开发板提供的2.6.24内核驱动比较丰富,还是将24内核移植到android的27内核吧

虽然内核变化比较大,过程蛮痛苦。

(1)
/home/kyon/kernel6410/arch/arm/include/asm/memory.h:27:25: error: mach/memory.h: No such file or directory
/home/kyon/kernel6410/arch/arm/include/asm/timex.h:15:24: error: mach/timex.h: No such file or directory
/home/kyon/kernel6410/arch/arm/include/asm/pgtable.h:23:26: error: mach/vmalloc.h: No such file or directory

#include

/home/kyon/kernel6410/arch/arm/include/asm/irq.h:4:23: error: mach/irqs.h: No such file or directory
/home/kyon/kernel6410/arch/arm/include/asm/dma.h:9:22: error: mach/dma.h: No such file or directory
/home/kyon/kernel6410/arch/arm/include/asm/io.h:86:21: error: mach/io.h: No such file or directory

include/asm/arch/dma.h:17:26: error: asm/hardware.h: No such file or directory

一大堆的头文件不匹配,各位看着办,可以用新形式,也可以用old,反正咱们只用6410一款处理器

(2)
arch/arm/mach-s3c6410/s3c6410.c:137: error: implicit declaration of function 'set_kset_name'
arch/arm/mach-s3c6410/s3c6410.c:137: error: initializer element is not constant
arch/arm/mach-s3c6410/s3c6410.c:137: error: (near initialization for 's3c6410_sysclass.name')

#define set_kset_name(str) .kset = { .kobj = { .name = str } }
本来是添加以上内容的,后来发现不应该这样做

有几个地方
比如
struct sysdev_class dma_sysclass = {
//set_kset_name("s3c64xx-dma"),
.name = "s3c64xx-dma",
.suspend = s3c_dma_suspend,
.resume = s3c_dma_resume,
};

set_kset_name已经非弃用,直接用 .name = "s3c64xx-dma",即可

还有这儿也是
struct sysdev_class s3c6410_sysclass = {
.name = "s3c6410-core",
};

(3)
arch/arm/mach-s3c6410/mach-smdk6410.c:473: error: 'MMC_CAP_MULTIWRITE' undeclared here (not in a function)


/include/linux/mmc/host.h添加
#define MMC_CAP_MULTIWRITE (1 << 1) /* Can accurately report bytes sent to card on error */

(4)
  CC      arch/arm/plat-s3c64xx/irq-pl192.o
arch/arm/plat-s3c64xx/irq-pl192.c: In function 's3c_irqext_type':
arch/arm/plat-s3c64xx/irq-pl192.c:242: error: 'IRQT_NOEDGE' undeclared (first use in this function)
arch/arm/plat-s3c64xx/irq-pl192.c:242: error: (Each undeclared identifier is reported only once
arch/arm/plat-s3c64xx/irq-pl192.c:242: error: for each function it appears in.)
arch/arm/plat-s3c64xx/irq-pl192.c:246: error: 'IRQT_RISING' undeclared (first use in this function)
arch/arm/plat-s3c64xx/irq-pl192.c:250: error: 'IRQT_FALLING' undeclared (first use in this function)
arch/arm/plat-s3c64xx/irq-pl192.c:254: error: 'IRQT_BOTHEDGE' undeclared (first use in this function)
arch/arm/plat-s3c64xx/irq-pl192.c:258: error: 'IRQT_LOW' undeclared (first use in this function)
arch/arm/plat-s3c64xx/irq-pl192.c:262: error: 'IRQT_HIGH' undeclared (first use in this function)
make[1]: *** [arch/arm/plat-s3c64xx/irq-pl192.o] 错误 1
make: *** [arch/arm/plat-s3c64xx] 错误 2
[kyon@SEP4020 kernel6410]$ 

include/asm/irq.h添加
/*
 * Migration helpers
 */
#define __IRQT_FALEDGE IRQ_TYPE_EDGE_FALLING
#define __IRQT_RISEDGE IRQ_TYPE_EDGE_RISING
#define __IRQT_LOWLVL IRQ_TYPE_LEVEL_LOW
#define __IRQT_HIGHLVL IRQ_TYPE_LEVEL_HIGH

#define IRQT_NOEDGE (0)
#define IRQT_RISING (__IRQT_RISEDGE)
#define IRQT_FALLING (__IRQT_FALEDGE)
#define IRQT_BOTHEDGE (__IRQT_RISEDGE|__IRQT_FALEDGE)
#define IRQT_LOW (__IRQT_LOWLVL)
#define IRQT_HIGH (__IRQT_HIGHLVL)
#define IRQT_PROBE IRQ_TYPE_PROBE

(5)
arch/arm/plat-s3c64xx/pm.c:762: error: unknown field 'set_target' specified in initializer
arch/arm/plat-s3c64xx/pm.c:763: warning: initialization from incompatible pointer type
arch/arm/plat-s3c64xx/pm.c:765: warning: initialization from incompatible pointer type
暂时在内核中关闭pm选项

(6)
/home/kyon/kernel6410/arch/arm/include/asm/vga.h:4:27: error: mach/hardware.h: No such file or directory
make[2]: *** [drivers/char/tty_io.o] 错误 1
make[1]: *** [drivers/char] 错误 2
make: *** [drivers] 错误 2
[kyon@SEP4020 kernel6410]$ 

#include ,从24内核复制一个过去

(7)
In file included from include/linux/gpio.h:7,
                 from drivers/misc/timed_gpio.c:21:
/home/kyon/kernel6410/arch/arm/include/asm/gpio.h:5:23: error: mach/gpio.h: No such file or directory
drivers/misc/timed_gpio.c: In function 'gpio_timer_func':
drivers/misc/timed_gpio.c:40: error: implicit declaration of function 'gpio_direction_output'
make[2]: *** [drivers/misc/timed_gpio.o] 错误 1
make[1]: *** [drivers/misc] 错误 2
make: *** [drivers] 错误 2
[kyon@SEP4020 kernel6410]$ 

头文件路径问题

(8)
  Kernel: arch/arm/boot/Image is ready
  LD      arch/arm/boot/compressed/vmlinux
arm-none-linux-gnueabi-ld:--defsym zreladdr=: syntax error
make[2]: *** [arch/arm/boot/compressed/vmlinux] 错误 1
make[1]: *** [arch/arm/boot/compressed/vmlinux] 错误 2
make: *** [zImage] 错误 2
[kyon@SEP4020 kernel6410]$ 

手动定义zreladdr = 0xc0008000?
好像还不对,目前无法加载zimage文件

(9)
drivers/serial/serial_core.c:2180: warning: initialization from incompatible pointer type
drivers/serial/serial_core.c:2193: warning: initialization from incompatible pointer type
drivers/serial/serial_core.c: In function 'uart_add_one_port':
drivers/serial/serial_core.c:2350: error: lvalue required as left operand of assignment

暂时注释掉那一行

(10)
Starting kernel ...

Linux version 2.6.27 (kyon@SEP4020.Linux) (gcc version 4.3.2 (Sourcery G++ Lite 2008q3-72) ) #5 PREEMPT Thu Jul 30 11:04:56 CST 2009
CPU: ARMv6-compatible processor [410fb766] revision 6 (ARMv7), cr=00c5387f
Machine: SMDK6410
Ignoring unrecognised tag 0x00000000
Memory policy: ECC disabled, Data cache writeback
CPU S3C6410 (id 0x36410101)
S3C6410: core 532.000 MHz, memory 133.000 MHz, peripheral 66.500 MHz
S3C6410: EPLL 192.000 MHz
S3C64XX Clocks, (c) 2007 Samssung Electronics
CPU0: D VIPT write-back cache
CPU0: I cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
CPU0: D cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 21082
Kernel command line: root=/dev/nfs rw nfsroot=192.168.0.3:/nfs ip=192.168.0.2:192.168.0.3:255.255.255.0 console=ttySAC0,115200 init=/init
Trying to install chained interrupt handler for IRQ0
Trying to install chained interrupt handler for IRQ1
Trying to install chained interrupt handler for IRQ32
Trying to install chained interrupt handler for IRQ33
PID hash table entries: 512 (order: 9, 2048 bytes)
timer tcon=00600000, tcnt 103c3, tcfg 00000400,00000000, usec 00001340
Console: colour dummy device 80x30
console [ttySAC0] enabled
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 83MB = 83MB total
Memory: 79760KB available (3448K code, 751K data, 136K init)
Calibrating delay loop... 530.84 BogoMIPS (lpj=1327104)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok

死在这里,郁闷了半天,跟踪start_kernel代码,
死在最后的rest_init()函数的schedule函数,这个函数怎么也会死啊,哭

最终发现是general options里的选项没有选择正确,吐血


(11)
done!加载zimage还有问题,暂时先用没压缩的image吧

Bytes transferred = 2002864 (1e8fb0 hex)
## Booting image at c0008000 ...
Boot with Image

Starting kernel ...

Linux version 2.6.27 (kyon@SEP4020.Linux) (gcc version 4.3.2 (Sourcery G++ Lite 2008q3-72) ) #46 PREEMPT Thu Jul 30 16:34:39 CST 2009
CPU: ARMv6-compatible processor [410fb766] revision 6 (ARMv7), cr=00c5387f
Machine: SMDK6410
Ignoring unrecognised tag 0x00000000
Memory policy: ECC disabled, Data cache writeback
CPU S3C6410 (id 0x36410101)
S3C6410: core 532.000 MHz, memory 133.000 MHz, peripheral 66.500 MHz
S3C6410: EPLL 192.000 MHz
S3C64XX Clocks, (c) 2007 Samssung Electronics
CPU0: D VIPT write-back cache
CPU0: I cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
CPU0: D cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 21082
Kernel command line: root=/dev/nfs rw nfsroot=192.168.0.3:/nfs ip=192.168.0.2:192.168.0.3:255.255.255.0 console=ttySAC0,115200 init=/init
Trying to install chained interrupt handler for IRQ0
Trying to install chained interrupt handler for IRQ1
Trying to install chained interrupt handler for IRQ32
Trying to install chained interrupt handler for IRQ33
PID hash table entries: 512 (order: 9, 2048 bytes)
timer tcon=00600000, tcnt 103c3, tcfg 00000400,00000000, usec 00001340
Console: colour dummy device 80x30
console [ttySAC0] enabled
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 83MB = 83MB total
Memory: 81936KB available (1800K code, 274K data, 76K init)
Calibrating delay loop... 530.84 BogoMIPS (lpj=1327104)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
s3c6410: Initialising architecture
S3C DMA-pl080 Controller Driver, (c) 2006-2007 Samsung Electronics
Total 32 DMA channels will be initialized.
SCSI subsystem initialized
NetWinder Floating Point Emulator V0.97 (double precision)
ashmem: initialized
NTFS driver 2.1.29 [Flags: R/O].
msgmni has been set to 160
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered (default)
s3c-uart.0: s3c_serial0 at MMIO 0x7f005000 (irq = 37) is a S3C
s3c-uart.1: s3c_serial1 at MMIO 0x7f005400 (irq = 38) is a S3C
s3c-uart.2: s3c_serial2 at MMIO 0x7f005800 (irq = 39) is a S3C
s3c-uart.3: s3c_serial3 at MMIO 0x7f005c00 (irq = 40) is a S3C
Driver 'sd' needs updating - please use bus_type methods
mice: PS/2 mouse device common for all mice
VFS: Cannot open root device "nfs" or unknown-block(0,255)
Please append a correct "root=" boot option; here are the available partitions:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,255)

阅读(644) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~