ophub / amlogic-s9xxx-openwrt

Support for OpenWrt in Amlogic, Rockchip and Allwinner boxes. Support a311d, s922x, s905x3, s905x2, s912, s905d, s905x, s905w, s905, s905l, rk3588, rk3568, rk3399, rk3328, h6, etc.
GNU General Public License v2.0
1.78k stars 1.59k forks source link

Beelink-IPC-R(rk3588)支持使用OpenWrt和Armbian #415

Closed gwx11111111 closed 1 year ago

gwx11111111 commented 1 year ago
HI,ophub

       现在我在用amlogic-s9xxx-openwrt的代码,但是烧录了发现开不了机呢?
日志如下:

DDR Version V1.09 20220721
LPDDR4X, 1584MHz
channel[0] BW=16 Col=10 Bk=8 CS0 Row=16 CS1 Row=16 CS=2 Die BW=16 Size=2048MB
 BW=16 Col=10 Bk=8 CS0 Row=16 CS1 Row=16 CS=2 Die BW=16 Size=2048MB
channel[2] BW=16 Col=10 Bk=8 CS0 Row=16 CS1 Row=16 CS=2 Die BW=16 Size=2048MB
channel[3] BW=16 Col=10 Bk=8 CS0 Row=16 CS1 Row=16 CS=2 Die BW=16 Size=2048MB
Manufacturer ID:0x6
change to F1: 528MHz
change to F2: 1068MHz
change to F3: 1560MHz
change to F0: 1584MHz
h
vv3kFK6v&&6V&ailed to set cpub01
Failed to set cpub23
unknown raw ID phN
unrecognized JEDEC id bytes: 00, 00, 00
Trying to boot from MMC2
spl: partition error
Trying fit image at 0x4000 sector
## Verified-boot: 0
## Checking atf-1 0x00040000 ... sha256(806278dba1...) + OK
## Checking uboot 0x00200000 ... sha256(d37588cc6f...) + OK
## Checking fdt 0x0030a190 ... sha256(d32827d3ac...) + OK
## Checking atf-2 0x000f0000 ... sha256(c00c7fd75b...) + OK
## Checking atf-3 0xff100000 ... sha256(71c3a5841b...) + OK
## Checking atf-4 0xff001000 ... sha256(2301cf73be...) + OK
Jumping to U-Boot(0x00200000) via ARM Trusted Firmware(0x00040000)
Total: 348.738 ms

