制作A20蜂鸟开发板干净系统[构建内核]

A20蜂鸟开发板的配置非常好,当然这是相对于他的定价来说,蓝牙WIFI,板载NAND,还预留副NAND焊盘,没占用的IO也死多的,屏幕RGB也支持等等.但是技术资料就是渣渣,只有原理图和根本编译不过的SDK.Linux Sunxi维护的GitHub源又死老的.非常不爽.所以想构建一个好的系统就非常重要了,也好不让板子吃灰嘛.

但是说的容易做起来没那么简单,过中肯定不少问题,比如闭源的WLAN/BT驱动就让人非常无语.但是功能阉掉就让人很不爽的.当我写这之前,我还没确定我能否完成下去,如果有大家的帮助和支持,那是无限鼓励我.

首先确定我GCC版本是4.6.3,这是Ubuntu 12.04 LTS默认的交叉编一起GCC版本,不知道后续的版本是否能编译,先试试这个:

GCC版本

然后到Kernel.ORG[网址:https://www.kernel.org/]下载内核,目前稳定版4.01.下载起来比较慢,但如果你在国内的话,下载就更慢了,下载好了就解压,

Linux-40

生成默认配置:

sudo ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make sunxi_defconfig

然后进入菜单配置,打开一些设置:

sudo ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make menuconfig

菜单中使用这些设置:

  1. General setup -> 取消 Automatically append version information to the version string
  2. 勾选 Enable loadable module support
  3. Kernel hacking -> 取消 Enable stack unwinding support (EXPERIMENTAL)

如果需要其他配置,还得自己多多看看了:

LInuxMenuConfig

我电脑有8个核,所以我就8核全开,编译:

sudo ARCH=arm LOADADDR=0x40008000 CROSS_COMPILE=arm-linux-gnueabihf- make -j8 uImage modules dtbs

没过几分钟,我的内核就编译好了.

Kernel-Compile-Finsh

插入TF卡,预烧写好Cubian或者其他A20板子的系统.先安装内核模块,比如我这样的:

make modules_install INSTALL_MOD_PATH=/media/874ac702-5253-4ae6-8a7f-4ca851bc1e7d/

后面应该根据你实际的路径,进行修改,我的TF卡自动挂载到这个位置而已.当然还要自行复制内核哦.

LInux-Kernel-CP

最后还要复制设备树文件:

cp arch/arm/boot/dts/sun7i-a20-hummingbird.dtb /media/874ac702-5253-4ae6-8a7f-4ca851bc1e7d/boot/sun7i-a20-hummingbird.dtb 

最后肯定是理所当然的测试一下,启动日志如下:

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.0.1 (root@tater-VirtualBox) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #1 SMP Fri May 1 18:52:56 CST 2015
[    0.000000] CPU: ARMv7 Processor [410fc074] revision 4 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine model: Merrii A20 Hummingbird
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] PERCPU: Embedded 10 pages/cpu @eefcc000 s10944 r8192 d21824 u40960
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 260624
[    0.000000] Kernel command line: console=ttyS0,115200 sunxi_g2d_mem_reserve=0 sunxi_ve_mem_reserve=0 sunxi_no_mali_mem_reserve root=/dev/mmcblk0p1 rootwait panic=10
[    0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Memory: 1033576K/1048576K available (3963K kernel code, 177K rwdata, 1152K rodata, 252K init, 228K bss, 15000K reserved, 0K cma-reserved, 270336K highmem)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xf0000000 - 0xff000000   ( 240 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xef800000   ( 760 MB)
[    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
[    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
[    0.000000]       .text : 0xc0008000 - 0xc0506f8c   (5116 kB)
[    0.000000]       .init : 0xc0507000 - 0xc0546000   ( 252 kB)
[    0.000000]       .data : 0xc0546000 - 0xc05725c0   ( 178 kB)
[    0.000000]        .bss : 0xc05725c0 - 0xc05ab944   ( 229 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    0.000000] Hierarchical RCU implementation.
[    0.000000] RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=2.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] Architected cp15 timer(s) running at 24.00MHz (virt).
[    0.000009] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 2863311519744ns
[    0.000022] Switching to timer-based delay loop, resolution 41ns
[    0.000366] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 178956969942ns
[    0.000703] Console: colour dummy device 80x30
[    0.000731] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[    0.000745] pid_max: default: 32768 minimum: 301
[    0.000852] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000863] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.001417] CPU: Testing write buffer coherency: ok
[    0.001692] /cpus/cpu@0 missing clock-frequency property
[    0.001709] /cpus/cpu@1 missing clock-frequency property
[    0.001722] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.001782] Setting up static identity map for 0x403e5128 - 0x403e5180
[    0.002965] Brought up 1 CPUs
[    0.002983] SMP: Total of 1 processors activated (48.00 BogoMIPS).
[    0.002990] CPU: All CPU(s) started in SVC mode.
[    0.003520] devtmpfs: initialized
[    0.004414] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 4
[    0.004867] pinctrl core: initialized pinctrl subsystem
[    0.012451] NET: Registered protocol family 16
[    0.012846] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.020017] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.020034] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.026668] reg-fixed-voltage ahci-5v: could not find pctldev for node /soc@01c00000/pinctrl@01c20800/ahci_pwr_pin@0, deferring probe
[    0.026696] platform ahci-5v: Driver reg-fixed-voltage requests probe deferral
[    0.026726] reg-fixed-voltage usb1-vbus: could not find pctldev for node /soc@01c00000/pinctrl@01c20800/usb1_vbus_pin@0, deferring probe
[    0.026740] platform usb1-vbus: Driver reg-fixed-voltage requests probe deferral
[    0.026766] reg-fixed-voltage usb2-vbus: could not find pctldev for node /soc@01c00000/pinctrl@01c20800/usb2_vbus_pin@0, deferring probe
[    0.026778] platform usb2-vbus: Driver reg-fixed-voltage requests probe deferral
[    0.027463] reg-fixed-voltage mmc3_vdd: could not find pctldev for node /soc@01c00000/pinctrl@01c20800/mmc3_vdd_pin@0, deferring probe
[    0.027481] platform mmc3_vdd: Driver reg-fixed-voltage requests probe deferral
[    0.027507] reg-fixed-voltage gmac_vdd: could not find pctldev for node /soc@01c00000/pinctrl@01c20800/gmac_vdd_pin@0, deferring probe
[    0.027520] platform gmac_vdd: Driver reg-fixed-voltage requests probe deferral
[    0.028007] SCSI subsystem initialized
[    0.028568] usbcore: registered new interface driver usbfs
[    0.028648] usbcore: registered new interface driver hub
[    0.028718] usbcore: registered new device driver usb
[    0.028881] pps_core: LinuxPPS API ver. 1 registered
[    0.028889] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti 
[    0.028919] PTP clock support registered
[    0.030072] Switched to clocksource arch_sys_counter
[    0.039929] NET: Registered protocol family 2
[    0.040576] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
[    0.040655] TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
[    0.040775] TCP: Hash tables configured (established 8192 bind 8192)
[    0.040862] TCP: reno registered
[    0.040876] UDP hash table entries: 512 (order: 2, 16384 bytes)
[    0.040933] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
[    0.041176] NET: Registered protocol family 1
[    0.041628] RPC: Registered named UNIX socket transport module.
[    0.041640] RPC: Registered udp transport module.
[    0.041647] RPC: Registered tcp transport module.
[    0.041653] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.042287] hw perfevents: enabled with armv7_cortex_a7 PMU driver, 5 counters available
[    0.043484] futex hash table entries: 512 (order: 3, 32768 bytes)
[    0.054141] NFS: Registering the id_resolver key type
[    0.054210] Key type id_resolver registered
[    0.054218] Key type id_legacy registered
[    0.055259] bounce: pool size: 64 pages
[    0.055502] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 250)
[    0.055522] io scheduler noop registered
[    0.055534] io scheduler deadline registered
[    0.055723] io scheduler cfq registered (default)
[    0.056268] platform 1c13400.phy: Driver sun4i-usb-phy requests probe deferral
[    0.058984] sun7i-a20-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[    0.117668] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[    0.120934] console [ttyS0] disabled
[    0.141145] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 42, base_baud = 1500000) is a U6_16550A
[    0.769013] console [ttyS0] enabled
[    0.793943] 1c28800.serial: ttyS1 at MMIO 0x1c28800 (irq = 43, base_baud = 1500000) is a U6_16550A
[    0.826347] 1c28c00.serial: ttyS2 at MMIO 0x1c28c00 (irq = 44, base_baud = 1500000) is a U6_16550A
[    0.858665] 1c29000.serial: ttyS3 at MMIO 0x1c29000 (irq = 45, base_baud = 1500000) is a U6_16550A
[    0.891008] 1c29400.serial: ttyS4 at MMIO 0x1c29400 (irq = 46, base_baud = 1500000) is a U6_16550A
[    0.901639] platform 1c18000.sata: Driver ahci-sunxi requests probe deferral
[    0.910528] platform 1c50000.ethernet: Driver stmmaceth requests probe deferral
[    0.917940] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.924515] ehci-platform: EHCI generic platform driver
[    0.929879] platform 1c14000.usb: Driver ehci-platform requests probe deferral
[    0.937204] platform 1c1c000.usb: Driver ehci-platform requests probe deferral
[    0.944550] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    0.950772] ohci-platform: OHCI generic platform driver
[    0.956113] platform 1c14400.usb: Driver ohci-platform requests probe deferral
[    0.963429] platform 1c1c400.usb: Driver ohci-platform requests probe deferral
[    0.971794] sunxi-rtc 1c20d00.rtc: rtc core: registered rtc-sunxi as rtc0
[    0.978584] sunxi-rtc 1c20d00.rtc: RTC enabled
[    0.983192] i2c /dev entries driver
[    0.987596] axp20x 0-0034: AXP20x variant AXP209 found
[    1.000953] input: axp20x-pek as /devices/platform/soc@01c00000/1c2ac00.i2c/i2c-0/0-0034/axp20x-pek/input/input0
[    1.011319] axp20x-regulator axp20x-regulator: regulators node not found
[    1.020464] axp20x 0-0034: AXP20X driver loaded
[    1.027418] sunxi-wdt 1c20c90.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[    1.035540] Driver 'mmcblk' needs updating - please use bus_type methods
[    1.042773] sunxi-mmc 1c0f000.mmc: No vqmmc regulator found
[    1.048721] sunxi-mmc 1c0f000.mmc: Got CD GPIO
[    1.090137] sunxi-mmc 1c0f000.mmc: base:0xf00bc000 irq:26
[    1.095964] platform 1c12000.mmc: Driver sunxi-mmc requests probe deferral
[    1.103924] usbcore: registered new interface driver usbhid
[    1.109492] usbhid: USB HID core driver
[    1.114210] TCP: cubic registered
[    1.117539] NET: Registered protocol family 17
[    1.122130] Key type dns_resolver registered
[    1.127139] Registering SWP/SWPB emulation handler
[    1.167069] mmc0: host does not support reading read-only switch, assuming write-enable
[    1.177519] mmc0: new high speed SDHC card at address 0001
[    1.183498] mmcblk0: mmc0:0001 SD8GB 7.44 GiB
[    1.189360]  mmcblk0: p1
[    1.200084] ahci-sunxi 1c18000.sata: controller can't do PMP, turning off CAP_PMP
[    1.207569] ahci-sunxi 1c18000.sata: forcing PORTS_IMPL to 0x1
[    1.213484] ahci-sunxi 1c18000.sata: AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl platform mode
[    1.222460] ahci-sunxi 1c18000.sata: flags: ncq sntf pm led clo only pio slum part ccc
[    1.231380] scsi host0: ahci-sunxi
[    1.235106] ata1: SATA max UDMA/133 mmio [mem 0x01c18000-0x01c18fff] port 0x100 irq 31
[    1.243737] stmmaceth 1c50000.ethernet: no reset control found
[    1.249573]  Ring mode enabled
[    1.252671]  No HW DMA feature register supported
[    1.257198]  Normal descriptors
[    1.260529]  TX Checksum insertion supported
[    1.319134] libphy: stmmac: probed
[    1.322609] eth0: PHY ID 001cc915 at 0 IRQ POLL (stmmac-0:00) active
[    1.328956] eth0: PHY ID 001cc915 at 1 IRQ POLL (stmmac-0:01)
[    1.335096] ehci-platform 1c14000.usb: EHCI Host Controller
[    1.340735] ehci-platform 1c14000.usb: new USB bus registered, assigned bus number 1
[    1.348601] ehci-platform 1c14000.usb: irq 28, io mem 0x01c14000
[    1.370035] ehci-platform 1c14000.usb: USB 2.0 started, EHCI 1.00
[    1.377043] hub 1-0:1.0: USB hub found
[    1.380899] hub 1-0:1.0: 1 port detected
[    1.385495] ehci-platform 1c1c000.usb: EHCI Host Controller
[    1.391155] ehci-platform 1c1c000.usb: new USB bus registered, assigned bus number 2
[    1.399027] ehci-platform 1c1c000.usb: irq 32, io mem 0x01c1c000
[    1.419970] ehci-platform 1c1c000.usb: USB 2.0 started, EHCI 1.00
[    1.426953] hub 2-0:1.0: USB hub found
[    1.430795] hub 2-0:1.0: 1 port detected
[    1.435368] ohci-platform 1c14400.usb: Generic Platform OHCI controller
[    1.442063] ohci-platform 1c14400.usb: new USB bus registered, assigned bus number 3
[    1.449924] ohci-platform 1c14400.usb: irq 29, io mem 0x01c14400
[    1.514831] hub 3-0:1.0: USB hub found
[    1.518623] hub 3-0:1.0: 1 port detected
[    1.523261] ohci-platform 1c1c400.usb: Generic Platform OHCI controller
[    1.529909] ohci-platform 1c1c400.usb: new USB bus registered, assigned bus number 4
[    1.537847] ohci-platform 1c1c400.usb: irq 33, io mem 0x01c1c400
[    1.604868] hub 4-0:1.0: USB hub found
[    1.608664] hub 4-0:1.0: 1 port detected
[    1.613609] sunxi-mmc 1c12000.mmc: No vqmmc regulator found
[    1.649989] sunxi-mmc 1c12000.mmc: base:0xf011e000 irq:27
[    1.655491] sunxi-rtc 1c20d00.rtc: setting system clock to 2015-05-01 11:12:38 UTC (1430478758)
[    1.668679] vcc5v0: disabling
[    1.671754] vcc3v3: disabling
[    1.675475] ata1: SATA link down (SStatus 0 SControl 300)
[    1.681707] sunxi-mmc 1c0f000.mmc: smc 0 err, cmd 18, RD RTO !!
[    1.687677] sunxi-mmc 1c0f000.mmc: data error, sending stop command
[    1.694004] sunxi-mmc 1c0f000.mmc: send stop command failed
[    1.700690] sunxi-mmc 1c0f000.mmc: smc 0 err, cmd 13, RTO !!
[    1.706368] mmcblk0: error -110 sending status command, retrying
[    1.712420] sunxi-mmc 1c0f000.mmc: smc 0 err, cmd 13, RTO !!
[    1.720294] mmcblk0: error -110 sending status command, retrying
[    1.726306] sunxi-mmc 1c12000.mmc: smc 1 err, cmd 8, RTO !!
[    1.731919] sunxi-mmc 1c0f000.mmc: smc 0 err, cmd 13, RTO !!
[    1.737592] mmcblk0: error -110 sending status command, aborting
[    1.753706] mmc1: queuing unknown CIS tuple 0x80 (2 bytes)
[    1.760685] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[    1.767664] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[    1.775821] mmc1: queuing unknown CIS tuple 0x80 (7 bytes)
[    1.798924] mmc1: new high speed SDIO card at address 0001
[    1.824133] mmc0: tried to reset card
[    1.828507] EXT4-fs (mmcblk0p1): couldn't mount as ext3 due to feature incompatibilities
[    1.837624] EXT4-fs (mmcblk0p1): couldn't mount as ext2 due to feature incompatibilities
[    1.857017] EXT4-fs (mmcblk0p1): mounted filesystem with ordered data mode. Opts: (null)
[    1.865229] VFS: Mounted root (ext4 filesystem) readonly on device 179:1.
[    1.880203] devtmpfs: mounted
[    1.883466] Freeing unused kernel memory: 252K (c0507000 - c0546000)

大家可能看得比较晕,比较值得注意就是CPU missing clock-frequency property,NAND,WLAN等驱动也没加载,看来修复还得一些时间啊.

发表评论

电子邮件地址不会被公开。 必填项已用*标注