From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Holger Assmann <h.assmann@pengutronix.de>,
Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 4/4] ARM: stm32mp: dk2: have barebox image support DK1 as well
Date: Wed, 30 Sep 2020 14:53:03 +0200 [thread overview]
Message-ID: <20200930125303.14933-4-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20200930125303.14933-1-a.fatoum@pengutronix.de>
The STM32MP157C-DK2 and STM32MP157A-DK1 are basically the same board
except the DK2 has a MIPI-DSI display attached and the SoC has a
crypto IP block.
Allow the same barebox image to run on both boards by deciding
that if we are compiled with a 157C-DK2 device tree, but we have
a 157A SoC, it must be a DK1 instead.
Cc: Holger Assmann <h.assmann@pengutronix.de>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
arch/arm/boards/stm32mp157c-dk2/board.c | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/arch/arm/boards/stm32mp157c-dk2/board.c b/arch/arm/boards/stm32mp157c-dk2/board.c
index 46366031218d..55afdd49e6e5 100644
--- a/arch/arm/boards/stm32mp157c-dk2/board.c
+++ b/arch/arm/boards/stm32mp157c-dk2/board.c
@@ -2,17 +2,23 @@
#include <common.h>
#include <init.h>
#include <mach/bbu.h>
+#include <mach/revision.h>
+#include <of.h>
-static int dk2_postcore_init(void)
+static int dkx_postcore_init(void)
{
if (!of_machine_is_compatible("st,stm32mp157c-dk2"))
return 0;
- stm32mp_bbu_mmc_register_handler("sd", "/dev/mmc0.ssbl",
- BBU_HANDLER_FLAG_DEFAULT);
+ if (stm32mp_cputype() == CPU_STM32MP157Axx) {
+ of_property_write_strings(of_get_root_node(), "compatible",
+ "st,stm32mp157a-dk1", "st,stm32mp157", NULL);
+ barebox_set_model("STM32MP157A-DK1");
+ } else {
+ barebox_set_model("STM32MP157C-DK2");
+ }
- barebox_set_model("STM32MP157C-DK2");
-
- return 0;
+ return stm32mp_bbu_mmc_register_handler("sd", "/dev/mmc0.ssbl",
+ BBU_HANDLER_FLAG_DEFAULT);
}
-postcore_initcall(dk2_postcore_init);
+postcore_initcall(dkx_postcore_init);
--
2.28.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2020-09-30 12:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-30 12:53 [PATCH 1/4] include: string: migrate barebox function from <linux/string.h> Ahmad Fatoum
2020-09-30 12:53 ` [PATCH 2/4] of: implement of_property_write_strings for multiple strings Ahmad Fatoum
2020-09-30 12:53 ` [PATCH 3/4] ARM: stm32mp: init: set up CPU and bootsource at core init level Ahmad Fatoum
2020-09-30 12:53 ` Ahmad Fatoum [this message]
2020-10-01 9:14 ` [PATCH 4/4] ARM: stm32mp: dk2: have barebox image support DK1 as well Ahmad Fatoum
2020-10-02 4:10 ` [PATCH 1/4] include: string: migrate barebox function from <linux/string.h> Sascha Hauer
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=20200930125303.14933-4-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=h.assmann@pengutronix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox