summaryrefslogtreecommitdiff
path: root/arch/arm/include
diff options
context:
space:
mode:
authorYe Li <[email protected]>2026-03-02 13:20:02 +0800
committerFabio Estevam <[email protected]>2026-03-16 18:44:00 -0300
commite1cc7117b6302464977fffca3e2c05bf8f3f6c77 (patch)
tree6a128d98085777595ddfd74015cf1e5bca91b96f /arch/arm/include
parenta27980786cfb3c430aa1c05da8e79180c584d221 (diff)
imx9: scmi: Get DDR size through SM SCMI API
System Manager(SM) has implemented the MISC protocol to retrieve DDR information. Using this API, U-Boot can obtain the DDR size dynamically instead of relying on static configuration macros. This change addresses the DDR ECC enabled case, where 1/8 of the total DDR size is reserved for ECC data. The scmi_misc_ddrinfo() returns the DDR size with EEC overhead already deducted. Implementation details: - Query the DDR size via scmi_misc_ddrinfo() - Replace direct REG_DDR_CS[0,1]_BNDS register reads with SCMI call - Switch from PHYS_SDRAM[x]_SIZE macros to runtime detection - For backward compatibility with older SM firmware, fall back to static PHYS_SDRAM[x]_SIZE configuration if the SCMI call fails Signed-off-by: Ye Li <[email protected]> Signed-off-by: Alice Guo <[email protected]> Reviewed-by: Peng Fan <[email protected]>
Diffstat (limited to 'arch/arm/include')
-rw-r--r--arch/arm/include/asm/mach-imx/sys_proto.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/arch/arm/include/asm/mach-imx/sys_proto.h b/arch/arm/include/asm/mach-imx/sys_proto.h
index 46da7a1eff5..13857b921a0 100644
--- a/arch/arm/include/asm/mach-imx/sys_proto.h
+++ b/arch/arm/include/asm/mach-imx/sys_proto.h
@@ -254,6 +254,43 @@ struct scmi_rom_passover_get_out {
u32 passover[(sizeof(rom_passover_t) + 8) / 4];
};
+/**
+ * struct scmi_ddr_info_out - Get DDR memory region info
+ * @status: Error code
+ * @attributes: Region attributes:
+ * Bit[31] ECC enable.
+ * Set to 1 if ECC enabled.
+ * Set to 0 if ECC disabled or not configured.
+ * Bits[30:18] Reserved, must be zero.
+ * Bits[17:16] Number of DDR memory regions.
+ * Bits[15:11] Reserved, must be zero.
+ * Bits[10:8] Width.
+ * Bus width is 16 << this field.
+ * So 0=16, 1=32, 2=64, etc.
+ * Bits[7:5] Reserved, must be zero.
+ * Bits[4:0] DDR type.
+ * Set to 0 if LPDDR5.
+ * Set to 1 if LPDDR5X.
+ * Set to 2 if LPDDR4.
+ * Set to 3 if LPDDR4X
+ * @mts: DDR speed in megatransfers per second
+ * @startlow: The lower 32 bits of the physical start address of the region
+ * @starthigh: The upper 32 bits of the physical start address of the region
+ * @endlow: The lower 32 bits of the physical end address of the region. This
+ * excludes any DDR used to store ECC data
+ * @endhigh: The upper 32 bits of the physical end address of the region. This
+ * excludes any DDR used to store ECC data
+ */
+struct scmi_ddr_info_out {
+ s32 status;
+ u32 attributes;
+ u32 mts;
+ u32 startlow;
+ u32 starthigh;
+ u32 endlow;
+ u32 endhigh;
+};
+
#endif
/* For i.MX ULP */