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

相关文章

mysqld_multi在Linux服务器上运行多个MySQL实例

《mysqld_multi在Linux服务器上运行多个MySQL实例》在Linux系统上使用mysqld_multi来启动和管理多个MySQL实例是一种常见的做法,这种方式允许你在同一台机器上运行多个... 目录1. 安装mysql2. 配置文件示例配置文件3. 创建数据目录4. 启动和管理实例启动所有实例

Linux内存泄露的原因排查和解决方案(内存管理方法)

《Linux内存泄露的原因排查和解决方案(内存管理方法)》文章主要介绍了运维团队在Linux处理LB服务内存暴涨、内存报警问题的过程,从发现问题、排查原因到制定解决方案,并从中学习了Linux内存管理... 目录一、问题二、排查过程三、解决方案四、内存管理方法1)linux内存寻址2)Linux分页机制3)

解决IDEA使用springBoot创建项目,lombok标注实体类后编译无报错,但是运行时报错问题

《解决IDEA使用springBoot创建项目,lombok标注实体类后编译无报错,但是运行时报错问题》文章详细描述了在使用lombok的@Data注解标注实体类时遇到编译无误但运行时报错的问题,分析... 目录问题分析问题解决方案步骤一步骤二步骤三总结问题使用lombok注解@Data标注实体类,编译时

VScode连接远程Linux服务器环境配置图文教程

《VScode连接远程Linux服务器环境配置图文教程》:本文主要介绍如何安装和配置VSCode,包括安装步骤、环境配置(如汉化包、远程SSH连接)、语言包安装(如C/C++插件)等,文中给出了详... 目录一、安装vscode二、环境配置1.中文汉化包2.安装remote-ssh,用于远程连接2.1安装2

Linux中shell解析脚本的通配符、元字符、转义符说明

《Linux中shell解析脚本的通配符、元字符、转义符说明》:本文主要介绍shell通配符、元字符、转义符以及shell解析脚本的过程,通配符用于路径扩展,元字符用于多命令分割,转义符用于将特殊... 目录一、linux shell通配符(wildcard)二、shell元字符(特殊字符 Meta)三、s

Linux之软件包管理器yum详解

《Linux之软件包管理器yum详解》文章介绍了现代类Unix操作系统中软件包管理和包存储库的工作原理,以及如何使用包管理器如yum来安装、更新和卸载软件,文章还介绍了如何配置yum源,更新系统软件包... 目录软件包yumyum语法yum常用命令yum源配置文件介绍更新yum源查看已经安装软件的方法总结软

linux报错INFO:task xxxxxx:634 blocked for more than 120 seconds.三种解决方式

《linux报错INFO:taskxxxxxx:634blockedformorethan120seconds.三种解决方式》文章描述了一个Linux最小系统运行时出现的“hung_ta... 目录1.问题描述2.解决办法2.1 缩小文件系统缓存大小2.2 修改系统IO调度策略2.3 取消120秒时间限制3

Linux alias的三种使用场景方式

《Linuxalias的三种使用场景方式》文章介绍了Linux中`alias`命令的三种使用场景:临时别名、用户级别别名和系统级别别名,临时别名仅在当前终端有效,用户级别别名在当前用户下所有终端有效... 目录linux alias三种使用场景一次性适用于当前用户全局生效,所有用户都可调用删除总结Linux

Linux:alias如何设置永久生效

《Linux:alias如何设置永久生效》在Linux中设置别名永久生效的步骤包括:在/root/.bashrc文件中配置别名,保存并退出,然后使用source命令(或点命令)使配置立即生效,这样,别... 目录linux:alias设置永久生效步骤保存退出后功能总结Linux:alias设置永久生效步骤

Linux使用fdisk进行磁盘的相关操作

《Linux使用fdisk进行磁盘的相关操作》fdisk命令是Linux中用于管理磁盘分区的强大文本实用程序,这篇文章主要为大家详细介绍了如何使用fdisk进行磁盘的相关操作,需要的可以了解下... 目录简介基本语法示例用法列出所有分区查看指定磁盘的区分管理指定的磁盘进入交互式模式创建一个新的分区删除一个存