mt7620a拓展串口
要修改的文件有两个:
mt7620a.dtsi
进入/home/ihid/chaos_calmer/target/linux/ramips/dts/mt7620a.dtsi
pinctrl {
state_default: pinctrl0 {
gpio {
ralink,group ="i2c","uartf";
ralink,function ="gpio";
};
};
};
把uartf去掉。
MT7620a.dtsi
进入/home/ihid/chaos_calmer/target/linux/ramips/dts/MT7620a.dtsi
chosen {
bootargs ="console=ttyS0,57600";
};
把这个ttyS0,改为ttyS1,因为串口驱动起来后,ttyS0做为了扩展串口。Open串口时选择 ttyS0
uart@500 {
compatible ="ralink,mt7620a-uart","ralink,rt2880-uart", "ns16550a";
reg = <0x500 0x100>;
resets = <&rstctrl12>;
reset-names ="uart";
interrupt-parent =<&intc>;
interrupts = <5>;
reg-shift = <2>;
status ="disabled";
status= "disabled";改为:
pinctrl-names = "default";
pinctrl-0 = <&uartf_gpio_pins>;
status = "ok";
即把status = "disabled";这句注释掉或者删除,加上这句默认串口驱动没有加载。
pcm_i2s_pins: pcm_i2s {
pcm_i2s {
ralink,group ="uartf";
ralink,function ="pcm i2s";
};
};
uartf_gpio_pins: uartf_gpio {
uartf_gpio {
ralink,group ="uartf";
ralink,function ="gpio uartf";
};
这里把ralink,function的值都改为uartf。