sun8i-v3s.dtsi
uart0_pins_a: uart0@0 {
pins = "PB8", "PB9";
function = "uart0";
};
uart1_pins_a: uart1@0 {
pins = "PE21", "PE22";
function = "uart1";
bias-pull-up;
};
uart2_pins_a: uart2@0 {
pins = "PB0", "PB1";
function = "uart2";
bias-pull-up;
};
sun8i-v3s-licheepi-zero.dts
aliases {
serial0 = &uart0;
serial1 = &uart1;
serial2 = &uart2;
spi0 = &spi0;
};
chosen {
stdout-path = "serial1:115200n8";
};
&uart0 {
pinctrl-0 = <&uart0_pins_a>;
pinctrl-names = "default";
status = "okay";
};
&uart1 {
pinctrl-0 = <&uart1_pins_a>;
pinctrl-names = "default";
status = "okay";
};
&uart2 {
pinctrl-0 = <&uart2_pins_a>;
pinctrl-names = "default";
status = "okay";
};
#define CONFIG_BOOTARGS "console=ttyS1,115200 earlyprintk panic=5 rootwait " \
"mtdparts=spi32766.0:1M(uboot)ro,64k(dtb)ro,4M(kernel)ro,-(rootfs) root=31:03 rw rootfstype=jffs2"
以下由 @哇酷小二 2021-02-10 添加
------------------------------------
相关链接:
请问 荔枝派zero V3s主线u-boot 如何修改默认的串口为uart2(PB0/PB1) ?
http://whycan.com/t_1417.html
最近编辑记录 john78 (2018-09-10 17:23:52)
离线
2L是的,3L没改
离线
include/configs/sunxi-common.h
#define CONFIG_CONS_INDEX 1 /* UART0 */
改成:
#define CONFIG_CONS_INDEX 2 /* UART1 */
晕哥,坑还不小。不过改了这,编译就与提示了,gpio_init(void)中没有这个初始化。修改下,就可以了
离线
include/configs/sunxi-common.h
#define CONFIG_CONS_INDEX 2 /* UART1 */
下面增加
#elif CONFIG_CONS_INDEX == 2 && defined(CONFIG_MACH_SUN8I)
#define OF_STDOUT_PATH "/soc@01c00000/serial@01c28400:115200"
//还有增加这个引脚的初始化驱动
u-boot/arch/arm/include/asm/arch-sunxi/gpio.h
增加
#define SUN8I_V3S_GPE_UART1 4
u-boot/arch/arm/arch-sunxi/board.c
static int gpio_init(void)
{
增加
#elif CONFIG_CONS_INDEX == 2 && defined(CONFIG_MACH_SUN8I_V3S)
sunxi_gpio_set_cfgpin(SUNXI_GPE(21), SUN8I_V3S_GPE_UART1);
sunxi_gpio_set_cfgpin(SUNXI_GPE(22), SUN8I_V3S_GPE_UART1);
sunxi_gpio_set_pull(SUNXI_GPE(22), SUNXI_GPIO_PULL_UP);
}
离线