public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Devarsh Thakkar <devarsht@ti.com>
To: <u-boot@lists.denx.de>, <sjg@chromium.org>, <agust@denx.de>,
	<trini@konsulko.com>, <bmeng.cn@gmail.com>, <msuchanek@suse.de>,
	<rasmus.villemoes@prevas.dk>, <yangshiji66@outlook.com>
Cc: <praneeth@ti.com>, <nm@ti.com>, <vigneshr@ti.com>,
	<a-bhatia1@ti.com>, <j-luthra@ti.com>, <devarsht@ti.com>,
	<nsekhar@ti.com>, <n-jain1@ti.com>
Subject: [RFC PATCH 1/5] arm: mach-k3: common: Reserve video memory from end of the RAM
Date: Mon, 16 Oct 2023 21:36:07 +0530	[thread overview]
Message-ID: <20231016160611.1353458-2-devarsht@ti.com> (raw)
In-Reply-To: <20231016160611.1353458-1-devarsht@ti.com>

Move the function to setup video memory before page table
reservation so that framebuffer memory gets reserved from
the end of RAM.

This is as per the new policy being discussed for passing
blobs where each of the reserved areas for bloblists
to be passed need to be reserved at the end of RAM.

This is to enable the next stage to directly skip
the pre-reserved area from previous stage without
having to making any gaps/holes to accomodate those
regions which was the case if previous stage
reserved region say somewhere in the middle and not at
the end of RAM.

Suggested-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Devarsh Thakkar <devarsht@ti.com>
---
 arch/arm/mach-k3/common.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c
index cc755dd1bf..3978b9ccca 100644
--- a/arch/arm/mach-k3/common.c
+++ b/arch/arm/mach-k3/common.c
@@ -27,6 +27,7 @@
 #include <env.h>
 #include <elf.h>
 #include <soc.h>
+#include <video.h>
 
 #if IS_ENABLED(CONFIG_SYS_K3_SPL_ATF)
 enum {
@@ -522,6 +523,24 @@ void remove_fwl_configs(struct fwl_data *fwl_data, size_t fwl_data_size)
 	}
 }
 
+static int video_setup(void)
+{
+	if (CONFIG_IS_ENABLED(VIDEO)) {
+		ulong addr;
+		int ret;
+
+		addr = gd->relocaddr;
+		ret = video_reserve(&addr);
+		if (ret)
+			return ret;
+		debug("Reserving %luk for video at: %08lx\n",
+		      ((unsigned long)gd->relocaddr - addr) >> 10, addr);
+		gd->relocaddr = addr;
+	}
+
+	return 0;
+}
+
 void spl_enable_dcache(void)
 {
 #if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF))
@@ -537,6 +556,8 @@ void spl_enable_dcache(void)
 	if (ram_top >= 0x100000000)
 		ram_top = (phys_addr_t) 0x100000000;
 
+	gd->relocaddr = ram_top;
+	video_setup();
 	gd->arch.tlb_addr = ram_top - gd->arch.tlb_size;
 	gd->arch.tlb_addr &= ~(0x10000 - 1);
 	debug("TLB table from %08lx to %08lx\n", gd->arch.tlb_addr,
-- 
2.34.1


  reply	other threads:[~2023-10-16 16:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-16 16:06 [RFC PATCH 0/5] Move video memory reservation for SPL at the end of RAM Devarsh Thakkar
2023-10-16 16:06 ` Devarsh Thakkar [this message]
2023-10-19 13:56   ` [RFC PATCH 1/5] arm: mach-k3: common: Reserve video memory from end of the RAM Simon Glass
2023-10-23 12:11     ` Devarsh Thakkar
2023-10-26 13:26       ` Tom Rini
2023-10-16 16:06 ` [RFC PATCH 2/5] board: ti: am62x: evm: Remove video_setup from spl_board_init Devarsh Thakkar
2023-10-16 16:06 ` [RFC PATCH 3/5] common/board_f: Catch bloblist before starting resevatinos Devarsh Thakkar
2023-10-16 16:06 ` [RFC PATCH 4/5] video: Skip framebuffer reservation if already reserved Devarsh Thakkar
2023-10-19 13:56   ` Simon Glass
2023-10-16 16:06 ` [RFC PATCH 5/5] video: Fill video handoff in video post probe Devarsh Thakkar

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=20231016160611.1353458-2-devarsht@ti.com \
    --to=devarsht@ti.com \
    --cc=a-bhatia1@ti.com \
    --cc=agust@denx.de \
    --cc=bmeng.cn@gmail.com \
    --cc=j-luthra@ti.com \
    --cc=msuchanek@suse.de \
    --cc=n-jain1@ti.com \
    --cc=nm@ti.com \
    --cc=nsekhar@ti.com \
    --cc=praneeth@ti.com \
    --cc=rasmus.villemoes@prevas.dk \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=vigneshr@ti.com \
    --cc=yangshiji66@outlook.com \
    /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