All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Schultz <d.schultz@phytec.de>
To: <u-boot@lists.denx.de>, <trini@konsulko.com>,
	<joe.hershberger@ni.com>, <w.egorov@phytec.de>
Cc: <d-gole@ti.com>, <nm@ti.com>, <mkorpershoek@baylibre.com>,
	<upstream@lists.phytec.de>, <t.remmet@phytec.de>,
	<y.moog@phytec.de>, <m-chawdhry@ti.com>, <kamlesh@ti.com>,
	<jm@ti.com>, <B.Hahn@phytec.de>,
	Daniel Schultz <d.schultz@phytec.de>
Subject: [PATCH 3/6] board: phytec: common: k3: Add SOM detection overlays
Date: Sun, 7 Jul 2024 23:07:31 -0700	[thread overview]
Message-ID: <20240708060734.4029040-4-d.schultz@phytec.de> (raw)
In-Reply-To: <20240708060734.4029040-1-d.schultz@phytec.de>

Add overlays to disable or alter SOM features according
to the EEPROM image content.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
---
 board/phytec/common/k3/board.c | 45 ++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/board/phytec/common/k3/board.c b/board/phytec/common/k3/board.c
index 3d7e090ccaa..867dd880675 100644
--- a/board/phytec/common/k3/board.c
+++ b/board/phytec/common/k3/board.c
@@ -8,6 +8,7 @@
 #include <fdt_support.h>
 #include <spl.h>
 #include <asm/arch/hardware.h>
+#include <extension_board.h>
 
 #include "../am6_som_detection.h"
 
@@ -104,3 +105,47 @@ int ft_board_setup(void *blob, struct bd_info *bd)
 	return 0;
 }
 #endif
+
+#if IS_ENABLED(CONFIG_CMD_EXTENSION)
+int extension_board_scan(struct list_head *extension_list)
+{
+	struct extension *extension = NULL;
+	struct phytec_eeprom_data data;
+	int count = 0;
+	int ret;
+
+	ret = phytec_eeprom_data_setup(&data, 0, EEPROM_ADDR);
+	if (ret)
+		return count;
+
+	if (phytec_get_am6_eth(&data) == 0) {
+		extension = phytec_add_extension("Disable Ethernet phy",
+						 "k3-am6xx-phycore-disable-eth-phy.dtbo", "");
+		list_add_tail(&extension->list, extension_list);
+		count++;
+	}
+
+	if (phytec_get_am6_spi(&data) == PHYTEC_EEPROM_VALUE_X) {
+		extension = phytec_add_extension("Disable SPI NOR Flash",
+						 "k3-am6xx-phycore-disable-spi-nor.dtbo", "");
+		list_add_tail(&extension->list, extension_list);
+		count++;
+	}
+
+	if (phytec_am6_is_qspi(&data)) {
+		extension = phytec_add_extension("Select QSPI NOR Flash",
+						 "k3-am6xx-phycore-qspi-nor.dtbo", "");
+		list_add_tail(&extension->list, extension_list);
+		count++;
+	}
+
+	if (phytec_get_am6_rtc(&data) == 0) {
+		extension = phytec_add_extension("Disable RTC",
+						 "k3-am6xx-phycore-disable-rtc.dtbo", "");
+		list_add_tail(&extension->list, extension_list);
+		count++;
+	}
+
+	return count;
+}
+#endif
-- 
2.25.1


  parent reply	other threads:[~2024-07-08  6:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-08  6:07 [PATCH 0/6] Extend SOM detection Daniel Schultz
2024-07-08  6:07 ` [PATCH 1/6] include: env: phytec: overlays: Add extension command Daniel Schultz
2024-07-09  6:49   ` Yannic Moog
2024-07-09 13:31     ` Daniel Schultz
2024-07-09 13:47       ` Wadim Egorov
2024-07-10  5:38         ` Yannic Moog
2024-07-08  6:07 ` [PATCH 2/6] include: env: phytec: k3_mmc: Apply extension overlays Daniel Schultz
2024-07-08  6:07 ` Daniel Schultz [this message]
2024-07-08  6:07 ` [PATCH 4/6] board: phytec: common: Kconfig: Enable SUPPORT_EXTENSION_SCAN Daniel Schultz
2024-07-08  6:07 ` [PATCH 5/6] configs: phytec_am62x_a53_defconfig: Set CONFIG_CMD_EXTENSION Daniel Schultz
2024-07-08  6:07 ` [PATCH 6/6] configs: phycore_am64x_a53_defconfig: Enable SOM detection Daniel Schultz
2024-07-09  7:16 ` [PATCH 0/6] Extend " Daniel Schultz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240708060734.4029040-4-d.schultz@phytec.de \
    --to=d.schultz@phytec.de \
    --cc=B.Hahn@phytec.de \
    --cc=d-gole@ti.com \
    --cc=jm@ti.com \
    --cc=joe.hershberger@ni.com \
    --cc=kamlesh@ti.com \
    --cc=m-chawdhry@ti.com \
    --cc=mkorpershoek@baylibre.com \
    --cc=nm@ti.com \
    --cc=t.remmet@phytec.de \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=upstream@lists.phytec.de \
    --cc=w.egorov@phytec.de \
    --cc=y.moog@phytec.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.