public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH 1/3] mach-ipq40xx: add CPU specific code
@ 2024-04-24 11:13 Robert Marko
  2024-04-24 11:13 ` [PATCH 2/3] mach-ipq40xx: use OF_UPSTREAM Robert Marko
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Robert Marko @ 2024-04-24 11:13 UTC (permalink / raw)
  To: trini, caleb.connolly, neil.armstrong, sumit.garg, u-boot,
	u-boot-qcom
  Cc: j.beck, Robert Marko

Provide basic DRAM info population from DT, cache setting and the
board_init stub.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
---
 arch/arm/mach-ipq40xx/Makefile |  7 ++++++
 arch/arm/mach-ipq40xx/cpu.c    | 44 ++++++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+)
 create mode 100644 arch/arm/mach-ipq40xx/Makefile
 create mode 100644 arch/arm/mach-ipq40xx/cpu.c

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..0446627a8f
--- /dev/null
+++ b/arch/arm/mach-ipq40xx/cpu.c
@@ -0,0 +1,44 @@
+// 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 <common.h>
+#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;
+}
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-04-24 14:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-24 11:13 [PATCH 1/3] mach-ipq40xx: add CPU specific code Robert Marko
2024-04-24 11:13 ` [PATCH 2/3] mach-ipq40xx: use OF_UPSTREAM Robert Marko
2024-04-24 14:14   ` Caleb Connolly
2024-04-24 11:13 ` [PATCH 3/3] arm: dts: drop downstream IPQ4019 DTSI Robert Marko
2024-04-24 14:14   ` Caleb Connolly
2024-04-24 14:13 ` [PATCH 1/3] mach-ipq40xx: add CPU specific code Caleb Connolly

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox