From: Heiko Stuebner <heiko@sntech.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 5/8] rockchip: rk3288: reserve first 2MB when build with ATF support
Date: Fri, 5 Apr 2019 10:30:10 +0200 [thread overview]
Message-ID: <20190405083013.5473-6-heiko@sntech.de> (raw)
In-Reply-To: <20190405083013.5473-1-heiko@sntech.de>
ATF resides in the first 2MB of ram and will also protect this
area from non-secure access.
So similar to other Rockchip socs keep this area from the usable ram.
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
arch/arm/mach-rockchip/rk3288/rk3288.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/arch/arm/mach-rockchip/rk3288/rk3288.c b/arch/arm/mach-rockchip/rk3288/rk3288.c
index a725abc5a5..678ab0de65 100644
--- a/arch/arm/mach-rockchip/rk3288/rk3288.c
+++ b/arch/arm/mach-rockchip/rk3288/rk3288.c
@@ -2,11 +2,27 @@
/*
* Copyright (c) 2016 Rockchip Electronics Co., Ltd
*/
+#include <common.h>
#include <asm/io.h>
#include <asm/arch/hardware.h>
+DECLARE_GLOBAL_DATA_PTR;
+
#define GRF_SOC_CON2 0xff77024c
+int dram_init_banksize(void)
+{
+#ifdef CONFIG_SPL_ATF
+ size_t max_size = min((unsigned long)gd->ram_size, gd->ram_top);
+
+ /* Reserve 0x200000 for ATF bl32 */
+ gd->bd->bi_dram[0].start = 0x0200000;
+ gd->bd->bi_dram[0].size = max_size - gd->bd->bi_dram[0].start;
+#endif
+
+ return 0;
+}
+
int arch_cpu_init(void)
{
/* We do some SoC one time setting here. */
--
2.20.1
next prev parent reply other threads:[~2019-04-05 8:30 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-05 8:30 [U-Boot] [PATCH 0/8] arm-trusted-firmware support for rk3288 Heiko Stuebner
2019-04-05 8:30 ` [U-Boot] [PATCH 1/8] arm: v7: add read_mpidr function for arm32 Heiko Stuebner
2019-04-16 10:29 ` Matthias Brugger
2019-04-05 8:30 ` [U-Boot] [PATCH 2/8] spl: atf: add arm32 variant Heiko Stuebner
2019-04-05 8:30 ` [U-Boot] [PATCH 3/8] rockchip: rk3288: move TPL options to generic position Heiko Stuebner
2019-04-16 9:37 ` Jagan Teki
2019-04-05 8:30 ` [U-Boot] [PATCH 4/8] rockchip: rk3288: adjust load addresses Heiko Stuebner
2019-04-05 8:30 ` Heiko Stuebner [this message]
2019-05-07 2:29 ` [U-Boot] [PATCH 5/8] rockchip: rk3288: reserve first 2MB when build with ATF support Kever Yang
2019-04-05 8:30 ` [U-Boot] [PATCH 6/8] rockchip: rk3288: split evb into its two entities Heiko Stuebner
2019-04-05 8:30 ` [U-Boot] [PATCH 7/8] rockchip: rk3288: convert rk3288-evb to use tpl Heiko Stuebner
2019-05-07 2:32 ` Kever Yang
2019-04-05 8:30 ` [U-Boot] [PATCH 8/8] rockchip: rk3288: make both evb variants use atf Heiko Stuebner
2019-05-07 2:28 ` Kever Yang
[not found] ` <526672816.2740575.1557194072777.JavaMail.javamailuser@localhost>
2019-05-07 7:51 ` Heiko Stuebner
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=20190405083013.5473-6-heiko@sntech.de \
--to=heiko@sntech.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox