pinctrl里面的值是多少

问题描述 投票:0回答:1

我正在开发基于

iMX8MP
处理器的电路板。我正在查看设备树源,其中有很多引脚复用。例如:

pinctrl_keys: keysgrp {
    fsl,pins = <
        MX8MP_IOMUXC_SAI1_TXD1__GPIO4_IO13         0x00000140
        MX8MP_IOMUXC_SPDIF_TX__GPIO5_IO03          0x00000140
        MX8MP_IOMUXC_SPDIF_RX__GPIO5_IO04          0x00000140
        MX8MP_IOMUXC_SAI5_RXD2__GPIO3_IO23         0x00000140
    >;
};

我的问题是:价值

0x00000140
从何而来?这是什么意思。我查看了 iMX8MP 参考手册,但没有任何信息解释该值。

linux-kernel embedded-linux device-tree imx8
1个回答
1
投票

imx8mp pinctrl 设备树绑定的文档是Documentation/devicetree/bindings/pinctrl/fsl,imx8mp-pinctrl.yaml。这里将

fsl,pins
属性描述为:

properties:
  fsl,pins:
    description:
      each entry consists of 6 integers and represents the mux and config
      setting for one pin. The first 5 integers <mux_reg conf_reg input_reg
      mux_val input_val> are specified using a PIN_FUNC_ID macro, which can
      be found in <arch/arm64/boot/dts/freescale/imx8mp-pinfunc.h>. The last
      integer CONFIG is the pad setting value like pull-up on this pin. Please
      refer to i.MX8M Plus Reference Manual for detailed CONFIG settings.
    $ref: /schemas/types.yaml#/definitions/uint32-matrix
    items:
      items:
        - description: |
            "mux_reg" indicates the offset of mux register.
        - description: |
            "conf_reg" indicates the offset of pad configuration register.
        - description: |
            "input_reg" indicates the offset of select input register.
        - description: |
            "mux_val" indicates the mux value to be applied.
        - description: |
            "input_val" indicates the select input value to be applied.
        - description: |
            "pad_setting" indicates the pad configuration value to be applied.

如果我们以你的例子为例,MX8MP_IOMUXC_SAI1_TXD1__GPIO4_IO13 在 arch/arm64/boot/dts/freescale/imx8mp-pinfunc.h 中定义为

#define MX8MP_IOMUXC_SAI1_TXD1__GPIO4_IO13    0x17C 0x3DC 0x000 0x5 0x0

所以焊盘配置寄存器偏移量是0x3DC。如果我们查看 i.MX8M Plus 应用处理器参考手册,IOMUX 控制器 (IOMUXC) 中偏移量 0x3DC 处的寄存器是 SW_PAD_CTL_PAD_SAI1_TXD1 SW PAD 控制寄存器 (IOMUXC_SW_PAD_CTL_PAD_SAI1_TXD1):

田野 说明
8
体育
Pull Select Field
从 pad 的下一个值中选择一个:SAI1_TXD1
0 PE_0_PULL_DISABLE — Pull Disable
1 PE_1_PULL_ENABLE — Pull Enable
7
海斯
Input Select Field
从 pad 的下一个值中选择一个:SAI1_TXD1
0 HYS_0_CMOS — CMOS
1 HYS_1_SCHMITT — Schmitt
6
PUE
上拉/下拉配置。字段
从 pad 的下一个值中选择一个:SAI1_TXD1
0 PUE_0_WEAK_PULL_DOWN — 弱下拉
1 PUE_1_WEAK_PULL_UP — 弱上拉
5
颂歌
开漏场
从下一个焊盘值中选择一个:SAI1_TXD1
0 ODE_0_OPEN_DRAIN_DISABLE — 开漏禁用
1 ODE_1_OPEN_DRAIN_ENABLE — 开漏启用
4
FSEL
转换率字段
从焊盘的下一个值中选择一个:SAI1_TXD1
0 FSEL_0_SLOW_SLEW_RATE — 慢转换率 (SR=1)
1 FSEL_1_FAST_SLEW_RATE — 快速转换率 (SR=0)
3
-
此字段已保留。
预留
2–1
DSE
Drive Strength Field
选择 pad 的下一个值:SAI1_TXD1
00 DSE_X1 — X1
10 DSE_X2 — X2
01 DSE_X4 — X4
11 DSE_X6 — X6
0
-
此字段已保留。
预留

0x140 的焊盘配置值启用上拉,并禁用施密特触发器。其他设置无关紧要,因为这是一个输入引脚。

© www.soinside.com 2019 - 2024. All rights reserved.