iTop4412 3.0.15内核移植到linux4.4.34(一)
2017-01-25 18:30
861 查看
打算借linux移植学习内核启动过程,及4412各外设驱动原理
移植时,先修改一些config,然后解决编译出现的问题
System Type-->Multiple platform selection
[*]ARMv7 based platforms(Cortex-A,PJ4,Scorpion, Krait)
System Type--->Samsung EXYNOS
[*]SAMSUNG EXYNOS4
[*]SAMSUNG EXYNOS4412
File systems--->Network File Systems--->
<>NFS client support for NFS version 2
<*>NFS client support for NFS version 3
[]NFS server support for NFS version 3
[]NFS server support for NFS version 4
编译出现错误:
scripts/sign-file.c:23:30: fatal error: openssl/opensslv.h: No such file or directory
解决:apt-get install libssl-dev
/tmp/ccKduzSd.s: Assembler messages:
/tmp/ccKduzSd.s:869: Error: garbage following instruction -- `dmb ishst'
/tmp/ccKduzSd.s:888: Error: garbage following instruction -- `dmb ishst'
/tmp/ccKduzSd.s:919: Error: garbage following instruction -- `dmb ish'
/tmp/ccKduzSd.s:931: Error: garbage following instruction -- `dsb ishst'
解决:
System Type->ARM system type (ARM Ltd. Vesatile family)
配置改为
[*] MMU-based Paged Memory Management Support
ARM system type (Allow multiple platforms to be selected)
[*] Samsung EXYNOS ---> SAMSUNG EXYNOS4
SAMSUNG EXYNOS4412
问题:
CC arch/arm/kernel/suspend.o
/tmp/ccgcmPjb.s: Assembler messages:
/tmp/ccgcmPjb.s:243: Error: garbage following instruction -- `dsb nshst'
/tmp/ccgcmPjb.s:251: Error: garbage following instruction -- `dsb nsh'
解决:
Power management options --->
[] Suspend to RAM and standby
问题:
CC arch/arm/mm/fault.o
/tmp/ccEM41mf.s: Assembler messages:
/tmp/ccEM41mf.s:632: Error: garbage following instruction -- `dsb ishst'
make[1]: *** [arch/arm/mm/fault.o] Error 1
解决:
替换函数
static inline void flush_pmd_entry(pmd_t *pmd)
{
const unsigned int __tlb_flag = __cpu_tlb_flags;
if (tlb_flag(TLB_DCLEAN))
asm("mcr
p15, 0, %0, c7, c10, 1 @ flush_pmd"
: : "r" (pmd) : "cc");
if (tlb_flag(TLB_L2CLEAN_FR))
asm("mcr
p15, 1, %0, c15, c9, 1 @ L2 flush_pmd"
: : "r" (pmd) : "cc");
if (tlb_flag(TLB_WB))
dsb();
}
出错:
CC arch/arm/mm/flush.o
/tmp/ccobT12L.s: Assembler messages:
/tmp/ccobT12L.s:99: Error: garbage following instruction -- `dsb nshst'
/tmp/ccobT12L.s:107: Error: garbage following instruction -- `dsb nsh'
/tmp/ccobT12L.s:223: Error: garbage following instruction -- `dsb ishst'
/tmp/ccobT12L.s:308: Error: garbage following instruction -- `dsb nshst'
/tmp/ccobT12L.s:314: Error: garbage following instruction -- `dsb nsh'
/tmp/ccobT12L.s:386: Error: garbage following instruction -- `dsb nshst'
/tmp/ccobT12L.s:392: Error: garbage following instruction -- `dsb nsh'
/tmp/ccobT12L.s:427: Error: garbage following instruction -- `dsb ishst'
/tmp/ccobT12L.s:461: Error: garbage following instruction -- `dsb ishst'
/tmp/ccobT12L.s:516: Error: garbage following instruction -- `dsb ishst'
/tmp/ccobT12L.s:569: Error: garbage following instruction -- `dsb ishst'
make[1]: *** [arch/arm/mm/flush.o] Error 1
解决:
barrier.h
#if __LINUX_ARM_ARCH__ >= 7
#ifdef CONFIG_ARCH_EXYNOS
#define isb(option) __asm__ __volatile__ ("isb" : : : "memory")
#define dsb(option) __asm__ __volatile__ ("dsb" : : : "memory")
#define dmb(option) __asm__ __volatile__ ("dmb" : : : "memory")
#else
#define isb(option) __asm__ __volatile__ ("isb " #option : : : "memory")aa
#define dsb(option) __asm__ __volatile__ ("dsb " #option : : : "memory")
#define dmb(option) __asm__ __volatile__ ("dmb " #option : : : "memory")
#endif
问题:
arch/arm/mm/tlb-v7.S: Assembler messages:
arch/arm/mm/tlb-v7.S:38: Error: garbage following instruction -- `dsb ish'
arch/arm/mm/tlb-v7.S:59: Error: garbage following instruction -- `dsb ish'
arch/arm/mm/tlb-v7.S:72: Error: garbage following instruction -- `dsb ish'
arch/arm/mm/tlb-v7.S:87: Error: garbage following instruction -- `dsb ish'
make[1]: *** [arch/arm/mm/tlb-v7.o] Error 1
proc-v7.S与cache-v7.S也有相同问题
解决:
在对应文件中找到dsb ishst
替换为dsb
编译出错:
arch/arm/lib/testchangebit.S: Assembler messages:
arch/arm/lib/testchangebit.S:15: Error: garbage following instruction -- `dmb ish'
arch/arm/lib/testchangebit.S:15: Error: garbage following instruction -- `dmb ish'
make[1]: *** [arch/arm/lib/testchangebit.o] Error 1
修改arch\arm\include\asm\assembler.h
去掉ish
查看代码发现有个angel模式,不明白什么是这个模式,搜了下发现这个模式即ARM's standard semihosting interface ,用于外部调试,
是一种旧办法,现在基本不使用了。(参考:http://stackoverflow.com/questions/38550715/linux-booting-angel-booting)
至此编译通过
移植时,先修改一些config,然后解决编译出现的问题
System Type-->Multiple platform selection
[*]ARMv7 based platforms(Cortex-A,PJ4,Scorpion, Krait)
System Type--->Samsung EXYNOS
[*]SAMSUNG EXYNOS4
[*]SAMSUNG EXYNOS4412
File systems--->Network File Systems--->
<>NFS client support for NFS version 2
<*>NFS client support for NFS version 3
[]NFS server support for NFS version 3
[]NFS server support for NFS version 4
编译出现错误:
scripts/sign-file.c:23:30: fatal error: openssl/opensslv.h: No such file or directory
解决:apt-get install libssl-dev
/tmp/ccKduzSd.s: Assembler messages:
/tmp/ccKduzSd.s:869: Error: garbage following instruction -- `dmb ishst'
/tmp/ccKduzSd.s:888: Error: garbage following instruction -- `dmb ishst'
/tmp/ccKduzSd.s:919: Error: garbage following instruction -- `dmb ish'
/tmp/ccKduzSd.s:931: Error: garbage following instruction -- `dsb ishst'
解决:
System Type->ARM system type (ARM Ltd. Vesatile family)
配置改为
[*] MMU-based Paged Memory Management Support
ARM system type (Allow multiple platforms to be selected)
[*] Samsung EXYNOS ---> SAMSUNG EXYNOS4
SAMSUNG EXYNOS4412
问题:
CC arch/arm/kernel/suspend.o
/tmp/ccgcmPjb.s: Assembler messages:
/tmp/ccgcmPjb.s:243: Error: garbage following instruction -- `dsb nshst'
/tmp/ccgcmPjb.s:251: Error: garbage following instruction -- `dsb nsh'
解决:
Power management options --->
[] Suspend to RAM and standby
问题:
CC arch/arm/mm/fault.o
/tmp/ccEM41mf.s: Assembler messages:
/tmp/ccEM41mf.s:632: Error: garbage following instruction -- `dsb ishst'
make[1]: *** [arch/arm/mm/fault.o] Error 1
解决:
替换函数
static inline void flush_pmd_entry(pmd_t *pmd)
{
const unsigned int __tlb_flag = __cpu_tlb_flags;
if (tlb_flag(TLB_DCLEAN))
asm("mcr
p15, 0, %0, c7, c10, 1 @ flush_pmd"
: : "r" (pmd) : "cc");
if (tlb_flag(TLB_L2CLEAN_FR))
asm("mcr
p15, 1, %0, c15, c9, 1 @ L2 flush_pmd"
: : "r" (pmd) : "cc");
if (tlb_flag(TLB_WB))
dsb();
}
出错:
CC arch/arm/mm/flush.o
/tmp/ccobT12L.s: Assembler messages:
/tmp/ccobT12L.s:99: Error: garbage following instruction -- `dsb nshst'
/tmp/ccobT12L.s:107: Error: garbage following instruction -- `dsb nsh'
/tmp/ccobT12L.s:223: Error: garbage following instruction -- `dsb ishst'
/tmp/ccobT12L.s:308: Error: garbage following instruction -- `dsb nshst'
/tmp/ccobT12L.s:314: Error: garbage following instruction -- `dsb nsh'
/tmp/ccobT12L.s:386: Error: garbage following instruction -- `dsb nshst'
/tmp/ccobT12L.s:392: Error: garbage following instruction -- `dsb nsh'
/tmp/ccobT12L.s:427: Error: garbage following instruction -- `dsb ishst'
/tmp/ccobT12L.s:461: Error: garbage following instruction -- `dsb ishst'
/tmp/ccobT12L.s:516: Error: garbage following instruction -- `dsb ishst'
/tmp/ccobT12L.s:569: Error: garbage following instruction -- `dsb ishst'
make[1]: *** [arch/arm/mm/flush.o] Error 1
解决:
barrier.h
#if __LINUX_ARM_ARCH__ >= 7
#ifdef CONFIG_ARCH_EXYNOS
#define isb(option) __asm__ __volatile__ ("isb" : : : "memory")
#define dsb(option) __asm__ __volatile__ ("dsb" : : : "memory")
#define dmb(option) __asm__ __volatile__ ("dmb" : : : "memory")
#else
#define isb(option) __asm__ __volatile__ ("isb " #option : : : "memory")aa
#define dsb(option) __asm__ __volatile__ ("dsb " #option : : : "memory")
#define dmb(option) __asm__ __volatile__ ("dmb " #option : : : "memory")
#endif
问题:
arch/arm/mm/tlb-v7.S: Assembler messages:
arch/arm/mm/tlb-v7.S:38: Error: garbage following instruction -- `dsb ish'
arch/arm/mm/tlb-v7.S:59: Error: garbage following instruction -- `dsb ish'
arch/arm/mm/tlb-v7.S:72: Error: garbage following instruction -- `dsb ish'
arch/arm/mm/tlb-v7.S:87: Error: garbage following instruction -- `dsb ish'
make[1]: *** [arch/arm/mm/tlb-v7.o] Error 1
proc-v7.S与cache-v7.S也有相同问题
解决:
在对应文件中找到dsb ishst
替换为dsb
编译出错:
arch/arm/lib/testchangebit.S: Assembler messages:
arch/arm/lib/testchangebit.S:15: Error: garbage following instruction -- `dmb ish'
arch/arm/lib/testchangebit.S:15: Error: garbage following instruction -- `dmb ish'
make[1]: *** [arch/arm/lib/testchangebit.o] Error 1
修改arch\arm\include\asm\assembler.h
去掉ish
查看代码发现有个angel模式,不明白什么是这个模式,搜了下发现这个模式即ARM's standard semihosting interface ,用于外部调试,
是一种旧办法,现在基本不使用了。(参考:http://stackoverflow.com/questions/38550715/linux-booting-angel-booting)
至此编译通过
相关文章推荐
- 移植linux3.7.4系统到itop4412开发板记录
- Qt for ARM_Linux环境搭建-Qt5.7+iTop4412嵌入式平台移植
- 基于tiny4412的Linux内核移植 -- SD卡驱动移植(五)
- 基于S3C2410平台移植Linux 2.6内核指南
- linux--mini2440内核移植手册
- 手把手教你移植linux内核---------OK6410(二)
- Linux芯片级移植与底层驱动(基于3.7.4内核) --中断控制器 推荐
- linux 2.6.22.1内核在s3c2410平台的移植(完美版)
- Linux-2.6.32.2内核在mini2440上的移植(九)---触摸屏驱动移植
- 移植linux内核到S3C2410开发板的问题...
- Linux 2.6内核在S3C2440平台上移植
- iTop4412 QT/E4.7.1移植
- Linux内核移植 part2:uboot bootdelay参数
- ARM9开发板FL2440移植Linux-3.0内核————MMC和LCD驱动
- 移植最新的内核linux-4.9到开发板JZ2440全过程笔记
- 移植Linux内核到mini2440常见问题
- linux 内核移植 2.6.35.4 到s3c2440
- linux内核移植和根文件系统制作
- Linux内核移植过程之根文件系统
- Linux内核移植 part1:全面介绍ARM Linux启动流程