u-bootソースコード:Allwinner F1C100S / F1C200Sスタディノート(3)-u-bootのコンパイルと
書き込みubootのデフォルトのターミナルシリアルポートはuart0
、ここでは次のように修正されていuart1
ます。
パッチ:
Allwinner f1c100s / f1c200s-ubootシリアルポート1ターミナルパッチパッケージ
パッチの使用:1。u-bootと同じレベルのディレクトリに配置し
ます。2。u -bootディレクトリに入りu-boot-uart1.patch
ます。3。実行し
ます
。patch -p1 < ../u-boot-uart1.patch
変更されたコンテンツ:
u-boot/arch/arm/dts/suniv-f1c100s-licheepi-nano.dts
17行目:
/ {
model = "Lichee Pi Nano";
compatible = "licheepi,licheepi-nano", "allwinner,suniv-f1c100s",
"allwinner,suniv";
aliases {
serial0 = &uart0;
serial1 = &uart1;
spi0 = &spi0;
};
chosen {
stdout-path = "serial1:115200n8";
};
};
...
&uart1 {
pinctrl-names = "default";
pinctrl-0 = <&uart1_pins_a>;
status = "okay";
};
u-boot/arch/arm/dts/suniv.dtsi
124行目:
pio: pinctrl@1c20800 {
compatible = "allwinner,suniv-pinctrl";
reg = <0x01c20800 0x400>;
interrupts = <38>, <39>, <40>;
clocks = <&ccu CLK_BUS_PIO>, <&osc24M>, <&osc32k>;
clock-names = "apb", "hosc", "losc";
gpio-controller;
interrupt-controller;
#interrupt-cells = <3>;
#gpio-cells = <3>;
spi0_pins_a: spi0-pins-pc {
pins = "PC0", "PC1", "PC2", "PC3";
function = "spi0";
};
uart0_pins_a: uart-pins-pe {
pins = "PE0", "PE1";
function = "uart0";
};
uart1_pins_a: uart-pins-pa {
pins = "PA2", "PA3";
function = "uart1";
};
};
/u-boot/arch/arm/include/asm/arch-sunxi/gpio.h
146行目:
#define SUNXI_GPA_EMAC 2
#define SUNIV_GPA_UART1 5
u-boot/include/configs/suniv.h
17行目:
#include <configs/sunxi-common.h>
#undef CONFIG_CONS_INDEX
#define CONFIG_CONS_INDEX 2 //UART1
#endif /* __CONFIG_H */
u-boot/arch/arm/mach-sunxi/board.c
86行目:
#elif CONFIG_CONS_INDEX == 1 && defined(CONFIG_MACH_SUNIV)
sunxi_gpio_set_cfgpin(SUNXI_GPE(0), SUNIV_GPE_UART0);
sunxi_gpio_set_cfgpin(SUNXI_GPE(1), SUNIV_GPE_UART0);
sunxi_gpio_set_pull(SUNXI_GPE(1), 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(3), SUNXI_GPIO_PULL_UP);