]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
armv8/fsl-lsch3: Support 256M mem split for MC & dbg-srvr
authorPrabhakar Kushwaha <prabhakar@freescale.com>
Tue, 2 Jun 2015 05:25:52 +0000 (10:55 +0530)
committerLothar Waßmann <LW@KARO-electronics.de>
Wed, 9 Sep 2015 11:34:22 +0000 (13:34 +0200)
The agreed split of the top of memory is 256M for debug server and 256M
 for MC. This patch implements the split.

 In addition, the MC mem must be 512MB aligned, so the amount of memory
 to hide must be 512MB to achieve that alignment.

Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
Reviewed-by: York Sun <yorksun@freescale.com>
README
board/freescale/ls2085a/ls2085a.c
board/freescale/ls2085aqds/ls2085aqds.c
board/freescale/ls2085ardb/ls2085ardb.c
include/configs/ls2085a_common.h

diff --git a/README b/README
index 031684e247ec5ee7b2c8d07c229c38161543ec37..37e466cb134fac4e27ba2c3d75e4798eaf762d08 100644 (file)
--- a/README
+++ b/README
@@ -5184,6 +5184,21 @@ within that device.
        normal addressable memory via the LBC. CONFIG_SYS_LS_MC_FW_ADDR is the
        virtual address in NOR flash.
 
+Freescale Layerscape Debug Server Support:
+-------------------------------------------
+The Freescale Layerscape Debug Server Support supports the loading of
+"Debug Server firmware" and triggering SP boot-rom.
+This firmware often needs to be loaded during U-Boot booting.
+
+- CONFIG_FSL_DEBUG_SERVER
+       Enable the Debug Server for Layerscape SoCs.
+
+- CONFIG_SYS_DEBUG_SERVER_DRAM_BLOCK_MIN_SIZE
+       Define minimum DDR size required for debug server image
+
+- CONFIG_SYS_MEM_TOP_HIDE_MIN
+       Define minimum DDR size to be hided from top of the DDR memory
+
 Building the Software:
 ======================
 
index e43dd4c9af9442c79e66885c43b07a758b1e6bf9..73c44102c4442551b942805e65f23e45a2e0ab74 100644 (file)
@@ -80,7 +80,7 @@ unsigned long get_dram_size_to_hide(void)
        dram_to_hide += mc_get_dram_block_size();
 #endif
 
-       return dram_to_hide;
+       return roundup(dram_to_hide, CONFIG_SYS_MEM_TOP_HIDE_MIN);
 }
 
 int board_eth_init(bd_t *bis)
index 9b57799f91a12ad3a45a2a128e4a0b41f4930b48..c492c7e7d74d45af415fd75c24edc3c5baba19c9 100644 (file)
@@ -215,7 +215,7 @@ unsigned long get_dram_size_to_hide(void)
        dram_to_hide += mc_get_dram_block_size();
 #endif
 
-       return dram_to_hide;
+       return roundup(dram_to_hide, CONFIG_SYS_MEM_TOP_HIDE_MIN);
 }
 
 #ifdef CONFIG_FSL_MC_ENET
index 15cb25167cdf5d61cf5682a2b691df806a017527..1f8cf8a2e5f4e7f1ef01595013ec19251f578ae5 100644 (file)
@@ -212,7 +212,7 @@ unsigned long get_dram_size_to_hide(void)
        dram_to_hide += mc_get_dram_block_size();
 #endif
 
-       return dram_to_hide;
+       return roundup(dram_to_hide, CONFIG_SYS_MEM_TOP_HIDE_MIN);
 }
 
 #ifdef CONFIG_FSL_MC_ENET
index 1969696a7fcd72898e57b70afe5e962a4a9b48dc..1b4a35a25d61fe8abdd5aaccf7ed04b7b7daa764 100644 (file)
@@ -163,21 +163,27 @@ unsigned long long get_qixis_addr(void);
 #define CONFIG_SYS_NAND_BASE_PHYS              0x30000000
 
 /* Debug Server firmware */
-#define CONFIG_SYS_DEBUG_SERVER_DRAM_BLOCK_MIN_SIZE    (512UL * 1024 * 1024)
 /* 2 sec timeout */
 #define CONFIG_SYS_DEBUG_SERVER_TIMEOUT                        (2 * 1000 * 1000)
 
 /* MC firmware */
 #define CONFIG_FSL_MC_ENET
-#define CONFIG_SYS_LS_MC_DRAM_BLOCK_MIN_SIZE   (512UL * 1024 * 1024)
 /* TODO Actual DPL max length needs to be confirmed with the MC FW team */
 #define CONFIG_SYS_LS_MC_DPC_MAX_LENGTH            0x20000
 #define CONFIG_SYS_LS_MC_DRAM_DPC_OFFSET    0x00F00000
 #define CONFIG_SYS_LS_MC_DPL_MAX_LENGTH            0x20000
 #define CONFIG_SYS_LS_MC_DRAM_DPL_OFFSET    0x00F20000
 
-/* Carve out a DDR region which will not be used by u-boot/Linux */
+/*
+ * Carve out a DDR region which will not be used by u-boot/Linux
+ *
+ * It will be used by MC and Debug Server. The MC region must be
+ * 512MB aligned, so the min size to hide is 512MB.
+ */
 #if defined(CONFIG_FSL_MC_ENET) || defined(CONFIG_FSL_DEBUG_SERVER)
+#define CONFIG_SYS_DEBUG_SERVER_DRAM_BLOCK_MIN_SIZE    (256UL * 1024 * 1024)
+#define CONFIG_SYS_LS_MC_DRAM_BLOCK_MIN_SIZE           (256UL * 1024 * 1024)
+#define CONFIG_SYS_MEM_TOP_HIDE_MIN                    (512UL * 1024 * 1024)
 #define CONFIG_SYS_MEM_TOP_HIDE                get_dram_size_to_hide()
 #endif