#include <asm/arch/clk.h>
#include <asm/arch/reset.h>
#include <asm/arch/tieoff.h>
+#include <asm/arch/nx_gpio.h>
DECLARE_GLOBAL_DATA_PTR;
}
#ifdef CONFIG_PL011_SERIAL
+static void serial_set_pad_function(int index)
+{
+ switch (index) {
+ case 0:
+ /* gpiod-14, gpiod-18 */
+ nx_gpio_set_pad_function(3, 14, 1);
+ nx_gpio_set_pad_function(3, 18, 1);
+ break;
+ case 1:
+ /* gpiod-15, gpiod-19, gpioc-5, gpioc-6 */
+ nx_gpio_set_pad_function(3, 15, 1);
+ nx_gpio_set_pad_function(3, 19, 1);
+ nx_gpio_set_pad_function(2, 5, 2);
+ nx_gpio_set_pad_function(2, 6, 2);
+ break;
+ case 2:
+ /* gpiod-16, gpiod-20 */
+ nx_gpio_set_pad_function(3, 16, 1);
+ nx_gpio_set_pad_function(3, 20, 1);
+ break;
+ case 3:
+ /* gpiod-17, gpiod-21 */
+ nx_gpio_set_pad_function(3, 17, 1);
+ nx_gpio_set_pad_function(3, 21, 1);
+ break;
+ case 4:
+ /* gpiob-28, gpiob-29 */
+ nx_gpio_set_pad_function(1, 28, 3);
+ nx_gpio_set_pad_function(1, 29, 3);
+ break;
+ case 5:
+ /* gpiob-30, gpiob-31 */
+ nx_gpio_set_pad_function(1, 30, 3);
+ nx_gpio_set_pad_function(1, 31, 3);
+ break;
+ }
+}
+
static void serial_device_init(void)
{
char dev[10];
int id;
+ serial_set_pad_function(CONFIG_CONS_INDEX);
+
sprintf(dev, "nx-uart.%d", CONFIG_CONS_INDEX);
id = RESET_ID_UART0 + CONFIG_CONS_INDEX;