All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@arm.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 04/12] sunxi: Kconfig: introduce CONFIG_SUNXI_HIGH_SRAM
Date: Fri, 13 Jan 2017 01:29:56 +0000	[thread overview]
Message-ID: <1484271004-19681-5-git-send-email-andre.przywara@arm.com> (raw)
In-Reply-To: <1484271004-19681-1-git-send-email-andre.przywara@arm.com>

Traditionally Allwinner SoCs have their boot ROM mapped just below 4GB,
while the first SRAM region is mapped at address 0.
With the extended physical memory support of the A80 this was changed,
so the BROM is now at address 0 and the SRAM region starts right behind
this at 64KB. This configuration seems to be called "high SRAM".
Instead of enumerating the SoCs which have copied this configuration,
let's call a spade a spade and introduce a Kconfig option for this setup.
SoCs implementing this (A80, A64 and H5, so far), can then select this
configuration.
Simplify the config header definition on the way.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 arch/arm/include/asm/arch-sunxi/spl.h |  2 +-
 board/sunxi/Kconfig                   |  6 ++++++
 include/configs/sunxi-common.h        | 19 +++++++------------
 3 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/arch/arm/include/asm/arch-sunxi/spl.h b/arch/arm/include/asm/arch-sunxi/spl.h
index 5d7ab55..831d0c0 100644
--- a/arch/arm/include/asm/arch-sunxi/spl.h
+++ b/arch/arm/include/asm/arch-sunxi/spl.h
@@ -12,7 +12,7 @@
 #define SPL_SIGNATURE		"SPL" /* marks "sunxi" SPL header */
 #define SPL_HEADER_VERSION	1
 
-#if defined(CONFIG_MACH_SUN9I) || defined(CONFIG_MACH_SUN50I)
+#ifdef CONFIG_SUNXI_HIGH_SRAM
 #define SPL_ADDR		0x10000
 #else
 #define SPL_ADDR		0x0
diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
index 79b6fa7..feb6e79 100644
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -31,6 +31,10 @@ config SUNXI_NO_SMP
 	bool
 	default n
 
+config SUNXI_HIGH_SRAM
+	bool
+	default n
+
 # Note only one of these may be selected at a time! But hidden choices are
 # not supported by Kconfig
 config SUNXI_GEN_SUN4I
@@ -124,6 +128,7 @@ config MACH_SUN8I_H3
 config MACH_SUN9I
 	bool "sun9i (Allwinner A80)"
 	select CPU_V7
+	select SUNXI_HIGH_SRAM
 	select SUNXI_GEN_SUN6I
 	select SUPPORT_SPL
 
@@ -131,6 +136,7 @@ config MACH_SUN50I
 	bool "sun50i (Allwinner A64)"
 	select ARM64
 	select SUNXI_GEN_SUN6I
+	select SUNXI_HIGH_SRAM
 	select SUPPORT_SPL
 
 endchoice
diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index 04957b7..5ec43f4 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -86,7 +86,7 @@
 
 #define CONFIG_SPL_BSS_MAX_SIZE		0x00080000 /* 512 KiB */
 
-#if defined(CONFIG_MACH_SUN9I) || defined(CONFIG_MACH_SUN50I)
+#ifdef CONFIG_SUNXI_HIGH_SRAM
 /*
  * The A80's A1 sram starts at 0x00010000 rather then at 0x00000000 and is
  * slightly bigger. Note that it is possible to map the first 32 KiB of the
@@ -186,29 +186,24 @@
 #define CONFIG_SPL_BOARD_LOAD_IMAGE
 #endif
 
-#if defined(CONFIG_MACH_SUN9I) || defined(CONFIG_MACH_SUN50I)
+#ifdef CONFIG_SUNXI_HIGH_SRAM
 #define CONFIG_SPL_TEXT_BASE		0x10040		/* sram start+header */
-#define CONFIG_SPL_MAX_SIZE		0x7fc0		/* 32 KiB on sun9/50i */
+#define CONFIG_SPL_MAX_SIZE		0x7fc0		/* 32 KiB */
+#define LOW_LEVEL_SRAM_STACK		0x00018000
 #else
 #define CONFIG_SPL_TEXT_BASE		0x40		/* sram start+header */
 #define CONFIG_SPL_MAX_SIZE		0x5fc0		/* 24KB on sun4i/sun7i */
+#define LOW_LEVEL_SRAM_STACK		0x00008000	/* End of sram */
 #endif
 
