본문 바로가기

임베디드

Kernel 5.5 (rc4) 포팅과 부팅

Allwinner i3(S3) CPU에 최신 메인라인 커널을 포팅하는 과정을 기록하기 시작한다.

과정에 실수나 오류가 있을수 있으나 그 것 자체가 개발 과정에 대한 유용한 기록이 되리라 생각한다.

 

 

내 보드에 맞는 devicetree와  defconfig 파일은 5.4.1 버전에서 테스트가 된것을 거의 그대로 사용해 보자.

그리고 커널 config 설정할때 oldconfig 옵션에 대한 공부는 좀 더 필요해 보인다.

 

우선 Tovalds님의 최신 커널 repo를 Github 홈페이지에서 "fork" 하였고 개발용 PC에 git clone으로 전체 소스를 다운로드 받았다.

툴체인은 u-boot 빌드에 사용했던  gcc-linaro-6.3.1을 그대로 이용하였다.

 

Fork한 커널 소스는 https://github.com/foxnux/linux 에 있으며, 내가 만든 FoxNux 보드를 위한 device-tree와 default configuration 파일을 추가로 commit 하였다.

 

일단 부팅은 잘되었다. 

U-Boot SPL 2017.01-rc2-00082-g46418c24c5 (Dec 30 2019 - 17:00:24)
DRAM: 128 MiB
Trying to boot from MMC1

U-Boot 2017.01-rc2-00082-g46418c24c5 (Dec 30 2019 - 17:00:24 +0900) Allwinner Technology

CPU:   Allwinner S3/V3s (SUN8I 1681)
Model: FoxNux One
DRAM:  128 MiB
MMC:   SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment

Setting up a 1024x600 lcd console (overscan 0x0)
dotclock: 51000kHz = 51000kHz: (1 * 3MHz * 102) / 6
In:    serial@01c28000
Out:   serial@01c28000
Err:   serial@01c28000


U-Boot 2017.01-rc2-00082-g46418c24c5 (Dec 30 2019 - 17:00:24 +0900) Allwinner Technology

CPU:   Allwinner S3/V3s (SUN8I 1681)
Model: FoxNux One
DRAM:  128 MiB
MMC:   SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment

Setting up a 1024x600 lcd console (overscan 0x0)
dotclock: 51000kHz = 51000kHz: (1 * 3MHz * 102) / 6
In:    serial@01c28000
Out:   serial@01c28000
Err:   serial@01c28000
Net:   phy interface0
eth0: ethernet@1c30000
starting USB...
No controllers found
Press SPACE key two times to abort autoboot in 2 seconds
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
431 bytes read in 82 ms (4.9 KiB/s)
## Executing script at 41900000
4555464 bytes read in 373 ms (11.6 MiB/s)
11294 bytes read in 61 ms (180.7 KiB/s)
## Flattened Device Tree blob at 41800000
   Booting using the fdt blob at 0x41800000
   Loading Device Tree to 42dfa000, end 42dffc1d ... OK
