RK3288 电源有关配置以及 PIN MUX 配置

  • 电源

  • kernel/arch/arm/boot/dts/rk3288-evb.dtsi

  • 基本上的电源都记录在上面的这个 dtsi 里面, 如果有新的 ic_enable ic_reset 引脚,都可以在这里进行配置。

    194     vcc_gps: vcc-gps-regulator {
    195         compatible = "regulator-fixed";
    196         enable-active-high;
    197         gpio = <&gpio4 4 GPIO_ACTIVE_LOW>;
    198         pinctrl-names = "default";
    199         pinctrl-0 = <&gps_gpio>;
    200         regulator-name = "vcc_gps";
    201         regulator-always-on;
    202         regulator-boot-on;
    203     };
    
    592     gps {
    593         gps_gpio: gps_gpio {
    594             rockchip,pins = <2 3 RK_FUNC_GPIO &pcfg_pull_down>,
    595                         <5 18 RK_FUNC_GPIO &pcfg_pull_up>;
    596             };
    597     };
    
  • pin mux 配置。

  • 这个配置方法主要在 RK3288 的文档上面的.

  • 如下,要配置 GPS 的 enable reset 引脚为 GPIO 模式

  • 在 Rockchip RK3288TRM Registers 文档里面, General Register Files (GRF) 章节, 找到 GPIO2_A3 引脚的属性

  • 找到之后,计算 GPIO 的位置.

  • GPIO2A[3] 对应的属性是 2 3, 2就是 GPIO2 的, 3 是 (0 * 8) + 3

  • GPIO2A A 有 8 个, B 有 8 个, C 也有 8 个, D 也有8个。

  • 如果是 GPIO2B[3] 那就是 2 11。 (1 * 8)+ 3 == 11。

  • 所以,设备树配置如下:

    592     gps {
    593         gps_gpio: gps_gpio {
    594             rockchip,pins = <2 3 RK_FUNC_GPIO &pcfg_pull_down>,
    595                         <5 18 RK_FUNC_GPIO &pcfg_pull_up>;
    596             };
    597     };
    
  • 上下拉配置配置

    pcfg_pull_down  下拉
    pcfg_pull_up 上拉
    pcfg_pull_none 不操作
    
  • 具体参考:

posted @ 2020-04-01 16:16  陈富林  阅读(2136)  评论(0编辑  收藏  举报