git: a3ceeef26bc8 - main - arm64: lop off another 24MB of KVA for early device mappings

From: Kyle Evans <kevans_at_FreeBSD.org>
Date: Thu, 23 Nov 2023 16:23:28 UTC
The branch main has been updated by kevans:

URL: https://cgit.FreeBSD.org/src/commit/?id=a3ceeef26bc880b86f4e181bddd9924a2b5e0691

commit a3ceeef26bc880b86f4e181bddd9924a2b5e0691
Author:     Kyle Evans <kevans@FreeBSD.org>
AuthorDate: 2023-11-23 16:21:33 +0000
Commit:     Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2023-11-23 16:23:14 +0000

    arm64: lop off another 24MB of KVA for early device mappings
    
    This grows the block enough to fit a 4K 32-bit depth framebuffer; some
    firmware would present smaller GOP modes to be able to boot with a
    smaller framebuffer on these devices, but the Windows Devkit firmware
    is simply not that nice.  Instead, it offers exactly one GOP mode that
    matches the current resolution of the attached display, so with limited
    control over resolution on most of my displays it'd be nice if we could
    Just Work(TM) at 4K.
    
    andrew notes that he has some ideas for removing PMAP_MAPDEV_EARLY_SIZE
    entirely, so this limitation could end up removed altogether in the
    future.
    
    Reviewed by:    andrew, emaste
    Differential Revision:  https://reviews.freebsd.org/D42726
---
 sys/arm64/include/pte.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/sys/arm64/include/pte.h b/sys/arm64/include/pte.h
index f067feabe365..c3d0394e6e9f 100644
--- a/sys/arm64/include/pte.h
+++ b/sys/arm64/include/pte.h
@@ -164,7 +164,11 @@ typedef	uint64_t	pt_entry_t;		/* page table entry */
 	/* 0x2 also marks an invalid address */
 #define	L3_PAGE		0x3
 
-#define	PMAP_MAPDEV_EARLY_SIZE	(L2_SIZE * 8)
+/*
+ * A substantial portion of this is to make sure that we can cope with 4K
+ * framebuffers in early boot, assuming a common 4K resolution @ 32-bit depth.
+ */
+#define	PMAP_MAPDEV_EARLY_SIZE	(L2_SIZE * 20)
 
 #if PAGE_SIZE == PAGE_SIZE_4K
 #define	L0_ENTRIES_SHIFT 9