linux-kernel-4.4 移植 (2)解决上部遗留DMA-PL330的问题
查看drivers/tty/serial/samsung.c文件发现,当传输数据量小于ourport->min_dma_size时,不使用DMA,大于等于min_mda_size时才是使用DMA,因此可以判断时DMA的问题。
static void s3c24xx_serial_start_next_tx(struct s3c24xx_uart_port *ourport)
{
struct uart_port *port = &ourport->port;
struct circ_buf *xmit = &port->state->xmit;
unsigned long count; /* Get data size up to the end of buffer */
count = CIRC_CNT_TO_END(xmit->head, xmit->tail, UART_XMIT_SIZE); if (!count) {
s3c24xx_serial_stop_tx(port);
return;
} if (!ourport->dma || !ourport->dma->tx_chan ||
count < ourport->min_dma_size ||
xmit->tail & (dma_get_cache_alignment() - ))
s3c24xx_serial_start_tx_pio(ourport);
else
s3c24xx_serial_start_tx_dma(ourport, count);
}
解决方法
查阅资料发现【为了强制执行对非安全世界外设和地址访问的限制,Exynos4412配备了“TrustZone保护控制器”和“TrustZone地址空间控制器”。它们控制是否只有安全世界可访问任何给定的外设或者内存地址或安全和非安全世界。另一个需要注意的重要事项,即使CPU在安全模式下运行,PL330 DMA控制器也始终使用非安全模式,因此,如果尝试使用DMA访问在TZPC中设置为“仅安全”的内容,则会出现故障并且DMA传输将失败。所需要的只是将所有内存标记为非安全可读写,并将所有外设标记为非安全可读写即可。】
具体如下:
diff --git a/arch/arm/mach-exynos/dmc_init_exynos4412.c b/arch/arm/mach-exynos/d
index 2b2bc3b..1f756f8
--- a/arch/arm/mach-exynos/dmc_init_exynos4412.c
+++ b/arch/arm/mach-exynos/dmc_init_exynos4412.c
@@ -, +, @@
#include "common_setup.h"
#include "exynos4412_setup.h" +#define NR_TZASC_BANKS 4
++/* Allow non-secure and secure access to all memory */+#define RA0_VAL 0xf0000000
++static void tzasc_init (void) {+ unsigned int start = samsung_get_base_dmc_tzasc();++ unsigned int end = start + (DMC_OFFSET * (NR_TZASC_BANKS - ));+ for(;start <= end; start += DMC_OFFSET) {+ struct exynos4412_tzasc *asc = (struct exynos4412_tzasc *)start;+ writel(RA0_VAL, &asc -> region_attributes_0);+ }+}
#ifdef TINY4412
struct mem_timings mem = {
.direct_cmd_msr = {
@@ -, +, @@ void mem_ctrl_init(int reset)
dmc = (struct exynos4_dmc *)(samsung_get_base_dmc_ctrl()
+DMC_OFFSET);
dmc_init(dmc);
++ tzasc_init();++
}
diff --git a/arch/arm/mach-exynos/include/mach/cpu.h b/arch/arm/mach-exynos/incl
index 1f722df..5800a18
--- a/arch/arm/mach-exynos/include/mach/cpu.h
+++ b/arch/arm/mach-exynos/include/mach/cpu.h
@@ -, +, @@
#define EXYNOS4X12_SYSTIMER_BASE 0x10050000
#define EXYNOS4X12_WATCHDOG_BASE 0x10060000
#define EXYNOS4X12_TZPC_BASE 0x10110000
+
+#define EXYNOS4X12_DMC_TZASC_BASE 0x10700000
+
#define EXYNOS4X12_DMC_CTRL_BASE 0x10600000
#define EXYNOS4X12_GPIO_PART4_BASE 0x106E0000
#define EXYNOS4X12_ACE_SFR_BASE 0x10830000
@@ -, +, @@
#define EXYNOS4X12_AUDIOSS_BASE DEVICE_NOT_AVAILABLE
#define EXYNOS4X12_USB_HOST_XHCI_BASE DEVICE_NOT_AVAILABLE
#define EXYNOS4X12_USB3PHY_BASE DEVICE_NOT_AVAILABLE
-#define EXYNOS4X12_DMC_TZASC_BASE DEVICE_NOT_AVAILABLE
+
+/* #define EXYNOS4X12_DMC_TZASC_BASE DEVICE_NOT_AVAILABLE */ /* EXYNOS5 */
#define EXYNOS5_I2C_SPACING 0x10000
diff --git a/arch/arm/mach-exynos/include/mach/dmc.h b/arch/arm/mach-exynos/incl
index 4990a1a..304e094
--- a/arch/arm/mach-exynos/include/mach/dmc.h
+++ b/arch/arm/mach-exynos/include/mach/dmc.h
@@ -, +, @@ struct exynos5420_phy_control {
unsigned int phy_con42;
}; +struct exynos4412_tzasc {
+ unsigned char res1[0x100];
+ unsigned int region_setup_low_0; //
+ unsigned int region_setup_high_0; //
+ unsigned int region_attributes_0; //
+
+ unsigned char res2;//10c
+ unsigned int region_setup_low_1; //
+ unsigned int region_setup_high_1; //
+ unsigned int region_attributes_1; //
+
+ unsigned char res3;
+ unsigned int region_setup_low_2; //
+ unsigned int region_setup_high_2; //
+ unsigned int region_attributes_2; //
+
+ unsigned char res4;
+ unsigned int region_setup_low_3; //
+ unsigned int region_setup_high_3; //
+ unsigned int region_attributes_3; //
+
+};
+
+
struct exynos5420_tzasc {
unsigned char res1[0xf00];
unsigned int membaseconfig0;
diff --git a/arch/arm/mach-exynos/lowlevel_init.c b/arch/arm/mach-exynos/lowleve
index de85643..4736d60
--- a/arch/arm/mach-exynos/lowlevel_init.c
+++ b/arch/arm/mach-exynos/lowlevel_init.c
@@ -, +, @@ int do_lowlevel_init(void)
#endif
#endif
mem_ctrl_init(actions & DO_MEM_RESET);
-
-#ifndef TINY4412
tzpc_init();
-#endif
} return actions & DO_WAKEUP;
diff --git a/sd_fuse/tiny4412/sd_fusing.sh b/sd_fuse/tiny4412/sd_fusing.sh
index 2658c53..956fa29
--- a/sd_fuse/tiny4412/sd_fusing.sh
+++ b/sd_fuse/tiny4412/sd_fusing.sh
@@ -, +, @@ fi
signed_bl1_position=
bl2_position=
uboot_position=
-tzsw_position=
+tzsw_position= #<TrustZone S/W fusing>
-#echo "---------------------------------------"
-#echo "TrustZone S/W fusing"
-#dd iflag=dsync oflag=dsync if=./E4412_tzsw.bin of=$ seek=$tzsw_position
+echo "---------------------------------------"
+echo "TrustZone S/W fusing"
+dd iflag=dsync oflag=dsync if=./E4412_tzsw.bin of=$ seek=$tzsw_position #<flush to disk>
sync
参考:https://blog.csdn.net/qq_25370227/article/details/84891632
linux-kernel-4.4 移植 (2)解决上部遗留DMA-PL330的问题的更多相关文章
- Ubuntu 16.04.2 安装Linux kernel 4.10 内核并解决 VMware 问题
http://www.linuxidc.com/Linux/2017-03/141456.htm
- 移植Linux Kernel SM750 驱动到VxWorks 7
一.SM750简介 SM750 是SiliconMotion 推出的一款适合嵌入式设备的显卡(Embedded GPU),采用PCIe接口与CPU连接,内部集成16MB DDR SDRAM显存,产品具 ...
- Linux下VirtualBox出现kernel driver not installed的解决方法
今天安装好rhel-server-6.6-i386后,再安装VirtualBox成功,但是再VirtualBox中创建虚拟机的时候出现了“不能为xx虚拟机打开新任务” 并弹出如下的错误信息:
- Intel 80x86 Linux Kernel Interrupt(中断)、Interrupt Priority、Interrupt nesting、Prohibit Things Whthin CPU In The Interrupt Off State
目录 . 引言 . Linux 中断的概念 . 中断处理流程 . Linux 中断相关的源代码分析 . Linux 硬件中断 . Linux 软中断 . 中断优先级 . CPU在关中断状态下编程要注意 ...
- 如何进行Linux Kernel 开发
转自:http://www.cppblog.com/flyonok/archive/2011/04/15/144316.html 如何进行Linux Kernel 开发? (Take 3) 译者序:这 ...
- Linux Kernel - Debug Guide (Linux内核调试指南 )
http://blog.csdn.net/blizmax6/article/details/6747601 linux内核调试指南 一些前言 作者前言 知识从哪里来 为什么撰写本文档 为什么需要汇编级 ...
- 小白自制Linux开发板 三. Linux内核与文件系统移植
上一篇完成了uboot的移植,但是想要愉快的在开发板上玩耍还需要移植Linux内核和文件系统. 1.Linux内核 事实上对于F1C100S/F1C200S,Linux官方源码已经对licheepi ...
- Linux Kernel代码艺术——系统调用宏定义
我们习惯在SI(Source Insight)中阅读Linux内核,SI会建立符号表数据库,能非常方便地跳转到变量.宏.函数等的定义处.但在处理系统调用的函数时,却会遇到一些麻烦:我们知道系统调用函数 ...
- linux下编译出现空间不足解决办法
linux下编译出现空间不足解决办法 编译内核出现问题: AS .tmp_kallsyms1.o .tmp_kallsyms1.S:2: fatal error: when writing ...
随机推荐
- eclipse修改android项目的apk包名类名
在Google提供的Eclipse集成开发环境adt-bundle下修改名称的总结: 1. 修改工程名(apk名称) 在弹出的对话框中输入新名称 该操作实际上是修改<project&g ...
- Windows下虚拟机安装Mac OS X —– VMware Workstation12安装Mac OS X 10.11
1下载 镜像:Instal OS X Yosemite 10.10.3(14D131).cdr 密码:qhhm 2 unlocker208文件(链接:https://pan.baidu ...
- 接口与继承:方法覆盖(super)
源代码 //父类Parent class Parent{ int x; int y; Parent() { x = ; y = ; } public void Set(int a,int b) { x ...
- iOS字符串自动计算文本的宽和高
根据字符串如何自动计算出这些字符所占的宽和高: 首先,需要知道要显示的字体的样式,因为不同大小的字体所占据的空间大小不一样. 其次,要设置限制范围,例如一串字符可以显示成一行(较宽),也可以显示成多行 ...
- CI/CD
CI/CD 啥是CI/CD CI: continuous integration, 持续集成.就是频繁地把开发的工作提交到主线代码.主要是为了解决集成问题.什么是集成问题呢,白话说,就是从你本地的代码 ...
- Exp2 后门原理与实践 - 20164304 姜奥
实验内容 (1)使用netcat获取主机操作Shell,cron启动 (2)使用socat获取主机操作Shell, 任务计划启动 (3)使用MSF meterpreter(或其他软件)生成可执行文件 ...
- P4702 取石子
我什么时候写一下污污的小故事呢?反正不是现在. 题目描述 Alice 和 Bob 在玩游戏. 他们有 nn 堆石子,第 ii 堆石子有 a_iai 个,保证初始时 a_i \leq a_{i + 1 ...
- requests和session的区别
简单说 request对象和session对象的最大区别是生命周期. -request request对象的生命周期是针对一个客户端(说确切点就是一个浏览器应用程序)的一次请求,当请求完毕之后,req ...
- js中的“默默的失败”
看阮一峰的js标准教程,看到了“默默的失败”觉得很形象也很无奈, 总结一下都有哪些地方会“默默的失败” 字符串内部的单个字符无法改变和增删,这些操作会默默地失败. var s = 'hello'; d ...
- django项目部署
1.布署前需要关闭调试.允许任何机器访问,在setting文件中设置 DEBUG = False ALLOW_HOSTS=['*',] 2.安装uWSGI pip install uwsgi 3.配置 ...