移植编译bcm sdk6.4.8 过程-平台arm-linux cortex-a9双核,系xilinx soc

2023-10-08 08:50

本文主要是介绍移植编译bcm sdk6.4.8 过程-平台arm-linux cortex-a9双核,系xilinx soc,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

技术积累,移植编译bcm sdk6.4.8 过程记录

北京华环电子:任晓亮 2015-10-20

                                                                                             一句话总结:代码都是人写的,不试试怎么知道不行

目标平台:BCM-SDK-6.4.8

                   Linux kernel version-3-14-0

                   Xilinx znyq 7020 cortex-a9 双核

                   Zedboard

Sdk 修改内容:

renxl@icserver:~/sdk-xgs-robo-6.4.8/systems/linux/user/xilinx-3_14_0$make

1.  添加version.h文件。文件内容如下:

renxl@icserver:~/linux-xlnx-xilinx-v2014.2/include/linux$ cat version.h

#ifndef_VERSION_H

#define_VERSION_H

 

#ifndefLINUX_VERSION_CODE

#defineLINUX_VERSION_CODE 200192 ##这数字需经过实际v3.14.0,带入下面公式计算

#endif

 

#ifndefKERNEL_VERSION

#defineKERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))

#endif

 

#endif

2.  修改复制文件

linux-xlnx-xilinx-v2014.2\arch\arm\include\asm\bitsperlong.h到linux-xlnx-xilinx-v2014.2\include

 

3.  修改Makefile.linux-xilinx-3_14_0

87 ifeq (,$(KFLAGS))

 88 KFLAGS :=-D__KERNEL__  -nostdinc  \

 89         -isystem $(KFLAG_INCLD) \

 90         -I$(LINUX_INCLUDE) \

 91         -include$(LINUX_INCLUDE)/linux/version.h \

 92         -include$(LINUX_INCLUDE)/generated/autoconf.h \

 93         -I$(KERNDIR)/arch/arm \

 94         -I$(KERNDIR)/include/uapi \

 95        -I$(KERNDIR)/arch/arm/include \

 96        -I$(KERNDIR)/arch/arm/include/uapi \

 97        -I$(KERNDIR)/arch/arm/include/generated \

 98        -I$(KERNDIR)/arch/arm/mach-zynq/include \

 99         -Wall -Wundef -Wstrict-prototypes-Wno-trigraphs -fno-strict-aliasing -fno-common-Werror-implicit-function-declarat    ion-Wno-format-security -fno-delete-null-pointer-checks -O2 -marm-mabi=aapcs-linux -mno-thumb-interwork -funwind-tables -D    __LINUX_ARM_ARCH__=5 -march=armv5te-mtune=arm9tdmi -msoft-float -Uarm -fno-stack-protector -fomit-frame-pointer-Wdeclarati    on-after-statement-Wno-pointer-sign -fno-strict-overflow

100 endif

 

4.  修改Makefile.linux-kernel-3_14_0 去掉告警错误中断,-Werror

141 ifndef BCM_CFLAGS

142#BCM_CFLAGS   = -Wall -Werror

143 BCM_CFLAGS   = -Wall

144 endif

5.修改

vi include/generated/autoconf.h

注释掉:

482 //#define CONFIG_SMP 1:

 

6.错误

/home/renxl/work/nios-kernel/arm_linux/fae-sdk-robo-6.3.6/src/sal/core/linux/alloc.c:In function 'sal_alloc':

/home/renxl/work/nios-kernel/arm_linux/fae-sdk-robo-6.3.6/src/sal/core/linux/alloc.c:169:5:error: implicit declaration of function 'kmalloc'[-Werror=implicit-function-declaration]

/home/renxl/work/nios-kernel/arm_linux/fae-sdk-robo-6.3.6/src/sal/core/linux/alloc.c:169:13:warning: assignment makes pointer from integer without a cast [enabled bydefault]

/home/renxl/work/nios-kernel/arm_linux/fae-sdk-robo-6.3.6/src/sal/core/linux/alloc.c:In function 'sal_free':

/home/renxl/work/nios-kernel/arm_linux/fae-sdk-robo-6.3.6/src/sal/core/linux/alloc.c:259:9:error: implicit declaration of function 'kfree'[-Werror=implicit-function-declaration]

cc1: some warnings being treated as errors

在alloc.c添加这个头文件:

#include <linux/slab.h>

7.错误

