Created
April 21, 2022 00:53
-
-
Save apritzel/2a5163dea92a5d12afa606278a175a84 to your computer and use it in GitHub Desktop.
hackish U-Boot Allwinner H6 in ARMv7/32-bit patch, as a base for the Allwinner V5 port
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit 17efad455c2cb482f9f950cf6559f713379ce1f1 | |
Author: Andre Przywara <[email protected]> | |
Date: Thu Apr 21 01:20:49 2022 +0100 | |
naive H6 32-bit support (use lindenis_v5_defconfig) | |
diff --git a/arch/arm/include/asm/arch-sunxi/clock_sun50i_h6.h b/arch/arm/include/asm/arch-sunxi/clock_sun50i_h6.h | |
index 37df4410eaa..d821eafa85e 100644 | |
--- a/arch/arm/include/asm/arch-sunxi/clock_sun50i_h6.h | |
+++ b/arch/arm/include/asm/arch-sunxi/clock_sun50i_h6.h | |
@@ -263,7 +263,7 @@ struct sunxi_ccm_reg { | |
#define CCM_CPU_AXI_AXI_MASK 0x3 | |
#define CCM_CPU_AXI_DEFAULT_FACTORS 0x301 | |
-#ifdef CONFIG_MACH_SUN50I_H6 | |
+#if defined(CONFIG_MACH_SUN50I_H6) || defined(CONFIG_MACH_SUN8I_V5) | |
#define CCM_PLL6_DEFAULT 0xa0006300 | |
/* psi_ahb1_ahb2 bit field */ | |
diff --git a/arch/arm/include/asm/arch-sunxi/cpu_sun50i_h6.h b/arch/arm/include/asm/arch-sunxi/cpu_sun50i_h6.h | |
index d9cf8ae0428..488301c9d0a 100644 | |
--- a/arch/arm/include/asm/arch-sunxi/cpu_sun50i_h6.h | |
+++ b/arch/arm/include/asm/arch-sunxi/cpu_sun50i_h6.h | |
@@ -28,7 +28,7 @@ | |
#define SUNXI_GIC400_BASE 0x03020000 | |
#define SUNXI_IOMMU_BASE 0x030F0000 | |
-#ifdef CONFIG_MACH_SUN50I_H6 | |
+#if defined(CONFIG_MACH_SUN50I_H6) || defined(CONFIG_MACH_SUN8I_V5) | |
#define SUNXI_DRAM_COM_BASE 0x04002000 | |
#define SUNXI_DRAM_CTL0_BASE 0x04003000 | |
#define SUNXI_DRAM_PHY0_BASE 0x04005000 | |
diff --git a/arch/arm/include/asm/arch-sunxi/dram.h b/arch/arm/include/asm/arch-sunxi/dram.h | |
index 682daae6b1a..fe303014901 100644 | |
--- a/arch/arm/include/asm/arch-sunxi/dram.h | |
+++ b/arch/arm/include/asm/arch-sunxi/dram.h | |
@@ -27,7 +27,7 @@ | |
#include <asm/arch/dram_sunxi_dw.h> | |
#elif defined(CONFIG_MACH_SUN9I) | |
#include <asm/arch/dram_sun9i.h> | |
-#elif defined(CONFIG_MACH_SUN50I_H6) | |
+#elif defined(CONFIG_MACH_SUN50I_H6) || defined(CONFIG_MACH_SUN8I_V5) | |
#include <asm/arch/dram_sun50i_h6.h> | |
#elif defined(CONFIG_MACH_SUN50I_H616) | |
#include <asm/arch/dram_sun50i_h616.h> | |
diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig | |
index 1f43b253248..c686512dae1 100644 | |
--- a/arch/arm/mach-sunxi/Kconfig | |
+++ b/arch/arm/mach-sunxi/Kconfig | |
@@ -134,8 +134,8 @@ config SUNXI_GEN_SUN6I | |
config SUN50I_GEN_H6 | |
bool | |
- select FIT | |
- select SPL_LOAD_FIT | |
+ select FIT if ARM64 | |
+ select SPL_LOAD_FIT if ARM64 | |
select MMC_SUNXI_HAS_NEW_MODE | |
select SUPPORT_SPL | |
---help--- | |
@@ -359,6 +359,13 @@ config MACH_SUN50I_H6 | |
select DRAM_SUN50I_H6 | |
select SUN50I_GEN_H6 | |
+config MACH_SUN8I_V5 | |
+ bool "sun8i (Allwinner V5)" | |
+ select CPU_V7A | |
+ select PHY_SUN4I_USB | |
+ select DRAM_SUN50I_H6 | |
+ select SUN50I_GEN_H6 | |
+ | |
config MACH_SUN50I_H616 | |
bool "sun50i (Allwinner H616)" | |
select ARM64 | |
@@ -475,6 +482,7 @@ config DRAM_CLK | |
default 672 if MACH_SUN50I | |
default 744 if MACH_SUN50I_H6 | |
default 720 if MACH_SUN50I_H616 | |
+ default 744 if MACH_SUN8I_V5 | |
---help--- | |
Set the dram clock speed, valid range 240 - 480 (prior to sun9i), | |
must be a multiple of 24. For the sun9i (A80), the tested values | |
@@ -496,7 +504,7 @@ config DRAM_ZQ | |
MACH_SUN8I_A23 || MACH_SUN8I_A33 || MACH_SUN8I_A83T | |
default 127 if MACH_SUN7I | |
default 14779 if MACH_SUN8I_V3S | |
- default 3881979 if MACH_SUNXI_H3_H5 || MACH_SUN8I_R40 || MACH_SUN50I_H6 | |
+ default 3881979 if MACH_SUNXI_H3_H5 || MACH_SUN8I_R40 || MACH_SUN50I_H6 || MACH_SUN8I_V5 | |
default 4145117 if MACH_SUN9I | |
default 3881915 if MACH_SUN50I | |
---help--- | |
@@ -615,6 +623,7 @@ config SYS_CONFIG_NAME | |
default "sun50i" if MACH_SUN50I | |
default "sun50i" if MACH_SUN50I_H6 | |
default "sun50i" if MACH_SUN50I_H616 | |
+ default "sun50i" if MACH_SUN8I_V5 | |
config SYS_BOARD | |
default "sunxi" | |
diff --git a/arch/arm/mach-sunxi/board.c b/arch/arm/mach-sunxi/board.c | |
index 173e946465d..a821dc3bb6b 100644 | |
--- a/arch/arm/mach-sunxi/board.c | |
+++ b/arch/arm/mach-sunxi/board.c | |
@@ -126,7 +126,7 @@ static int gpio_init(void) | |
sunxi_gpio_set_cfgpin(SUNXI_GPB(8), SUN50I_GPB_UART0); | |
sunxi_gpio_set_cfgpin(SUNXI_GPB(9), SUN50I_GPB_UART0); | |
sunxi_gpio_set_pull(SUNXI_GPB(9), SUNXI_GPIO_PULL_UP); | |
-#elif CONFIG_CONS_INDEX == 1 && defined(CONFIG_MACH_SUN50I_H6) | |
+#elif CONFIG_CONS_INDEX == 1 && defined(CONFIG_SUN50I_GEN_H6) | |
sunxi_gpio_set_cfgpin(SUNXI_GPH(0), SUN50I_H6_GPH_UART0); | |
sunxi_gpio_set_cfgpin(SUNXI_GPH(1), SUN50I_H6_GPH_UART0); | |
sunxi_gpio_set_pull(SUNXI_GPH(1), SUNXI_GPIO_PULL_UP); | |
diff --git a/arch/arm/mach-sunxi/cpu_info.c b/arch/arm/mach-sunxi/cpu_info.c | |
index 7eef178859b..a8e09b94ece 100644 | |
--- a/arch/arm/mach-sunxi/cpu_info.c | |
+++ b/arch/arm/mach-sunxi/cpu_info.c | |
@@ -103,6 +103,8 @@ int print_cpuinfo(void) | |
puts("CPU: Allwinner H6 (SUN50I)\n"); | |
#elif defined CONFIG_MACH_SUN50I_H616 | |
puts("CPU: Allwinner H616 (SUN50I)\n"); | |
+#elif defined CONFIG_MACH_SUN8I_V5 | |
+ puts("CPU: Allwinner V5 (SUN8I)\n"); | |
#else | |
#warning Please update cpu_info.c with correct CPU information | |
puts("CPU: SUNXI Family\n"); | |
diff --git a/configs/lindenis_v5_defconfig b/configs/lindenis_v5_defconfig | |
new file mode 100644 | |
index 00000000000..77b108f0c34 | |
--- /dev/null | |
+++ b/configs/lindenis_v5_defconfig | |
@@ -0,0 +1,13 @@ | |
+CONFIG_ARM=y | |
+CONFIG_ARCH_SUNXI=y | |
+CONFIG_DEFAULT_DEVICE_TREE="sun50i-h6-pine-h64" | |
+CONFIG_SPL=y | |
+CONFIG_MACH_SUN8I_V5=y | |
+CONFIG_SUNXI_DRAM_H6_LPDDR3=y | |
+CONFIG_MMC0_CD_PIN="PF6" | |
+CONFIG_SPL_SPI_SUNXI=y | |
+# CONFIG_PSCI_RESET is not set | |
+# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set | |
+CONFIG_SUN8I_EMAC=y | |
+CONFIG_USB_EHCI_HCD=y | |
+CONFIG_USB_OHCI_HCD=y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment