OpenHarmony on rk3568使能can
Env
OH: v3.2.3
chip: rk3568
Content
首先查看源码中是否具有CAN_ROCKCHIP
选项:
❯ find -name "Kconfig" -exec grep -n "CAN_ROCKCHIP" {} + |
发现什么都没有..好吧,那看到官方的rk3568的补丁并没有打到这里,需要自己进行适配。
去rockchip的kernel仓库找到关于can的部分:https://github.com/rockchip-linux/kernel/blob/develop-5.10/drivers/net/can/rockchip/
进入到我们的内核工作目录,没有Makefile创建的可以见这篇文章:https://blog.505218.xyz/2024/08/16/rk3568%E7%A7%BB%E6%A4%8DopenHarmony-v3-2-3-%E7%B3%BB%E7%BB%9F%E7%A7%BB%E6%A4%8D/
将刚才仓库的文件无论用什么方式放到driver/net/can/rockchip
目录下,随后进行git
操作:
❯ git add drivers/net/can/Makefile |
并且修改driver/net/can/Makefile
和driver/net/can/Kconfig
:
❯ diff drivers/net/can/Makefile mmm |
随后修改config
文件:
❯ diff arch/arm64/configs/rockchip_linux_defconfig ccc |
继续git
操作:
❯ git add drivers/net/can/Makefile |
生成patch
:
❯ git format-patch --subject-prefix='PATCH' -n -s -1 |
修改编译脚本:
❯ diff device/board/hihope/rk3568/kernel/build_kernel.sh device/board/hihope/rk3568/kernel/build_kernel.sh.1 |
修改设备树:
|
Ref
https://blog.505218.xyz/2024/08/16/rk3568%E7%A7%BB%E6%A4%8DopenHarmony-v3-2-3-%E7%B3%BB%E7%BB%9F%E7%A7%BB%E6%A4%8D/
https://github.com/rockchip-linux/kernel/blob/develop-5.10/drivers/net/can/rockchip/
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 TroyMitchell's blog!