In file included from/home/renxl/work/nios-kernel/arm_linux/xilinx/linux-xlnx-xilinx-v2014.2/include/linux/kmemcheck.h:4:0,

                 from/home/renxl/work/nios-kernel/arm_linux/xilinx/linux-xlnx-xilinx-v2014.2/include/linux/net.h:25,

                 from/home/renxl/work/nios-kernel/arm_linux/sdk-xgs-robo-6.4.8/src/appl/diag/esw/txrx.c:65:

/home/renxl/work/nios-kernel/arm_linux/xilinx/linux-xlnx-xilinx-v2014.2/include/linux/mm_types.h:144:45: error: missing binary operator before token "("

/home/renxl/work/nios-kernel/arm_linux/xilinx/linux-xlnx-xilinx-v2014.2/include/linux/mm_types.h:427:46: error: missing binary operator before token "("

make[5]: ***[/home/renxl/work/nios-kernel/arm_linux/sdk-xgs-robo-6.4.8/build/linux-xilinx-3_14_0/src/appl/diag/esw/txrx.o]Error 1

修改:

vi include/linux/mm_types.h (内存页映射数据结构,错误提示这个宏定义有问题,注释掉宏开关)

144// #ifdefined(CONFIG_TRANSPARENT_HUGEPAGE) && USE_SPLIT_PMD_PTLOCKS

145                 pgtable_t pmd_huge_pte; /*protected by page->ptl */

146// #endif

427 行同样修改

 

8.错误

/home/renxl/work/nios-kernel/arm_linux/sdk-xgs-robo-6.4.8/systems/bde/linux/kernel/linux-kernel-bde.c:In function '_sinval':

/home/renxl/work/nios-kernel/arm_linux/sdk-xgs-robo-6.4.8/systems/bde/linux/kernel/linux-kernel-bde.c:4207:5:error: implicit declaration of function 'dma_cache_sync'[-Werror=implicit-function-declaration]

cc1: some warnings being treated as errors

 

9.错误,GPL开源协议错误

FATAL: modpost: GPL-incompatible modulelinux-uk-proxy.ko uses GPL-only symbol 'lockdep_init_map'

make[6]: *** [__modpost] Error 1

make[5]: *** [modules] Error 2

 

MODULE_LICENSE("Proprietary");  --------à>>>>>>>>>MODULE_LICENSE("GPL");

10.错误


Arm options:

https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html

-Wall

-Wundef

-Wstrict-prototypes

-Wno-trigraphs

-fno-strict-aliasing

-fno-common

-Wno-format-security

-fno-delete-null-pointer-checks

-O2

-marm

-mabi=aapcs-linux

-mno-thumb-interwork

-funwind-tables

-D__LINUX_ARM_ARCH__=7

-march=armv7-a

-mtune=cortex-a9

-msoft-float

-Uarm

-fno-stack-protector

-fomit-frame-pointer

-Wdeclaration-after-statement

-Wno-pointer-sign

-fno-strict-overflow

-mfpu=vfp===== 硬件浮点运算

11.错误  sdk-6.3.6

[root@GXR05/usr/app]$insmod linux-kernel-bde.ko

[85743.129419] linux_kernel_bde: Unknown symbol dma_cache_sync (err 0)

insmod: can't insert 'linux-kernel-bde.ko': unknown symbol in module orinvalid parameter

./systems/bde/linux/kernel/linux-kernel-bde.c:4207:    dma_cache_sync(NULL, ptr, length,DMA_BIDIRECTIONAL);

./systems/bde/linux/kernel/linux-kernel-bde.c:4223:    dma_cache_sync(NULL, ptr, length,DMA_BIDIRECTIONAL);

 注释掉:=====//dma_cache_sync(NULL,ptr, length, DMA_BIDIRECTIONAL);

12.错误 ==== http://blog.chinaunix.net/uid-25597477-id-4834426.html

In file included from/home/renxl/work/nios-kernel/arm_linux/sdk-xgs-robo-6.4.8/systems/linux/kernel/modules/bcm-core/bcm-core.c:747:0:

/home/renxl/work/nios-kernel/arm_linux/sdk-xgs-robo-6.4.8/systems/linux/kernel/modules/bcm-core/bcm-core-symbols.h:At top level:

/home/renxl/work/nios-kernel/arm_linux/sdk-xgs-robo-6.4.8/systems/linux/kernel/modules/bcm-core/bcm-core-symbols.h:920:1:error: 'is_eyescan_algorithm_legacy_mode' undeclaredhere (not in a function)

