Original http://blog.chinaunix.net/uid-22547469-id-5091963.html
Category: LINUX
Need to clean up the idea of the solution.
Background: Dragon Boat Festival, did not go home, the object to go to class, leaving me on the nest Room drive, in fact, can go out to stroll Park.
Let's talk about the system environment: VirtualBox, Ubuntu15.04@64bit
OpenWrt version: Chaos calmer 15.05-rc2
Hardware board: MT7688,64MB DDR2,8MB SPI FLASH, a treasure LH7688
The problem solved: MT7688 The remaining two serial port can not communicate, the other UART2 port is still in analog pad mode.
Not to be continued ....
All right, take some time to replenish the whole.
The first step is to change DTS because the default Mt7628an.dts is missing Uart1 and uart2 configurations.
The second step is to increase the Pinctrl information.
Step three, modify arch/mips/ralink/mt7620.c
First of all, see Perst,wdt are wrong, by the way change them.
Prom_soc_init,add This code to fix Agpio_mode: (otherwise uart2 or network level)
After this change, the net mouth only left Lan0, personal feel not enough, and not to do the router.
Step fourth, modify the file drivers/pinctrl/pinmux_rt2880.c
Analysis
Line317,pinmux_map_to_setting,group is a group of each pin that is pinmux registered, and Groups[i] is all the PIN group groups that can be seen in mt7620.c. Here to match, that is, polling again, but there is a problem, Num_groups has been passed in 1, which led to 357 lines for the loop always loop. The problem is that the get_function_groups function is num_groups.
So what's really going to change is drivers/pinctrl/pinmux-rt2880.c.
Why change to 15, because MT7620.C saw 15 groups.
By the way, the last serious problem, please make kernel_menuconfig find device Drivers---->character devices----->serial Drivers--->number of 8250/16550 serial ports to register at runtime. Changed from 2 to 3. Next, 3 serial ports are up.
By the way, the last serious problem, please make kernel_menuconfig find device Drivers---->character devices----->serial Drivers--->number of 8250/16550 serial ports to register at runtime. Changed from 2 to 3. After this modification, the 3 serial ports are up.