]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
stm32mp: add soc.c file
authorPatrick Delaunay <patrick.delaunay@foss.st.com>
Mon, 15 Jan 2024 14:05:49 +0000 (15:05 +0100)
committerPatrice Chotard <patrice.chotard@foss.st.com>
Fri, 19 Jan 2024 13:37:10 +0000 (14:37 +0100)
Add a new file soc.c for common functions between stm32mp1 and stm32mp2
family and move print_cpuinfo() in this new file.

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Igor Opaniuk <igor.opaniuk@foundries.io>
arch/arm/mach-stm32mp/Makefile
arch/arm/mach-stm32mp/soc.c [new file with mode: 0644]
arch/arm/mach-stm32mp/stm32mp1/cpu.c
arch/arm/mach-stm32mp/stm32mp2/cpu.c

index 00dc25bb275c816cea14948f4ce8c412694c36c7..fdcbbf91dfd58db409ef379eb695ff6db6af3f8c 100644 (file)
@@ -6,6 +6,7 @@
 obj-y += dram_init.o
 obj-y += syscon.o
 obj-y += bsec.o
+obj-y += soc.o
 
 obj-$(CONFIG_STM32MP15x) += stm32mp1/
 obj-$(CONFIG_STM32MP13x) += stm32mp1/
diff --git a/arch/arm/mach-stm32mp/soc.c b/arch/arm/mach-stm32mp/soc.c
new file mode 100644 (file)
index 0000000..d7b0359
--- /dev/null
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR BSD-3-Clause
+/*
+ * Copyright (C) 2024, STMicroelectronics - All Rights Reserved
+ */
+
+#include <env.h>
+#include <asm/arch/sys_proto.h>
+#include <dm/device.h>
+
+/* used when CONFIG_DISPLAY_CPUINFO is activated */
+int print_cpuinfo(void)
+{
+       char name[SOC_NAME_SIZE];
+
+       get_soc_name(name);
+       printf("CPU: %s\n", name);
+
+       return 0;
+}
index 55574fd4bebfee80663a3b8d9a5f0bade6ccae81..00fea7929b2ffb61e90e4963358778863e0be508 100644 (file)
@@ -158,17 +158,6 @@ void enable_caches(void)
        dcache_enable();
 }
 
-/* used when CONFIG_DISPLAY_CPUINFO is activated */
-int print_cpuinfo(void)
-{
-       char name[SOC_NAME_SIZE];
-
-       get_soc_name(name);
-       printf("CPU: %s\n", name);
-
-       return 0;
-}
-
 static void setup_boot_mode(void)
 {
        const u32 serial_addr[] = {
index f43d1aaf72cc910cab0ad3f67664796268c98dbc..c0f6519e8d7c82696db2f4b21bf64d50b2dbf7b7 100644 (file)
@@ -67,17 +67,6 @@ void enable_caches(void)
        dcache_enable();
 }
 
-/* used when CONFIG_DISPLAY_CPUINFO is activated */
-int print_cpuinfo(void)
-{
-       char name[SOC_NAME_SIZE];
-
-       get_soc_name(name);
-       printf("CPU: %s\n", name);
-
-       return 0;
-}
-
 int arch_misc_init(void)
 {
        return 0;