OpenWRT (RT5350) By default enables a serial port (Uartlite), as the console port, another serial port (UARTF) and Gpio multiplexing.
In the process of finding data, it was found that the concept of device tree was used in the new kernel, and DTS files were used to describe all the resources of the Soc.
For the RT5350 platform, there are several system-related configuration files:
1, ~/openwrt/build_dir/target-mispel_24kec+dsp_musl-1.1.10/linux-ramips_rt305x/linux-3.10.49/arch/mips/ralink/ Rt305x.c
2, ~/openwrt/build_dir/target-mispel_24kec+dsp_musl-1.1.10/linux-ramips_rt305x/linux-3.10.49/drivers/pinctrl/ Pinctrl-rt2880.c
3, ~/openwrt/target/linux/ramips/dts/rt5350.dtsi
4, ~/openwrt/target/linux/ramips/dts/mpra2.dts
Two C files are mainly for the hardware platform related interface register definition, and the DTS file is closely related to the addition of debugging information is tracked, do not need to modify.
Two DTS files are mainly on the interface configuration, such as the system start output serial port settings, Gpio port, SPI,I2C interface settings;
The following begins to configure the serial port to enable two serial ports: (Key modification in two DTS files)
1, Mpra2.dts will state_default from the following content:
Gpio {ralink,group = "i²c", "Jtag", "Rgmii", "Mdio", "uartf"; ralink,function = "Gpio";};
Modified to:
Gpio {ralink,group = "i²c", "Jtag", "Rgmii", "mdio"; ralink,function = "Gpio";}; uartf {ralink,group = "uartf"; ralink,function = "Gpio uartf";};
2. Comment out all the contents of the last Gpio_export of the file in Mpra2.dts.
3, Rt5350.dtsi need to modify Bootargs so that Uartlite still as the console:
(Before opening uartf, Uartlite for ttyS0 as the console, after opening the uartf, Uartf becomes ttys0,uartlite into ttyS1)
chosen {Bootargs = "console=ttys1,57600";};
4, Rt5350.dtsi release [email protected] Status = "disabled";
Status = "Disabled";
At this point, two serial ports enable to complete!
OpenWRT (RT5350) enables two serial ports