YuzukiHD / TinyVision

TinyVision - A Tiny Linux Board / IPC / Server / Router / And so on...
https://yuzukihd.top/TinyVision/#/
GNU Lesser General Public License v2.1
154 stars 19 forks source link

How to enable E907 in tina? #35

Open DeqingSun opened 4 weeks ago

DeqingSun commented 4 weeks ago

Hi I'm using Tina linux-4.9 and the CPU become a bottleneck and I'd like to offload some code to E907. If I understand it correctly, I can edit board.dts and config-4.9. Then I rebuild the image and flash it, I would find remoteproc in /sys/kernel/debug/.

So I manually applied the change in https://github.com/YuzukiHD/TinyVision/commit/89557df74eb3bec611eebcf1abaaf5c00b9b9abb and https://github.com/YuzukiHD/TinyVision/commit/fd6f0b3133735df4ff94761db32029954b557255 I did not add

CONFIG_MEDIA_USB_SUPPORT=y
CONFIG_USB_VIDEO_CLASS=y

because I have no USB device.

However the newly flashed SD card does not show remoteproc in /sys/kernel/debug/. Is there anything I need to do to load the driver or do some trouble shoot?

DeqingSun commented 4 weeks ago

I found some similar tutorial https://forums.100ask.net/t/topic/3151 It seems I need to run m kernel_menuconfig to check the kernel drivers. After doing so the remoteproc appears.

YuzukiTsuru commented 4 weeks ago

https://tinyvision.yuzukihd.top/#/?id=e907-小核开发

DeqingSun commented 4 weeks ago

Thank you for getting back to me.

When I run the following command after putting a e907.elf in lib/firmware

echo e907.elf > /sys/kernel/debug/remoteproc/remoteproc0/firmware
echo start > /sys/kernel/debug/remoteproc/remoteproc0/state

I got error

[  272.781123]  remoteproc0: powering up e907_rproc
[  272.786986]  remoteproc0: Can't finded boot_package head
[  272.793353]  remoteproc0: request_firmware failed from boot_package: -19

It seems triggered by sunxi_find_firmware_storage which refer to an offset in firmware_storages. And sunxi_firmware_read seems reading a specific offset of the /dev/mmcblk0

Does this means I need to flash the e907.elf into a certain address?

Also if I understand correctly, I found 2 issues:

https://github.com/YuzukiHD/TinyVision/commit/89557df74eb3bec611eebcf1abaaf5c00b9b9abb set UART pin to PE0 and PE1 which mismatches the configuration in https://github.com/YuzukiHD/TinyVision/blob/main/kernel/rtos/rtos/source/projects/v851-e907-tinyvision/configs/sys_config.fex

The driver for e907 is not compiled in kernel by default, run m kernel_menuconfig to check the kernel drivers seems necessary.