From 8994ac365a107ba443ff238719ffb5497a67b347 Mon Sep 17 00:00:00 2001
From: Dhruva Gole <d-gole@ti.com>
Date: Thu, 27 Oct 2022 20:23:10 +0530
Subject: [PATCH] arm: dts: Add OSPI support for AM62-SK

Add OSPI Support such that this device can boot up using OSPI Flash.
Also can use the flash for other purposes if required from uboot.

Signed-off-by: Dhruva Gole <d-gole@ti.com>
---
 arch/arm/dts/k3-am625-r5-sk.dts      |  5 +++++
 arch/arm/dts/k3-am625-sk-u-boot.dtsi | 24 ++++++++++++++++++++++++
 2 files changed, 29 insertions(+)

diff --git a/arch/arm/dts/k3-am625-r5-sk.dts b/arch/arm/dts/k3-am625-r5-sk.dts
index 6d696e720d..d39b334ed0 100644
--- a/arch/arm/dts/k3-am625-r5-sk.dts
+++ b/arch/arm/dts/k3-am625-r5-sk.dts
@@ -155,3 +155,8 @@
 	status = "okay";
 	u-boot,dm-spl;
 };
+
+&ospi0 {
+	reg = <0x00 0x0fc40000 0x00 0x100>,
+	      <0x00 0x60000000 0x00 0x08000000>;
+};
diff --git a/arch/arm/dts/k3-am625-sk-u-boot.dtsi b/arch/arm/dts/k3-am625-sk-u-boot.dtsi
index 159fa36bbe..92788bae3e 100644
--- a/arch/arm/dts/k3-am625-sk-u-boot.dtsi
+++ b/arch/arm/dts/k3-am625-sk-u-boot.dtsi
@@ -102,3 +102,27 @@
 &main_mmc1_pins_default {
 	u-boot,dm-spl;
 };
+
+&fss {
+	u-boot,dm-spl;
+};
+
+&ospi0_pins_default {
+	u-boot,dm-spl;
+};
+
+&ospi0 {
+	u-boot,dm-spl;
+
+	flash@0 {
+		u-boot,dm-spl;
+
+		partitions {
+			u-boot,dm-spl;
+
+			partition@3fc0000 {
+				u-boot,dm-spl;
+			};
+		};
+	};
+};
-- 
2.39.5