From 6afc3325cc71f81e4e77d5727b5e0f034aed1708 Mon Sep 17 00:00:00 2001 From: Martijn Braam Date: Sat, 2 May 2020 17:04:53 +0200 Subject: [PATCH] U-boot sunxi speed up --- Makefile | 8 +- src/u-boot-pinephone.patch | 395 +++++++++++++++++++++++++++++++++++++ 2 files changed, 400 insertions(+), 3 deletions(-) create mode 100644 src/u-boot-pinephone.patch diff --git a/Makefile b/Makefile index 46647a0..fc82ecc 100644 --- a/Makefile +++ b/Makefile @@ -127,7 +127,7 @@ build/atf/sun50i_a64/bl31.bin: src/arm-trusted-firmware u-boot-sunxi-with-spl.bin: build/atf/sun50i_a64/bl31.bin src/u-boot @echo "MAKE $@" @mkdir -p build/u-boot/sun50i_a64 - @BL31=../../../build/atf/sun50i_a64/bl31.bin $(MAKE) -C src/u-boot O=../../build/u-boot/sun50i_a64 $(CROSS_FLAGS_BOOT) pine64-lts_defconfig + @BL31=../../../build/atf/sun50i_a64/bl31.bin $(MAKE) -C src/u-boot O=../../build/u-boot/sun50i_a64 $(CROSS_FLAGS_BOOT) pinephone_defconfig @BL31=../../../build/atf/sun50i_a64/bl31.bin $(MAKE) -C src/u-boot O=../../build/u-boot/sun50i_a64 $(CROSS_FLAGS_BOOT) ARCH=arm all @cp build/u-boot/sun50i_a64/u-boot-sunxi-with-spl.bin "$@" @@ -159,8 +159,10 @@ src/arm-trusted-firmware: src/u-boot: @echo "WGET u-boot" @mkdir src/u-boot - @wget ftp://ftp.denx.de/pub/u-boot/u-boot-2020.04-rc4.tar.bz2 - @tar -xvf u-boot-2020.04-rc4.tar.bz2 --strip-components 1 -C src/u-boot + @wget ftp://ftp.denx.de/pub/u-boot/u-boot-2020.04.tar.bz2 + @tar -xvf u-boot-2020.04.tar.bz2 --strip-components 1 -C src/u-boot + @cd src/u-boot && patch -p1 < ../u-boot-pinephone.patch + .PHONY: clean cleanfast diff --git a/src/u-boot-pinephone.patch b/src/u-boot-pinephone.patch new file mode 100644 index 0000000..0d52bb4 --- /dev/null +++ b/src/u-boot-pinephone.patch @@ -0,0 +1,395 @@ +From 0cdfb424bbab2f58dc5491f966137714c38005ec Mon Sep 17 00:00:00 2001 +From: Samuel Holland +Date: Sun, 15 Dec 2019 13:34:43 -0600 +Subject: [PATCH] [DO NOT MERGE] sun50i: a64: Add PinePhone DTS and defconfig + +Signed-off-by: Samuel Holland +--- + arch/arm/dts/Makefile | 1 + + arch/arm/dts/sun50i-a64-pinephone.dts | 328 ++++++++++++++++++++++++++ + configs/pinephone_defconfig | 25 ++ + 3 files changed, 354 insertions(+) + create mode 100644 arch/arm/dts/sun50i-a64-pinephone.dts + create mode 100644 configs/pinephone_defconfig + +diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile +index bb979550c44..4ffdae21c30 100644 +--- a/arch/arm/dts/Makefile ++++ b/arch/arm/dts/Makefile +@@ -576,6 +576,7 @@ dtb-$(CONFIG_MACH_SUN50I) += \ + sun50i-a64-pine64-plus.dtb \ + sun50i-a64-pine64.dtb \ + sun50i-a64-pinebook.dtb \ ++ sun50i-a64-pinephone.dtb \ + sun50i-a64-sopine-baseboard.dtb \ + sun50i-a64-teres-i.dtb + dtb-$(CONFIG_MACH_SUN9I) += \ +diff --git a/arch/arm/dts/sun50i-a64-pinephone.dts b/arch/arm/dts/sun50i-a64-pinephone.dts +new file mode 100644 +index 00000000000..5cc7df71d73 +--- /dev/null ++++ b/arch/arm/dts/sun50i-a64-pinephone.dts +@@ -0,0 +1,328 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright (C) 2019 Icenowy Zheng ++ * ++ */ ++ ++/dts-v1/; ++ ++#include "sun50i-a64.dtsi" ++ ++#include ++#include ++#include ++ ++/ { ++ model = "PinePhone"; ++ compatible = "pine64,pinephone", "allwinner,sun50i-a64"; ++ ++ aliases { ++ serial0 = &uart0; ++ ethernet0 = &rtl8723cs; ++ }; ++ ++ backlight: backlight { ++ compatible = "pwm-backlight"; ++ pwms = <&r_pwm 0 50000 PWM_POLARITY_INVERTED>; ++ brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>; ++ default-brightness-level = <8>; ++ enable-gpios = <&pio 7 10 GPIO_ACTIVE_HIGH>; /* PH10 LCD-BL-EN */ ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ blue { ++ label = "pinephone:blue:user"; ++ gpios = <&pio 3 20 GPIO_ACTIVE_HIGH>; /* PD20 */ ++ }; ++ ++ green { ++ label = "pinephone:green:user"; ++ gpios = <&pio 3 18 GPIO_ACTIVE_HIGH>; /* PD18 */ ++ }; ++ ++ red { ++ label = "pinephone:red:user"; ++ gpios = <&pio 3 19 GPIO_ACTIVE_HIGH>; /* PD19 */ ++ }; ++ }; ++ ++ reg_3v3_wifi: regulator-3v3-wifi{ ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc-wifi"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ }; ++ ++ reg_vbat_4g: regulator-vbat-4g{ ++ compatible = "regulator-fixed"; ++ regulator-name = "vbat-4g"; ++ regulator-min-microvolt = <3700000>; ++ regulator-max-microvolt = <3700000>; ++ gpio = <&r_pio 0 7 GPIO_ACTIVE_HIGH>; /* PL7 */ ++ enable-active-high; ++ }; ++ ++ reg_vcc5v0: regulator-vcc5v0 { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc5v0"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ gpio = <&pio 3 8 GPIO_ACTIVE_HIGH>; /* PD8 */ ++ enable-active-high; ++ }; ++ ++ speaker_amp: audio-amplifier { ++ compatible = "simple-audio-amplifier"; ++ enable-gpios = <&pio 2 7 GPIO_ACTIVE_HIGH>; /* PC7 */ ++ sound-name-prefix = "Speaker Amp"; ++ }; ++ ++ wifi_pwrseq: wifi_pwrseq { ++ compatible = "mmc-pwrseq-simple"; ++ reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */ ++ }; ++}; ++ ++&cpu0 { ++ cpu-supply = <®_dcdc2>; ++}; ++ ++&de { ++ status = "okay"; ++}; ++ ++&ehci0 { ++ status = "okay"; ++}; ++ ++&ehci1 { ++ status = "okay"; ++}; ++ ++&mmc0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mmc0_pins>; ++ vmmc-supply = <®_dcdc1>; ++ cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; ++ disable-wp; ++ bus-width = <4>; ++ status = "okay"; ++}; ++ ++&mmc1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mmc1_pins>; ++ vmmc-supply = <®_3v3_wifi>; ++ vqmmc-supply = <®_dldo4>; ++ mmc-pwrseq = <&wifi_pwrseq>; ++ bus-width = <4>; ++ non-removable; ++ status = "okay"; ++ ++ rtl8723cs: wifi@1 { ++ reg = <1>; ++ }; ++}; ++ ++&mmc2 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mmc2_pins>; ++ vmmc-supply = <®_dcdc1>; ++ vqmmc-supply = <®_dcdc1>; ++ bus-width = <8>; ++ non-removable; ++ cap-mmc-hw-reset; ++ status = "okay"; ++}; ++ ++&ohci0 { ++ status = "okay"; ++}; ++ ++&ohci1 { ++ status = "okay"; ++}; ++ ++&pio { ++ vcc-pe-supply = <®_aldo1>; ++ vcc-pg-supply = <®_dldo4>; ++}; ++ ++&r_pwm { ++ status = "okay"; ++}; ++ ++&r_rsb { ++ status = "okay"; ++ ++ axp803: pmic@3a3 { ++ compatible = "x-powers,axp803"; ++ reg = <0x3a3>; ++ interrupt-parent = <&r_intc>; ++ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; ++ }; ++}; ++ ++#include "axp803.dtsi" ++ ++®_aldo1 { ++ regulator-min-microvolt = <2800000>; ++ regulator-max-microvolt = <2800000>; ++ regulator-name = "dovdd-csi"; ++}; ++ ++®_aldo2 { ++ regulator-always-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-name = "vcc-pl"; ++}; ++ ++®_aldo3 { ++ regulator-always-on; ++ regulator-min-microvolt = <2700000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-name = "vcc-pll-avcc"; ++}; ++ ++®_dc1sw { ++ regulator-always-on; ++ regulator-name = "dc1sw"; ++}; ++ ++®_dcdc1 { ++ regulator-always-on; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-name = "vcc-3v3"; ++}; ++ ++®_dcdc2 { ++ regulator-always-on; ++ regulator-min-microvolt = <1000000>; ++ regulator-max-microvolt = <1300000>; ++ regulator-name = "vdd-cpux"; ++}; ++ ++/* DCDC3 is polyphased with DCDC2 */ ++ ++®_dcdc5 { ++ regulator-always-on; ++ regulator-min-microvolt = <1200000>; ++ regulator-max-microvolt = <1200000>; ++ regulator-name = "vcc-dram"; ++}; ++ ++®_dcdc6 { ++ regulator-always-on; ++ regulator-min-microvolt = <1100000>; ++ regulator-max-microvolt = <1100000>; ++ regulator-name = "vdd-sys"; ++}; ++ ++®_dldo1 { ++ regulator-always-on; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-name = "vcc-dsi-sensor"; ++}; ++ ++®_dldo2 { ++ regulator-always-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-name = "vcc-mipi-io"; ++}; ++ ++®_dldo3 { ++ regulator-min-microvolt = <2800000>; ++ regulator-max-microvolt = <2800000>; ++ regulator-name = "avdd-csi"; ++}; ++ ++®_dldo4 { ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-name = "vcc-wifi-io"; ++}; ++ ++®_eldo1 { ++ regulator-always-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-name = "vcc-lpddr"; ++}; ++ ++®_eldo3 { ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-name = "dvdd-1v8-csi"; ++}; ++ ++®_fldo1 { ++ regulator-min-microvolt = <1200000>; ++ regulator-max-microvolt = <1200000>; ++ regulator-name = "vcc-1v2-hsic"; ++}; ++ ++®_fldo2 { ++ regulator-always-on; ++ regulator-min-microvolt = <1100000>; ++ regulator-max-microvolt = <1100000>; ++ regulator-name = "vdd-cpus"; ++}; ++ ++®_ldo_io0 { ++ regulator-always-on; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-name = "vcc-lcd"; ++ status = "okay"; ++}; ++ ++®_ldo_io1 { ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-name = "vcc-1v8-typec"; ++ status = "okay"; ++}; ++ ++®_rtc_ldo { ++ regulator-name = "vcc-rtc"; ++}; ++ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_pb_pins>; ++ status = "okay"; ++}; ++ ++&uart1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>; ++ status = "okay"; ++ ++ bluetooth { ++ compatible = "realtek,rtl8723cs-bt"; ++ reset-gpios = <&r_pio 0 4 GPIO_ACTIVE_LOW>; /* PL4 */ ++ device-wake-gpios = <&pio 7 6 GPIO_ACTIVE_LOW>; /* PH6 */ ++ host-wake-gpios = <&r_pio 0 5 GPIO_ACTIVE_HIGH>; /* PL5 */ ++ firmware-postfix = "pinebook"; ++ }; ++}; ++ ++&usb_otg { ++ dr_mode = "peripheral"; ++ status = "okay"; ++}; ++ ++&usbphy { ++ usb1_vbus-supply = <®_vbat_4g>; ++ status = "okay"; ++}; +diff --git a/configs/pinephone_defconfig b/configs/pinephone_defconfig +new file mode 100644 +index 00000000000..f4b9f6adaad +--- /dev/null ++++ b/configs/pinephone_defconfig +@@ -0,0 +1,26 @@ ++CONFIG_ARM=y ++CONFIG_ARCH_SUNXI=y ++CONFIG_NR_DRAM_BANKS=1 ++CONFIG_SPL=y ++CONFIG_IDENT_STRING="" ++CONFIG_MACH_SUN50I=y ++CONFIG_SUNXI_DRAM_LPDDR3_STOCK=y ++CONFIG_DRAM_CLK=552 ++CONFIG_DRAM_ZQ=3881949 ++CONFIG_MMC_SUNXI_SLOT_EXTRA=2 ++# CONFIG_VIDEO_DE2 is not set ++# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set ++CONFIG_SYS_CONSOLE_INFO_QUIET=y ++# CONFIG_DISPLAY_CPUINFO is not set ++# CONFIG_DISPLAY_BOARDINFO is not set ++# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set ++# CONFIG_SPL_BANNER_PRINT is not set ++# CONFIG_SPL_POWER_SUPPORT is not set ++CONFIG_CMD_POWEROFF=y ++# CONFIG_SPL_DOS_PARTITION is not set ++# CONFIG_SPL_EFI_PARTITION is not set ++CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-pinephone" ++CONFIG_SYS_RELOC_GD_ENV_ADDR=y ++# CONFIG_NET is not set ++# CONFIG_EFI_LOADER is not set ++CONFIG_BOOTDELAY=0 +-- +2.26.2 +