Cannot setup simplefb: node not found

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.5.0-rc4-dirty (odroid@h2) (gcc version 6.3.1 20170404 (Linaro GCC 6.3-2017.05)) #4 SMP Tue Dec 31 16:34:45 KST 2019
[    0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
[    0.000000] CPU: div instructions available: patching division code
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: Hardkernel FoxNux One
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] cma: Reserved 16 MiB at 0x47000000
[    0.000000] percpu: Embedded 15 pages/cpu s30540 r8192 d22708 u61440
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 32512
[    0.000000] Kernel command line: console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait panic=10 earlyprintk rw
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 101512K/131072K available (7168K kernel code, 366K rwdata, 1876K rodata, 1024K init, 243K bss, 13176K reserved, 16384K cma-reserved, 0K highmem)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu:     RCU event tracing is enabled.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] random: get_random_bytes called from start_kernel+0x2c0/0x450 with crng_init=0
[    0.000000] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000000] Console: colour dummy device 80x30
[    0.000000] sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 21474836475000000ns
[    0.050000] Calibrating delay loop... 2013.59 BogoMIPS (lpj=10067968)
[    0.060000] pid_max: default: 32768 minimum: 301
[    0.060000] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.060000] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.060000] CPU: Testing write buffer coherency: ok
[    0.060000] /cpus/cpu@0 missing clock-frequency property
[    0.060000] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.060000] Setting up static identity map for 0x40100000 - 0x40100060
[    0.060000] rcu: Hierarchical SRCU implementation.
[    0.060000] smp: Bringing up secondary CPUs ...
[    0.060000] smp: Brought up 1 node, 1 CPU
[    0.060000] SMP: Total of 1 processors activated (2013.59 BogoMIPS).
[    0.060000] CPU: All CPU(s) started in SVC mode.
[    0.060000] devtmpfs: initialized
[    0.060000] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[    0.060000] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.060000] futex hash table entries: 256 (order: 2, 16384 bytes, linear)
[    0.060000] pinctrl core: initialized pinctrl subsystem
[    0.060000] thermal_sys: Registered thermal governor 'step_wise'
[    0.060000] NET: Registered protocol family 16
[    0.060000] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.070000] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.070000] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.080000] SCSI subsystem initialized
[    0.080000] usbcore: registered new interface driver usbfs
[    0.080000] usbcore: registered new interface driver hub
[    0.080000] usbcore: registered new device driver usb
[    0.080000] videodev: Linux video capture interface: v2.00
[    0.080000] pps_core: LinuxPPS API ver. 1 registered
[    0.080000] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.080000] PTP clock support registered
[    0.090000] Advanced Linux Sound Architecture Driver Initialized.
[    0.090000] clocksource: Switched to clocksource timer
[    0.100000] NET: Registered protocol family 2
[    0.100000] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[    0.100000] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.100000] TCP bind hash table entries: 1024 (order: 1, 8192 bytes, linear)
[    0.100000] TCP: Hash tables configured (established 1024 bind 1024)
[    0.100000] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.100000] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.100000] NET: Registered protocol family 1
[    0.100000] RPC: Registered named UNIX socket transport module.
[    0.100000] RPC: Registered udp transport module.
[    0.100000] RPC: Registered tcp transport module.
[    0.100000] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.100000] Initialise system trusted keyrings
[    0.100000] workingset: timestamp_bits=30 max_order=15 bucket_order=0
[    0.110000] NFS: Registering the id_resolver key type
[    0.110000] Key type id_resolver registered
[    0.110000] Key type id_legacy registered
[    0.110000] Key type asymmetric registered
[    0.110000] Asymmetric key parser 'x509' registered
[    0.110000] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 248)
[    0.110000] io scheduler mq-deadline registered
[    0.110000] io scheduler kyber registered
[    0.110000] sun4i-usb-phy 1c19400.phy: Couldn't request ID GPIO
[    0.110000] sun8i-v3s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[    0.110000] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pb not found, using dummy regulator
[    0.170000] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[    0.170000] printk: console [ttyS0] disabled
[    0.190000] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 38, base_baud = 1500000) is a U6_16550A
[    0.730000] printk: console [ttyS0] enabled
[    0.740000] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pd not found, using dummy regulator
[    0.770000] panel-simple panel: panel supply power not found, using dummy regulator
[    0.780000] libphy: Fixed MDIO Bus: probed
[    0.790000] dwmac-sun8i 1c30000.ethernet: IRQ eth_wake_irq not found
[    0.790000] dwmac-sun8i 1c30000.ethernet: IRQ eth_lpi not found
[    0.800000] dwmac-sun8i 1c30000.ethernet: PTP uses main clock
[    0.810000] dwmac-sun8i 1c30000.ethernet: No regulator found
[    0.810000] dwmac-sun8i 1c30000.ethernet: Current syscon value is not the default 148000 (expect 38000)
[    0.820000] dwmac-sun8i 1c30000.ethernet: No HW DMA feature register supported
[    0.830000] dwmac-sun8i 1c30000.ethernet: RX Checksum Offload Engine supported
[    0.840000] dwmac-sun8i 1c30000.ethernet: COE Type 2
[    0.840000] dwmac-sun8i 1c30000.ethernet: TX Checksum insertion supported
[    0.850000] dwmac-sun8i 1c30000.ethernet: Normal descriptors
[    0.850000] dwmac-sun8i 1c30000.ethernet: Chain mode enabled
[    0.860000] libphy: stmmac: probed
[    0.860000] dwmac-sun8i 1c30000.ethernet: Found internal PHY node
[    0.870000] libphy: mdio_mux: probed
[    0.870000] dwmac-sun8i 1c30000.ethernet: Switch mux to internal PHY
[    0.880000] dwmac-sun8i 1c30000.ethernet: Powering internal PHY
[    0.890000] libphy: mdio_mux: probed
[    0.890000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.900000] ehci-platform: EHCI generic platform driver
[    0.900000] ehci-platform 1c1a000.usb: EHCI Host Controller
[    0.910000] ehci-platform 1c1a000.usb: new USB bus registered, assigned bus number 1
[    0.920000] ehci-platform 1c1a000.usb: irq 27, io mem 0x01c1a000
[    0.950000] ehci-platform 1c1a000.usb: USB 2.0 started, EHCI 1.00
[    0.950000] hub 1-0:1.0: USB hub found
[    0.960000] hub 1-0:1.0: 1 port detected
[    0.960000] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    0.970000] ohci-platform: OHCI generic platform driver
[    0.970000] ohci-platform 1c1a400.usb: Generic Platform OHCI controller
[    0.980000] ohci-platform 1c1a400.usb: new USB bus registered, assigned bus number 2
[    0.990000] ohci-platform 1c1a400.usb: irq 28, io mem 0x01c1a400
[    1.060000] hub 2-0:1.0: USB hub found
[    1.060000] hub 2-0:1.0: 1 port detected
[    1.070000] usbcore: registered new interface driver cdc_wdm
[    1.080000] usbcore: registered new interface driver usb-storage
[    1.080000] usbcore: registered new interface driver usbserial_generic
[    1.090000] usbserial: USB Serial support registered for generic
[    1.100000] usbcore: registered new interface driver ch341
[    1.100000] usbserial: USB Serial support registered for ch341-uart
[    1.110000] usbcore: registered new interface driver cp210x
[    1.110000] usbserial: USB Serial support registered for cp210x
[    1.120000] mousedev: PS/2 mouse device common for all mice
[    1.130000] input: 1c22800.lradc as /devices/platform/soc/1c22800.lradc/input/input0
[    1.140000] sun6i-rtc 1c20400.rtc: registered as rtc0
[    1.140000] sun6i-rtc 1c20400.rtc: RTC enabled
[    1.140000] i2c /dev entries driver
[    1.150000] Goodix-TS 0-0014: 0-0014 supply AVDD28 not found, using dummy regulator
[    1.160000] Goodix-TS 0-0014: 0-0014 supply VDDIO not found, using dummy regulator
[    1.290000] Goodix-TS 0-0014: ID 911, version: 1060
[    1.290000] usbcore: registered new interface driver uvcvideo
[    1.300000] USB Video Class driver (1.1.1)
[    1.300000] Goodix-TS 0-0014: Direct firmware load for goodix_911_cfg.bin failed with error -2
[    1.310000] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[    1.320000] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pf not found, using dummy regulator
[    1.340000] random: fast init done
[    1.350000] input: Goodix Capacitive TouchScreen as /devices/platform/soc/1c2ac00.i2c/i2c-0/0-0014/input/input1
[    1.360000] sunxi-mmc 1c0f000.mmc: initialized, max. request size: 16384 KB
[    1.370000] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pg not found, using dummy regulator
[    1.400000] sunxi-mmc 1c10000.mmc: initialized, max. request size: 16384 KB
[    1.410000] usbcore: registered new interface driver usbhid
[    1.420000] usbhid: USB HID core driver
[    1.420000] sun4i-codec 1c22c00.codec: Failed to register our card
[    1.430000] NET: Registered protocol family 17
[    1.430000] Key type dns_resolver registered
[    1.440000] Registering SWP/SWPB emulation handler
[    1.440000] Loading compiled-in X.509 certificates
[    1.460000] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pc not found, using dummy regulator
[    1.470000] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pd not found, using dummy regulator
[    1.480000] sun4i-drm display-engine: bound 1100000.mixer (ops 0xc084afd8)
[    1.490000] sun4i-drm display-engine: bound 1c0c000.lcd-controller (ops 0xc08482c4)
[    1.490000] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[    1.500000] [drm] No driver support for vblank timestamp query.
[    1.510000] [drm] Initialized sun4i-drm 1.0.0 20150629 for display-engine on minor 0
[    1.530000] mmc0: host does not support reading read-only switch, assuming write-enable
[    1.530000] mmc0: new high speed SDHC card at address aaaa
[    1.530000] mmcblk0: mmc0:aaaa SA16G 14.8 GiB 
[    1.530000]  mmcblk0: p1 p2
[    1.820000] Console: switching to colour frame buffer device 128x37
[    1.860000] sun4i-drm display-engine: fb0: sun4i-drmdrmfb frame buffer device
[    1.870000] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[    1.880000] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[    1.890000] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 3
[    1.890000] hub 3-0:1.0: USB hub found
[    1.900000] hub 3-0:1.0: 1 port detected
[    1.900000] debugfs: Directory '1c22c00.codec' with parent 'V3s Audio Codec' already present!
[    1.910000] sun4i-codec 1c22c00.codec: Codec <-> 1c22c00.codec mapping ok
[    1.920000] sun6i-rtc 1c20400.rtc: setting system clock to 2019-12-31T08:11:28 UTC (1577779888)
[    1.930000] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    1.940000] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    1.950000] ALSA device list:
[    1.950000]   #0: V3s Audio Codec
[    1.960000] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[    1.970000] cfg80211: failed to load regulatory.db
[    1.990000] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    2.000000] VFS: Mounted root (ext4 filesystem) on device 179:2.
[    2.010000] devtmpfs: mounted
[    2.010000] Freeing unused kernel memory: 1024K
[    2.020000] Run /sbin/init as init process
[    2.380000] usb 1-1: new high-speed USB device number 2 using ehci-platform
[    2.520000] systemd[1]: Failed to insert module 'autofs4': No such file or directory
[    2.550000] systemd[1]: systemd 237 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid)
[    2.580000] systemd[1]: Detected architecture arm.
[    2.580000] hub 1-1:1.0: USB hub found
[    2.590000] hub 1-1:1.0: 4 ports detected

Welcome to Ubuntu 18.04.3 LTS!

[    2.600000] systemd[1]: Set hostname to <bionic-minimal>.
[    3.020000] systemd[1]: File /lib/systemd/system/systemd-journald.service:35 configures an IP firewall (IPAddressDeny=any), but the local system does not support BPF/cgroup based firewalling.
[    3.040000] systemd[1]: Proceeding WITHOUT firewalling in effect! (This warning is only shown for the first loaded unit using IP firewalling.)
[    3.330000] random: systemd: uninitialized urandom read (16 bytes read)
[    3.330000] systemd[1]: Created slice User and Session Slice.
[  OK  [    3.340000] random: systemd: uninitialized urandom read (16 bytes read)
] Created slice User and Session Slice.
[    3.350000] systemd[1]: Created slice System Slice.
[  OK  [    3.360000] random: systemd: uninitialized urandom read (16 bytes read)
] Created slice System Slice.
[    3.370000] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[  OK  [    3.380000] systemd[1]: Listening on Syslog Socket.
] Started Forward Password Requests to Wall Directory Watch.
[    3.380000] systemd[1]: Reached target Swap.
[  OK  ] Listening on Syslog Socket.
[  OK  ] Reached target Swap.
[  OK  ] Created slice system-serial\x2dgetty.slice.
[  OK  ] Listening on udev Kernel Socket.
[  OK  ] Listening on Network Service Netlink Socket.
[  OK  ] Reached target Remote File Systems.
[  OK  ] Reached target Slices.
[  OK  ] Listening on udev Control Socket.
[  OK  ] Started Dispatch Password Requests to Console Directory Watch.
[  OK  ] Reached target Paths.
[  OK  ] Reached target Local Encrypted Volumes.
[  OK  ] Listening on Journal Socket (/dev/log).
[  OK  ] Listening on /dev/initctl Compatibility Named Pipe.
[  OK  ] Listening on Journal Socket.
         Starting Set the console keyboard layout...
         Starting Remount Root and Kernel File Systems...
         Starting udev Coldplug all Devices...
         Starting Load Kernel Modules...
         Starting Journal Service...
         Starting Create Static Device Nodes in /dev...
         Mounting Kernel Debug File System...
