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,设置属于你自己模式。
  • 相关阅读:
    Poj3126
    Poj1426
    2806 红与黑
    3100 蜗牛
    1225 八数码难题
    2549 自然数和分解
    2547 东方辉针城
    2928 你缺什么
    1629 01迷宫
    1029 遍历问题
  • 原文地址:https://www.cnblogs.com/chenfulin5/p/6559405.html
Copyright © 2011-2022 走看看