Allow LINUX_KERNEL_TYPE=tiny to be built on qemuarm64.

Reduces size of kernel Image from 20MB to 9MB using reference config.

Bootlog:

[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x411fd070]
[    0.000000] Linux version 5.15.14-yocto-tiny (oe-user@oe-host) 
(aarch64-poky-linux-gcc (GCC) 11.2.0, GNU ld (GNU Binutils) 2.37.20210721) #1 
SMP PREEMPT Thu Jan 13 04:02:36 UTC 2022
[    0.000000] Machine model: linux,dummy-virt
[    0.000000] Memory limited to 256MB
[    0.000000] efi: UEFI not found.
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000040000000-0x000000004fffffff]
[    0.000000]   DMA32    empty
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000040000000-0x000000004fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000040000000-0x000000004fffffff]
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: PSCIv0.2 detected in firmware.
[    0.000000] psci: Using standard PSCI v0.2 function IDs
[    0.000000] psci: Trusted OS migration not required
[    0.000000] percpu: Embedded 16 pages/cpu s25432 r8192 d31912 u65536
[    0.000000] Detected PIPT I-cache on CPU0
[    0.000000] CPU features: detected: Spectre-v2
[    0.000000] CPU features: detected: Spectre-v4
[    0.000000] CPU features: detected: ARM erratum 832075
[    0.000000] CPU features: detected: ARM errata 1165522, 1319367, or 1530923
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 64512
[    0.000000] Kernel command line: root=/dev/vda rw  mem=256M 
ip=192.168.7.4::192.168.7.3:255.255.255.0::eth0:off:8.8.8.8 console=ttyAMA0 
console=hvc0
[    0.000000] Dentry cache hash table entries: 32768 (order: 6, 262144 bytes, 
linear)
[    0.000000] Inode-cache hash table entries: 16384 (order: 5, 131072 bytes, 
linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 246208K/262144K available (5760K kernel code, 784K 
rwdata, 1576K rodata, 1024K init, 326K bss, 15936K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000] rcu:     RCU event tracing is enabled.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=4.
[    0.000000]  Trampoline variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 
jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] Root IRQ handler: gic_handle_irq
[    0.000000] GICv2m: range[mem 0x08020000-0x08020fff], SPI[80:143]
[    0.000000] random: get_random_bytes called from start_kernel+0x3d0/0x628 
with crng_init=0
[    0.000000] arch_timer: cp15 timer(s) running at 62.50MHz (virt).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff 
max_cycles: 0x1cd42e208c, max_idle_ns: 881590405314 ns
[    0.000105] sched_clock: 56 bits at 62MHz, resolution 16ns, wraps every 
4398046511096ns
[    0.007727] Console: colour dummy device 80x25
[    0.009317] Calibrating delay loop (skipped), value calculated using timer 
frequency.. 125.00 BogoMIPS (lpj=250000)
[    0.009502] pid_max: default: 32768 minimum: 301
[    0.011186] Mount-cache hash table entries: 512 (order: 0, 4096 bytes, 
linear)
[    0.011252] Mountpoint-cache hash table entries: 512 (order: 0, 4096 bytes, 
linear)
[    0.039464] /cpus/cpu-map: empty cluster
[    0.050167] rcu: Hierarchical SRCU implementation.
[    0.053712] EFI services will not be available.
[    0.055150] smp: Bringing up secondary CPUs ...
[    0.063065] Detected PIPT I-cache on CPU1
[    0.066324] CPU1: Booted secondary processor 0x0000000001 [0x411fd070]
[    0.083365] Detected PIPT I-cache on CPU2
[    0.084264] CPU2: Booted secondary processor 0x0000000002 [0x411fd070]
[    0.090920] Detected PIPT I-cache on CPU3
[    0.092074] CPU3: Booted secondary processor 0x0000000003 [0x411fd070]
[    0.095353] smp: Brought up 1 node, 4 CPUs
[    0.095648] SMP: Total of 4 processors activated.
[    0.095889] CPU features: detected: 32-bit EL0 Support
[    0.097045] CPU features: detected: CRC32 instructions
[    0.105713] CPU: All CPU(s) started at EL1
[    0.106600] alternatives: patching kernel code
[    0.145248] devtmpfs: initialized
[    0.182216] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, 
max_idle_ns: 7645041785100000 ns
[    0.182756] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[    0.186134] DMI not present or invalid.
[    0.193390] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.200324] DMA: preallocated 128 KiB GFP_KERNEL pool for atomic allocations
[    0.200629] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA pool for atomic 
allocations
[    0.200761] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA32 pool for atomic 
allocations
[    0.205730] ASID allocator initialised with 65536 entries
[    0.205981] Serial: AMBA PL011 UART driver
[    0.245235] 9000000.pl011: ttyAMA0 at MMIO 0x9000000 (irq = 47, base_baud = 
0) is a PL011 rev1
[    0.255985] printk: console [ttyAMA0] enabled
[    0.354051] iommu: Default domain type: Translated
[    0.354371] iommu: DMA domain TLB invalidation policy: strict mode
[    0.356797] vgaarb: loaded
[    0.359924] SCSI subsystem initialized
[    0.361219] usbcore: registered new interface driver usbfs
[    0.362709] usbcore: registered new interface driver hub
[    0.363212] usbcore: registered new device driver usb
[    0.364144] pps_core: LinuxPPS API ver. 1 registered
[    0.364345] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo 
Giometti <[email protected]>
[    0.364717] PTP clock support registered
[    0.383530] clocksource: Switched to clocksource arch_sys_counter
[    0.473183] NET: Registered PF_INET protocol family
[    0.476165] IP idents hash table entries: 4096 (order: 3, 32768 bytes, 
linear)
[    0.486396] tcp_listen_portaddr_hash hash table entries: 256 (order: 0, 4096 
bytes, linear)
[    0.487278] TCP established hash table entries: 2048 (order: 2, 16384 bytes, 
linear)
[    0.487734] TCP bind hash table entries: 2048 (order: 3, 32768 bytes, linear)
[    0.488089] TCP: Hash tables configured (established 2048 bind 2048)
[    0.489933] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.490386] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.493290] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.503104] RPC: Registered named UNIX socket transport module.
[    0.503347] RPC: Registered udp transport module.
[    0.503467] RPC: Registered tcp transport module.
[    0.503579] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.503828] PCI: CLS 0 bytes, default 64
[    0.516042] workingset: timestamp_bits=62 max_order=16 bucket_order=0
[    0.547737] NFS: Registering the id_resolver key type
[    0.549141] Key type id_resolver registered
[    0.549304] Key type id_legacy registered
[    0.552567] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 
250)
[    0.552926] io scheduler mq-deadline registered
[    0.553171] io scheduler kyber registered
[    0.559454] pci-host-generic 4010000000.pcie: host bridge /pcie@10000000 
ranges:
[    0.560699] pci-host-generic 4010000000.pcie:       IO 
0x003eff0000..0x003effffff -> 0x0000000000
[    0.561649] pci-host-generic 4010000000.pcie:      MEM 
0x0010000000..0x003efeffff -> 0x0010000000
[    0.561938] pci-host-generic 4010000000.pcie:      MEM 
0x8000000000..0xffffffffff -> 0x8000000000
[    0.563091] pci-host-generic 4010000000.pcie: Memory resource size exceeds 
max for 32 bits
[    0.563887] pci-host-generic 4010000000.pcie: ECAM at [mem 
0x4010000000-0x401fffffff] for [bus 00-ff]
[    0.565617] pci-host-generic 4010000000.pcie: PCI host bridge to bus 0000:00
[    0.566035] pci_bus 0000:00: root bus resource [bus 00-ff]
[    0.566264] pci_bus 0000:00: root bus resource [io  0x0000-0xffff]
[    0.566430] pci_bus 0000:00: root bus resource [mem 0x10000000-0x3efeffff]
[    0.567091] pci_bus 0000:00: root bus resource [mem 
0x8000000000-0xffffffffff]
[    0.569360] pci 0000:00:00.0: [1b36:0008] type 00 class 0x060000
[    0.575448] pci 0000:00:01.0: [1af4:1005] type 00 class 0x00ff00
[    0.575935] pci 0000:00:01.0: reg 0x10: [io  0x0000-0x001f]
[    0.576192] pci 0000:00:01.0: reg 0x20: [mem 0x00000000-0x00003fff 64bit 
pref]
[    0.577373] pci 0000:00:02.0: [1b36:000d] type 00 class 0x0c0330
[    0.577580] pci 0000:00:02.0: reg 0x10: [mem 0x00000000-0x00003fff 64bit]
[    0.579551] pci 0000:00:03.0: [1af4:1050] type 00 class 0x038000
[    0.579758] pci 0000:00:03.0: reg 0x14: [mem 0x00000000-0x00000fff]
[    0.579943] pci 0000:00:03.0: reg 0x20: [mem 0x00000000-0x00003fff 64bit 
pref]
[    0.584454] pci 0000:00:01.0: BAR 4: assigned [mem 0x8000000000-0x8000003fff 
64bit pref]
[    0.585022] pci 0000:00:02.0: BAR 0: assigned [mem 0x8000004000-0x8000007fff 
64bit]
[    0.585291] pci 0000:00:03.0: BAR 4: assigned [mem 0x8000008000-0x800000bfff 
64bit pref]
[    0.585511] pci 0000:00:03.0: BAR 1: assigned [mem 0x10000000-0x10000fff]
[    0.585698] pci 0000:00:01.0: BAR 0: assigned [io  0x1000-0x101f]
[    0.587871] pci 0000:00:02.0: enabling device (0000 -> 0002)
[    0.601053] virtio-pci 0000:00:01.0: enabling device (0000 -> 0003)
[    0.604895] virtio-pci 0000:00:03.0: enabling device (0000 -> 0002)
[    0.621515] [drm] pci: virtio-gpu-pci detected at 0000:00:03.0
[    0.622520] [drm] features: -virgl +edid -resource_blob -host_visible
[    0.623067] random: fast init done
[    0.626111] random: crng init done
[    0.629956] [drm] number of scanouts: 1
[    0.630134] [drm] number of cap sets: 0
[    0.654903] [drm] Initialized virtio_gpu 0.1.0 0 for virtio3 on minor 0
[    0.716373] virtio_gpu virtio3: [drm] drm_plane_enable_fb_damage_clips() not 
called
[    0.767855] Console: switching to colour frame buffer device 128x48
[    0.793492] virtio_gpu virtio3: [drm] fb0: virtio_gpudrmfb frame buffer 
device
[    0.799671] cacheinfo: Unable to detect cache hierarchy for CPU 0
[    0.820170] brd: module loaded
[    0.845200] virtio_blk virtio0: [vda] 22268 512-byte logical blocks (11.4 
MB/10.9 MiB)
[    0.878366] xhci_hcd 0000:00:02.0: xHCI Host Controller
[    0.879511] xhci_hcd 0000:00:02.0: new USB bus registered, assigned bus 
number 1
[    0.885819] xhci_hcd 0000:00:02.0: hcc params 0x00087001 hci version 0x100 
quirks 0x0000000000000010
[    0.899982] hub 1-0:1.0: USB hub found
[    0.901162] hub 1-0:1.0: 4 ports detected
[    0.908986] xhci_hcd 0000:00:02.0: xHCI Host Controller
[    0.909162] xhci_hcd 0000:00:02.0: new USB bus registered, assigned bus 
number 2
[    0.909419] xhci_hcd 0000:00:02.0: Host supports USB 3.0 SuperSpeed
[    0.910829] usb usb2: We don't know the algorithms for LPM for this host, 
disabling LPM.
[    0.913705] hub 2-0:1.0: USB hub found
[    0.914138] hub 2-0:1.0: 4 ports detected
[    0.924386] rtc-pl031 9010000.pl031: registered as rtc0
[    0.924946] rtc-pl031 9010000.pl031: setting system clock to 
2022-01-27T19:55:25 UTC (1643313325)
[    0.928230] usbcore: registered new interface driver usbhid
[    0.928405] usbhid: USB HID core driver
[    0.940553] NET: Registered PF_INET6 protocol family
[    0.968191] Segment Routing with IPv6
[    0.968627] In-situ OAM (IOAM) with IPv6
[    0.969455] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    0.974404] NET: Registered PF_PACKET protocol family
[    0.976095] Key type dns_resolver registered
[    0.977583] NET: Registered PF_VSOCK protocol family
[    0.988876] printk: console [netcon0] enabled
[    0.989063] netconsole: network logging started
[    1.041136] IP-Config: Complete:
[    1.041584]      device=eth0, hwaddr=52:54:00:12:34:04, ipaddr=192.168.7.4, 
mask=255.255.255.0, gw=192.168.7.3
[    1.043089]      host=192.168.7.4, domain=, nis-domain=(none)
[    1.043628]      bootserver=255.255.255.255, rootserver=255.255.255.255, 
rootpath=
[    1.043835]      nameserver0=8.8.8.8
[    1.184446] usb 1-1: new high-speed USB device number 2 using xhci_hcd
[    1.249259] EXT4-fs (vda): recovery complete
[    1.253360] EXT4-fs (vda): mounted filesystem with ordered data mode. Opts: 
(null). Quota mode: disabled.
[    1.254218] VFS: Mounted root (ext4 filesystem) on device 254:0.
[    1.258140] devtmpfs: mounted
[    1.293410] Freeing unused kernel memory: 1024K
[    1.311148] Run /sbin/init as init process
[    1.381864] input: QEMU QEMU USB Tablet as 
/devices/platform/4010000000.pcie/pci0000:00/0000:00:02.0/usb1/1-1/1-1:1.0/0003:0627:0001.0001/input/input0
[    1.383627] hid-generic 0003:0627:0001.0001: input: USB HID v0.01 Mouse 
[QEMU QEMU USB Tablet] on usb-0000:00:02.0-1/input0
INIT: version 3.01 booting
[    1.511666] usb 1-2: new high-speed USB device number 3 using xhci_hcd
[    1.686137] input: QEMU QEMU USB Keyboard as 
/devices/platform/4010000000.pcie/pci0000:00/0000:00:02.0/usb1/1-2/1-2:1.0/0003:0627:0001.0002/input/input1
[    1.752883] hid-generic 0003:0627:0001.0002: input: USB HID v1.11 Keyboard 
[QEMU QEMU USB Keyboard] on usb-0000:00:02.0-2/input0
[    1.888713] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Starting udev
[    3.472356] udevd[86]: starting version 3.2.10
[    3.575386] udevd[87]: starting eudev-3.2.10
[    5.305739] EXT4-fs (vda): re-mounted. Opts: (null). Quota mode: disabled.
INIT: Entering runlevel: 5
Configuring network interfaces... ip: RTNETLINK answers: File exists
Starting syslogd/klogd: done

