大破雑記帳

個人用メモな雑記ブログ いろんなことをざっくりと。

realtek target Kernel 5.10移植メモ

一旦色々飛ばしてブートだけするようにした状態

コンパイルエラーになるもの

  • Ethernetドライバ
  • PHYドライバ
  • DSAドライバ

backport試行予定

  • GPIOドライバ (RTL83xx/RTL93xx): linux-next (5.13)
  • SPIドライバ (RTL83xx/RTL93xx): 5.12

現状のbootlog

一旦AML2-17GPにD-Link DGS-1210-16用initramfs-kernelイメージを使用

U-Boot 2011.12.46351 (Mar 14 2014 - 16:33:56)

Board: RTL838x CPU:500MHz LXB:200MHz MEM:300MHz
DRAM:  128 MB
SPI-F: 1x32 MB
Loading 65536B env. variables from offset 0x80000
Switch Model: RTL8382M_INTPHY_8218B_8214FC_DEMO (Port Count: 17)
Switch Chip: RTL8382M
0. [0xbb00a000] 0. val = 0x2f39eb3f
0. [0xbb00a000] 1. val = 0x2f396b3f
0. val = 0x00ffff00
**************************************************
### Error chip ID = 0x0000ffff ###
**************************************************
#### RTL8218B config - MAC ID = 8 ####
Now Internal PHY
**************************************************
#### RTL8218B config - MAC ID = 16 ####
Now External 8218B
**************************************************
**** RTL8214FC config - MAC ID = 24 ****
Now External 8214FC
Net:   Net Initialization Skipped
rtl8380#0
Hit any key to stop autoboot:  0
RTL838x# # rtk network on
Enable network
Force port28 link up 1G
Please wait for PHY init-time ...

RTL838x# # tftp 0x81000000
*** Warning: no boot file name; using '0101A8C0.img'
Using rtl8380#0 device
TFTP from server 192.168.1.111; our IP address is 192.168.1.1
Filename '0101A8C0.img'.
Load address: 0x81000000
Loading: T T T #################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#############################################################
done
Bytes transferred = 5660796 (56607c hex)
RTL838x# # bootm
## Booting kernel from Legacy Image at 81000000 ...
Image Name:   MIPS OpenWrt Linux-5.10.33
Created:      2021-05-05   7:21:40 UTC
Image Type:   MIPS Linux Kernel Image (gzip compressed)
Data Size:    5660732 Bytes = 5.4 MB
Load Address: 80000000
Entry Point:  80000400
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK

Starting kernel ...

