diff mbox series

[v2,1/3] mach-ipq40xx: add CPU specific code

Message ID 20240514101824.23872-1-robert.marko@sartura.hr
State Accepted
Delegated to: Caleb Connolly
Headers show
Series [v2,1/3] mach-ipq40xx: add CPU specific code | expand

Commit Message

Robert Marko May 14, 2024, 10:17 a.m. UTC
Provide basic DRAM info population from DT, cache setting and the
board_init stub.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
Acked-by: Caleb Connolly <caleb.connolly@linaro.org>
---
Changes in v2:
* Drop <common.h>

 arch/arm/mach-ipq40xx/Makefile |  7 ++++++
 arch/arm/mach-ipq40xx/cpu.c    | 43 ++++++++++++++++++++++++++++++++++
 2 files changed, 50 insertions(+)
 create mode 100644 arch/arm/mach-ipq40xx/Makefile
 create mode 100644 arch/arm/mach-ipq40xx/cpu.c

Comments

Caleb Connolly May 20, 2024, 3:04 p.m. UTC | #1
On Tue, 14 May 2024 12:17:50 +0200, Robert Marko wrote:
> Provide basic DRAM info population from DT, cache setting and the
> board_init stub.
> 
> 

Applied, thanks!

[1/3] mach-ipq40xx: add CPU specific code
      https://source.denx.de/u-boot/custodians/u-boot-snapdragon/-/commit/31718ccb900d
[2/3] mach-ipq40xx: use OF_UPSTREAM
      https://source.denx.de/u-boot/custodians/u-boot-snapdragon/-/commit/6eb2efafc33a
[3/3] arm: dts: drop downstream IPQ4019 DTSI
      https://source.denx.de/u-boot/custodians/u-boot-snapdragon/-/commit/d8903c0f94ee

Best regards,
diff mbox series

Patch

diff --git a/arch/arm/mach-ipq40xx/Makefile b/arch/arm/mach-ipq40xx/Makefile
new file mode 100644
index 0000000000..d611de9933
--- /dev/null
+++ b/arch/arm/mach-ipq40xx/Makefile
@@ -0,0 +1,7 @@ 
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Copyright (c) 2024 Sartura Ltd.
+#
+# Author: Robert Marko <robert.marko@sartura.hr>
+
+obj-y += cpu.o
diff --git a/arch/arm/mach-ipq40xx/cpu.c b/arch/arm/mach-ipq40xx/cpu.c
new file mode 100644
index 0000000000..92c34d6111
--- /dev/null
+++ b/arch/arm/mach-ipq40xx/cpu.c
@@ -0,0 +1,43 @@ 
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * CPU code for Qualcomm IPQ40xx SoC
+ *
+ * Copyright (c) 2024 Sartura Ltd.
+ *
+ * Author: Robert Marko <robert.marko@sartura.hr>
+ */
+
+#include <cpu_func.h>
+#include <init.h>
+
+int dram_init(void)
+{
+	int ret;
+
+	ret = fdtdec_setup_memory_banksize();
+	if (ret)
+		return ret;
+	return fdtdec_setup_mem_size_base();
+}
+
+/*
+ * Enable/Disable D-cache.
+ * I-cache is already enabled in start.S
+ */
+void enable_caches(void)
+{
+	dcache_enable();
+}
+
+void disable_caches(void)
+{
+	dcache_disable();
+}
+
+/*
+ * In case boards need specific init code, they can override this stub.
+ */
+int __weak board_init(void)
+{
+	return 0;
+}