From cce3e7a23db49b29fe64572323a335329406ea67 Mon Sep 17 00:00:00 2001
From: Nishanth Menon <nm@ti.com>
Date: Thu, 27 Jul 2023 13:58:44 -0500
Subject: [PATCH] doc: board: ti: Optimize sources references

We have duplication of sources which makes it hard to sustain across the
board, but at the same time, we'd like to ensure readers get specific
information without having to cross refer to different documentation to
get piecemeal information that they need to put together.

Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
---
 doc/board/ti/am62x_sk.rst  | 17 +++--------------
 doc/board/ti/am65x_evm.rst | 17 +++--------------
 doc/board/ti/j7200_evm.rst | 17 +++--------------
 doc/board/ti/j721e_evm.rst | 17 +++--------------
 doc/board/ti/k3.rst        |  4 ++++
 5 files changed, 16 insertions(+), 56 deletions(-)

diff --git a/doc/board/ti/am62x_sk.rst b/doc/board/ti/am62x_sk.rst
index 0721ee3074..0a3bbdfaf0 100644
--- a/doc/board/ti/am62x_sk.rst
+++ b/doc/board/ti/am62x_sk.rst
@@ -115,21 +115,10 @@ Below is the pictorial representation of boot flow:
 
 Sources:
 --------
-1. Trusted Firmware-A:
-	Tree: https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/
-	Branch: master
-
-2. OP-TEE:
-	Tree: https://github.com/OP-TEE/optee_os.git
-	Branch: master
-
-3. U-Boot:
-	Tree: https://source.denx.de/u-boot/u-boot
-	Branch: master
 
-4. TI Linux Firmware:
-	Tree: git://git.ti.com/processor-firmware/ti-linux-firmware.git
-	Branch: ti-linux-firmware
+.. include::  k3.rst
+    :start-after: .. k3_rst_include_start_boot_sources
+    :end-before: .. k3_rst_include_end_boot_sources
 
 Build procedure:
 ----------------
diff --git a/doc/board/ti/am65x_evm.rst b/doc/board/ti/am65x_evm.rst
index 82bae7c633..93b983fda6 100644
--- a/doc/board/ti/am65x_evm.rst
+++ b/doc/board/ti/am65x_evm.rst
@@ -117,21 +117,10 @@ instead use Falcon boot flow to reduce boot time.
 
 Sources:
 --------
-1. Trusted Firmware-A:
-        Tree: https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/
-        Branch: master
-
-2. OP-TEE:
-        Tree: https://github.com/OP-TEE/optee_os.git
-        Branch: master
-
-3. U-Boot:
-        Tree: https://source.denx.de/u-boot/u-boot
-        Branch: master
 
-4. TI Linux Firmware:
-        Tree: git://git.ti.com/processor-firmware/ti-linux-firmware.git
-        Branch: ti-linux-firmware
+.. include::  k3.rst
+    :start-after: .. k3_rst_include_start_boot_sources
+    :end-before: .. k3_rst_include_end_boot_sources
 
 Build procedure:
 ----------------
diff --git a/doc/board/ti/j7200_evm.rst b/doc/board/ti/j7200_evm.rst
index 909eb50963..24d309a9ff 100644
--- a/doc/board/ti/j7200_evm.rst
+++ b/doc/board/ti/j7200_evm.rst
@@ -120,21 +120,10 @@ Below is the pictorial representation of boot flow:
 
 Sources:
 --------
-1. Trusted Firmware-A:
-	Tree: https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/
-	Branch: master
-
-2. OP-TEE:
-	Tree: https://github.com/OP-TEE/optee_os.git
-	Branch: master
-
-3. U-Boot:
-	Tree: https://source.denx.de/u-boot/u-boot
-	Branch: master
 
-4. TI Linux Firmware:
-	Tree: git://git.ti.com/processor-firmware/ti-linux-firmware.git
-	Branch: ti-linux-firmware
+.. include::  k3.rst
+    :start-after: .. k3_rst_include_start_boot_sources
+    :end-before: .. k3_rst_include_end_boot_sources
 
 Build procedure:
 ----------------
diff --git a/doc/board/ti/j721e_evm.rst b/doc/board/ti/j721e_evm.rst
index a93160b774..637b42d7c6 100644
--- a/doc/board/ti/j721e_evm.rst
+++ b/doc/board/ti/j721e_evm.rst
@@ -130,21 +130,10 @@ support. Below is the pictorial representation of boot flow:
 
 Sources:
 --------
-1. Trusted Firmware-A:
-	Tree: https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/
-	Branch: master
-
-2. OP-TEE:
-	Tree: https://github.com/OP-TEE/optee_os.git
-	Branch: master
-
-3. U-Boot:
-	Tree: https://source.denx.de/u-boot/u-boot
-	Branch: master
 
-4. TI Linux Firmware:
-	Tree: git://git.ti.com/processor-firmware/ti-linux-firmware.git
-	Branch: ti-linux-firmware
+.. include::  k3.rst
+    :start-after: .. k3_rst_include_start_boot_sources
+    :end-before: .. k3_rst_include_end_boot_sources
 
 Build procedure:
 ----------------
diff --git a/doc/board/ti/k3.rst b/doc/board/ti/k3.rst
index 2db7bbdb42..2df57c9850 100644
--- a/doc/board/ti/k3.rst
+++ b/doc/board/ti/k3.rst
@@ -111,6 +111,8 @@ All scripts and code needed to build the `tiboot3.bin`, `tispl.bin` and
 `u-boot.img` for all K3 SoCs can be located at the following places
 online
 
+.. k3_rst_include_start_boot_sources
+
 * **Das U-Boot**
 
   | **source:** https://source.denx.de/u-boot/u-boot.git
@@ -131,6 +133,8 @@ online
   | **source:** https://git.ti.com/git/processor-firmware/ti-linux-firmware.git
   | **branch:** ti-linux-firmware
 
+.. k3_rst_include_end_boot_sources
+
 Build Procedure
 ---------------
 
-- 
2.39.5