summaryrefslogtreecommitdiff
path: root/arch/arm/mach-stm32mp/include
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-stm32mp/include')
-rw-r--r--arch/arm/mach-stm32mp/include/mach/etzpc.h32
-rw-r--r--arch/arm/mach-stm32mp/include/mach/rif.h26
-rw-r--r--arch/arm/mach-stm32mp/include/mach/stm32.h16
-rw-r--r--arch/arm/mach-stm32mp/include/mach/sys_proto.h24
4 files changed, 94 insertions, 4 deletions
diff --git a/arch/arm/mach-stm32mp/include/mach/etzpc.h b/arch/arm/mach-stm32mp/include/mach/etzpc.h
new file mode 100644
index 00000000000..fd697c3e2ac
--- /dev/null
+++ b/arch/arm/mach-stm32mp/include/mach/etzpc.h
@@ -0,0 +1,32 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later OR BSD-3-Clause */
+/*
+ * Copyright (C) 2023, STMicroelectronics - All Rights Reserved
+ */
+
+#ifndef MACH_ETZPC_H
+#define MACH_ETZPC_H
+
+#include <linux/types.h>
+
+/**
+ * stm32_etzpc_check_access - Check ETZPC accesses for given device node
+ *
+ * @device_node Node of the device for which the accesses are checked
+ *
+ * @returns 0 on success (if access is granted), -EINVAL if access is denied.
+ * Else, returns an appropriate negative ERRNO value
+ */
+int stm32_etzpc_check_access(ofnode device_node);
+
+/**
+ * stm32_etzpc_check_access_by_id - Check ETZPC accesses for given id
+ *
+ * @device_node Node of the device to get a reference on ETZPC
+ * @id ID of the resource to check
+ *
+ * @returns 0 on success (if access is granted), -EINVAL if access is denied.
+ * Else, returns an appropriate negative ERRNO value
+ */
+int stm32_etzpc_check_access_by_id(ofnode device_node, u32 id);
+
+#endif /* MACH_ETZPC_H*/
diff --git a/arch/arm/mach-stm32mp/include/mach/rif.h b/arch/arm/mach-stm32mp/include/mach/rif.h
new file mode 100644
index 00000000000..10b22108120
--- /dev/null
+++ b/arch/arm/mach-stm32mp/include/mach/rif.h
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later OR BSD-3-Clause */
+/*
+ * Copyright (C) 2023, STMicroelectronics - All Rights Reserved
+ */
+
+#ifndef MACH_RIF_H
+#define MACH_RIF_H
+
+#include <linux/types.h>
+
+/**
+ * stm32_rifsc_check_access - Check RIF accesses for given device node
+ *
+ * @device_node Node of the device for which the accesses are checked
+ */
+int stm32_rifsc_check_access(ofnode device_node);
+
+/**
+ * stm32_rifsc_check_access - Check RIF accesses for given id
+ *
+ * @device_node Node of the device to get a reference on RIFSC
+ * @id ID of the resource to check
+ */
+int stm32_rifsc_check_access_by_id(ofnode device_node, u32 id);
+
+#endif /* MACH_RIF_H*/
diff --git a/arch/arm/mach-stm32mp/include/mach/stm32.h b/arch/arm/mach-stm32mp/include/mach/stm32.h
index 6eb85ba7233..a9ac49bc5d2 100644
--- a/arch/arm/mach-stm32mp/include/mach/stm32.h
+++ b/arch/arm/mach-stm32mp/include/mach/stm32.h
@@ -42,6 +42,9 @@ enum boot_device {
BOOT_FLASH_SPINAND = 0x70,
BOOT_FLASH_SPINAND_1 = 0x71,
+
+ BOOT_FLASH_HYPERFLASH = 0x80,
+ BOOT_FLASH_HYPERFLASH_1 = 0x81
};
#define TAMP_BOOT_MODE_MASK GENMASK(15, 8)
@@ -158,8 +161,20 @@ enum forced_boot_mode {
#endif /* CONFIG_STM32MP15X || CONFIG_STM32MP13X */
#ifdef CONFIG_STM32MP25X
+#define STM32_USART2_BASE 0x400E0000
+#define STM32_USART3_BASE 0x400F0000
+#define STM32_UART4_BASE 0x40100000
+#define STM32_UART5_BASE 0x40110000
+#define STM32_USART6_BASE 0x40220000
+#define STM32_UART9_BASE 0x402C0000
+#define STM32_USART1_BASE 0x40330000
+#define STM32_UART7_BASE 0x40370000
+#define STM32_UART8_BASE 0x40380000
#define STM32_RCC_BASE 0x44200000
#define STM32_TAMP_BASE 0x46010000
+#define STM32_SDMMC1_BASE 0x48220000
+#define STM32_SDMMC2_BASE 0x48230000
+#define STM32_SDMMC3_BASE 0x48240000
#define STM32_DDR_BASE 0x80000000
@@ -197,6 +212,7 @@ enum forced_boot_mode {
#ifdef CONFIG_STM32MP25X
#define BSEC_OTP_SERIAL 5
#define BSEC_OTP_RPN 9
+#define BSEC_OTP_REVID 102
#define BSEC_OTP_PKG 122
#define BSEC_OTP_BOARD 246
#define BSEC_OTP_MAC 247
diff --git a/arch/arm/mach-stm32mp/include/mach/sys_proto.h b/arch/arm/mach-stm32mp/include/mach/sys_proto.h
index 2a65efc0a50..19073668497 100644
--- a/arch/arm/mach-stm32mp/include/mach/sys_proto.h
+++ b/arch/arm/mach-stm32mp/include/mach/sys_proto.h
@@ -58,6 +58,7 @@ u32 get_cpu_type(void);
/* return CPU_DEV constants */
u32 get_cpu_dev(void);
+/* Silicon revision = REV_ID[15:0] of Device Version */
#define CPU_REV1 0x1000
#define CPU_REV1_1 0x1001
#define CPU_REV1_2 0x1003
@@ -65,7 +66,15 @@ u32 get_cpu_dev(void);
#define CPU_REV2_1 0x2001
#define CPU_REV2_2 0x2003
-/* return Silicon revision = REV_ID[15:0] of Device Version */
+/* OTP revision ID = 6 bits : 3 for Major / 3 for Minor */
+#define OTP_REVID_1 0b001000
+#define OTP_REVID_1_1 0b001001
+#define OTP_REVID_1_2 0b001010
+#define OTP_REVID_2 0b010000
+#define OTP_REVID_2_1 0b010001
+#define OTP_REVID_2_2 0b010010
+
+/* return SoC revision = Silicon revision (STM32MP1) or OTP revision ID (STM32MP2)*/
u32 get_cpu_rev(void);
/* Get Package options from OTP */
@@ -80,9 +89,9 @@ u32 get_cpu_package(void);
/* package used for STM32MP25x */
#define STM32MP25_PKG_CUSTOM 0
-#define STM32MP25_PKG_AL_TBGA361 3
-#define STM32MP25_PKG_AK_TBGA424 4
-#define STM32MP25_PKG_AI_TBGA436 5
+#define STM32MP25_PKG_AL_VFBGA361 1
+#define STM32MP25_PKG_AK_VFBGA424 3
+#define STM32MP25_PKG_AI_TFBGA436 5
#define STM32MP25_PKG_UNKNOWN 7
/* Get SOC name */
@@ -111,3 +120,10 @@ u32 get_otp(int index, int shift, int mask);
uintptr_t get_stm32mp_rom_api_table(void);
uintptr_t get_stm32mp_bl2_dtb(void);
+
+/* helper function: check "closed" state in product "Life Cycle" */
+#ifdef CONFIG_CMD_STM32KEY
+bool stm32mp_is_closed(void);
+#else
+static inline bool stm32mp_is_closed(void) { return false; }
+#endif