1. 程式人生 > >Device Tree(四)linux-4.19.10 板級移植

Device Tree(四)linux-4.19.10 板級移植

1、修改Makefile

ARCH            ?= arm
CROSS_COMPILE   ?= arm-linux-gnueabihf-

如果發現:/tmp/cc8nFJm8.s:549: Error: garbage following instruction -- `dsb nshst', 則到linaro.org下載新版本的編譯器,我使用版本為7.7.3

2、修改arch\arm\boot\Makefile

$(obj)/uImage:	$(obj)/zImage FORCE
	@$(check_for_multiple_loadaddr)
	$(call if_changed,uimage)
	#cp -f arch/arm/boot/uImage ../bin/uImage.bin
	cp -f arch/arm/boot/uImage /mnt/hgfs/Bin/uImage.bin;\
    	cp -f arch/arm/boot/dts/s5pv210-smdkv210.dtb /mnt/hgfs/Bin/s5pv210-smdkv210.dtb
	@$(kecho) '  Image 
[email protected]
is ready'

3、編譯

make s5pv210_defconfig; make menuconfig; make; make dtbs; make LOADADDR=0x20008000 uImage

(s5pv210_defconfig在arch/arm/configs下, LOADADDR為uImage自解壓後搬運核心到此處)

4、下載kernel與dtb至開發板

 tftp 40000000 uImage; tftp 50000000 s5pv210-smdkv210.dtb; fdt addr 5000000; bootm 40000000 - 50000000

只打印瞭如下所示就不列印了:

Starting kernel ...

(除錯發現不列印linux-4.19.10 “Uncompressing Linux... done, booting the kernel.”)

可以使用early_print列印進行除錯,原因是dts檔案中沒有設定xxti的時鐘頻率,導致計時器卡死,

新增xxti頻率配置在xusbti平級:

&xusbxti {
	clock-frequency = <24000000>;
};

/* add by Louis */
&xxti {
	clock-frequency = <24000000>;
};

可以看到列印資訊

Starting kernel ...

Booting Linux on physical CPU 0x0
Linux version 4.19.10 ([email protected]) (gcc version 7.3.0 (Ubuntu/Linaro 7.3.0-27ubuntu1~18.04)) #2 PREEMPT Wed Dec 19 04:49:03 PST 2018
CPU: ARMv7 Processor [412fc082] revision 2 (ARMv7), cr=10c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
OF: fdt: Machine model: Samsung Louis210 based on S5PV210
Memory policy: Data cache writeback
CPU: All CPU(s) started in SVC mode.
random: get_random_bytes called from start_kernel+0x9c/0x3f8 with crng_init=0
Built 1 zonelists, mobility grouping on.  Total pages: 260096
Kernel command line: root=/dev/nfs nfsroot=192.168.5.136:/root/code/rootfs ip=192.168.5.187 init=/init console=ttySAC0,115200 rw
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Memory: 1030784K/1048576K available (5120K kernel code, 209K rwdata, 1504K rodata, 1024K init, 248K bss, 17792K reserved, 0K cma-reserved)
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    vmalloc : 0xc0800000 - 0xff800000   (1008 MB)
    lowmem  : 0x80000000 - 0xc0000000   (1024 MB)
    modules : 0x7f000000 - 0x80000000   (  16 MB)
      .text : 0x(ptrval) - 0x(ptrval)   (6112 kB)
      .init : 0x(ptrval) - 0x(ptrval)   (1024 kB)
      .data : 0x(ptrval) - 0x(ptrval)   ( 210 kB)
       .bss : 0x(ptrval) - 0x(ptrval)   ( 249 kB)
SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
rcu: Preemptible hierarchical RCU implementation.
        Tasks RCU enabled.
NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
VIC @(ptrval): id 0x00041192, vendor 0x41
VIC @(ptrval): id 0x00041192, vendor 0x41
VIC @(ptrval): id 0x00041192, vendor 0x41
VIC @(ptrval): id 0x00041192, vendor 0x41
S5PV210 clocks: mout_apll = 1000000000, mout_mpll = 667000000
        mout_epll = 96000000, mout_vpll = 54000000
sched_clock: 32 bits at 33MHz, resolution 29ns, wraps every 64392313329ns
clocksource: samsung_clocksource_timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 57309158834 ns
Console: colour dummy device 80x30
Calibrating delay loop... 996.14 BogoMIPS (lpj=4980736)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
CPU: Testing write buffer coherency: ok
CPU0: Spectre v2: firmware did not set auxiliary control register IBE bit, system vulnerable
Setting up static identity map for 0x20100000 - 0x20100060
rcu: Hierarchical SRCU implementation.
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 2
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
futex hash table entries: 256 (order: 0, 7168 bytes)
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
clocksource: Switched to clocksource samsung_clocksource_timer
NET: Registered protocol family 2
tcp_listen_portaddr_hash hash table entries: 512 (order: 1, 12288 bytes)
TCP established hash table entries: 8192 (order: 3, 32768 bytes)
TCP bind hash table entries: 8192 (order: 5, 163840 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
UDP hash table entries: 512 (order: 2, 24576 bytes)
UDP-Lite hash table entries: 512 (order: 2, 24576 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
Initialise system trusted keyrings
workingset: timestamp_bits=30 max_order=18 bucket_order=0
romfs: ROMFS MTD (C) 2007 Red Hat, Inc.
Key type asymmetric registered
Asymmetric key parser 'x509' registered
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
io scheduler mq-deadline registered
io scheduler kyber registered
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
e2900000.serial: ttySAC0 at MMIO 0xe2900000 (irq = 58, base_baud = 0) is a S3C6400/10
console [ttySAC0] enabled
e2900400.serial: ttySAC1 at MMIO 0xe2900400 (irq = 59, base_baud = 0) is a S3C6400/10
e2900800.serial: ttySAC2 at MMIO 0xe2900800 (irq = 60, base_baud = 0) is a S3C6400/10
e2900c00.serial: ttySAC3 at MMIO 0xe2900c00 (irq = 61, base_baud = 0) is a S3C6400/10
exynos4-fb f8000000.fimd: failed to get system register.
OF: graph: no port node found in /soc/[email protected]
[drm] Exynos DRM: using f8000000.fimd device for DMA mapping operations
exynos-drm exynos-drm: bound f8000000.fimd (ops fimd_component_ops)
[drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[drm] No driver support for vblank timestamp query.
Console: switching to colour frame buffer device 100x30
exynos-drm exynos-drm: fb0:  frame buffer device
[drm] Initialized exynos 1.1.0 20180330 for exynos-drm on minor 0
brd: module loaded
loop: module loaded
dm9000 88000000.ethernet: 88000000.ethernet supply vcc not found, using dummy regulator
dm9000 88000000.ethernet: Linked as a consumer to regulator.0
dm9000 88000000.ethernet: enable clock 'sromc'
eth0: dm9000b at (ptrval),(ptrval) IRQ 144 MAC: 00:00:de:ad:be:ef (platform data)
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-exynos: EHCI EXYNOS driver
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
ohci-exynos: OHCI EXYNOS driver
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
s3c-sdhci eb000000.sdhci: clock source 0: mmc_busclk.0 (133400000 Hz)
s3c-sdhci eb000000.sdhci: clock source 2: mmc_busclk.2 (96000000 Hz)
mmc0: SDHCI controller on samsung-hsmmc [eb000000.sdhci] using ADMA
s3c-sdhci eb100000.sdhci: clock source 0: mmc_busclk.0 (133400000 Hz)
s3c-sdhci eb100000.sdhci: clock source 2: mmc_busclk.2 (96000000 Hz)
mmc1: SDHCI controller on samsung-hsmmc [eb100000.sdhci] using ADMA
s3c-sdhci eb200000.sdhci: clock source 0: mmc_busclk.0 (133400000 Hz)
s3c-sdhci eb200000.sdhci: clock source 2: mmc_busclk.2 (96000000 Hz)
mmc2: SDHCI controller on samsung-hsmmc [eb200000.sdhci] using ADMA
s3c-sdhci eb300000.sdhci: clock source 0: mmc_busclk.0 (133400000 Hz)
s3c-sdhci eb300000.sdhci: clock source 3: mmc_busclk.3 (96000000 Hz)
mmc3: Internal clock never stabilised.
mmc3: sdhci: ============ SDHCI REGISTER DUMP ===========
mmc3: sdhci: Sys addr:  0x00000000 | Version:  0x00002401
mmc3: sdhci: Blk size:  0x00000000 | Blk cnt:  0x00000000
mmc3: sdhci: Argument:  0x00000000 | Trn mode: 0x00000000
mmc3: sdhci: Present:   0x01fa0000 | Host ctl: 0x00000000
mmc3: sdhci: Power:     0x0000000e | Blk gap:  0x00000000
mmc3: sdhci: Wake-up:   0x00000000 | Clock:    0x00008001
mmc3: sdhci: Timeout:   0x00000000 | Int stat: 0x00000000
mmc3: sdhci: Int enab:  0x00ff0043 | Sig enab: 0x00ff0043
mmc3: sdhci: AC12 err:  0x00000000 | Slot int: 0x00000000
mmc3: sdhci: Caps:      0x05e80080 | Caps_1:   0x00000000
mmc3: sdhci: Cmd:       0x00000000 | Max curr: 0x00000000
mmc3: sdhci: Resp[0]:   0x00000000 | Resp[1]:  0x00000000
mmc3: sdhci: Resp[2]:   0x00000000 | Resp[3]:  0x00000000
mmc3: sdhci: Host ctl2: 0x00000000
mmc3: sdhci: ADMA Err:  0x00000000 | ADMA Ptr: 0x00000000
mmc3: sdhci: ============================================
mmc3: SDHCI controller on samsung-hsmmc [eb300000.sdhci] using ADMA