New VoCore2 small size blocked UART0 and UART1, so I have to use UART2 for debug.
From datasheet, we have two plans for UART2:
The only valid plan for VoCore2 is SPIS_MODE.
Default uboot is using UART0 as default console port, we must change it.
MTK uboot source code already have it, we just need to modify two lines.
1. serial.h, change RT2880_UART1 in macro MT7628_ASIC_BOARD to RT2880_UART3.
This is to tell uboot, we will use UART3 control register(it is UART2 on chip).
2. serial.c, add one line in function serial_setbrg, ra_or(RALINK_SYSCTL_BASE + 0x0060, (1<<2|1<<3));
This is to change uart2 pins from gpio to real uart in system control.
After this, just simply "make menuconfig", remember to choose "ETH One Port", then "make", everything will work.
PS: uboot autoconf has a bug in config.in, have to change ETH_ONE_PORT_ONLY to CONFIG_ETH_ONE_PORT_ONLY.