add first working meta-layer
This commit is contained in:
108
recipes-bsp/u-boot/files/0001-use-uart5-as-uboot-console.patch
Normal file
108
recipes-bsp/u-boot/files/0001-use-uart5-as-uboot-console.patch
Normal file
@ -0,0 +1,108 @@
|
||||
diff --git a/arch/arm/dts/sun50i-h616-orangepi-zero2w.dts b/arch/arm/dts/sun50i-h616-orangepi-zero2w.dts
|
||||
index 2e6e740dc..971891901 100644
|
||||
--- a/arch/arm/dts/sun50i-h616-orangepi-zero2w.dts
|
||||
+++ b/arch/arm/dts/sun50i-h616-orangepi-zero2w.dts
|
||||
@@ -17,10 +17,11 @@
|
||||
aliases {
|
||||
ethernet0 = &emac0;
|
||||
serial0 = &uart0;
|
||||
+ serial5 = &uart5;
|
||||
};
|
||||
|
||||
chosen {
|
||||
- stdout-path = "serial0:115200n8";
|
||||
+ stdout-path = "serial5:115200n8";
|
||||
};
|
||||
|
||||
leds {
|
||||
@@ -170,6 +171,12 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
+&uart5 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&uart5_ph_pins>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&usbotg {
|
||||
dr_mode = "peripheral";
|
||||
status = "okay";
|
||||
diff --git a/arch/arm/dts/sun50i-h616.dtsi b/arch/arm/dts/sun50i-h616.dtsi
|
||||
index dd4d2f311..1cc260298 100644
|
||||
--- a/arch/arm/dts/sun50i-h616.dtsi
|
||||
+++ b/arch/arm/dts/sun50i-h616.dtsi
|
||||
@@ -211,7 +211,10 @@
|
||||
pins = "PH0", "PH1";
|
||||
function = "uart0";
|
||||
};
|
||||
-
|
||||
+ uart5_ph_pins: uart5-ph-pins {
|
||||
+ pins = "PH2", "PH3";
|
||||
+ function = "uart5";
|
||||
+ };
|
||||
uart1_pins: uart1-pins {
|
||||
pins = "PG6", "PG7";
|
||||
function = "uart1";
|
||||
|
||||
diff --git a/arch/arm/include/asm/arch-sunxi/gpio.h b/arch/arm/include/asm/arch-sunxi/gpio.h
|
||||
index 2969a530a..bcb792a09 100644
|
||||
--- a/arch/arm/include/asm/arch-sunxi/gpio.h
|
||||
+++ b/arch/arm/include/asm/arch-sunxi/gpio.h
|
||||
@@ -208,6 +208,7 @@ enum sunxi_gpio_number {
|
||||
#define SUN9I_GPH_UART0 2
|
||||
#define SUN50I_H6_GPH_UART0 2
|
||||
#define SUN50I_H616_GPH_UART0 2
|
||||
+#define SUN50I_H616_GPH_UART5 2
|
||||
|
||||
#define SUNXI_GPI_SDC3 2
|
||||
#define SUN7I_GPI_TWI3 3
|
||||
diff --git a/arch/arm/mach-sunxi/board.c b/arch/arm/mach-sunxi/board.c
|
||||
index 0537c29b2..650bb928a 100644
|
||||
--- a/arch/arm/mach-sunxi/board.c
|
||||
+++ b/arch/arm/mach-sunxi/board.c
|
||||
@@ -135,6 +135,10 @@ static int gpio_init(void)
|
||||
sunxi_gpio_set_cfgpin(SUNXI_GPH(0), SUN50I_H616_GPH_UART0);
|
||||
sunxi_gpio_set_cfgpin(SUNXI_GPH(1), SUN50I_H616_GPH_UART0);
|
||||
sunxi_gpio_set_pull(SUNXI_GPH(1), SUNXI_GPIO_PULL_UP);
|
||||
+#elif CONFIG_CONS_INDEX == 6 && defined(CONFIG_MACH_SUN50I_H616)
|
||||
+ sunxi_gpio_set_cfgpin(SUNXI_GPH(2), SUN50I_H616_GPH_UART5);
|
||||
+ sunxi_gpio_set_cfgpin(SUNXI_GPH(3), SUN50I_H616_GPH_UART5);
|
||||
+ sunxi_gpio_set_pull(SUNXI_GPH(3), SUNXI_GPIO_PULL_UP);
|
||||
#elif CONFIG_CONS_INDEX == 1 && defined(CONFIG_MACH_SUN8I_A83T)
|
||||
sunxi_gpio_set_cfgpin(SUNXI_GPB(9), SUN8I_A83T_GPB_UART0);
|
||||
sunxi_gpio_set_cfgpin(SUNXI_GPB(10), SUN8I_A83T_GPB_UART0);
|
||||
|
||||
diff --git a/configs/orangepi_zero2w_defconfig b/configs/orangepi_zero2w_defconfig
|
||||
index 7bec5462d..267a708e8 100644
|
||||
--- a/configs/orangepi_zero2w_defconfig
|
||||
+++ b/configs/orangepi_zero2w_defconfig
|
||||
@@ -16,3 +16,4 @@ CONFIG_AXP_DCDC3_VOLT=1100
|
||||
CONFIG_SPL_I2C_SUPPORT=y
|
||||
CONFIG_AXP313A_POWER=y
|
||||
CONFIG_SPL_SPI_SUNXI=y
|
||||
+CONFIG_CONS_INDEX=6
|
||||
|
||||
diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
|
||||
index eb9ccf47c..2d93713a4 100644
|
||||
--- a/include/configs/sunxi-common.h
|
||||
+++ b/include/configs/sunxi-common.h
|
||||
@@ -46,6 +46,9 @@
|
||||
# define CONFIG_SYS_NS16550_COM3 SUNXI_UART2_BASE
|
||||
# define CONFIG_SYS_NS16550_COM4 SUNXI_UART3_BASE
|
||||
# define CONFIG_SYS_NS16550_COM5 SUNXI_R_UART_BASE
|
||||
+#ifdef CONFIG_MACH_SUN50I_H616
|
||||
+# define CONFIG_SYS_NS16550_COM6 0x05001400
|
||||
+#endif
|
||||
#endif
|
||||
|
||||
/* CPU */
|
||||
@@ -470,7 +473,7 @@ extern int soft_i2c_gpio_scl;
|
||||
MEM_LAYOUT_ENV_EXTRA_SETTINGS \
|
||||
DFU_ALT_INFO_RAM \
|
||||
"fdtfile=" FDTFILE "\0" \
|
||||
- "console=ttyS0,115200\0" \
|
||||
+ "console=ttyS5,115200\0" \
|
||||
SUNXI_MTDIDS_DEFAULT \
|
||||
SUNXI_MTDPARTS_DEFAULT \
|
||||
"uuid_gpt_esp=" UUID_GPT_ESP "\0" \
|
85142
recipes-bsp/u-boot/files/0002-debug.patch
Normal file
85142
recipes-bsp/u-boot/files/0002-debug.patch
Normal file
File diff suppressed because it is too large
Load Diff
83
recipes-bsp/u-boot/files/boot.cmd
Normal file
83
recipes-bsp/u-boot/files/boot.cmd
Normal file
@ -0,0 +1,83 @@
|
||||
# default values
|
||||
setenv load_addr "0x45000000"
|
||||
setenv overlay_error "false"
|
||||
setenv rootdev "/dev/mmcblk1p2"
|
||||
setenv verbosity "1"
|
||||
setenv rootfstype "ext4"
|
||||
setenv console "both"
|
||||
setenv bootlogo "false"
|
||||
setenv overlay_prefix "sun50i-h616"
|
||||
setenv disp_mode "1920x1080p60"
|
||||
setenv recovery "false"
|
||||
setenv recovery_image "recovery.initramfs"
|
||||
|
||||
# Print boot source
|
||||
itest.b *0x10028 == 0x00 && echo "U-boot loaded from SD"
|
||||
itest.b *0x10028 == 0x02 && echo "U-boot loaded from eMMC or secondary SD"
|
||||
itest.b *0x10028 == 0x03 && echo "U-boot loaded from SPI"
|
||||
|
||||
echo "Boot script loaded from ${devtype}"
|
||||
|
||||
if test -e ${devtype} ${devnum} config.txt; then
|
||||
load ${devtype} ${devnum} ${load_addr} config.txt
|
||||
env import -t ${load_addr} ${filesize}
|
||||
fi
|
||||
|
||||
if test "${console}" = "display" || test "${console}" = "both"; then setenv consoleargs "console=ttyS0,115200 console=tty1"; fi
|
||||
if test "${console}" = "serial"; then setenv consoleargs "console=ttyS0,115200"; fi
|
||||
if test "${bootlogo}" = "true"; then
|
||||
setenv consoleargs "splash plymouth.ignore-serial-consoles ${consoleargs}"
|
||||
else
|
||||
setenv consoleargs "splash=verbose ${consoleargs}"
|
||||
fi
|
||||
|
||||
# get PARTUUID of first partition on SD/eMMC it was loaded from
|
||||
# mmc 0 is always mapped to device u-boot (2016.09+) was loaded from
|
||||
if test "${devtype}" = "mmc"; then part uuid mmc 0:1 partuuid; fi
|
||||
|
||||
# consoleblank=0 loglevel=${verbosity}
|
||||
|
||||
setenv bootargs "root=${rootdev} rootwait rootfstype=${rootfstype} ${consoleargs} ubootpart=${partuuid} usb-storage.quirks=${usbstoragequirks} ${extraargs} ${extraboardargs}"
|
||||
|
||||
# if test "${docker_optimizations}" = "on"; then setenv bootargs "${bootargs} cgroup_enable=memory swapaccount=1"; fi
|
||||
|
||||
load ${devtype} ${devnum} ${fdt_addr_r} ${fdtfile}
|
||||
fdt addr ${fdt_addr_r}
|
||||
fdt resize 65536
|
||||
for overlay_file in ${overlays}; do
|
||||
if load ${devtype} ${devnum} ${load_addr} allwinner/overlay/${overlay_prefix}-${overlay_file}.dtbo; then
|
||||
echo "Applying kernel provided DT overlay ${overlay_prefix}-${overlay_file}.dtbo"
|
||||
fdt apply ${load_addr} || setenv overlay_error "true"
|
||||
fi
|
||||
done
|
||||
|
||||
if test "${overlay_error}" = "true"; then
|
||||
echo "Error applying DT overlays, restoring original DT"
|
||||
load ${devtype} ${devnum} ${fdt_addr_r} ${fdtfile}
|
||||
else
|
||||
if load ${devtype} ${devnum} ${load_addr} allwinner/overlay/${overlay_prefix}-fixup.scr; then
|
||||
echo "Applying kernel provided DT fixup script (${overlay_prefix}-fixup.scr)"
|
||||
source ${load_addr}
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "${ethernet_phy}" = "rtl8211f"; then
|
||||
fdt set /soc/ethernet@5020000 allwinner,rx-delay-ps <3100>
|
||||
fdt set /soc/ethernet@5020000 allwinner,tx-delay-ps <700>
|
||||
fi
|
||||
|
||||
if test "${ethernet_phy}" = "yt8531c"; then
|
||||
fdt set /soc/ethernet@5020000 allwinner,rx-delay-ps <0>
|
||||
fdt set /soc/ethernet@5020000 allwinner,tx-delay-ps <600>
|
||||
fi
|
||||
|
||||
load ${devtype} ${devnum} ${kernel_addr_r} Image
|
||||
if test "${recovery}" = "true"; then
|
||||
load ${devtype} ${devnum} ${ramdisk_addr_r} ${recovery_image}
|
||||
booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}
|
||||
else
|
||||
booti ${kernel_addr_r} - ${fdt_addr_r}
|
||||
fi
|
||||
|
||||
# Recompile with:
|
||||
# mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr
|
BIN
recipes-bsp/u-boot/files/boot.scr
Normal file
BIN
recipes-bsp/u-boot/files/boot.scr
Normal file
Binary file not shown.
Reference in New Issue
Block a user