全志 添加PWM7参数

简介: 全志 添加PWM7参数

本文介绍如何在全志的硬件描述文件中添加PWM7的参数。这是一个针对Linux内核的设备树源文件(DTS)的修改,特定于全志的硬件平台。

以下是对修改的简要概述:

  1. 文件修改:文件路径为lichee/linux-3.10/arch/arm/boot/dts/sun8iw11p1.dtsi
添加pwm7的参数
 
diff --git a/lichee/linux-3.10/arch/arm/boot/dts/sun8iw11p1.dtsi b/lichee/linux-3.10/arch/arm/boot/dts/sun8iw11p1.dtsi
index db8d122..102d0bd 100755
--- a/lichee/linux-3.10/arch/arm/boot/dts/sun8iw11p1.dtsi
+++ b/lichee/linux-3.10/arch/arm/boot/dts/sun8iw11p1.dtsi
@@ -1254,9 +1254,9 @@
                pwm: pwm@01c23400 {
                        compatible = "allwinner,sunxi-pwm";
                        reg = <0x0 0x01c23400 0x0 0x154>;
-                       pwm-number = <1>;
+                       pwm-number = <3>;
                        pwm-base = <0x0>;
-                       pwms = <&pwm0>, <&pwm1>;
+                       pwms = <&pwm0>, <&pwm1>,<&pwm7>;
                };
 
                pwm0: pwm0@01c23400 {
@@ -1437,6 +1437,96 @@
                        reg_active_width = <0x10>;
                };
 
+               pwm7: pwm7@01c23400 {
+                       compatible = "allwinner,sunxi-pwm7";
+                       pinctrl-names = "active", "sleep";
+                       reg_base = <0x01c23400>;
+                       reg_peci_offset = <0x00>;
+                       reg_peci_shift = <0x07>;
+                       reg_peci_width = <0x01>;
+
+                       reg_pis_offset = <0x04>;
+                       reg_pis_shift = <0x07>;
+                       reg_pis_width = <0x01>;
+
+                       reg_crie_offset = <0x10>;
+                       reg_crie_shift = <0x07>;
+                       reg_crie_width = <0x01>;
+
+                       reg_cfie_offset = <0x10>;
+                       reg_cfie_shift = <0x01>;
+                       reg_cfie_width = <0x01>;
+
+                       reg_cris_offset = <0x14>;
+                       reg_cris_shift = <0x07>;
+                       reg_cris_width = <0x01>;
+
+                       reg_cfis_offset = <0x14>;
+                       reg_cfis_shift = <0x01>;
+                       reg_cfis_width = <0x01>;
+
+                       reg_clk_src_offset = <0x20>;
+                       reg_clk_src_shift = <0x07>;
+                       reg_clk_src_width = <0x02>;
+
+                       reg_bypass_offset = <0x20>;
+                       reg_bypass_shift = <0x05>;
+                       reg_bypass_width = <0x01>;
+
+                       reg_clk_gating_offset = <0x2c>;
+                       reg_clk_gating_shift = <0x04>;
+                       reg_clk_gating_width = <0x01>;
+
+                       reg_clk_div_m_offset = <0x2c>;
+                       reg_clk_div_m_shift = <0x00>;
+                       reg_clk_div_m_width = <0x04>;
+
+                       reg_pdzintv_offset = <0x3c>;
+                       reg_pdzintv_shift = <0x08>;
+                       reg_pdzintv_width = <0x08>;
+
+                       reg_dz_en_offset = <0x3c>;
+                       reg_dz_en_shift = <0x00>;
+                       reg_dz_en_width = <0x01>;
+
+                       reg_enable_offset = <0x40>;
+                       reg_enable_shift = <0x07>;
+                       reg_enable_width = <0x01>;
+
+                       reg_cap_en_offset = <0x44>;
+                       reg_cap_en_shift = <0x07>;
+                       reg_cap_en_width = <0x01>;
+
+                       reg_period_rdy_offset = <0x140>;
+                       reg_period_rdy_shift = <0x0b>;
+                       reg_period_rdy_width = <0x01>;
+
+                       reg_pul_start_offset = <0x140>;
+                       reg_pul_start_shift = <0x0a>;
+                       reg_pul_start_width = <0x01>;
+
+                       reg_mode_offset = <0x140>;
+                       reg_mode_shift = <0x09>;
+                       reg_mode_width = <0x01>;
+
+                       reg_act_sta_offset = <0x140>;
+                       reg_act_sta_shift = <0x08>;
+                       reg_act_sta_width = <0x01>;
+
+                       reg_prescal_offset = <0x140>;
+                       reg_prescal_shift = <0x00>;
+                       reg_prescal_width = <0x08>;
+
+                       reg_entire_offset = <0x144>;
+                       reg_entire_shift = <0x10>;
+                       reg_entire_width = <0x10>;
+
+                       reg_active_offset = <0x144>;
+                       reg_active_shift = <0x00>;
+                       reg_active_width = <0x10>;
+               };
+
+               
  1. PWM节点修改
  • 在原有的pwm节点中,pwm-number<1>更改为<3>,这意味着现在有3个PWMs。
  • pwms属性中,添加了对pwm7的引用。
  1. 添加PWM7节点
  • 新增了一个名为pwm7的节点,它描述了PWM7的各种属性和寄存器偏移量。
  • 这个节点包含了PWM7的兼容性、引脚控制、各种寄存器的偏移量、位移和宽度等信息。

这些修改意味着现在系统可以识别和使用PWM7,并且为其配置了正确的参数。这对于需要调试使用PWM7的驱动程序来说是必要的。

相关文章
|
4月前
|
异构计算
FPGA新起点V1开发板(十)——按键控制LED
FPGA新起点V1开发板(十)——按键控制LED
FPGA新起点V1开发板(十)——按键控制LED
|
4月前
STM32Cubemx PWM驱动加湿器模拟火山喷发效果
STM32Cubemx PWM驱动加湿器模拟火山喷发效果
69 14
|
4月前
STM32Cubemx PWM驱动SG90舵机
STM32Cubemx PWM驱动SG90舵机
162 13
|
3月前
|
编解码 算法
掌握PWM:STM32F103实现PWM控制直流电机小风扇
PWM,即脉冲宽度调制(Pulse Width Modulation),是一种广泛应用于电子和电机控制领域的信号编码方法。PWM的核心思想是通过改变数字信号的脉冲宽度来模拟模拟信号的幅度变化,从而达到控制输出功率的目的。
506 0
|
4月前
|
异构计算
FPGA强化(9):TFT_LCD液晶屏驱动
FPGA强化(9):TFT_LCD液晶屏驱动
55 0
|
缓存 C++
基于ARM-contexA9-蜂鸣器pwm驱动开发
基于ARM-contexA9-蜂鸣器pwm驱动开发
109 0