移植编译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

相关文章

将Mybatis升级为Mybatis-Plus的详细过程

《将Mybatis升级为Mybatis-Plus的详细过程》本文详细介绍了在若依管理系统(v3.8.8)中将MyBatis升级为MyBatis-Plus的过程,旨在提升开发效率,通过本文,开发者可实现... 目录说明流程增加依赖修改配置文件注释掉MyBATisConfig里面的Bean代码生成使用IDEA生

Linux换行符的使用方法详解

《Linux换行符的使用方法详解》本文介绍了Linux中常用的换行符LF及其在文件中的表示,展示了如何使用sed命令替换换行符,并列举了与换行符处理相关的Linux命令,通过代码讲解的非常详细,需要的... 目录简介检测文件中的换行符使用 cat -A 查看换行符使用 od -c 检查字符换行符格式转换将

Java编译生成多个.class文件的原理和作用

《Java编译生成多个.class文件的原理和作用》作为一名经验丰富的开发者,在Java项目中执行编译后,可能会发现一个.java源文件有时会产生多个.class文件,从技术实现层面详细剖析这一现象... 目录一、内部类机制与.class文件生成成员内部类(常规内部类)局部内部类(方法内部类)匿名内部类二、

Linux系统配置NAT网络模式的详细步骤(附图文)

《Linux系统配置NAT网络模式的详细步骤(附图文)》本文详细指导如何在VMware环境下配置NAT网络模式,包括设置主机和虚拟机的IP地址、网关,以及针对Linux和Windows系统的具体步骤,... 目录一、配置NAT网络模式二、设置虚拟机交换机网关2.1 打开虚拟机2.2 管理员授权2.3 设置子

Linux系统中卸载与安装JDK的详细教程

《Linux系统中卸载与安装JDK的详细教程》本文详细介绍了如何在Linux系统中通过Xshell和Xftp工具连接与传输文件,然后进行JDK的安装与卸载,安装步骤包括连接Linux、传输JDK安装包... 目录1、卸载1.1 linux删除自带的JDK1.2 Linux上卸载自己安装的JDK2、安装2.1

C# WinForms存储过程操作数据库的实例讲解

《C#WinForms存储过程操作数据库的实例讲解》:本文主要介绍C#WinForms存储过程操作数据库的实例,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录一、存储过程基础二、C# 调用流程1. 数据库连接配置2. 执行存储过程(增删改)3. 查询数据三、事务处

JSON Web Token在登陆中的使用过程

《JSONWebToken在登陆中的使用过程》:本文主要介绍JSONWebToken在登陆中的使用过程,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录JWT 介绍微服务架构中的 JWT 使用结合微服务网关的 JWT 验证1. 用户登录,生成 JWT2. 自定义过滤

Linux卸载自带jdk并安装新jdk版本的图文教程

《Linux卸载自带jdk并安装新jdk版本的图文教程》在Linux系统中,有时需要卸载预装的OpenJDK并安装特定版本的JDK,例如JDK1.8,所以本文给大家详细介绍了Linux卸载自带jdk并... 目录Ⅰ、卸载自带jdkⅡ、安装新版jdkⅠ、卸载自带jdk1、输入命令查看旧jdkrpm -qa

Linux samba共享慢的原因及解决方案

《Linuxsamba共享慢的原因及解决方案》:本文主要介绍Linuxsamba共享慢的原因及解决方案,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录linux samba共享慢原因及解决问题表现原因解决办法总结Linandroidux samba共享慢原因及解决

java中使用POI生成Excel并导出过程

《java中使用POI生成Excel并导出过程》:本文主要介绍java中使用POI生成Excel并导出过程,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录需求说明及实现方式需求完成通用代码版本1版本2结果展示type参数为atype参数为b总结注:本文章中代码均为