[    0.000000] Linux version 5.10.33 (tofu@Tofu-B450HVUS20-Jenkins-Slave) (mips-openwrt-linux-musl-gcc (OpenWrt GCC 8.4.0 r16639-b656199f91) 8.4.0, GNU ld (GNU Binutils) 2.34) #0 Wed May 5 07:21:40 2021
[    0.000000] RTL838X model is 83826800
[    0.000000] SoC Type: RTL8382
[    0.000000] Kernel command line:
[    0.000000] printk: bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019070 (MIPS 4KEc)
[    0.000000] MIPS: machine is D-Link DGS-1210-16
[    0.000000] Registering _machine_restart
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Using appended Device Tree.
[    0.000000] Primary instruction cache 16kB, VIPT, 4-way, linesize 16 bytes.
[    0.000000] Primary data cache 16kB, 2-way, VIPT, cache aliases, linesize 16 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] On node 0 totalpages: 32768
[    0.000000]   Normal zone: 288 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 32768 pages, LIFO batch:7
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 32480
[    0.000000] Kernel command line: console=ttyS0,115200
[    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: 115528K/131072K available (5168K kernel code, 564K rwdata, 1136K rodata, 7140K init, 203K bss, 15544K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 32
[    0.000000] random: get_random_bytes called from start_kernel+0x3c4/0x5b4 with crng_init=0
[    0.000000] timer_probe: no matching timers found
[    0.000000] CPU frequency from device tree: 500MHz
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041786 ns
[    0.000022] sched_clock: 32 bits at 250MHz, resolution 4ns, wraps every 8589934590ns
[    0.008674] Calibrating delay loop... 498.89 BogoMIPS (lpj=2494464)
[    0.075575] pid_max: default: 32768 minimum: 301
[    0.081073] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.089130] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.103385] dyndbg: Ignore empty _ddebug table in a CONFIG_DYNAMIC_DEBUG_CORE build
[    0.117100] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.128019] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.135698] pinctrl core: initialized pinctrl subsystem
[    0.142917] NET: Registered protocol family 16
[    0.276586] clocksource: Switched to clocksource MIPS
[    0.285070] NET: Registered protocol family 2
[    0.291394] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.300837] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.309398] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.317251] TCP: Hash tables configured (established 1024 bind 1024)
[    0.324787] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.332135] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.340473] NET: Registered protocol family 1
[    0.723511] workingset: timestamp_bits=14 max_order=15 bucket_order=1
[    0.739398] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.745781] jffs2: version 2.2 (NAND) (SUMMARY) (ZLIB) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.761661] pinctrl-single bb001000.pinmux: 32 pins, size 4
[    0.870084] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    0.879284] printk: console [ttyS0] disabled
[    0.884091] b8002000.uart: ttyS0 at MMIO 0xb8002000 (irq = 31, base_baud = 12500000) is a 16550A
[    0.893902] printk: console [ttyS0] enabled
[    0.893902] printk: console [ttyS0] enabled
[    0.903237] printk: bootconsole [early0] disabled
[    0.903237] printk: bootconsole [early0] disabled
[    0.915510] b8002100.uart: ttyS1 at MMIO 0xb8002100 (irq = 30, base_baud = 12500000) is a 16550A
[    1.582336] brd: module loaded
[    1.588006] libphy: Fixed MDIO Bus: probed
[    1.598991] NET: Registered protocol family 10
[    1.650862] Segment Routing with IPv6
[    1.655195] NET: Registered protocol family 17
[    1.661106] 8021q: 802.1Q VLAN Support v1.8
[    1.748943] Freeing unused kernel memory: 7140K
[    1.754029] This architecture does not have kernel memory protection.
[    1.761346] Run /init as init process
[    1.765454]   with arguments:
[    1.768849]     /init
[    1.771403]   with environment:
[    1.774917]     HOME=/
[    1.777629]     TERM=linux
[    2.596641] random: fast init done
[    2.799162] init: Console is alive
[    2.828891] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    2.841632] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    2.867257] init: - preinit -
[    3.265727] random: jshn: uninitialized urandom read (4 bytes read)
[    3.388842] random: jshn: uninitialized urandom read (4 bytes read)
mtd_get_mac_ascii: partition u-boot-env not found!
[    3.592951] random: jshn: uninitialized urandom read (4 bytes read)
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[    7.073778] procd: - early -
[    9.430791] procd: - ubus -
[    9.452830] urandom_read: 2 callbacks suppressed
[    9.452849] random: ubusd: uninitialized urandom read (4 bytes read)
[    9.487983] random: ubusd: uninitialized urandom read (4 bytes read)
[    9.496168] random: ubusd: uninitialized urandom read (4 bytes read)
[    9.512895] procd: - init -
Please press Enter to activate this console.
[   10.582497] kmodloader: loading kernel modules from /etc/modules.d/*
[   10.738075] xt_time: kernel timezone is -0000
[   10.815593] kmodloader: done loading kernel modules from /etc/modules.d/*
[   10.866925] urngd: v1.0.2 started.
[   11.025112] random: crng init done
[   11.029082] random: 2 urandom warning(s) missed due to ratelimiting

BusyBox v1.33.0 () built-in shell (ash)

_______                     ________        __
|       |.-----.-----.-----.|  |  |  |.----.|  |_
|   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
|_______||   __|_____|__|__||________||__|  |____|
|__| W I R E L E S S   F R E E D O M
-----------------------------------------------------
OpenWrt SNAPSHOT, r16644-7d10a4c7cb
-----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@OpenWrt:/#