[  OK  ] Mounted Kernel Debug File System.
[  OK  ] Started Load Kernel Modules.
         Starting Apply Kernel Variables...
[  OK  ] Started Create Static Device Nodes in /dev.
[  OK  ] Started Apply Kernel Variables.
[  OK  ] Started Journal Service.
[  OK  ] Started Remount Root and Kernel File Systems.
         Starting udev Kernel Device Manager...
         Starting Flush Journal to Persistent Storage...
         Starting Load/Save Random Seed...
[  OK  ] Started Load/Save Random Seed.
[  OK  ] Started udev Kernel Device Manager.
         Starting Network Service...
[  OK  ] Started Network Service.
[  OK  ] Started Set the console keyboard layout.
[  OK  ] Started Flush Journal to Persistent Storage.
[  OK  ] Reached target Local File Systems (Pre).
[  OK  ] Started udev Coldplug all Devices.
[  OK  ] Reached target Sound Card.
[  OK  ] Found device /dev/ttyS0.
[  OK  ] Found device /dev/disk/by-uuid/df013f6e-fe44-4564-82f6-bdf211cce054.
[  OK  ] Listening on Load/Save RF Kill Switch Status /dev/rfkill Watch.
         Mounting /boot...
[  OK  ] Mounted /boot.
[  OK  ] Reached target Local File Systems.
         Starting Set console font and keymap...
         Starting Create Volatile Files and Directories...