INFO:    Preloader serial: 2
NOTICE:  BL31: v2.3():v2.3-405-gb52c2eadd:derrick.huang
NOTICE:  BL31: Built : 11:23:47, Aug 15 2022
INFO:    spec: 0x1
INFO:    ext 32k is not valid
INFO:    GICv3 without legacy support detected.
INFO:    ARM GICv3 driver initialized in EL3
INFO:    system boots from cpu-hwid-4
INFO:    idle_st=0x21fff, pd_st=0x11fff9, repair_st=0xfff70001
INFO:    dfs DDR fsp_params[0].freq_mhz= 1584MHz
INFO:    dfs DDR fsp_params[1].freq_mhz= 528MHz
INFO:    dfs DDR fsp_params[2].freq_mhz= 1068MHz
INFO:    dfs DDR fsp_params[3].freq_mhz= 1560MHz
INFO:    BL31: Initialising Exception Handling Framework
INFO:    BL31: Initializing runtime services
WARNING: No OPTEE provided by BL2 boot loader, Booting device without OPTEE initialization. SMC`s destined for OPTEE will return SMC_UNK
ERROR:   Error initializing runtime service opteed_fast
INFO:    BL31: Preparing for EL3 exit to normal world
INFO:    Entry point address = 0x200000
INFO:    SPSR = 0x3c9

U-Boot 2017.09-g73cc10cb06-220414 #root (Oct 19 2022 - 16:15:35 +0800)

Model: Radxa ROCK 5B
PreSerial: 2, raw, 0xfeb50000
DRAM:  7.7 GiB
Sysmem: init
Relocation Offset: edb6d000
Relocation fdt: eb9f9e58 - eb9fecc8
CR: M/C/I
Using default environment

no mmc device at slot 1
mmc@fe2c0000: 1 (SD), mmc@fe2e0000: 0
Bootdev(atags): mmc 1
MMC1: Legacy, 52Mhz
PartType: EFI
DM: v2
No misc partition
boot mode: None
FIT: No boot partition
No resource partition
No resource partition
No resource partition
Failed to load DTB, ret=-19
No find valid DTB, ret=-22
Failed to get kernel dtb, ret=-22
In:    serial
Out:   serial
Err:   serial
Model: Radxa ROCK 5B
CLK: (sync kernel. arm: enter 1008000 KHz, init 1008000 KHz, kernel 0N/A)
  b0pll 24000 KHz
  b1pll 24000 KHz
  lpll 24000 KHz
  v0pll 24000 KHz
  aupll 24000 KHz
  cpll 1500000 KHz
  gpll 1188000 KHz
  npll 24000 KHz
  ppll 1100000 KHz
  aclk_center_root 702000 KHz
  pclk_center_root 100000 KHz
  hclk_center_root 396000 KHz
  aclk_center_low_root 500000 KHz
  aclk_top_root 750000 KHz
  pclk_top_root 100000 KHz
  aclk_low_top_root 396000 KHz
No misc partition
Net:   No ethernet found.
Hit key to stop autoboot('CTRL+C'):  0 
switch to partitions #0, OK
mmc1 is current device
** Invalid partition 1 **
switch to partitions #0, OK
mmc0(part 0) is current device
Failed to mount ext2 filesystem...
** Unrecognized filesystem type **
starting USB...
No working controllers found
USB is stopped. Please issue 'usb start' first.
这是为什么呢?
gwx11111111 commented 1 year ago

HI,ophub 上面的测试固件就是 https://github.com/radxa/u-boot.git 的吗?还是radxa的uboot还在编译呢

ophub commented 1 year ago

https://github.com/ophub/amlogic-s9xxx-armbian/commit/480a0087b9893cce0d1eb7abf7de2b5b1647a721 https://github.com/radxa/u-boot.git 的刚更新,正在打包,5分钟后可以测试固件。 https://github.com/ophub/amlogic-s9xxx-openwrt/actions/runs/4698564136

https://github.com/ophub/amlogic-s9xxx-armbian/blob/main/build-armbian/armbian-files/platform-files/rockchip/bootfs/dtb/rockchip/rk3588-nvr-demo-v10-android.dtb

你这个dtb是5.10.100编译的吗?

gwx11111111 commented 1 year ago

是安卓内核5.10.110编译的

ophub commented 1 year ago

你把你的 rk3588-nvr-demo-v10-android.dts 放在 https://github.com/unifreq/linux-5.10.y-rk35xx 这个里编译下看看,5b的 u-boot和kernel用这个现在几个rk3588设备都可以正常运行.

gwx11111111 commented 1 year ago

HI,ophub 如果改内核的dtb不是得改https://github.com/unifreq/linux-5.10.y-rk35xx.git这个仓库的dts吗? 为啥直接放到files/rockchip/bootfs/dtb/rockchip/rk3588-nvr-demo-v10-android.dtb这也可以呢

ophub commented 1 year ago

https://github.com/ophub/amlogic-s9xxx-openwrt/releases/tag/OpenWrt_lede_04.14.0558

用radxa的u-boot重新打包的op,你试试

gwx11111111 commented 1 year ago

好的

gwx11111111 commented 1 year ago

谢谢了

ophub commented 1 year ago

你直接放他就不编译,能不能用忽略了。制作过程只是复制dtb,不管这个文件是不是可以正常使用。

现在u-boot顺利编译,用你的和radxa的都可以编译完成,如果你使用的是rk3588-evb的话现在编译的u-boot就可以使用,过程在上面的帖子都说明了。可能是dtb的问题了。

你放到kernel源码下编译dts,要保障你的这个dtb是可以正常编译,可以和u-boot正常配合使用的。

ophub commented 1 year ago

内核是从f大维护的这个源码仓库提前编译好的文件,制作op时直接使用已经编好的内核文件,省时间。

https://github.com/ophub/kernel/blob/main/.github/workflows/compile-rk3588-kernel.yml

编好的放这个tags下了:

https://github.com/ophub/kernel/releases/tag/kernel_rk3588

在Armbian放的是临时用的:

https://github.com/ophub/amlogic-s9xxx-armbian/tree/main/build-armbian/armbian-files/platform-files/rockchip/bootfs/dtb/rockchip

这里是内核tar解压的文件,在制作op时从内核仓库tags下载最新文件,解压并覆盖上面的同名文件。现在内核tar包里没有你的这个dtb,所以放解压包里,制作op时没有同名文件覆盖,就保留下来了,以后把你的dts也添加到这个内核仓库里以后,这个目录里面的就没用了,每次都会被覆盖了

https://github.com/ophub/amlogic-s9xxx-openwrt/blob/2ad0a3d304967bd54a3669e38887726439ba2076/make#L87

https://github.com/ophub/amlogic-s9xxx-openwrt/blob/2ad0a3d304967bd54a3669e38887726439ba2076/make#L680

https://github.com/ophub/amlogic-s9xxx-openwrt/blob/2ad0a3d304967bd54a3669e38887726439ba2076/make#L720

gwx11111111 commented 1 year ago
HI,ophub
    好的,了解
现在最新的tf卡启动可以开机了,但是一直
[    2.504005] es8311 3-0018: ASoC: error at soc_component_read_no_lock on es8311.3-0018: -6
[    2.504152] es8311 3-0018: ASoC: error at soc_component_read_no_lock on es8311.3-0018: -6
[    2.504299] es8311 3-0018: ASoC: error at soc_component_read_no_lock on es8311.3-0018: -6
[    2.504447] es8311 3-0018: ASoC: error at soc_component_write_no_lock on es8311.3-0018: -6
[    2.504597] es8311 3-0018: ASoC: error at soc_component_read_no_lock on es8311.3-0018: -6
[    2.504744] es8311 3-0018: ASoC: error at soc_component_write_no_lock on es8311.3-0018: -6
[    2.504892] es8311 3-0018: ASoC: error at soc_component_write_no_lock on es8311.3-0018: -6
[    2.505040] es8311 3-0018: ASoC: error at soc_component_write_no_lock on es8311.3-0018: -6
[    2.505884] es8311 3-0018: ASoC: error at soc_component_read_no_lock on es8311.3-0018: -6
[    2.506038] es8311 3-0018: ASoC: error at soc_component_read_no_lock on es8311.3-0018: -6
[    2.509218] ALSA device list:
[    2.509228]   #0: rockchip,dp1
[    2.509234]   #1: rockchip,hdmi0
[    2.509238]   #2: rockchip,es8311
[    2.513022] Freeing unused kernel memory: 7488K
[    2.521967] Run /init as init process
[    2.540201] vendor storage:20190527 ret = 0
[    2.563755] usb 2-1: New USB device found, idVendor=05e3, idProduct=0608, bcdDevice=85.36
[    2.563798] usb 2-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[    2.563814] usb 2-1: Product: USB2.0 Hub
[    2.564655] hub 2-1:1.0: USB hub found
[    2.564993] hub 2-1:1.0: 4 ports detected
[    2.715420] mali fb000000.gpu: Kernel DDK version g15p0-01eac0
[    2.718011] mali fb000000.gpu: bin=0
[    2.718207] mali fb000000.gpu: leakage=21
[    2.718269] debugfs: Directory 'fb000000.gpu-mali' with parent 'vdd_gpu_s0' already present!
[    2.725246] mali fb000000.gpu: pvtm=866
[    2.726339] mali fb000000.gpu: pvtm-volt-sel=3
[    2.726839] mali fb000000.gpu: avs=0
[    2.726927] W : [File] : drivers/gpu/arm/bifrost/platform/rk/mali_kbase_config_rk.c; [Line] : 136; [Func] : kbase_platform_rk_init(); power-off-delay-ms not available.
[    2.738775] mali fb000000.gpu: GPU hardware issue table may need updating:
[    2.738775] r0p0 status 5 is unknown; treating as r0p0 status 0
[    2.738800] mali fb000000.gpu: GPU identified as 0x7 arch 10.8.6 r0p0 status 0
[    2.738845] mali fb000000.gpu: No priority control manager is configured
[    2.738942] mali fb000000.gpu: No memory group manager is configured
[    2.738964] mali fb000000.gpu: Protected memory allocator not available
[    2.739429] mali fb000000.gpu: Capping CSF_FIRMWARE_TIMEOUT to CSF_FIRMWARE_PING_TIMEOUT
[    2.740236] mali fb000000.gpu: Couldn't find power_model DT node matching 'arm,mali-simple-power-model'
[    2.740257] mali fb000000.gpu: Error -22, no DT entry: mali-simple-power-model.static-coefficient = 1*[0]
[    2.740484] mali fb000000.gpu: Error -22, no DT entry: mali-simple-power-model.dynamic-coefficient = 1*[0]
[    2.740649] mali fb000000.gpu: Error -22, no DT entry: mali-simple-power-model.ts = 4*[0]
[    2.740814] mali fb000000.gpu: Error -22, no DT entry: mali-simple-power-model.thermal-zone = ''
[    2.743178] mali fb000000.gpu: Using configured power model mali-lodx-power-model, and fallback mali-simple-power-model
[    2.743386] mali fb000000.gpu: l=10000 h=85000 hyst=5000 l_limit=0 h_limit=800000000 h_table=0
[    2.762016] mali fb000000.gpu: Probed as mali0
卡在这里
ophub commented 1 year ago

https://github.com/ophub/amlogic-s9xxx-armbian/releases/tag/Armbian_bullseye_04.14.0709

rock5b一直想要gpu还使用不上,op卡这了,你下载上面的armbian试试,刷tf卡启动看看什么情况。下载名字里带ipc-r的文件。

gwx11111111 commented 1 year ago

好的

gwx11111111 commented 1 year ago

下载上面的armbian也是一样卡在gpu这里了

ophub commented 1 year ago

好的,这个问题我没遇到过,我问问f大这怎么解决。

gwx11111111 commented 1 year ago

好的,谢谢!

ophub commented 1 year ago

我猜测可能是dtb的问题,gpu在op里没用,在armbian里现在rock5b官方还在开发中没用上,所以要使用gpu应该是你dtb触发的,但是现在内核里没有。 你把你的dts放f大的内核仓库调试下,这个dts关联的几个文件和他的内核仓库调试下。

https://github.com/unifreq/linux-5.10.y-rk35xx

gwx11111111 commented 1 year ago

好的,我再研究研究

gwx11111111 commented 1 year ago

hi,ophub armbian和openwrt改了dtb,armbian现在好像能开机了,但是以太网不能用 image; openwrt用一样的dtb image 卡在这里,好像以太网也是不能用的,这是为啥呢

ophub commented 1 year ago

你有USB转千兆网卡接一个,应该USB网卡可以正常工作。

板载网卡不能工作说明dtb里网卡节点设置的不正确。

你的网卡是千兆还是2.5g的,和rock5b那些用的不同?你看内核源码里驱动有没有

gwx11111111 commented 1 year ago

dtb网卡节点已经改成了我们的配置了的,和rock5b是不一样 ,看了内核也有驱动的drivers/net/phy/realtek.c驱动是这个文件

ophub commented 1 year ago

https://github.com/unifreq/linux-5.10.y-rk35xx

把你的相关文件放进去,make munuconfig把驱动等选择好,编译一个内核

可以用下面这个仑库的actions编: https://github.com/ophub/kernel

这个config换成你make munuconfig改好的.config更名为config-5.10覆盖这个模板 https://github.com/ophub/kernel/blob/main/kernel-config/rk3588/config-5.10

编内核actions https://github.com/ophub/kernel/blob/main/.github/workflows/compile-rk3588-kernel.yml

编译前先给编译仓库添加token,不然最后一步没有权限上传到releases里。看1-3这几节的添加方法: https://github.com/ophub/amlogic-s9xxx-armbian/blob/main/build-armbian/documents/README.cn.md

gwx11111111 commented 1 year ago

好的

gwx11111111 commented 1 year ago

HI,ophub 我这边fork你们的仓库,改成了我自己的仓库编译,好像编译出来的openwrt固件有问题呢?改cang仓库的代码如下 image image image 编译出来的固件比你编译出来的小几十M 这是我编译出来的固件 https://github.com/gwx11111111/amlogic-s9xxx-openwrt/releases/download/OpenWrt_lede_04.15.1319/openwrt_lede_rockchip_ipc-r_k5.10.110_2023.04.15.img.gz

gwx11111111 commented 1 year ago

HI,ophub 我看了一下内核编译,好像有报错 image 为什么有报错也能编译成功呢?

gwx11111111 commented 1 year ago

HI,ophub rk3588编译openwrt时下面的这个tags要选择那个呢?还是3个都可以的

image

ophub commented 1 year ago

对rk3588这个选项无效,rk3588只会从kernel_rk3588下载。所以可以任选一个。

ophub commented 1 year ago

编译内核的错误往前再看,日志一千行就退出了不对,日志应该有几万行才能编完

gwx11111111 commented 1 year ago

好的,我查一下代码先

gwx11111111 commented 1 year ago

HI,ophub 为什么eth0网卡会进入禁用状态的呢?目前dts已经配置好板子的网卡了,看内核的编译日志驱动realtek.o也有编译出来; 配置好的2个网卡都有跑: image 但是到最后eth0就进入了禁用状态 image 这是为什么知道吗

gwx11111111 commented 1 year ago

HI,ophub 还有现在开机能连接上以太网,但是一会就断开了,还有openwrt还是不能开机成功,这是为啥呢 image openwrt现在还是一直卡在这 image

gwx11111111 commented 1 year ago

Hi,ophub 现在我接了个usb网卡, 但是还是不能进到命令行里面呢? image 还是卡在这里呢

ophub commented 1 year ago

错误还是dts里phy配置不对。

你可以先拿armbian测试,这个相当于是电脑,每个网口默认是独立的,只要网卡工作正常接入其中一个就可以上网了。

openwrt到时候得添加多网卡设置,例如在openwrt系统的 /etc/board.d/ 目录下添加网卡设置: https://github.com/unifreq/openwrt_packit/tree/master/files/rk3568/r68s/board.d

你可以把armbian和openwrt的启动认为是完全相同的设置。所以u-boot和dtb正确的情况下,armbian可以正常启动和工作了,openwrt也就可以了,两个系统的差异化设置好弄。

gwx11111111 commented 1 year ago

好的,我重新编译一个openwrt和armbian先看看

gwx11111111 commented 1 year ago

HI,ophub 我现在把板子自带的网卡都关闭了,现在插上usb网卡还是连接上后有关闭了,感觉这不像是dts配置的问题了 image

ophub commented 1 year ago

https://forum.openwrt.org/t/interface-goes-up-and-down-continously/122106

你的问题和你一样的网卡(Realtek Chip, Driver = Generic FE-GE Realtek PHY r8169) ,一样的症状。他们的反馈是线缆的兼容性问题。帖子里的人建议使用交换机,提问的人反馈他更换电缆后不再这样掉线了。

还有桥接设置的问题: https://openwrt-devel.openwrt.narkive.com/XHDYKsek/how-does-openwrt-start-network

https://github.com/openwrt/openwrt/issues/9440

gwx11111111 commented 1 year ago

HI,ophub armbian目前接上网线是有up的,没出现掉线的日志,也能进到命令行 image openwrt用和armbian一样的dts, 但是还是一样up后就掉线了,并且不能进入到命令行一直卡在下面 image 因为uboot和dts都一样的,只有openwrt有问题,说明是openwrt系统的问题了; 还有我发现在ubuntu上armbian可以查看ROOTFS的文件夹的,但是openwrt的话 查看不了ROOTFS的文件夹,是不是openwrt的ROOTFS有问题呢?

gwx11111111 commented 1 year ago

armbian的ROOTFS: image openwrt的ROOTFS: image

unifreq commented 1 year ago

rk3588内置千兆网卡的驱动好象不支持promisc模式,因此在op固件里做不了lan口,只能做wan口,这种情况在h88k上曾经遇到过。解决办法暂时没有。

gwx11111111 commented 1 year ago

那不能进入到登陆用户的地方呢

gwx11111111 commented 1 year ago

像进入到 image 这里

ophub commented 1 year ago

楼上的 unifreq 就是网络上大家习惯叫的 f 大(flippy),我的armbian和openwrt所知道的都是和他学习的。这2个系统的boot引导分区的设置都是遵循的他的标准。

openwrt的这个欢迎界面是默认跑码完后是不显示的,接USB键盘一回车就看到banner了

gwx11111111 commented 1 year ago

HI,ophub 好的,了解; 但是按键盘回车没有效果,armbian按回车是可以进入banner的

ophub commented 1 year ago

armbian第一次进来也看不到banner,是一个修改密码的提示界面,root和1234进去后修改了密码,再次进入的时候就是欢迎banner了。

openwrt如果用不了这个网卡,可能产品设计上要换支持的网卡?这么多网卡,换2.5G的比较香,你是beelink的工作人员?

unifreq commented 1 year ago

可能是askffirst进程没起来,要检查/etc/inittab文件 rk3588一般是这样的: ::sysinit:/etc/init.d/rcS S boot ::shutdown:/etc/init.d/rcS K shutdown tty1::askfirst:/usr/libexec/login.sh ttyS2::askfirst:/usr/libexec/login.sh ttyFIQ0::askfirst:/usr/libexec/login.sh

gwx11111111 commented 1 year ago

hi,unifreq 进不了命令行,怎么检查呢

unifreq commented 1 year ago

那只能检查打包的固件,你们用哪个固件改的?

gwx11111111 commented 1 year ago

那固件怎么解包有方法吗

ophub commented 1 year ago

boot文件: https://github.com/ophub/amlogic-s9xxx-armbian/tree/main/build-armbian/armbian-files/different-files/ipc-r/bootfs

u-boot文件: https://github.com/ophub/amlogic-s9xxx-armbian/tree/main/build-armbian/u-boot/rockchip/ipc-r

配置文件: (r103) https://github.com/ophub/amlogic-s9xxx-armbian/blob/main/build-armbian/armbian-files/common-files/etc/model_database.conf

openwrt使用rootfs.tar.gz ,修改的部分(需要个性化修改的文件,在你fork的仓库的这个目录里,直接修改放进去,打包就是你修改的,文件路径是openwrt的根目录): https://github.com/ophub/amlogic-s9xxx-openwrt/tree/main/make-openwrt/openwrt-files/common-files

unifreq commented 1 year ago

用linux解包,losetup -fP img文件名 lsblk会发现/dev/loopX 设备,然后把loopXp2挂载到一个空白目录即可 例如mount /dev/loop0p2 /mnt