微處理器 - Allwinner F1C100S (荔枝派Nano) - 如何將U-Boot的輸出訊息轉到UART1
diff -Naur old/arch/arm/dts/suniv.dtsi new/arch/arm/dts/suniv.dtsi
--- old/arch/arm/dts/suniv.dtsi 2018-12-16 19:06:19.557062431 +0800
+++ new/arch/arm/dts/suniv.dtsi 2018-12-16 19:23:11.246260641 +0800
@@ -125,6 +125,11 @@
pins = "PE0", "PE1";
function = "uart0";
};
+
+ uart1_pins_a: uart-pins-pa {
+ pins = "PA2", "PA3";
+ function = "uart1";
+ };
};
timer@1c20c00 {
diff -Naur old/arch/arm/dts/suniv-f1c100s-licheepi-nano.dts new/arch/arm/dts/suniv-f1c100s-licheepi-nano.dts
--- old/arch/arm/dts/suniv-f1c100s-licheepi-nano.dts 2018-12-16 19:06:19.557062431 +0800
+++ new/arch/arm/dts/suniv-f1c100s-licheepi-nano.dts 2018-12-16 19:23:20.478103567 +0800
@@ -15,11 +15,12 @@
aliases {
serial0 = &uart0;
+ serial1 = &uart1;
spi0 = &spi0;
};
chosen {
- stdout-path = "serial0:115200n8";
+ stdout-path = "serial1:115200n8";
};
};
@@ -47,6 +48,12 @@
status = "okay";
};
+&uart1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart1_pins_a>;
+ status = "okay";
+};
+
&usb_otg {
dr_mode = "otg";
status = "okay";
diff -Naur old/arch/arm/include/asm/arch/gpio.h new/arch/arm/include/asm/arch/gpio.h
--- old/arch/arm/include/asm/arch/gpio.h 2018-12-16 19:06:19.589062838 +0800
+++ new/arch/arm/include/asm/arch/gpio.h 2018-12-16 19:24:23.697007683 +0800
@@ -176,6 +176,7 @@
#define SUNXI_GPD_LVDS0 3
#define SUNIV_GPE_UART0 5
+#define SUNIV_GPA_UART1 5
#define SUN5I_GPE_SDC2 3
#define SUN8I_GPE_TWI2 3
diff -Naur old/arch/arm/include/asm/arch-sunxi/gpio.h new/arch/arm/include/asm/arch-sunxi/gpio.h
--- old/arch/arm/include/asm/arch-sunxi/gpio.h 2018-12-16 19:06:19.589062838 +0800
+++ new/arch/arm/include/asm/arch-sunxi/gpio.h 2018-12-16 19:24:23.697007683 +0800
@@ -176,6 +176,7 @@
#define SUNXI_GPD_LVDS0 3
#define SUNIV_GPE_UART0 5
+#define SUNIV_GPA_UART1 5
#define SUN5I_GPE_SDC2 3
#define SUN8I_GPE_TWI2 3
diff -Naur old/arch/arm/mach-sunxi/board.c new/arch/arm/mach-sunxi/board.c
--- old/arch/arm/mach-sunxi/board.c 2018-12-16 19:06:19.641063500 +0800
+++ new/arch/arm/mach-sunxi/board.c 2018-12-16 19:26:02.219236670 +0800
@@ -137,6 +137,10 @@
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);
+#elif CONFIG_CONS_INDEX == 2 && defined(CONFIG_MACH_SUNIV)
+ sunxi_gpio_set_cfgpin(SUNXI_GPA(2), SUNIV_GPA_UART1);
+ sunxi_gpio_set_cfgpin(SUNXI_GPA(3), SUNIV_GPA_UART1);
+ sunxi_gpio_set_pull(SUNXI_GPA(2), SUNXI_GPIO_PULL_UP);
#else
#error Unsupported console port number. Please fix pin mux settings in board.c
#endif
diff -Naur old/.config new/.config
--- old/.config 2018-12-16 19:28:32.740409376 +0800
+++ new/.config 2018-12-16 19:28:27.412511586 +0800
@@ -143,7 +143,7 @@
CONFIG_SPL_LIBCOMMON_SUPPORT=y
CONFIG_SPL_LIBGENERIC_SUPPORT=y
CONFIG_SYS_MALLOC_F_LEN=0x400
-CONFIG_CONS_INDEX=1
+CONFIG_CONS_INDEX=2
CONFIG_SPL_MMC_SUPPORT=y
CONFIG_SPL_SERIAL_SUPPORT=y
# CONFIG_SPL_DRIVERS_MISC_SUPPORT is not set
diff -Naur old/include/configs/sunxi-common.h new/include/configs/sunxi-common.h
--- old/include/configs/sunxi-common.h 2018-12-16 19:06:20.293071786 +0800
+++ new/include/configs/sunxi-common.h 2018-12-16 19:27:23.281730234 +0800
@@ -273,6 +273,8 @@
#else
#define OF_STDOUT_PATH "/soc@01c00000/serial@01c28000:115200"
#endif
+#elif CONFIG_CONS_INDEX == 2 && defined(CONFIG_MACH_SUNIV)
+#define OF_STDOUT_PATH "/soc@01c00000/serial@01c28400:115200"
#elif CONFIG_CONS_INDEX == 2 && defined(CONFIG_MACH_SUN5I)
#define OF_STDOUT_PATH "/soc@01c00000/serial@01c28400:115200"
#elif CONFIG_CONS_INDEX == 3 && defined(CONFIG_MACH_SUN8I)