+#define CONFIG_SPL_STACK		LOW_LEVEL_SRAM_STACK
+
 #ifndef CONFIG_ARM64
 #define CONFIG_SPL_LDSCRIPT "arch/arm/cpu/armv7/sunxi/u-boot-spl.lds"
 #endif
 
 #define CONFIG_SPL_PAD_TO		32768		/* decimal for 'dd' */
 
-#if defined(CONFIG_MACH_SUN9I) || defined(CONFIG_MACH_SUN50I)
-/* FIXME: 40 KiB instead of 32 KiB ? */
-#define LOW_LEVEL_SRAM_STACK		0x00018000
-#define CONFIG_SPL_STACK		LOW_LEVEL_SRAM_STACK
-#else
-/* end of 32 KiB in sram */
-#define LOW_LEVEL_SRAM_STACK		0x00008000 /* End of sram */
-#define CONFIG_SPL_STACK		LOW_LEVEL_SRAM_STACK
-#endif
 
 /* I2C */
 #if defined CONFIG_AXP152_POWER || defined CONFIG_AXP209_POWER || \
-- 
2.8.2

  parent reply	other threads:[~2017-01-13  1:29 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-13  1:29 [U-Boot] [PATCH 00/12] sunxi: Allwinner H5 and OrangePi PC2 support Andre Przywara
2017-01-13  1:29 ` [U-Boot] [PATCH 01/12] sunxi: fix ACTLR.SMP assembly routine Andre Przywara
2017-01-16  7:42   ` Maxime Ripard
2017-01-13  1:29 ` [U-Boot] [PATCH 02/12] sunxi: simplify ACTLR.SMP bit set #ifdef Andre Przywara
2017-01-13  4:41   ` Icenowy Zheng
2017-01-13  8:09     ` [U-Boot] [linux-sunxi] " Vishnu Patekar
2017-01-13  8:28       ` André Przywara
2017-01-16  7:44         ` Maxime Ripard
2017-01-22  1:06           ` André Przywara
2017-01-23  9:55             ` Maxime Ripard
2017-01-13  8:20     ` [U-Boot] " André Przywara
2017-01-13  1:29 ` [U-Boot] [PATCH 03/12] sunxi: configs: merge sun9i and sun50i SPL memory definitions Andre Przywara
2017-01-16  7:45   ` Maxime Ripard
2017-01-13  1:29 ` Andre Przywara [this message]
2017-01-16  7:46   ` [U-Boot] [PATCH 04/12] sunxi: Kconfig: introduce CONFIG_SUNXI_HIGH_SRAM Maxime Ripard
2017-01-13  1:29 ` [U-Boot] [PATCH 05/12] sunxi: provide ARMv8 mem_map for every ARM64 board Andre Przywara
2017-01-16  7:47   ` Maxime Ripard
2017-01-13  1:29 ` [U-Boot] [PATCH 06/12] SPI: SPL: sunxi: fix 64-bit build Andre Przywara
2017-01-15 12:17   ` Rask Ingemann Lambertsen
2017-01-19 13:57     ` Simon Glass
2017-01-13  1:29 ` [U-Boot] [PATCH 07/12] sunxi: DRAM: add Allwinner H5 support Andre Przywara
2017-01-16  7:56   ` Maxime Ripard
2017-01-13  1:30 ` [U-Boot] [PATCH 08/12] sunxi: prepare for sharing MACH_SUN8I_H3 config symbol Andre Przywara
2017-01-16  7:59   ` Maxime Ripard
2017-01-22  1:06     ` André Przywara
2017-01-13  1:30 ` [U-Boot] [PATCH 09/12] sunxi: H5: add COUNTER_FREQUENCY Andre Przywara
2017-01-16  8:01   ` Maxime Ripard
2017-01-22  1:06     ` André Przywara
2017-01-13  1:30 ` [U-Boot] [PATCH 10/12] sunxi: introduce Allwinner H5 config option Andre Przywara
2017-01-13  1:30 ` [U-Boot] [PATCH 11/12] sunxi: dts: add basic OrangePi PC 2 device tree file Andre Przywara
2017-01-13  1:30 ` [U-Boot] [PATCH 12/12] sunxi: configs: add basic OrangePi PC 2 defconfig Andre Przywara
2017-01-13  4:39 ` [U-Boot] [PATCH 00/12] sunxi: Allwinner H5 and OrangePi PC2 support Icenowy Zheng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1484271004-19681-5-git-send-email-andre.przywara@arm.com \
    --to=andre.przywara@arm.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.