1

我正在尝试编译一个 linux 模块,该模块应该在 arm-64 位架构(Cortex-A53)上运行。部分功能是在某个时候刷新缓存,这以前在 arm-32 位架构上工作。如何构建包含相关标头(如 cache.h 和 cacheflush.h)的内核标头?

我正在使用 Xilinx 工具链(Vivado 和 SDK、PetaLinux 工具)来生成所有必需的嵌入式 Linux 组件,如引导加载程序、内核映像和设备树。此外,我克隆了 Xilinx-Linux-Repository,切换到当前分支并配置 PetaLinux 工具以使用特定的 Xilinx-Linux-Repo 来生成使用该存储库的组件。我的平台是 Avnet-UltraZed-EG-IOCC Board,我正在使用 Debian-10 根文件系统进行开发。我正在尝试编译的模块已在其他 Zynq-7000 开发中工作。使用 outercache.h 刷新缓存的板。

1) 使用 PetaLinux 构建引导文件、内核映像和设备树

Host $ petalinux-config <hw-desc>  
Host $ petalinux-build  
Host $ petalinux-package ...  

2) 克隆 Xilinx-Linux-Repo 并构建头文件

Host $ git clone <xlnx-lnx-repo>; cd <xlnx-lnx-repo>  
Host $ make xilinx_zynqmp_defconfig  
Host $ make deb-pkg  
Host $ make headers_install  
Host $ ls usr/include/*  
Host $ find usr/include/ -name "outercache.h" # Header not found  
Host $ find <xlnx-lnx-repo>/ -name "outercache.h" # Header found under arch/arm/include/asm/outercache.h 

3) 使用 Debian 启动系统

UZ3EG $ find /usr/include/ -name "outercache.h" # Header not found  
UZ3EG $ sudo dpkg -I linux-header* linux-image* linux-libc*  
UZ3EG $ cd /lib/modules/<uname -r>/build  
UZ3EG $ make headers_install  
UZ3EG $ make modules  
UZ3EG $ find usr/include/ -name "outercache.h" # Header not found  

我不确定哪些标头可以工作,但我希望在将标头构建到 /usr/include/asm/*.h 之后找到 cache.h 和 cacheflush.h

4

0 回答 0