zoukankan      html  css  js  c++  java
  • am335x Linux kernel DTS pinmux 定义记录

    记录am335x TI PDK3.0 Linux Kernel 设备的pinmux 的配置

    在TI 的Linux kernel 设备树里面,有很多关于pinctrl-single,pins 的配置,
    我一直搞不懂这些配置的地址是怎么来,今天问了群的大牛终于得出了答案。

    • 大概跟了一下相关的代码,有如下:
        /*  arch/arm/boot/dts/am33xx.dtsi */
                scm: scm@210000 {
                    compatible = "ti,am3-scm", "simple-bus";
                    reg = <0x210000 0x2000>;
                    #address-cells = <1>;
                    #size-cells = <1>;
                    ranges = <0 0x210000 0x2000>;
    
                    am33xx_pinmux: pinmux@800 {
                        compatible = "pinctrl-single";
                        reg = <0x800 0x238>;     //  从0x800开始
                        #address-cells = <1>;
                        #size-cells = <0>;
                        pinctrl-single,register-width = <32>;
                        pinctrl-single,function-mask = <0x7f>;
                    };  
    
        上面的这份DTS的代码中,他规定了寄存器是从0x800 开始,
        所以在 
                AM335x ARM Cortex-A8 Microprocessors (MPUs) Technical Reference Manual (Rev.pdf
                9.3 CONTROL_MODULE Registers  有相关的地址标示,
        但是在 `*.dts ` 里面的代码是偏移了 0x800 的地址的,所以有如下代码:
    
      nandflash_pins_s0: nandflash_pins_s0 {
           pinctrl-single,pins = <
              0x0 (PIN_INPUT_PULLUP | MUX_MODE0)  /* gpmc_ad0.gpmc_ad0 */
              0x4 (PIN_INPUT_PULLUP | MUX_MODE0)  /* gpmc_ad1.gpmc_ad1 */
              0x8 (PIN_INPUT_PULLUP | MUX_MODE0)  /* gpmc_ad2.gpmc_ad2 */
              0xc (PIN_INPUT_PULLUP | MUX_MODE0)  /* gpmc_ad3.gpmc_ad3 */
              0x10 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad4.gpmc_ad4 */
              0x14 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad5.gpmc_ad5 */
              0x18 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad6.gpmc_ad6 */
              0x1c (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad7.gpmc_ad7 */
              0x70 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_wait0.gpmc_wait0 */
              0x74 (PIN_INPUT_PULLUP | MUX_MODE7) /* gpmc_wpn.gpio0_30 */
              0x7c (PIN_OUTPUT | MUX_MODE0)       /* gpmc_csn0.gpmc_csn0  */
              0x90 (PIN_OUTPUT | MUX_MODE0)       /* gpmc_advn_ale.gpmc_advn_ale */
              0x94 (PIN_OUTPUT | MUX_MODE0)       /* gpmc_oen_ren.gpmc_oen_ren */
              0x98 (PIN_OUTPUT | MUX_MODE0)       /* gpmc_wen.gpmc_wen */
              0x9c (PIN_OUTPUT | MUX_MODE0)       /* gpmc_be0n_cle.gpmc_be0n_cle */
          >;
      };
    
    • 对应的TRM描述如下所示:、


    * 对应的模式的设置要查看 AM335x ARM® Cortex™-A8 微处理器(MPU) 这一份datasheet, 找到对应的MODE,设置属于你自己模式。
  • 相关阅读:
    JS 定义函数的参数的个数,传入参数的个数对调用的影响
    jQuery常见操作总结
    jQuery hover事件
    Ajax实现登陆并友好提示错误信息
    JS实现弹出登录框
    .NET源码 SortedSet(红黑树)
    C#链接SQL Server数据库
    628. Maximum Product of Three Numbers 最大的三个数的乘积
    501. Find Mode in Binary Search Tree 找二叉搜索树的众数
    235. Lowest Common Ancestor of a Binary Search Tree 二叉搜索树的LCA
  • 原文地址:https://www.cnblogs.com/chenfulin5/p/6559405.html
Copyright © 2011-2022 走看看