上一篇博客已经介绍了UART在lk里面的配置,接下来看看在kernel中的配置。
首先是UART的低速模式配置:
路径:/kernel/arch/ARM/boot/dts/qcom/msm8916.dtsi
aliases {
uart2 = & blsp1_uart2; //uart2将会被注册为 ttyHSL2
};
blsp1_uart2: serial@78b0000 {
compatible = "qcom,msm-lsuart-v14";
reg = <0x78b0000 0x200>;
interrupts = <0 108 0>;
status = "disabled";
clocks = <&clock_gcc clk_gcc_blsp1_uart2_apps_clk>,
<&clock_gcc clk_gcc_blsp1_ahb_clk>;
clock-names = "core_clk", "iface_clk";
};
上面是基础配置,接下来看一下引脚配置
路径:kernel/arch/arm/boot/dts/qcom/msm8916-pinctrl.dtsi
pmx-uartconsole {
qcom,pins = <&gp 4>, <&gp 5>;
qcom,num-grp-pins = <2>;
qcom,pin-func = <2>;
label = "uart-console";
uart_console_sleep: uart-console {
drive-strength = <2>;
bias-pull-down;
};
};
低速模式配置好了,接下来看一下UART的高速模式配置:
路径:/kerenl/arch/arm/boot/dts/qcom/msm8916.dtsi
aliases {
uart1 = & blsp1_uart1;
};
blsp1_uart1: uart@78af000 {
compatible = "qcom,msm-hsuart-v14";
reg = <0x78af000 0x200>,
<0x7884000 0x23000>;
reg-names = "core_mem", "bam_mem";
interrupt-names = "core_irq", "bam_irq", "wakeup_irq";
#address-cells = <0>;
interrupt-parent = <&blsp1_uart1>;
interrupts = <0 1 2>;
#interrupt-cells = <1>;
interrupt-map-mask = <0xffffffff>;
interrupt-map = <0 &intc 0 107 0
1 &intc 0 238 0
2 &msm_gpio 1 0>;
qcom,bam-tx-ep-pipe-index = <0>;
qcom,bam-rx-ep-pipe-index = <1>;
qcom,master-id = <86>;
clocks = <&clock_gcc clk_gcc_blsp1_uart1_apps_clk>,
<&clock_gcc clk_gcc_blsp1_ahb_clk>;
clock-names = "core_clk", "iface_clk";
qcom,msm-bus,name = "blsp1_uart1";
qcom,msm-bus,num-cases = <2>;
qcom,msm-bus,num-paths = <1>;
qcom,msm-bus,vectors-KBps =
<86 512 0 0>,
<86 512 500 800>;
pinctrl-names = "sleep", "default";
pinctrl-0 = <&hsuart_sleep>;
pinctrl-1 = <&hsuart_active>;
/*status = "disabled";*/
status = "ok";
};
上面是UART的基础配置,接下来看一下引脚配置:
路径:/kernel/arch/arm/boot/dts/qcom/msm8916-pinc
blsp1_uart1_active {
qcom,pins = <&gp 0>, <&gp 1>, <&gp 2>, <&gp 3>;
qcom,num-grp-pins = <4>;
qcom,pin-func = <2>;
label = "blsp1_uart1_active";
hsuart_active: default {
drive-strength = <16>;
bias-disable;
};
};
blsp1_uart1_sleep {
qcom,pins = <&gp 0>, <&gp 1>, <&gp 2>, <&gp 3>;
qcom,num-grp-pins = <4>;
qcom,pin-func = <0>;
label = "blsp1_uart1_sleep";
hsuart_sleep: sleep {
drive-strength = <2>;
bias-disable;
};
};
其他的UART就可以参考这个配置进行配置了。
|