summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-stm32mp/include
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2022-02-21 11:36:24 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2022-03-08 09:59:59 +0100
commitba35a497d411468fe3b920ad42628fa8b9b479b4 (patch)
tree8d6856f561722ce1abb0d3d82ae6a9d46047c96a /arch/arm/mach-stm32mp/include
parentc1b883261f0e4916ef9e283d24bac1a579673239 (diff)
downloadbarebox-ba35a497d411468fe3b920ad42628fa8b9b479b4.tar.gz
barebox-ba35a497d411468fe3b920ad42628fa8b9b479b4.tar.xz
ARM: stm32mp: ddrctl: add STM32MP131 RAM size querying support
Full buswidth for STM32MP131 means 2 byte wide, not 4 as the memory bus is restricted to 16-bit. Teach barebox the difference. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220221103625.3728055-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-stm32mp/include')
-rw-r--r--arch/arm/mach-stm32mp/include/mach/revision.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/arm/mach-stm32mp/include/mach/revision.h b/arch/arm/mach-stm32mp/include/mach/revision.h
index 2ef8ef30c3..c141b925a1 100644
--- a/arch/arm/mach-stm32mp/include/mach/revision.h
+++ b/arch/arm/mach-stm32mp/include/mach/revision.h
@@ -32,6 +32,14 @@
#define CPU_STM32MP151Fxx 0x050000AE
#define CPU_STM32MP151Dxx 0x050000AF
+#define cpu_stm32_is(mask, val) ({ \
+ u32 type; \
+ __stm32mp_get_cpu_type(&type) == 0 ? (type & mask) == val : 0; \
+})
+
+#define cpu_stm32_is_stm32mp15() cpu_stm32_is(0xFFFF0000, 0x05000000)
+#define cpu_stm32_is_stm32mp13() cpu_stm32_is(0xFFFF0000, 0x05010000)
+
/* silicon revisions */
#define CPU_REV_A 0x1000
#define CPU_REV_B 0x2000