Skip to content

Commit 5908cec

Browse files
Support Lenovo Xiaoxin Pad 12.7 Qcom.
1 parent 4de7083 commit 5908cec

File tree

10 files changed

+284
-5
lines changed

10 files changed

+284
-5
lines changed

.gitmodules

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
[submodule "Common/edk2"]
22
path = Common/edk2
3-
url = https://github.com/tianocore/edk2.git
3+
url = https://hub.nuaa.cf/tianocore/edk2.git
44
branch = 5801910013757bd626f67ed77eea6c16a176eebf
55
[submodule "Common/edk2-platforms"]
66
path = Common/edk2-platforms
7-
url = https://github.com/tianocore/edk2-platforms.git
7+
url = https://hub.nuaa.cf/tianocore/edk2-platforms.git
88
branch = d8232e8816fafb875a3656dda788b6681bc25149
99
[submodule "Platform/EFI_Binaries"]
1010
path = Platform/EFI_Binaries
11-
url = https://github.com/edk2-porting/edk2-msm-binary.git
11+
url = https://hub.nuaa.cf/edk2-porting/edk2-msm-binary.git
1212
[submodule "Platform/RenegadePkg/Library/SimpleInit"]
1313
path = GPLDrivers/Library/SimpleInit
14-
url = https://github.com/BigfootACA/simple-init.git
14+
url = https://hub.nuaa.cf/BigfootACA/simple-init.git
1515
[submodule "tools/Installer"]
1616
path = tools/Installer
17-
url = https://github.com/MollySophia/Flashable_UEFI_Installer
17+
url = https://hub.nuaa.cf/MollySophia/Flashable_UEFI_Installer
4.03 KB
Binary file not shown.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//
2+
// NOTE: The 3rd parameter (i.e. ComplianceRevision) must be >=2 for 64-bit integer support.
3+
//
4+
DefinitionBlock("DSDT.AML", "DSDT", 0x02, "QCOMM ", "SDM850 ", 3)
5+
{
6+
Scope(\_SB_) {
7+
8+
// Include("addSub.asl")
9+
Include("dsdt_common.asl")
10+
// Include("cust_dsdt.asl")
11+
12+
// Include("usb.asl")
13+
14+
//
15+
// Buttons
16+
//
17+
// Include("cust_arraybutton.asl")
18+
19+
//
20+
// Bluetooth
21+
//
22+
// Include("wcnss_bt.asl")
23+
}
24+
}
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
Name(SOID, 0xffffffff) // Holds the Chip Id
2+
Name(STOR, 0x1) // Holds boot options 0 = nvme, 1 = ufs
3+
Name(SIDS, "899800000000000") // Holds the Chip ID translated to a string
4+
Name(SIDV, 0xffffffff) // Holds the Chip Version as (major<<16)|(minor&0xffff)
5+
Name(SVMJ, 0xffff) // Holds the major Chip Version
6+
Name(SVMI, 0xffff) // Holds the minor Chip Version
7+
Name(SDFE, 0xffff) // Holds the Chip Family enum
8+
Name(SFES, "899800000000000") // Holds the Chip Family translated to a string
9+
Name(SIDM, 0xfffffffff) // Holds the Modem Support bit field
10+
Name(SUFS, 0x0) // Holds secondary UFS enablement (1 = enabled)
11+
Name(PUS3, 0x0) // Holds whether primary UFS has 3.0 part (1 = UFS 3.0 and newer)
12+
Name(SUS3, 0x0) // Holds whether secondary UFS has 3.0 part (1 = UFS 3.0 and newer)
13+
Name(SIDT, 0xffffffff) // Holds the Chip Tier value
14+
Name(SJTG, 0xffffffff) // Holds the JTAG ID
15+
Name(SOSN, 0xaaaaaaaabbbbbbbb) // Holds the Chip Serial Number
16+
Name(PLST, 0xffffffff) // Holds the Device platform subtype
17+
Name(EMUL, 0xffffffff) // Holds the Device emulation type
18+
Name (RMTB, 0xaaaaaaaa) // Holds the RemoteFS shared memory base address
19+
Name (RMTX, 0xbbbbbbbb) // Holds the RemoteFS shared memory length
20+
Name (RFMB, 0xcccccccc) // Holds the RFSA MPSS shared memory base address
21+
Name (RFMS, 0xdddddddd) // Holds the RFSA MPSS shared memory length
22+
Name (RFAB, 0xeeeeeeee) // Holds the RFSA ADSP shared memory base address
23+
Name (RFAS, 0x77777777) // Holds the RFSA ADSP shared memory length
24+
Name (TCMA, 0xDEADBEEF) // Holds TrEE Carveout Memory Address
25+
Name (TCML, 0xBEEFDEAD) // Holds TrEE Carveout Memory Length
26+
Name (SOSI, 0xdeadbeefffffffff) // Holds the base address of the SoCInfo shared memory region used by ChipInfoLib
27+
Name (PRP1, 0xFFFFFFFF) // 0xFFFFFFFF - PCIe state unknown : 0x00000001 - PCIe root port 1 present : 0x00000000 - PCIe root port 1 not present
28+
Name (SKUV, 0x1) // Set SKU Version to 1
29+
30+
//Audio Drivers
31+
// Include("audio.asl")
32+
33+
//
34+
// Storage - UFS/SD
35+
//
36+
Include("ufs.asl")
37+
// Include("sdc.asl") // No SD support on polaris
38+
39+
//
40+
// ASL Bridge Device
41+
//
42+
// Include("abd.asl")
43+
44+
Name (ESNL, 20) // Exsoc name limit 20 characters
45+
Name (DBFL, 23) // buffer Length, should be ESNL+3
46+
47+
//
48+
// PMIC driver
49+
//
50+
// Include("pmic_core.asl")
51+
52+
//
53+
// PMICTCC driver
54+
//
55+
// Include("pmic_batt.asl")
56+
57+
// Include("pep.asl")
58+
// Include("bam.asl")
59+
// Include("buses.asl")
60+
61+
// MPROC Drivers (PIL Driver and Subsystem Drivers)
62+
// Include("win_mproc.asl")
63+
// Include("syscache.asl")
64+
// Include("HoyaSmmu.asl")
65+
// Include("graphics.asl")
66+
67+
// Include("SCM.asl");
68+
69+
//
70+
// SPMI driver
71+
//
72+
// Include("spmi.asl")
73+
74+
//
75+
// TLMM controller.
76+
//
77+
// Include("qcgpio.asl")
78+
79+
// Include("pcie.asl")
80+
81+
// Include("cbsp_mproc.asl")
82+
83+
// Include("adsprpc.asl")
84+
85+
//
86+
// RemoteFS
87+
//
88+
// Include("rfs.asl")
89+
90+
//
91+
// Qualcomm IPA
92+
// Include("ipa.asl")
93+
94+
// Include("gsi.asl")
95+
96+
// Include("qcdb.asl")
97+
98+
// copied from sm7325, need to check
99+
Include("Pep_lpi.asl")
100+
101+
// QUPV3 GPI device node and resources
102+
//
103+
// Include("qgpi.asl")
950 KB
Binary file not shown.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#include <Library/BaseLib.h>
2+
#include <Library/PlatformMemoryMapLib.h>
3+
4+
static ARM_MEMORY_REGION_DESCRIPTOR_EX gDeviceMemoryDescriptorEx[] = {
5+
/* Hypervisor seems needed for windows boot? */
6+
{"Hypervisor", 0x80000000, 0x00600000, AddMem, SYS_MEM, SYS_MEM_CAP, Reserv, NS_DEVICE},
7+
{"HLOS 1", 0x80600000, 0x00100000, AddMem, SYS_MEM, SYS_MEM_CAP, Conv, WRITE_BACK_XN},
8+
{"AOP", 0x80700000, 0x00160000, AddMem, MEM_RES, UNCACHEABLE, Reserv, UNCACHED_UNBUFFERED_XN},
9+
{"AOP CMD DB", 0x80860000, 0x00020000, AddMem, MEM_RES, UNCACHEABLE, Reserv, UNCACHED_UNBUFFERED_XN},
10+
{"XBL Log Buffer", 0x80880000, 0x00014000, AddMem, SYS_MEM, SYS_MEM_CAP, Reserv, WRITE_BACK_XN},
11+
{"HLOS 2", 0x80894000, 0x0006C000, AddMem, SYS_MEM, SYS_MEM_CAP, Conv, WRITE_BACK_XN},
12+
{"SMEM", 0x80900000, 0x00200000, AddMem, MEM_RES, UNCACHEABLE, Reserv, UNCACHED_UNBUFFERED_XN},
13+
{"Removed Mem", 0x80b00000, 0x05700000, AddMem, SYS_MEM, SYS_MEM_CAP, Reserv, NS_DEVICE},
14+
{"PIL Reserved", 0x86200000, 0x05D00000, AddMem, SYS_MEM, SYS_MEM_CAP, Reserv, UNCACHED_UNBUFFERED_XN},
15+
{"HLOS 3", 0x8BF00000, 0x10100000, AddMem, SYS_MEM, SYS_MEM_CAP, Conv, WRITE_BACK_XN},
16+
{"Display Reserved", 0x9C000000, 0x02400000, AddMem, MEM_RES, SYS_MEM_CAP, Reserv, WRITE_THROUGH_XN},
17+
{"DBI Dump", 0x9E400000, 0x00F00000, NoHob, MMAP_IO, INITIALIZED, Conv, UNCACHED_UNBUFFERED_XN},
18+
{"HLOS 4", 0x9F300000, 0x00C00000, AddMem, SYS_MEM, SYS_MEM_CAP, Conv, WRITE_BACK_XN},
19+
{"SEC Heap", 0x9FF00000, 0x0008C000, AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK_XN},
20+
{"CPU Vectors", 0x9FF8C000, 0x00001000, AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK},
21+
{"MMU PageTables", 0x9FF8D000, 0x00003000, AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK_XN},
22+
{"UEFI Stack", 0x9FF90000, 0x00040000, AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK_XN},
23+
{"HLOS 5", 0x9FFD0000, 0x00027000, AddMem, SYS_MEM, SYS_MEM_CAP, Conv, WRITE_BACK_XN},
24+
{"Log Buffer", 0x9FFF7000, 0x00008000, AddMem, SYS_MEM, SYS_MEM_CAP, Reserv, WRITE_BACK_XN},
25+
{"Info Blk", 0x9FFFF000, 0x00001000, AddMem, SYS_MEM, SYS_MEM_CAP, Reserv, WRITE_BACK_XN},
26+
27+
{"HLOS 6", 0xA0000000, 0x10000000, AddMem, SYS_MEM, SYS_MEM_CAP, Conv, WRITE_BACK_XN},
28+
/* Set pstore size to 0x00500000, otherwise OnePlus 8 Pro will crashdump. */
29+
{"PSTORE", 0xB0000000, 0x00500000, AddMem, SYS_MEM, SYS_MEM_CAP, Reserv, WRITE_BACK_XN},
30+
{"HLOS 7", 0xB0400000, 0x0C800000, AddMem, SYS_MEM, SYS_MEM_CAP, Conv, WRITE_BACK_XN},
31+
32+
{"DXE Heap", 0xC0000000, 0x0E000000, AddMem, SYS_MEM, SYS_MEM_CAP, Conv, WRITE_BACK_XN},
33+
{"UEFI FD", 0xCE000000, 0x02000000, AddMem, SYS_MEM, SYS_MEM_CAP, BsData, WRITE_BACK},
34+
35+
{"RAM Partition", 0xD0000000,0x130000000, AddMem, SYS_MEM, SYS_MEM_CAP, Conv, WRITE_BACK_XN},
36+
37+
/* Other memory regions */
38+
{"IMEM Base", 0x14680000, 0x00040000, NoHob, MMAP_IO, INITIALIZED, Conv, NS_DEVICE},
39+
{"IMEM Cookie Base", 0x146BF000, 0x00001000, AddDev, MMAP_IO, INITIALIZED, Conv, NS_DEVICE},
40+
41+
/* Register regions */
42+
{"IPC_ROUTER_TOP", 0x00400000, 0x00100000, AddDev, MMAP_IO, UNCACHEABLE, MmIO, NS_DEVICE},
43+
{"SECURITY CONTROL", 0x00780000, 0x00007000, AddDev, MMAP_IO, UNCACHEABLE, MmIO, NS_DEVICE},
44+
{"QUPV3_2_GSI", 0x00800000, 0x000D0000, AddDev, MMAP_IO, UNCACHEABLE, MmIO, NS_DEVICE},
45+
{"QUPV3_0_GSI", 0x00900000, 0x000D0000, AddDev, MMAP_IO, UNCACHEABLE, MmIO, NS_DEVICE},
46+
{"QUPV3_1_GSI", 0x00A00000, 0x000D0000, AddDev, MMAP_IO, UNCACHEABLE, MmIO, NS_DEVICE},
47+
{"PRNG_CFG_PRNG", 0x00790000, 0x00010000, AddDev, MMAP_IO, UNCACHEABLE, MmIO, NS_DEVICE},
48+
{"CRYPTO0 CRYPTO", 0x01DC0000, 0x00040000, AddDev, MMAP_IO, UNCACHEABLE, MmIO, NS_DEVICE},
49+
{"TCSR_TCSR_REGS", 0x01FC0000, 0x00030000, AddDev, MMAP_IO, UNCACHEABLE, MmIO, NS_DEVICE},
50+
{"GPU_GMU_CX_BLK", 0x02C7D000, 0x00002000, AddDev, MMAP_IO, UNCACHEABLE, MmIO, NS_DEVICE},
51+
{"GPU_CC", 0x02C90000, 0x0000A000, AddDev, MMAP_IO, UNCACHEABLE, MmIO, NS_DEVICE},
52+
{"QUPV3_SSC_GSI", 0x05A00000, 0x000D0000, AddDev, MMAP_IO, UNCACHEABLE, MmIO, NS_DEVICE},
53+
{"PERIPH_SS", 0x08800000, 0x00200000, AddDev, MMAP_IO, UNCACHEABLE, MmIO, NS_DEVICE},
54+
{"USB30_PRIM", 0x0A600000, 0x0011B000, AddDev, MMAP_IO, UNCACHEABLE, MmIO, NS_DEVICE},
55+
{"USB_RUMI", 0x0A720000, 0x00010000, AddDev, MMAP_IO, UNCACHEABLE, MmIO, NS_DEVICE},
56+
{"USB30_SEC", 0x0A800000, 0x0011B000, AddDev, MMAP_IO, UNCACHEABLE, MmIO, NS_DEVICE},
57+
{"AOSS", 0x0B000000, 0x04000000, AddDev, MMAP_IO, UNCACHEABLE, MmIO, NS_DEVICE},
58+
{"TLMM_WEST", 0x0F100000, 0x00300000, AddDev, MMAP_IO, UNCACHEABLE, MmIO, NS_DEVICE},
59+
{"TLMM_SOUTH", 0x0F500000, 0x00300000, AddDev, MMAP_IO, UNCACHEABLE, MmIO, NS_DEVICE},
60+
{"TLMM_NORTH", 0x0F900000, 0x00300000, AddDev, MMAP_IO, UNCACHEABLE, MmIO, NS_DEVICE},
61+
{"SMMU", 0x15000000, 0x000D0000, AddDev, MMAP_IO, UNCACHEABLE, MmIO, NS_DEVICE},
62+
{"APSS_HM", 0x17800000, 0x0d981000, AddDev, MMAP_IO, UNCACHEABLE, MmIO, NS_DEVICE},
63+
{"Terminator", 0, 0, 0, 0, 0, 0, 0}
64+
};
65+
66+
ARM_MEMORY_REGION_DESCRIPTOR_EX *GetPlatformMemoryMap()
67+
{
68+
return gDeviceMemoryDescriptorEx;
69+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
## @file
2+
# PlatformMemoryMapLib
3+
#
4+
# Copyright (c) DuoWoA authors. All rights reserved.
5+
# Copyright (c) Renegade Project. All rights reserved.
6+
# SPDX-License-Identifier: BSD-2-Clause-Patent
7+
##
8+
[Defines]
9+
INF_VERSION = 0x00010005
10+
BASE_NAME = PlatformMemoryMapLib
11+
FILE_GUID = 59C11815-F8DA-4F49-B4FB-EC1E41ED1F01
12+
MODULE_TYPE = BASE
13+
VERSION_STRING = 1.0
14+
LIBRARY_CLASS = PlatformMemoryMapLib
15+
16+
[Sources]
17+
PlatformMemoryMapLib.c
18+
19+
[Packages]
20+
ArmPkg/ArmPkg.dec
21+
MdePkg/MdePkg.dec
22+
MdeModulePkg/MdeModulePkg.dec
23+
EmbeddedPkg/EmbeddedPkg.dec
24+
Silicon/Qualcomm/QcomPkg/QcomPkg.dec
25+
26+
[LibraryClasses]
27+
BaseLib

Platform/Lenovo/sm8250/tb371fc.dsc

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[Defines]
2+
VENDOR_NAME = Lenovo
3+
PLATFORM_NAME = tb371fc
4+
PLATFORM_GUID = 49f1a3bf-193a-47e3-a7b9-5a435eaab2ee
5+
PLATFORM_VERSION = 0.1
6+
DSC_SPECIFICATION = 0x00010019
7+
OUTPUT_DIRECTORY = Build/$(PLATFORM_NAME)
8+
SUPPORTED_ARCHITECTURES = AARCH64
9+
BUILD_TARGETS = DEBUG|RELEASE
10+
SKUID_IDENTIFIER = DEFAULT
11+
FLASH_DEFINITION = Platform/Qualcomm/sm8250/sm8250.fdf
12+
DEVICE_DXE_FV_COMPONENTS = Platform/Lenovo/sm8250/tb371fc.fdf.inc
13+
14+
!include Platform/Qualcomm/sm8250/sm8250.dsc
15+
16+
[BuildOptions.common]
17+
GCC:*_*_AARCH64_CC_FLAGS = -DENABLE_SIMPLE_INIT -DENABLE_LINUX_SIMPLE_MASS_STORAGE
18+
19+
[PcdsFixedAtBuild.common]
20+
gQcomTokenSpaceGuid.PcdMipiFrameBufferWidth|2944
21+
gQcomTokenSpaceGuid.PcdMipiFrameBufferHeight|1840
22+
23+
# Simple Init
24+
gSimpleInitTokenSpaceGuid.PcdGuiDefaultDPI|340
25+
26+
gRenegadePkgTokenSpaceGuid.PcdDeviceVendor|"Lenovo"
27+
gRenegadePkgTokenSpaceGuid.PcdDeviceProduct|"XiaoXin Pad Pro 12.7"
28+
gRenegadePkgTokenSpaceGuid.PcdDeviceCodeName|"TB371FC"
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//ButtonsDxe
2+
FILE DRIVER = 5bd181db-0487-4f1a-ae73-820e165611b3 {
3+
SECTION DXE_DEPEX = Platform/EFI_Binaries/Drivers/sm8250/ButtonsDxe/ButtonsDxe.depex
4+
SECTION PE32 = Platform/EFI_Binaries/Drivers/sm8250/ButtonsDxe/ButtonsDxe.efi
5+
SECTION UI = "ButtonsDxe"
6+
}
7+
8+
// ACPI Tables
9+
FILE FREEFORM = 7E374E25-8E01-4FEE-87F2-390C23C606CD {
10+
SECTION RAW = Platform/Lenovo/sm8250/AcpiTables/tb371fc/DSDT.aml
11+
SECTION RAW = Silicon/Qualcomm/sm8250/AcpiTables/Madt.aml
12+
SECTION RAW = Silicon/Qualcomm/sm8250/AcpiTables/Facp.aml
13+
SECTION RAW = Silicon/Qualcomm/sm8250/AcpiTables/Gtdt.aml
14+
SECTION RAW = Silicon/Qualcomm/sm8250/AcpiTables/bgrt.aml
15+
SECTION UI = "AcpiTables"
16+
}

configs/devices/tb371fc.conf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
SOC_PLATFORM="SM8250"
2+
VENDOR_NAME="Lenovo"
3+
PLATFORM_NAME="tb371fc"
4+
5+
# mkbootimg config
6+
BOOTIMG_OS_PATCH_LEVEL="2024-02"
7+
BOOTIMG_OS_VERSION=11.0.0
8+
BOOTIMG_HEADER_VERSION=1
9+
10+
# ACPI config
11+
SPLIT_DSDT=true
12+
USE_IASL=true

0 commit comments

Comments
 (0)