Conflicts:
	patch/u-boot/u-boot-sun50i-dev/add-FIT-support-H5-spl.patch
This commit is contained in:
Martin Ayotte 2017-04-26 10:41:17 -04:00
commit c116342b7f
9 changed files with 239 additions and 105 deletions

View file

@ -0,0 +1,20 @@
# H5 quad core 1GB RAM
BOARD_NAME="Nanopi M1+ 2"
LINUXFAMILY="sun50iw2"
BOOTCONFIG="nanopim1plus2_defconfig"
MODULES=""
MODULES_NEXT=""
CPUMIN="480000"
CPUMAX="1296000"
#
CLI_TARGET=""
DESKTOP_TARGET=""
KERNEL_TARGET="dev"
#
CLI_BETA_TARGET=""
DESKTOP_BETA_TARGET=""
#
BOARDRATING=""
CHIP="https://docs.armbian.com/Hardware_Allwinner-H5-A64/"
HARDWARE="https://linux-sunxi.org/Orange_Pi_PC_2"
FORUMS="https://forum.armbian.com/index.php/forum/11-other-boards/"

View file

@ -398,7 +398,7 @@ addtorepo()
# adding main
if find $POT -maxdepth 1 -type f -name "*.deb" 2>/dev/null | grep -q .; then
display_alert "Adding to repository $release" "main" "ext"
aptly repo add -force-replace=$replace -config=config/aptly.conf $release $POT/*.deb
aptly repo add -force-replace=$replace -remove-files -config=config/aptly.conf $release $POT/*.deb
else
display_alert "Not adding $release" "main" "wrn"
fi
@ -406,7 +406,7 @@ addtorepo()
# adding main distribution packages
if find ${POT}${release} -maxdepth 1 -type f -name "*.deb" 2>/dev/null | grep -q .; then
display_alert "Adding to repository $release" "main" "ext"
aptly repo add -force-replace=$replace -config=config/aptly.conf $release ${POT}${release}/*.deb
aptly repo add -force-replace=$replace -remove-files -config=config/aptly.conf $release ${POT}${release}/*.deb
else
display_alert "Not adding $release" "main" "wrn"
fi
@ -414,7 +414,7 @@ addtorepo()
# adding utils
if find ${POT}extra/utils -maxdepth 1 -type f -name "*.deb" 2>/dev/null | grep -q .; then
display_alert "Adding to repository $release" "utils" "ext"
aptly repo add -config=config/aptly.conf "utils" ${POT}extra/utils/*.deb
aptly repo add -config=config/aptly.conf -remove-files "utils" ${POT}extra/utils/*.deb
else
display_alert "Not adding $release" "utils" "wrn"
fi
@ -422,7 +422,7 @@ addtorepo()
# adding desktop
if find ${POT}extra/${release}-desktop -maxdepth 1 -type f -name "*.deb" 2>/dev/null | grep -q .; then
display_alert "Adding to repository $release" "desktop" "ext"
aptly repo add -force-replace=$replace -config=config/aptly.conf "${release}-desktop" ${POT}extra/${release}-desktop/*.deb
aptly repo add -force-replace=$replace -remove-files -config=config/aptly.conf "${release}-desktop" ${POT}extra/${release}-desktop/*.deb
else
display_alert "Not adding $release" "desktop" "wrn"
fi

View file

@ -9,7 +9,7 @@ index c73efd5..5783a72 100644
--- a/u-boot/configs/sun50i_h5_spl32_defconfig
+++ b/u-boot/configs/sun50i_h5_spl32_defconfig
@@ -4,12 +4,15 @@ CONFIG_MACH_SUN50I_H5_32=y
CONFIG_DRAM_CLK=672
CONFIG_DRAM_CLK=624
CONFIG_DRAM_ZQ=3881977
CONFIG_DRAM_ODT_EN=y
-# CONFIG_FIT is not set

View file

@ -8,7 +8,7 @@ index 0000000..6e550c8
+CONFIG_ARCH_SUNXI=y
+CONFIG_MACH_SUN50I_H5_64=y
+CONFIG_SPL=y
+CONFIG_DRAM_CLK=672
+CONFIG_DRAM_CLK=504
+CONFIG_DRAM_ZQ=3881977
+CONFIG_DEFAULT_DEVICE_TREE="sun50i-h5-nanopi2"
+# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set

View file

@ -181,7 +181,7 @@ index 0000000..68f889d
+CONFIG_ARCH_SUNXI=y
+CONFIG_MACH_SUN50I_H5_64=y
+CONFIG_SPL=y
+CONFIG_DRAM_CLK=672
+CONFIG_DRAM_CLK=624
+CONFIG_DRAM_ZQ=3881977
+CONFIG_DEFAULT_DEVICE_TREE="sun50i-h5-orangepi-prime"
+# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set

View file

@ -196,97 +196,3 @@ index 0000000..68f889d
+# CONFIG_CMD_FPGA is not set
+CONFIG_SUN8I_EMAC=y
+CONFIG_USB_EHCI_HCD=y
diff --git a/Makefile b/Makefile
index 5d56b3c..9c049f1 100644
--- a/Makefile
+++ b/Makefile
@@ -47,6 +47,17 @@ u_boot_a64_so:
$(MAKE) -C u-boot ARCH=arm CROSS_COMPILE="$(ccache) aarch64-linux-gnu-"
@cp u-boot/u-boot.bin u-boot.bin
+.PHONY: u_boot_a64_opiwin
+u_boot_a64_opiwin:
+ $(MAKE) -C u-boot clean
+ $(MAKE) -C u-boot ARCH=arm CROSS_COMPILE="$(ccache) arm-linux-gnueabihf-" sun50i_spl32_defconfig
+ $(MAKE) -C u-boot ARCH=arm CROSS_COMPILE="$(ccache) arm-linux-gnueabihf-"
+ @cp u-boot/spl/sunxi-spl.bin sunxi-spl.bin
+ $(MAKE) -C u-boot clean
+ $(MAKE) -C u-boot ARCH=arm CROSS_COMPILE="$(ccache) aarch64-linux-gnu-" orangepiwin_defconfig
+ $(MAKE) -C u-boot ARCH=arm CROSS_COMPILE="$(ccache) aarch64-linux-gnu-"
+ @cp u-boot/u-boot.bin u-boot.bin
+
.PHONY: arm_trusted_firmware
arm_trusted_firmware:
$(MAKE) -C arm-trusted-firmware PLAT=sun50iw1p1 DEBUG=1 CROSS_COMPILE="$(ccache) aarch64-linux-gnu-" bl31
@@ -72,6 +83,11 @@ pine64so: u_boot_a64_so arm_trusted_firmware
@u-boot/tools/mkimage -E -f config.its u-boot.itb
@aarch64-linux-gnu-objcopy --gap-fill=0xff -j .text -j .rodata -j .data -j .u_boot_list -j .rela.dyn -j .efi_runtime -j .efi_runtime_rel -I binary -O binary --pad-to=32768 --gap-fill=0xff sunxi-spl.bin u-boot-sunxi-with-spl.bin && cat u-boot.itb >> u-boot-sunxi-with-spl.bin
+.PHONY: orangepiwin
+orangepiwin: u_boot_a64_opiwin arm_trusted_firmware
+ @u-boot/tools/mkimage -E -f config.its u-boot.itb
+ @aarch64-linux-gnu-objcopy --gap-fill=0xff -j .text -j .rodata -j .data -j .u_boot_list -j .rela.dyn -j .efi_runtime -j .efi_runtime_rel -I binary -O binary --pad-to=32768 --gap-fill=0xff sunxi-spl.bin u-boot-sunxi-with-spl.bin && cat u-boot.itb >> u-boot-sunxi-with-spl.bin
+
.PHONY: clean
clean:
[ -f u-boot/Makefile ] && $(MAKE) -C u-boot ARCH=arm clean
@@ -86,6 +102,10 @@ pine64_plus_defconfig:
pine64_so_defconfig:
@cp blobs/sun50i_a64.its config.its
+.PHONY: orangepi_win_defconfig
+orangepi_win_defconfig:
+ @cp blobs/sun50i_a64_opiwin.its config.its
+
.PHONY: orangepi_pc2_defconfig
orangepi_pc2_defconfig:
@cp blobs/sun50i_h5.its config.its
diff --git a/blobs/sun50i_a64_opiwin.its b/blobs/sun50i_a64_opiwin.its
new file mode 100644
index 0000000..68f889d
--- /dev/null
+++ b/blobs/sun50i_a64_opiwin.its
@@ -0,0 +1,42 @@
+/dts-v1/;
+
+/ {
+ description = "Configuration to load ATF before U-Boot";
+ #address-cells = <1>;
+
+ images {
+ uboot@1 {
+ description = "U-Boot (64-bit)";
+ data = /incbin/("u-boot.bin");
+ type = "standalone";
+ arch = "arm64";
+ compression = "none";
+ load = <0x4a000000>;
+ };
+ atf@1 {
+ description = "ARM Trusted Firmware";
+ data = /incbin/("bl31.bin");
+ type = "firmware";
+ arch = "arm64";
+ compression = "none";
+ load = <0x44000>;
+ entry = <0x44000>;
+ };
+ fdt@1 {
+ description = "OrangePiWin DT";
+ data = /incbin/("u-boot/arch/arm/dts/sun50i-a64-orangepiwin.dtb");
+ type = "flat_dt";
+ compression = "none";
+ load = <0x4fa00000>;
+ };
+ };
+ configurations {
+ default = "config@1";
+
+ config@1 {
+ description = "Pine64";
+ loadables = "atf@1", "uboot@1";
+ fdt = "fdt@1";
+ };
+ };
+};
+

View file

@ -169,7 +169,7 @@ index 0000000..68f889d
+CONFIG_ARCH_SUNXI=y
+CONFIG_MACH_SUN50I_H5_64=y
+CONFIG_SPL=y
+CONFIG_DRAM_CLK=672
+CONFIG_DRAM_CLK=624
+CONFIG_DRAM_ZQ=3881977
+CONFIG_MMC_SUNXI_SLOT_EXTRA=2
+CONFIG_DEFAULT_DEVICE_TREE="sun50i-h5-orangepi-zeroplus"
@ -178,7 +178,7 @@ index 0000000..68f889d
+# CONFIG_CMD_IMLS is not set
+# CONFIG_CMD_FLASH is not set
+# CONFIG_CMD_FPGA is not set
+CONFIG_SUN8I_EMAC=y
+CONFIG_MMC_SUNXI_SLOT_EXTRA=2
+CONFIG_USB_EHCI_HCD=y
+CONFIG_VIDEO=y
+CONFIG_VIDEO_COMPOSITE=y

View file

@ -0,0 +1,208 @@
diff --git a/u-boot/arch/arm/dts/Makefile b/u-boot/arch/arm/dts/Makefile
index 15f2a76..5653153 100644
--- a/u-boot/arch/arm/dts/Makefile
+++ b/u-boot/arch/arm/dts/Makefile
@@ -283,7 +283,8 @@
dtb-$(CONFIG_MACH_SUN50I_H5) += \
sun50i-h5-orangepi-pc2.dtb \
sun50i-h5-orangepi-prime.dtb \
- sun50i-h5-orangepi-zeroplus.dtb
+ sun50i-h5-orangepi-zeroplus.dtb \
+ sun50i-h5-nanopim1plus2.dtb
dtb-$(CONFIG_MACH_SUN50I) += \
sun50i-a64-pine64-plus.dtb \
sun50i-a64-pine64.dtb \
diff --git a/u-boot/arch/arm/dts/sun50i-h5-nanopim1plus2.dts b/u-boot/arch/arm/dts/sun50i-h5-nanopim1plus2.dts
new file mode 100644
index 0000000..68f889d
--- /dev/null
+++ b/u-boot/arch/arm/dts/sun50i-h5-nanopim1plus2.dts
@@ -0,0 +1,165 @@
+/*
+ * Copyright (c) 2016 ARM Ltd.
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ * a) This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ * b) Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
+#include "sun8i-h3.dtsi"
+
+/ {
+ model = "Nanopi M1+ 2";
+ compatible = "xunlong,orangepi-pc-2", "allwinner,sun50i-h5";
+
+ chosen {
+ stdout-path = "serial0:115200n8";
+ };
+
+ memory {
+ reg = <0x40000000 0x40000000>;
+ };
+
+
+ aliases {
+ serial0 = &uart0;
+ ethernet0 = &emac;
+ };
+
+ soc {
+ reg_vcc3v3: vcc3v3 {
+ compatible = "regulator-fixed";
+ regulator-name = "vcc3v3";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ };
+ };
+
+ reg_gmac_3v3: gmac-3v3 {
+ compatible = "regulator-fixed";
+ regulator-name = "gmac-3v3";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ startup-delay-us = <100000>;
+ enable-active-high;
+ gpio = <&pio 3 14 GPIO_ACTIVE_HIGH>;
+ };
+
+ reg_usb1_vbus: usb1-vbus {
+ compatible = "regulator-fixed";
+ pinctrl-names = "default";
+ pinctrl-0 = <&usb1_vbus_pin_a>;
+ regulator-name = "usb1-vbus";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-boot-on;
+ enable-active-high;
+ gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>;
+ status = "okay";
+ };
+};
+
+&gic {
+ compatible = "arm,gic-400";
+};
+
+&mmc0 {
+ compatible = "allwinner,sun50i-h5-mmc",
+ "allwinner,sun50i-a64-mmc",
+ "allwinner,sun5i-a13-mmc";
+ pinctrl-names = "default";
+ pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
+ vmmc-supply = <&reg_vcc3v3>;
+ bus-width = <4>;
+ cd-gpios = <&pio 5 6 0>;
+ cd-inverted;
+ status = "okay";
+};
+
+&mmc2 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&mmc2_8bit_pins>;
+ vmmc-supply = <&reg_vcc3v3>;
+ vqmmc-supply = <&reg_vcc3v3>;
+ bus-width = <8>;
+ non-removable;
+ status = "okay";
+};
+
+&pio {
+ usb1_vbus_pin_a: usb1_vbus_pin@0 {
+ allwinner,pins = "PD6";
+ allwinner,function = "gpio_out";
+ allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+ allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+ };
+};
+&uart0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart0_pins_a>;
+ status = "okay";
+};
+
+&usbphy {
+ status = "okay";
+};
+
+&ohci1 {
+ status = "okay";
+};
+
+&ehci1 {
+ status = "okay";
+};
+&emac {
+ pinctrl-names = "default";
+ pinctrl-0 = <&emac_rgmii_pins>;
+ phy-mode = "rgmii";
+ phy-supply = <&reg_gmac_3v3>;
+ phy-handle = <&ext_rgmii_phy>;
+ status = "okay";
+
+ mdio {
+ ext_rgmii_phy: ethernet-phy@1 {
+ reg = <0>;
+ };
+ };
+};
diff --git a/u-boot/configs/nanopim1plus2_defconfig b/u-boot/configs/nanopim1plus2_defconfig
new file mode 100644
index 0000000..68f889d
--- /dev/null
+++ b/u-boot/configs/nanopim1plus2_defconfig
@@ -0,0 +1,17 @@
+CONFIG_ARM=y
+CONFIG_ARCH_SUNXI=y
+CONFIG_MACH_SUN50I_H5_64=y
+CONFIG_SPL=y
+CONFIG_DRAM_CLK=624
+CONFIG_DRAM_ZQ=3881977
+CONFIG_DEFAULT_DEVICE_TREE="sun50i-h5-nanopim1plus2"
+# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_CONSOLE_MUX=y
+# CONFIG_CMD_IMLS is not set
+# CONFIG_CMD_FLASH is not set
+# CONFIG_CMD_FPGA is not set
+CONFIG_SUN8I_EMAC=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_VIDEO=y
+CONFIG_VIDEO_COMPOSITE=y
+CONFIG_MMC_SUNXI_SLOT_EXTRA=2

View file

@ -43,7 +43,7 @@ declare -A mkopts mountopts
mkopts[ext2]='-qF'
mkopts[ext3]='-qF'
mkopts[ext4]='-qF'
mkopts[btrfs]='-qf'
mkopts[btrfs]='-f'
mountopts[ext2]='defaults,noatime,nodiratime,commit=600,errors=remount-ro 0 1'
mountopts[ext3]='defaults,noatime,nodiratime,commit=600,errors=remount-ro 0 1'
@ -60,7 +60,7 @@ create_armbian()
[[ -n $2 ]] && mount -o compress-force=zlib $2 /mnt/rootfs
elif [[ $eMMCFilesystemChoosen == "btrfs" && $FilesystemChoosen != "btrfs" ]]; then
[[ -n $1 ]] && mount ${1::-1}"1" /mnt/bootfs
[[ -n $2 ]] && mount $2 /mnt/rootfs
[[ -n $2 ]] && mount -o compress-force=zlib $2 /mnt/rootfs
else
[[ -n $2 ]] && mount $2 /mnt/rootfs
[[ -n $1 ]] && mount $1 /mnt/bootfs