make[3]: ***[/home/renxl/work/nios-kernel/arm_linux/sdk-xgs-robo-6.4.8/build/linux-xilinx-3_14_0/systems/linux/kernel/modules/bcm-core/bcm-core.o]Error 1

make[2]: *** [bcm-core] Error 2

make[1]: *** [kernel_modules] Error 2

make[1]: Leaving directory`/home/renxl/work/nios-kernel/arm_linux/sdk-xgs-robo-6.4.8/systems/linux/kernel/common'

make: *** [build] Error 2

 

屏蔽掉bcm-core-symbols.h:920 //EXPORT_SYMBOL(is_eyescan_algorithm_legacy_mode);

 

13.错误 insmod error;

(1)内核版本不一致导致:下面错误

[  59.053845] linux_bcm_diag_full: disagrees about version of symbolmodule_layout

insmod: can't insert'linux-bcm-diag-full.ko': invalid module format

(2)insmod: can't insert 'linux-bcm-diag-full.ko': invalid module format

Busybox:insmod 错误提示位置:

renxl@icserver:~/work/nios-kernel/busybox-1.20.2$grep -r -n "invalid module format" ./*

Binary file ./busybox matches

Binary file ./busybox_unstripped matches

./modutils/modprobe-small.c:164:          return "debug--164=invalid moduleformat";

Binary file ./modutils/modutils.o matches

Binary file ./modutils/lib.a matches

Binary file ./modutils/modprobe-small.omatches

./modutils/modutils.c:191:               return "debug--191-invalid moduleformat";


14:操作顺序

[root@GXR05/mnt]$insmod linux-uk-proxy.ko

[root@GXR05/mnt]$insmod linux-kernel-bde.ko

[root@GXR05/mnt]$insmodlinux-bcm-diag-full.ko

[root@GXR05/mnt]$mknod/dev/linux-uk-proxy c 125 0

15.核心模块error

       这个问题可能跟内核有关,需要深入研究,内核模块太大,申请内存出现错误:

http://bbs.chinaunix.net/thread-4168128-1-1.html

 

Linux 3.0对应修改源码:的memory.h里面的

1.  /*

2.  * PAGE_OFFSET - the virtual address of thestart of the kernel image

3.  * TASK_SIZE - the maximum size of a userspace task.

4.  * TASK_UNMAPPED_BASE - the lower boundaryof the mmap VM area

5.  */

6.  #define PAGE_OFFSET               UL(CONFIG_PAGE_OFFSET)

7.  #define TASK_SIZE               (UL(CONFIG_PAGE_OFFSET) - UL(0x01000000))

8.  #define TASK_UNMAPPED_BASE       (UL(CONFIG_PAGE_OFFSET) / 3)

9.   

10. /*

11. * The maximum size of a 26-bit user spacetask.

12. */

13. #define TASK_SIZE_26               UL(0x04000000)

14.  

15. /*

16. * The module space lives between theaddresses given by TASK_SIZE

17. * and PAGE_OFFSET - it must be within 32MBof the kernel text.

18. */

19. #ifndef CONFIG_THUMB2_KERNEL

20. #define MODULES_VADDR               (PAGE_OFFSET - 16*1024*1024)

21. #else

22. /* smaller range for Thumb-2 symbolsrelocation (2^24)*/

23. #define MODULES_VADDR               (PAGE_OFFSET - 8*1024*1024)

24. #endif

25.  

26. #if TASK_SIZE > MODULES_VADDR

27. #error Top of user space clashes withstart of module space

28. #endif

29.  

30. /*

31. * The highmem pkmap virtual space sharesthe end of the module area.

32. */

33. #ifdef CONFIG_HIGHMEM

34. #define MODULES_END               (PAGE_OFFSET - PMD_SIZE)

35. #else

36. #define MODULES_END               (PAGE_OFFSET)

37. #endif

16, error for insmod linux-bcm-core.ko

[root@GXR05/mnt]$insmod linux-bcm-core.ko

[   76.334104] linux_bcm_core:Unknown symbol soc_mem_array_write (err 0)

[   76.342565] linux_bcm_core:Unknown symbol soc_phy_set_verbose (err 0)

[   76.352435] linux_bcm_core:Unknown symbol soc_custom_reg_above_64_set (err 0)

[   76.360465] linux_bcm_core:Unknown symbol soc_mem_array_read_flags (err 0)

[   76.370004] linux_bcm_core:Unknown symbol bcm5324_trunk_patch_linkscan (err 0)

[   76.382773] linux_bcm_core:Unknown symbol soc_mem_array_read (err 0)

[   76.391729] linux_bcm_core:Unknown symbol soc_custom_reg_above_64_get (err 0)

[   76.399626] linux_bcm_core:Unknown symbol soc_mem_array_write_extended (err 0)

insmod: can't insert 'linux-bcm-core.ko': unknown symbol in module orinvalid parameter

修改:

./systems/linux/kernel/modules/bcm-core/bcm-core-symbols.h:871:EXPORT_SYMBOL(soc_mem_array_write);

这篇关于移植编译bcm sdk6.4.8 过程-平台arm-linux cortex-a9双核,系xilinx soc的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/164116

相关文章

SpringBoot整合liteflow的详细过程

《SpringBoot整合liteflow的详细过程》:本文主要介绍SpringBoot整合liteflow的详细过程,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋...  liteflow 是什么? 能做什么?总之一句话:能帮你规范写代码逻辑 ,编排并解耦业务逻辑,代码

Java中调用数据库存储过程的示例代码

《Java中调用数据库存储过程的示例代码》本文介绍Java通过JDBC调用数据库存储过程的方法,涵盖参数类型、执行步骤及数据库差异,需注意异常处理与资源管理,以优化性能并实现复杂业务逻辑,感兴趣的朋友... 目录一、存储过程概述二、Java调用存储过程的基本javascript步骤三、Java调用存储过程示

Visual Studio 2022 编译C++20代码的图文步骤

《VisualStudio2022编译C++20代码的图文步骤》在VisualStudio中启用C++20import功能,需设置语言标准为ISOC++20,开启扫描源查找模块依赖及实验性标... 默认创建Visual Studio桌面控制台项目代码包含C++20的import方法。右键项目的属性:

Linux中SSH服务配置的全面指南

《Linux中SSH服务配置的全面指南》作为网络安全工程师,SSH(SecureShell)服务的安全配置是我们日常工作中不可忽视的重要环节,本文将从基础配置到高级安全加固,全面解析SSH服务的各项参... 目录概述基础配置详解端口与监听设置主机密钥配置认证机制强化禁用密码认证禁止root直接登录实现双因素

MySQL中的InnoDB单表访问过程

《MySQL中的InnoDB单表访问过程》:本文主要介绍MySQL中的InnoDB单表访问过程,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录1、背景2、环境3、访问类型【1】const【2】ref【3】ref_or_null【4】range【5】index【6】

浏览器插件cursor实现自动注册、续杯的详细过程

《浏览器插件cursor实现自动注册、续杯的详细过程》Cursor简易注册助手脚本通过自动化邮箱填写和验证码获取流程,大大简化了Cursor的注册过程,它不仅提高了注册效率,还通过友好的用户界面和详细... 目录前言功能概述使用方法安装脚本使用流程邮箱输入页面验证码页面实战演示技术实现核心功能实现1. 随机

在Linux终端中统计非二进制文件行数的实现方法

《在Linux终端中统计非二进制文件行数的实现方法》在Linux系统中,有时需要统计非二进制文件(如CSV、TXT文件)的行数,而不希望手动打开文件进行查看,例如,在处理大型日志文件、数据文件时,了解... 目录在linux终端中统计非二进制文件的行数技术背景实现步骤1. 使用wc命令2. 使用grep命令

Navicat数据表的数据添加,删除及使用sql完成数据的添加过程

《Navicat数据表的数据添加,删除及使用sql完成数据的添加过程》:本文主要介绍Navicat数据表的数据添加,删除及使用sql完成数据的添加过程,具有很好的参考价值,希望对大家有所帮助,如有... 目录Navicat数据表数据添加,删除及使用sql完成数据添加选中操作的表则出现如下界面,查看左下角从左

Linux如何快速检查服务器的硬件配置和性能指标

《Linux如何快速检查服务器的硬件配置和性能指标》在运维和开发工作中,我们经常需要快速检查Linux服务器的硬件配置和性能指标,本文将以CentOS为例,介绍如何通过命令行快速获取这些关键信息,... 目录引言一、查询CPU核心数编程(几C?)1. 使用 nproc(最简单)2. 使用 lscpu(详细信

linux重启命令有哪些? 7个实用的Linux系统重启命令汇总

《linux重启命令有哪些?7个实用的Linux系统重启命令汇总》Linux系统提供了多种重启命令,常用的包括shutdown-r、reboot、init6等,不同命令适用于不同场景,本文将详细... 在管理和维护 linux 服务器时,完成系统更新、故障排查或日常维护后,重启系统往往是必不可少的步骤。本文