Poky (Yocto Project Reference Distro) 
3.4+snapshot-50409b5f1bef8670efad7126e6be564ffbbdec98 qemuarm64 /dev/ttyAMA0

qemuarm64 login:root
root@qemuarm64:~# uname -ar
Linux qemuarm64 5.15.14-yocto-tiny #1 SMP PREEMPT Thu Jan 13 04:02:36 UTC 2022 
aarch64 GNU/Linux

Signed-off-by: Alejandro Enedino Hernandez Samaniego <[email protected]>
---
 bsp/qemuarm64/qemuarm64-tiny.scc | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 bsp/qemuarm64/qemuarm64-tiny.scc

diff --git a/bsp/qemuarm64/qemuarm64-tiny.scc b/bsp/qemuarm64/qemuarm64-tiny.scc
new file mode 100644
index 00000000..0ec933dc
--- /dev/null
+++ b/bsp/qemuarm64/qemuarm64-tiny.scc
@@ -0,0 +1,14 @@
+# SPDX-License-Identifier: MIT
+define KMACHINE qemuarm64
+define KTYPE tiny
+define KARCH arm64
+
+include ktypes/tiny/tiny.scc
+branch qemuarm64
+
+include cfg/virtio.scc
+include cfg/fs/ext4.scc
+include qemuarm64.scc
+
+# enable the ability to run 32 bit apps
+include arch/arm/32bit-compat.scc
\ No newline at end of file
-- 
2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#10892): 
https://lists.yoctoproject.org/g/linux-yocto/message/10892
Mute This Topic: https://lists.yoctoproject.org/mt/88730738/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to