总结
Rk3566的emmc接口最高支持hs200 (200MHz SDR)
HPS SD/eMMC Timing Characteristics
可以看到, DataStrobe是一个 emmc颗粒向rk3566主控发送的信号,而且只有在hs400模式下启用. 因此rk3566的datastrobe没有任何作用可以不接.
全員が等しく 不幸の世界を見せてやる!
Rk3566的emmc接口最高支持hs200 (200MHz SDR)
HPS SD/eMMC Timing Characteristics
可以看到, DataStrobe是一个 emmc颗粒向rk3566主控发送的信号,而且只有在hs400模式下启用. 因此rk3566的datastrobe没有任何作用可以不接.
设备:rk3566
emmc:8GB/32GB Sandisk emmc
Host: Ubuntu22.04(24.04's qemu has problem when creating ubuntu base rootfs, so skip it)
参考: 【每周学习摘要06(23/10/27-23/11/10)】
Image
, ko
and dtb
files,TBD
boot.img包含kernel以及设备树等,以及uboot保存的env(saveenv)
预留63M
空间足以(未压缩的Image最大50MiB), 如果要更大,请修改parameter.txt
以防止烧录时干涉rootfs分区
touch boot.img
dd if=/dev/zero of=boot.img bs=1M count=63
sync
mkfs.fat boot.img
sync
sudo mount boot.img /mnt
sudo cp -a -r boot/* /mnt
sync
sudo umount /mnt
地址:https://cdimage.ubuntu.com/ubuntu-base/releases/jammy/release/
wget https://cdimage.ubuntu.com/ubuntu-base/releases/jammy/release/ubuntu-base-22.04.5-base-arm64.tar.gz
mkdir rootfs && tar --same-owner -xf ubuntu-base-22.04.5-base-arm64.tar.gz -C rootfs
Note you shall
添加dns解析
echo nameserver 114.114.114.114 > rootfs/etc/resolv.conf
以及apt源(vim rootfs/etc/apt/source.list
)
deb [trusted=yes] http://mirrors.aliyun.com/ubuntu-ports/ jammy main restricted
deb [trusted=yes] http://mirrors.aliyun.com/ubuntu-ports/ jammy-updates main restricted
deb [trusted=yes] http://mirrors.aliyun.com/ubuntu-ports/ jammy universe
deb [trusted=yes] http://mirrors.aliyun.com/ubuntu-ports/ jammy-updates universe
deb [trusted=yes] http://mirrors.aliyun.com/ubuntu-ports/ jammy multiverse
deb [trusted=yes] http://mirrors.aliyun.com/ubuntu-ports/ jammy-updates multiverse
deb [trusted=yes] http://mirrors.aliyun.com/ubuntu-ports/ jammy-backports main restricted universe multiverse
deb [trusted=yes] http://mirrors.aliyun.com/ubuntu-ports/ jammy-security main restricted
deb [trusted=yes] http://mirrors.aliyun.com/ubuntu-ports/ jammy-security universe
deb [trusted=yes] http://mirrors.aliyun.com/ubuntu-ports/ jammy-security multiverse
进入环境后更新apt 源并且下载必要包
sudo chroot rootfs
apt update
apt upgrade
apt install vim sudo kmod net-tools ethtool ifupdown language-pack-en-base rsyslog htop iputils-ping udev systemd network-manager -y
change passwd for root
passwd root
create user meta
adduser meta
add meta to sudoers
chmod +w /etc/sudoers
vim /etc/sudoers
on line 44
# User privilege specification
root ALL=(ALL:ALL) ALL
meta ALL=(ALL:ALL) ALL
Finally pack it
return to the father of rootfs
directory.
Create a rootfs.img
buffer with 1G size
shrink its size by e2fsck
and resize2fs
touch rootfs.img
dd if=/dev/zero of=rootfs.img bs=1M count=900
sync
mkfs.ext4 rootfs.img
sudo mount rootfs.img /mnt
sudo cp -a -r rootfs/* /mnt
sync
sudo umount /mnt
e2fsck -f -p rootfs.img
resize2fs -M rootfs.img
You can adjust count in the second command by check fs usage by mounting it to /mnt
and then check df -h
. To achieve a smaller image size, better make the Available space to be less than 50M.
example:
➜ my-emmc-image df -h
Filesystem Size Used Avail Use% Mounted on
tmpfs 6.3G 2.2M 6.3G 1% /run
/dev/nvme1n1p3 60G 31G 27G 54% /
tmpfs 32G 148M 32G 1% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
efivarfs 268K 144K 120K 55% /sys/firmware/efi/efivars
/dev/nvme0n1p1 256M 49M 208M 19% /boot/efi
tmpfs 6.3G 64K 6.3G 1% /run/user/1000
/dev/nvme0n1p5 480G 405G 51G 89% /media/ztn/4ca5df7c-065c-4b2b-b868-bab13a2816b0
/dev/loop10 868M 783M 24M 98% /mnt
TBD, both kernel and user space
TBD, only mali so libs
if you want to accesss net after connecting to ZJUWLAN but lacks of a webbrowser to authenticate, you can use
https://github.com/Mythologyli/zju-web-login
First install python3
apt install python3
then follow https://pip.pypa.io/en/stable/installation/ to install pip
By using host's system's wget, we can get rid of downloading wget
and its dependency.
su meta
cd ~
wget https://bootstrap.pypa.io/get-pip.py
python3 get-pip.py
In order to shrink the rootfs size, don't install git
but rather clone by downloading.
Again, by using host's system's wget, to avoid downloading wget and its dependency. Then unzip it.
wget https://github.com/Mythologyli/zju-web-login/archive/refs/heads/master.zip
unzip master.zip
cd master
pip3 install -r requirements.txt
after adding, use command sudo depmod -a
to build a tree where you can call modprobe to find your module.
Line5:
# swap to uart2 by tz61 25/02/14
console=ttyS2,115200
Line112
; swap to uart2 debug by tz61. 25/02/14
[uart_para]
uart_debug_port = 2
;uart_debug_tx = port:PF02<3><1><default><default>
;uart_debug_rx = port:PF04<3><1><default><default>
uart_debug_tx = port:PB00<2><1><default><default>
uart_debug_rx = port:PB01<2><1><default><default>
[force_uart_para]
force_uart_port = 2
;force_uart_tx = port:PF02<3><1><default><default>
;force_uart_rx = port:PF04<3><1><default><default>
force_uart_tx = port:PB00<2><1><default><default>
force_uart_rx = port:PB01<2><1><default><default>
目录:drivers/staging/fbtft
其中文件分为核心驱动与面板驱动
fbtft-core.c
, fbtft-bus.c
, fbtft-sysfs.c
, fbtft-io.c
, fbtft.h
fb_st7789v.c
write_reg -> fbtftops.write_register
fbtftops.write_register -> fbtft_write_reg8_bus8 -> fbtft_write_buf_dc -> fbtftops.write
fbtft_update_display -> fbtftops.write_vmem -> fbtft_write_vmem16_bus8 -> fbtftops.write
reg,value对本质上就是两个u8参数.
用于覆盖默认的ops
这个是更新整个屏幕的核心函数,首先调用特定的display驱动的set_addr_win,来指定行列起始(x start/end; y start/end)
在设置完起始后write_reg(par, MIPI_DCS_WRITE_MEMORY_START);
来直接写入屏幕的VRAM
流程图如下(MIPI_DCS_WRITE_MEMORY_START)(0x2C)(RAMWR)
deferred_io 每次调用会回调fbtftops.update_display
来更新屏幕. deferred_io 是整个驱动的上层接口
见https://docs.kernel.org/fb/deferred_io.html
TBD
TBD
在fbtft.h
有一个FBTFT_REGISTER_DRIVER
宏,在每个display驱动里面调用这个.
一开始只有accel的代码
这个是注册驱动后,irq中断次数(iio的bmi088挂载在spi4(fecb0000节点下面)
因为linux-header包里面含有/lib/modules/build
,指向header安装的根目录
所以通过一个简单的makefile
obj-m += xxxx.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
就能直接得到ko模块
用msvc编译后(之所以不用mingw是因为 HLS Csim用的是一个老的mingw,如果你用新的编译很麻烦)
编译完后dll丢进D:\Xilinx\Vitis_HLS\2022.2\tps\win64\msys64\mingw64\bin
然后HLS project里面设置Ldflags 为lib导入库SDL2d.lib
还有SDL2maind.lib
如果不想用SDL_main(),在include SDL2.h之前设置
"And I am not frightened of dying, any time will do, I
don't mind. Why should I be frightened of dying?
There's no reason for it, you've gotta go sometime."
"I never said I was frightened of dying."