[  OK  ] Started Set console font and keymap.
[  OK  ] Started Create Volatile Files and Directories.
         Starting Network Name Resolution...
         Starting Network Time Synchronization...
         Starting Update UTMP about System Boot/Shutdown...
[  OK  ] Started Network Name Resolution.
[  OK  ] Started Update UTMP about System Boot/Shutdown.
[  OK  ] Started Network Time Synchronization.
[  OK  ] Reached target System Time Synchronized.
[  OK  ] Reached target System Initialization.
[  OK  ] Started Discard unused blocks once a week.
[  OK  ] Started Message of the Day.
[  OK  ] Listening on D-Bus System Message Bus Socket.
[  OK  ] Reached target Sockets.
[  OK  ] Reached target Basic System.
         Starting System Logging Service...
         Starting Login Service...
         Starting Dispatcher daemon for systemd-networkd...
[  OK  ] Started D-Bus System Message Bus.
[  OK  ] Started Login Service.
[  OK  ] Started Daily apt download activities.
[  OK  ] Started Daily apt upgrade and clean activities.
[  OK  ] Started Regular background program processing daemon.
[  OK  ] Started Set the CPU Frequency Scaling governor.
[  OK  ] Started Daily Cleanup of Temporary Directories.
[  OK  ] Reached target Timers.
         Starting Save/Restore Sound Card State...
[  OK  ] Reached target Host and Network Name Lookups.
[  OK  ] Reached target Network.
         Starting OpenBSD Secure Shell server...
         Starting /etc/rc.local Compatibility...
         Starting Permit User Sessions...
[  OK  ] Started System Logging Service.
[  OK  ] Started /etc/rc.local Compatibility.
[  OK  ] Started Permit User Sessions.
         Starting Set console scheme...
[  OK  ] Started Serial Getty on ttyS0.
[  OK  ] Started Save/Restore Sound Card State.
[  OK  ] Started Set console scheme.
[  OK  ] Created slice system-getty.slice.
[  OK  ] Started Getty on tty1.
[  OK  ] Reached target Login Prompts.
[  OK  ] Started OpenBSD Secure Shell server.
[  OK  ] Started Dispatcher daemon for systemd-networkd.
[  OK  ] Reached target Multi-User System.
[  OK  ] Reached target Graphical Interface.
         Starting Update UTMP about System Runlevel Changes...
[  OK  ] Started Update UTMP about System Runlevel Changes.

Ubuntu 18.04.3 LTS bionic-minimal ttyS0

bionic-minimal login: root
Password: 
Last login: Tue Dec 31 01:15:57 UTC 2019 on ttyS0
Welcome to Ubuntu 18.04.3 LTS (GNU/Linux 5.5.0-rc4-dirty armv7l)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage
                                                  
 _____         _   _               ___             
|  ___|____  _| \ | |_   ___  __  / _ \ _ __   ___ 
| |_ / _ \ \/ /  \| | | | \ \/ / | | | | '_ \ / _ \
|  _| (_) >  <| |\  | |_| |>  <  | |_| | | | |  __/
|_|  \___/_/\_\_| \_|\__,_/_/\_\  \___/|_| |_|\___|
                                                   

Welcome to Ubuntu 18.04.3 LTS
Tuesday, 31 December 2019, 08:11:29 AM
Up time:     0 days, 00:00:19
Free memory: 42004 / 118920 kB
IP:          192.168.1.29


root@bionic-minimal:~# uname -a
Linux bionic-minimal 5.5.0-rc4-dirty #4 SMP Tue Dec 31 16:34:45 KST 2019 armv7l armv7l armv7l GNU/Linux

u-boot 딜레이 약 3초, 커널 약 3초, 우분투의 각종 서비스 기동와 네트웍 접속까지 대략 9초.. 총 16초 정도에 부팅이 된다.

u-boot 딜레이 없애고 build-root를 사용하면 총 6~7초 이내로 어플까지 동작시킬 수 있을것으로 기대한다.

 

현재 LCD, USB 호스트 허브, 이더넷, 멀치 터치스크린, 오디오 출력 등 중요한 것들은 잘 동작한다.

 

두가지 해야할일!

ADC에 연결된 Key pad 드라이버는 voltage level 문제인지 스캔값이 좀 이상하다. 원인 분석 필요!!!

그리고 parallel VGA 카메라 입력은 Kernel 4.18에서만 테스트가 되었다. Kernel 5.5의 Device Tree 수정해서 테스트를 해보아야 한다.

 

커널 소스를 다운로드하고 빌드하는 순서는 다음과 같다. device-driver들은 대부분 built-in이라 module은 따로 빌드/설치하지 않았다.

git clone --depth 1  https://github.com/foxnux/linux.git
cd linux
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- foxnux_defconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j5

 

문제없이 컴파일이 끝나면 zImage와 dtb 파일을 SD카드의 boot 파티션(vfat)에 복사한다.

 sudo cp arch/arm/boot/dts/sun8i-s3-foxnux-one.dtb /media/odroid/BOOT/.
 sudo cp arch/arm/boot/zImage /media/odroid/BOOT/.

 

u-boot이 커널과 DTB를 읽어오는 boot.scr 스크립트의 소스는 boot.cmd이며 그 내용은 아래와 같다.

setenv bootargs console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait panic=10 earlyprintk rw

load mmc 0:1 0x41000000 zImage
load mmc 0:1 0x41800000 sun8i-s3-foxnux-one.dtb

bootz 0x41000000 - 0x41800000

boot.scr은 아래와 같이 mkimage 명령으로 만들고, 마찬가지로 boot 파티션에 복사하면 된다.

mkimage -C none -A arm -T script -d boot.cmd boot.scr

 

boot 파티션에 필요한 파일은 boot.scr, zImage, sun8i-s3-foxnux-one.dtb 이렇개 3개만 있으면 된다.

 

 

추신: 4.18에서 잘 동작하던 카메라가 인식은 되지만 정상동작하지 않는다.

SOC_CAMERA 관련 드라이버가 사라지고 V4L2형식의 드라이버만 지원하는 듯 하다.

좀 더 연구해 보아야 겠다.

 

또 다른 이상현상이 있는데 부팅 후 3~4초 뒤에 아래와 같은 커널 메시지가 거의 항상 보인다.

[    8.464556] random: crng init done
[    8.464573] random: 7 urandom warning(s) missed due to ratelimiting

그런데 random number generator의 seed의 entropy가 부족할때 나타나는 경고인데, 근본적인 원인과 해결방법을 찾고 싶다.

 "haveged"라는 데비안 패키지를 설치하니 더 이상 나타나진 않는다. 빌드루트에도 해당 패키지가 있으니 땜빵 솔루션은 있다.

 

'임베디드' 카테고리의 다른 글

카메라 입력 테스트  (0) 2020.01.03
동영상 재생 테스트  (0) 2020.01.02
CH330N/CH340 Windows 10 드라이버 설치  (0) 2019.12.31
u-boot Ethernet 기능 활성화  (0) 2019.12.25
u-boot 로고 이미지 변경하기  (3) 2019.12.23