[PATCH uboot v2016.05-aspeed-openbmc 6/9] aspeed/ast-g4: use literal defines in misc_init_r()

Cédric Le Goater clg at kaod.org
Thu Jun 30 02:09:48 AEST 2016


and also make sure the routine is called: CONFIG_MISC_INIT_R still
needs to be defined in the platform config file.

Signed-off-by: Cédric Le Goater <clg at kaod.org>
---
 board/aspeed/ast-g4/ast-g4.c | 15 +++++++++------
 include/configs/ast-g4.h     |  1 +
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/board/aspeed/ast-g4/ast-g4.c b/board/aspeed/ast-g4/ast-g4.c
index c4fa76d216be..c632af70b9e1 100644
--- a/board/aspeed/ast-g4/ast-g4.c
+++ b/board/aspeed/ast-g4/ast-g4.c
@@ -7,7 +7,10 @@
 
 #include <common.h>
 #include <netdev.h>
+#include <asm/arch/platform.h>
 #include <asm/arch/ast-sdmc.h>
+#include <asm/arch/regs-ahbc.h>
+#include <asm/arch/regs-scu.h>
 #include <asm/io.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -36,14 +39,14 @@ int misc_init_r(void)
 	u32 reg;
 
 	/* Unlock AHB controller */
-	writel(0xAEED1A03, 0x1E600000);
+	writel(AHBC_PROTECT_UNLOCK, AST_AHBC_BASE);
 
 	/* Map DRAM to 0x00000000 */
-	reg = readl(0x1E60008C);
-	writel(reg | BIT(0), 0x1E60008C);
+	reg = readl(AST_AHBC_BASE + AST_AHBC_ADDR_REMAP);
+	writel(reg | BIT(0), AST_AHBC_BASE + AST_AHBC_ADDR_REMAP);
 
 	/* Unlock SCU */
-	writel(0x1688A8A8, 0x1e6e2000);
+	writel(SCU_PROTECT_UNLOCK, AST_SCU_BASE);
 
 	/*
 	 * The original file contained these comments.
@@ -53,10 +56,10 @@ int misc_init_r(void)
 	 * PCLK  = HPLL/8
 	 * BHCLK = HPLL/8
 	 */
-	reg = readl(0x1e6e2008);
+	reg = readl(AST_SCU_BASE + AST_SCU_CLK_SEL);
 	reg &= 0x1c0fffff;
 	reg |= 0x61800000;
-	writel(reg, 0x1e6e2008);
+	writel(reg, AST_SCU_BASE + AST_SCU_CLK_SEL);
 
 	return 0;
 }
diff --git a/include/configs/ast-g4.h b/include/configs/ast-g4.h
index ed182e0c8829..ab0a4bb7654d 100644
--- a/include/configs/ast-g4.h
+++ b/include/configs/ast-g4.h
@@ -20,6 +20,7 @@
 
 
 #define CONFIG_ARCH_CPU_INIT
+#define CONFIG_MISC_INIT_R
 #define CONFIG_MACH_TYPE		MACH_TYPE_ASPEED
 
 #include <asm/arch/platform.h>
-- 
2.1.4



More information about the openbmc mailing list