@ -46,28 +46,33 @@ static int gpio_init(void)
sunxi_gpio_set_cfgpin ( SUNXI_GPB ( 22 ) , SUNXI_GPIO_INPUT ) ;
sunxi_gpio_set_cfgpin ( SUNXI_GPB ( 23 ) , SUNXI_GPIO_INPUT ) ;
# endif
sunxi_gpio_set_cfgpin ( SUNXI_GPF ( 2 ) , SUNXI_GPF2_UART0_TX ) ;
sunxi_gpio_set_cfgpin ( SUNXI_GPF ( 4 ) , SUNXI_GPF4_UART0_RX ) ;
# if defined(CONFIG_MACH_SUN8I)
sunxi_gpio_set_cfgpin ( SUNXI_GPF ( 2 ) , SUN8I_GPF_UART0_TX ) ;
sunxi_gpio_set_cfgpin ( SUNXI_GPF ( 4 ) , SUN8I_GPF_UART0_RX ) ;
# else
sunxi_gpio_set_cfgpin ( SUNXI_GPF ( 2 ) , SUNXI_GPF_UART0_TX ) ;
sunxi_gpio_set_cfgpin ( SUNXI_GPF ( 4 ) , SUNXI_GPF_UART0_RX ) ;
# endif
sunxi_gpio_set_pull ( SUNXI_GPF ( 4 ) , 1 ) ;
# elif CONFIG_CONS_INDEX == 1 && (defined(CONFIG_MACH_SUN4I) || defined(CONFIG_MACH_SUN7I))
sunxi_gpio_set_cfgpin ( SUNXI_GPB ( 22 ) , SUN4I_GPB22_UART0_TX ) ;
sunxi_gpio_set_cfgpin ( SUNXI_GPB ( 23 ) , SUN4I_GPB23_UART0_RX ) ;
sunxi_gpio_set_cfgpin ( SUNXI_GPB ( 22 ) , SUN4I_GPB_UART0 ) ;
sunxi_gpio_set_cfgpin ( SUNXI_GPB ( 23 ) , SUN4I_GPB_UART0 ) ;
sunxi_gpio_set_pull ( SUNXI_GPB ( 23 ) , SUNXI_GPIO_PULL_UP ) ;
# elif CONFIG_CONS_INDEX == 1 && defined(CONFIG_MACH_SUN5I)
sunxi_gpio_set_cfgpin ( SUNXI_GPB ( 19 ) , SUN5I_GPB19 _UART0_TX ) ;
sunxi_gpio_set_cfgpin ( SUNXI_GPB ( 20 ) , SUN5I_GPB20 _UART0_RX ) ;
sunxi_gpio_set_cfgpin ( SUNXI_GPB ( 19 ) , SUN5I_GPB_UART0 ) ;
sunxi_gpio_set_cfgpin ( SUNXI_GPB ( 20 ) , SUN5I_GPB_UART0 ) ;
sunxi_gpio_set_pull ( SUNXI_GPB ( 20 ) , SUNXI_GPIO_PULL_UP ) ;
# elif CONFIG_CONS_INDEX == 1 && defined(CONFIG_MACH_SUN6I)
sunxi_gpio_set_cfgpin ( SUNXI_GPH ( 20 ) , SUN6I_GPH20 _UART0_TX ) ;
sunxi_gpio_set_cfgpin ( SUNXI_GPH ( 21 ) , SUN6I_GPH21 _UART0_RX ) ;
sunxi_gpio_set_cfgpin ( SUNXI_GPH ( 20 ) , SUN6I_GPH_UART0 ) ;
sunxi_gpio_set_cfgpin ( SUNXI_GPH ( 21 ) , SUN6I_GPH_UART0 ) ;
sunxi_gpio_set_pull ( SUNXI_GPH ( 21 ) , SUNXI_GPIO_PULL_UP ) ;
# elif CONFIG_CONS_INDEX == 2 && defined(CONFIG_MACH_SUN5I)
sunxi_gpio_set_cfgpin ( SUNXI_GPG ( 3 ) , SUN5I_GPG3 _UART1_TX ) ;
sunxi_gpio_set_cfgpin ( SUNXI_GPG ( 4 ) , SUN5I_GPG4 _UART1_RX ) ;
sunxi_gpio_set_cfgpin ( SUNXI_GPG ( 3 ) , SUN5I_GPG_UART1 ) ;
sunxi_gpio_set_cfgpin ( SUNXI_GPG ( 4 ) , SUN5I_GPG_UART1 ) ;
sunxi_gpio_set_pull ( SUNXI_GPG ( 4 ) , SUNXI_GPIO_PULL_UP ) ;
# elif CONFIG_CONS_INDEX == 5 && defined(CONFIG_MACH_SUN8I)
sunxi_gpio_set_cfgpin ( SUNXI_GPL ( 2 ) , SUN8I_GPL2 _R_UART_TX ) ;
sunxi_gpio_set_cfgpin ( SUNXI_GPL ( 3 ) , SUN8I_GPL3 _R_UART_RX ) ;
sunxi_gpio_set_cfgpin ( SUNXI_GPL ( 2 ) , SUN8I_GPL_R_UART ) ;
sunxi_gpio_set_cfgpin ( SUNXI_GPL ( 3 ) , SUN8I_GPL_R_UART ) ;
sunxi_gpio_set_pull ( SUNXI_GPL ( 3 ) , SUNXI_GPIO_PULL_UP ) ;
# else
# error Unsupported console port number. Please fix pin mux settings in board.c