Linux2.6.28到Linux2.6.32的内核移植
今天从GIT上拖下最新的Android Linux2.6.32内核,对S3C6410的支持还是基本功能。 目前三星内核树上功能比较全的内核应该是28了,升级到32试试,本来以为只要换几个目录即可,没想到做下来发现还是要改很多东西。
过程如下:
1 替换目录 mach-s3c6400 mach-s3c6410 plat-s3c plat-s3c64XX plat-s3C24XX(不确定这个是否一定要换)
2 修改arch/arm/Kconfig
config HZ int default 128 if ARCH_L7200 default 200 if ARCH_EBSA110 || ARCH_S3C2410 || ARCH_S3C64XX || ARCH_S5P64XX || ARCH_S5PC1XX default OMAP_32K_TIMER_HZ if ARCH_OMAP && OMAP_32K_TIMER default AT91_TIMER_HZ if ARCH_AT91 default 100
config ARCH_S3C64XX bool "Samsung S3C64XX" select GENERIC_GPIO select HAVE_CLK help Samsung S3C64XX series based systems
3 修改arch/arm/mm/kconfig
# ARMv6 config CPU_V6 bool "Support ARM V6 processor" depends on ARCH_INTEGRATOR || MACH_REALVIEW_EB || ARCH_OMAP2 || ARCH_MX3 || ARCH_MSM || MACH_REALVIEW_PB11MP || MACH_REALVIEW_PB1176 || ARCH_S3C64XX || ARCH_S5P64XX default y if ARCH_MX3 default y if ARCH_MSM default y if (ARCH_S3C64XX || ARCH_S5P64XX) select CPU_32v6 select CPU_ABRT_EV6 select CPU_PABRT_NOIFAR select CPU_CACHE_V6 select CPU_CACHE_VIPT select CPU_CP15_MMU select CPU_HAS_ASID if MMU select CPU_COPY_V6 if MMU select CPU_TLB_V6 if MMU
4 以下是编译错误
arch/arm/kernel/process.c: In function 'arm_machine_restart': arch/arm/kernel/process.c:103: error: too many arguments to function 'arch_reset' make[1]: *** [arch/arm/kernel/process.o] 错误 1
解决方法:arch/arm/kernel/process.c //arch_reset(mode, cmd); arch_reset(mode);
===============================================
CC arch/arm/mach-s3c6410/dma.o In file included from arch/arm/plat-s3c/include/mach/s3c-dma.h:13, from arch/arm/mach-s3c6400/include/mach/dma.h:14, from arch/arm/mach-s3c6410/dma.c:20: arch/arm/plat-s3c/include/mach/dma-pl080.h:12:1: warning: "MAX_DMA_ADDRESS" redefined In file included from arch/arm/mach-s3c6410/dma.c:19: /home/kyon/UT6410/2.6.32/arch/arm/include/asm/dma.h:10:1: warning: this is the location of the previous definition In file included from arch/arm/mach-s3c6400/include/mach/dma.h:14, from arch/arm/mach-s3c6410/dma.c:20: arch/arm/plat-s3c/include/mach/s3c-dma.h:300: error: expected ')' before 'channel' arch/arm/plat-s3c/include/mach/s3c-dma.h:309: error: expected ')' before 'channel' arch/arm/plat-s3c/include/mach/s3c-dma.h:317: error: expected ')' before 'channel' arch/arm/plat-s3c/include/mach/s3c-dma.h:326: error: expected ')' before 'channel' arch/arm/plat-s3c/include/mach/s3c-dma.h:336: error: expected ')' before 'channel' arch/arm/plat-s3c/include/mach/s3c-dma.h:339: error: expected ')' before 'channel' arch/arm/plat-s3c/include/mach/s3c-dma.h:347: error: expected ')' before 'channel' arch/arm/plat-s3c/include/mach/s3c-dma.h:362: error: expected ')' before 'channel' arch/arm/plat-s3c/include/mach/s3c-dma.h:366: error: expected ')' before 's3c2410_dma_opfn_t' arch/arm/plat-s3c/include/mach/s3c-dma.h:367: error: expected ')' before 's3c2410_dma_cbfn_t' make[1]: *** [arch/arm/mach-s3c6410/dma.o] 错误 1 make: *** [arch/arm/mach-s3c6410] 错误 2 [kyon@SEP4020 2.6.32]$ make menuconfig scripts/kconfig/mconf arch/arm/Kconfig make[1]: *** wait: 没有子进程。 停止。 make[1]: *** 正在等待未完成的任务.... make[1]: *** wait: 没有子进程。 停止。 make: *** [menuconfig] 错误 2
解决方法: 缺少定义 typedef unsigned int dmach_t;
================================ arch/arm/plat-s3c64xx/irq.c: In function 's3c64xx_init_irq': arch/arm/plat-s3c64xx/irq.c:301: error: too few arguments to function 'vic_init' arch/arm/plat-s3c64xx/irq.c:302: error: too few arguments to function 'vic_init' make[1]: *** [arch/arm/plat-s3c64xx/irq.o] 错误 1 make: *** [arch/arm/plat-s3c64xx] 错误 2 [kyon@SEP4020 2.6.32]$
解决方法:arch/arm/plat-s3c64xx/irq.c: /* initialise the pair of VICs */ vic_init(S3C_VA_VIC0, S3C_VIC0_BASE, vic0_valid, 0); vic_init(S3C_VA_VIC1, S3C_VIC1_BASE, vic1_valid, 0);
===================================== arch/arm/plat-s3c64xx/dev-fimc0.c:31: error: 'IRQ_CAMIF_C' undeclared here (not in a function) make[1]: *** [arch/arm/plat-s3c64xx/dev-fimc0.o] 错误 1 make: *** [arch/arm/plat-s3c64xx] 错误 2
arch/arm/plat-s3c64xx/dev-fimc1.c:31: error: 'IRQ_CAMIF_P' undeclared here (not in a function) make[1]: *** [arch/arm/plat-s3c64xx/dev-fimc1.o] 错误 1 make: *** [arch/arm/plat-s3c64xx] 错误 2
解决方法:dev-fimc0.c 添加#include <plat/irqs.h>
======================================= arch/arm/plat-s3c/include/plat/s3c-dma.h:9: error: 'S3C_DMA_CHANNELS' undeclared here (not in a function) arch/arm/plat-s3c/include/plat/s3c-dma.h:45: warning: 'enum s3c2410_dmasrc' declared inside parameter list arch/arm/plat-s3c/include/plat/s3c-dma.h:45: warning: its scope is only this definition or declaration, which is probably not what you want arch/arm/plat-s3c/include/plat/s3c-dma.h:69: error: 'DMACH_MAX' undeclared here (not in a function) In file included from arch/arm/plat-s3c/include/mach/s3c-dma.h:13, from arch/arm/mach-s3c6400/include/mach/dma.h:14, from arch/arm/plat-s3c/dma-pl080.c:37: arch/arm/plat-s3c/include/mach/dma-pl080.h:12:1: warning: "MAX_DMA_ADDRESS" redefined In file included from arch/arm/plat-s3c/dma-pl080.c:32: /home/kyon/UT6410/2.6.32/arch/arm/include/asm/dma.h:10:1: warning: this is the location of the previous definition make[1]: *** [arch/arm/plat-s3c/dma-pl080.o] 错误 1 make: *** [arch/arm/plat-s3c] 错误 2
解决方法:arch/arm/plat-s3c/dma-pl080.c 添加#include <mach/s3c-dma.h>
============================================ CC arch/arm/plat-s3c/dev-hsmmc2.o arch/arm/plat-s3c/dev-hsmmc2.c:41: error: 'MMC_CAP_ON_BOARD' undeclared here (not in a function) make[1]: *** [arch/arm/plat-s3c/dev-hsmmc2.o] 错误 1 make: *** [arch/arm/plat-s3c] 错误 2
解决方法:用下面的替换 #define MMC_CAP_DISABLE (1 << 7) /* Can the host be disabled */
============================= CC arch/arm/plat-s3c/dev-i2c0.o arch/arm/plat-s3c/dev-i2c0.c:32: error: 'IRQ_IIC' undeclared here (not in a function) make[1]: *** [arch/arm/plat-s3c/dev-i2c0.o] 错误 1 make: *** [arch/arm/plat-s3c] 错误 2 [kyon@SEP4020 2.6.32]$
解决方法: 添加#include <plat/irqs.h>
============================= arch/arm/mach-s3c6410/built-in.o: In function `smdk6410_machine_init': /home/kyon/UT6410/2.6.32/arch/arm/mach-s3c6410/mach-smdk6410.c:339: undefined reference to `s3c_ts_set_platdata' arch/arm/mach-s3c6410/built-in.o:(.init.data+0x2ce4): undefined reference to `s3c_device_ts' drivers/built-in.o: In function `pmem_map_garbage': /home/kyon/UT6410/2.6.32/drivers/misc/pmem.c:485: undefined reference to `vm_insert_pfn' drivers/built-in.o: In function `pmem_unmap_pfn_range': /home/kyon/UT6410/2.6.32/drivers/misc/pmem.c:502: undefined reference to `zap_page_range' drivers/built-in.o: In function `pmem_remap_pfn_range': /home/kyon/UT6410/2.6.32/drivers/misc/pmem.c:531: undefined reference to `zap_page_range' make: *** [.tmp_vmlinux1] 错误 1
解决方法:触摸屏驱动没有,先注释掉 //s3c_ts_set_platdata(&s3c_ts_platform); //&s3c_device_ts,
=================================================================================
5 至此总算内核可以运行,怕DMA那有问题,导致下一步添加驱动出现问题,god包邮吧
Starting kernel ...
Uncompressing Linux................................................................ done, booting the kernel. <5>Linux version 2.6.32.9 (kyon@SEP4020.Linux) (gcc version 4.3.2 (Sourcery G++ Lite 2008q3-72) ) #7 Sat Mar 20 17:28:04 CST 2010 CPU: ARMv6-compatible processor [410fb766] revision 6 (ARMv7), cr=00c5387f CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache Machine: SMDK6410 Memory policy: ECC disabled, Data cache writeback <7>On node 0 totalpages: 32768 <7>free_area_init_node: node 0, pgdat c01e9bbc, node_mem_map c0220000 <7> DMA zone: 256 pages used for memmap <7> DMA zone: 0 pages reserved <7> DMA zone: 32512 pages, LIFO batch:7 CPU S3C6410 (id 0x36410101) <7>s3c6410_init_clocks: initialising clocks <6>S3C24XX Clocks, (c) 2004 Simtec Electronics <7>s3c6400_setup_clocks: registering clocks <7>s3c6400_setup_clocks: clkdiv0 = 01043310 <7>s3c6400_setup_clocks: xtal is 12000000 <6>S3C64XX: PLL settings, A=666000000, M=532000000, E=24000000 <6>S3C64XX: HCLKx2=266000000, HCLK=133000000, PCLK=66500000 div1: 00000555 <6>mout_apll: source is fout_apll (1), rate is 666000000 <6>mout_epll: source is fout_epll (1), rate is 24000000 <6>mout_mpll: source is mpll (1), rate is 532000000 <7>s3c64xx_clk_doutmpll_get_rate: parent is 532000000 <6>mmc_bus: source is dout_mpll (1), rate is 44333333 <7>s3c64xx_clk_doutmpll_get_rate: parent is 532000000 <6>mmc_bus: source is dout_mpll (1), rate is 44333333 <7>s3c64xx_clk_doutmpll_get_rate: parent is 532000000 <6>mmc_bus: source is dout_mpll (1), rate is 44333333 <6>usb-host-bus: source is mout_epll (0), rate is 24000000 <7>s3c64xx_clk_doutmpll_get_rate: parent is 532000000 <6>uclk1: source is dout_mpll (1), rate is 66500000 <6>spi-bus: source is mout_epll (0), rate is 24000000 <6>spi-bus: source is mout_epll (0), rate is 24000000 <6>audio-bus0: source is mout_epll (0), rate is 24000000 <6>audio-bus1: source is mout_epll (0), rate is 24000000 <6>audio-bus2: source is mout_epll (0), rate is 24000000 <6>irda-bus: source is mout_epll (0), rate is 24000000 Built 1 zonelists in Zone order, mobility grouping on. Total pages: 32512 <5>Kernel command line: root=/dev/nfs rw nfsroot=192.168.0.3:/nfs ip=192.168.0.2:192.168.0.3:off:255.255.255.0:s3c6410:eth0:off console=ttySAC0,115200 init=./init mem=128MB <6>PID hash table entries: 512 (order: -1, 2048 bytes) <6>Dentry cache hash table entries: 16384 (order: 4, 65536 bytes) <6>Inode-cache hash table entries: 8192 (order: 3, 32768 bytes) <6>Memory: 128MB = 128MB total <5>Memory: 127600KB available (1668K code, 312K data, 92K init, 0K highmem) <6>SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 <6>Hierarchical RCU implementation. <6>NR_IRQS:229 <7>s3c64xx_init_irq: initialising interrupts <6>VIC @f4000000: id 0x00041192, vendor 0x41 <6>VIC @f4010000: id 0x00041192, vendor 0x41 <7>timer tcon=00500000, tcnt b98b, tcfg 00000600,00000000, usec 00001719 Console: colour dummy device 80x30 Linux version 2.6.32.9 (kyon@SEP4020.Linux) (gcc version 4.3.2 (Sourcery G++ Lite 2008q3-72) ) #7 Sat Mar 20 17:28:04 CST 2010 CPU: ARMv6-compatible processor [410fb766] revision 6 (ARMv7), cr=00c5387f CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache Machine: SMDK6410 Memory policy: ECC disabled, Data cache writeback CPU S3C6410 (id 0x36410101) S3C24XX Clocks, (c) 2004 Simtec Electronics S3C64XX: PLL settings, A=666000000, M=532000000, E=24000000 S3C64XX: HCLKx2=266000000, HCLK=133000000, PCLK=66500000 div1: 00000555 mout_apll: source is fout_apll (1), rate is 666000000 mout_epll: source is fout_epll (1), rate is 24000000 mout_mpll: source is mpll (1), rate is 532000000 mmc_bus: source is dout_mpll (1), rate is 44333333 mmc_bus: source is dout_mpll (1), rate is 44333333 mmc_bus: source is dout_mpll (1), rate is 44333333 usb-host-bus: source is mout_epll (0), rate is 24000000 uclk1: source is dout_mpll (1), rate is 66500000 spi-bus: source is mout_epll (0), rate is 24000000 spi-bus: source is mout_epll (0), rate is 24000000 audio-bus0: source is mout_epll (0), rate is 24000000 audio-bus1: source is mout_epll (0), rate is 24000000 audio-bus2: source is mout_epll (0), rate is 24000000 irda-bus: source is mout_epll (0), rate is 24000000 Built 1 zonelists in Zone order, mobility grouping on. Total pages: 32512 Kernel command line: root=/dev/nfs rw nfsroot=192.168.0.3:/nfs ip=192.168.0.2:192.168.0.3:off:255.255.255.0:s3c6410:eth0:off console=ttySAC0,115200 init=./init mem=128MB 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: 127600KB available (1668K code, 312K data, 92K init, 0K highmem) SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 Hierarchical RCU implementation. NR_IRQS:229 VIC @f4000000: id 0x00041192, vendor 0x41 VIC @f4010000: <d 0x00041192, vendor 0x41 Console: colour dummy device 80x30 6>console [ttySAC0] enabled console [ttySAC0] enabled <6>Calibrating delay loop... Calibrating delay loop... <c>663.55 BogoMIPS (lpj=1658880) 663.55 BogoMIPS (lpj=1658880) Mount-cache hash table entries: 512 Mount-cache hash table entries: 512 <6>CPU: Testing write buffer coherency: CPU: Testing write buffer coherency: ok ok S3C6410: Initialising architecture S3C6410: Initialising architecture S3C DMA-pl080 Controller Driver, (c) 2006-2007 Samsung Electronics S3C DMA-pl080 Controller Driver, (c) 2006-2007 Samsung Electronics Total 32 DMA channels will be initialized. Total 32 DMA channels will be initialized. bio: create slab <bio-0> at 0 bio: create slab <bio-0> at 0 <6>ROMFS MTD (C) 2007 Red Hat, Inc. ROMFS MTD (C) 2007 Red Hat, Inc. <6>io scheduler noop registered io scheduler noop registered <6>io scheduler anticipatory registered io scheduler anticipatory registered <6>io scheduler deadline registered io scheduler deadline registered <6>io scheduler cfq registered (default) io scheduler cfq registered (default) <6>Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled <6>s3c6400-uart.0: s3c2410_serial0 at MMIO 0x7f005000 (irq = 16) is a S3C6400/10 s3c6400-uart.0: s3c2410_serial0 at MMIO 0x7f005000 (irq = 16) is a S3C6400/10 <6>s3c6400-uart.1: s3c2410_serial1 at MMIO 0x7f005400 (irq = 20) is a S3C6400/10 s3c6400-uart.1: s3c2410_serial1 at MMIO 0x7f005400 (irq = 20) is a S3C6400/10 <6>s3c6400-uart.2: s3c2410_serial2 at MMIO 0x7f005800 (irq = 24) is a S3C6400/10 s3c6400-uart.2: s3c2410_serial2 at MMIO 0x7f005800 (irq = 24) is a S3C6400/10 <6>s3c6400-uart.3: s3c2410_serial3 at MMIO 0x7f005c00 (irq = 28) is a S3C6400/10 s3c6400-uart.3: s3c2410_serial3 at MMIO 0x7f005c00 (irq = 28) is a S3C6400/10 <6>brd: module loaded brd: module loaded <6>loop: module loaded loop: module loaded <6>mice: PS/2 mouse device common for all mice mice: PS/2 mouse device common for all mice <6>sdhci: Secure Digital Host Controller Interface driver sdhci: Secure Digital Host Controller Interface driver <6>sdhci: Copyright(c) Pierre Ossman sdhci: Copyright(c) Pierre Ossman <6>s3c-sdhci s3c-sdhci.0: clock source 0: hsmmc (133000000 Hz) s3c-sdhci s3c-sdhci.0: clock source 0: hsmmc (133000000 Hz) <6>s3c-sdhci s3c-sdhci.0: clock source 1: hsmmc (133000000 Hz) s3c-sdhci s3c-sdhci.0: clock source 1: hsmmc (133000000 Hz) <7>s3c64xx_clk_doutmpll_get_rate: parent is 532000000 <6>s3c-sdhci s3c-sdhci.0: clock source 2: mmc_bus (44333333 Hz) s3c-sdhci s3c-sdhci.0: clock source 2: mmc_bus (44333333 Hz) <7>sdhci [sdhci_add_host()]: Disabling DMA as it is marked broken <7>sdhci [sdhci_add_host()]: Disabling ADMA as it is marked broken <7>s3c64xx_clk_doutmpll_get_rate: parent is 532000000 <7>s3c64xx_clk_doutmpll_get_rate: parent is 532000000 <7>sdhci: ============== REGISTER DUMP ============== <7>sdhci: Sys addr: 0x00000000 | Version: 0x00000401 <7>sdhci: Blk size: 0x00000000 | Blk cnt: 0x00000000 <7>sdhci: Argument: 0x00000000 | Trn mode: 0x00000000 <7>sdhci: Present: 0x01ff0000 | Host ctl: 0x00000000 <7>sdhci: Power: 0x00000000 | Blk gap: 0x00000000 <7>sdhci: Wake-up: 0x00000000 | Clock: 0x00000000 <7>sdhci: Timeout: 0x00000000 | Int stat: 0x00000000 <7>sdhci: Int enab: 0x00ff0003 | Sig enab: 0x00ff0003 <7>sdhci: AC12 err: 0x00000000 | Slot int: 0x00000000 <7>sdhci: Caps: 0x05e80080 | Max curr: 0x00000000 <7>sdhci: =========================================== <7>mmc0: clock 0Hz busmode 1 powermode 0 cs 0 Vdd 0 width 0 timing 0 <6>mmc0: SDHCI controller on samsung-hsmmc [s3c-sdhci.0] using PIO mmc0: SDHCI controller on samsung-hsmmc [s3c-sdhci.0] using PIO <7>mmc0: clock 0Hz busmode 1 powermode 1 cs 0 Vdd 21 width 0 timing 0 VFS: Cannot open root device "nfs" or unknown-block(0,255) VFS: Cannot open root device "nfs" or unknown-block(0,255) Please append a correct "root=" boot option; here are the available partitions: Please append a correct "root=" boot option; here are the available partitions: <0>Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,255) Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,255) [<c0025c48>] (unwind_backtrace+0x0/0xdc) from [<c0153d7c>] (panic+0x40/0x114) [<c0025c48>] (u[wind_backtrace+0x0/0xdc) from [<c0153d7c>] (panic+0x40/0x114) <c0153d7c>] (panic+0x40/0x114) from [<c0008fd0>] (mount_block_root+0x25c/0x2ac) [<c0153d7c>] (pani[+0x40/0x114) from [<c0008fd0>] (mount_block_root+0x25c/0x2ac) <c0008fd0>] (mount_block_root+0x25c/0x2ac) from [<c00091e8>] (prepare_namespace+0x164/0x1bc) [<c0008fd0>] (mount_block_root+[x25c/0x2ac) from [<c00091e8>] (prepare_namespace+0x164/0x1bc) <c00091e8>] (prepare_namespace+0x164/0x1bc) from [<c00085c0>] (kernel_init+0xd8/0x10c) [<c00091e8>] (prepare_nam[space+0x164/0x1bc) from [<c00085c0>] (kernel_init+0xd8/0x10c) <c00085c0>] (kernel_init+0xd8/0x10c) from [<c0020e04>] (kernel_thread_exit+0x0/0x8) [<c00085c0>] (kernel_init+0xd8/0x10c) from [<c0020e04>] (kernel_thread_exit+0x0/0x8) ? |