mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 01/16] ARM: start: Allow to pass machine type as boarddata
Date: Wed, 18 Sep 2019 09:54:06 +0200	[thread overview]
Message-ID: <20190918075421.20456-2-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20190918075421.20456-1-s.hauer@pengutronix.de>

Allow to pass a machine type number as directly as boarddata. This makes
it easy for non device tree boards to pass a machine type and to
identify themselves during runtime.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/cpu/start.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c
index c97b2770c4..0c2e9fb9a8 100644
--- a/arch/arm/cpu/start.c
+++ b/arch/arm/cpu/start.c
@@ -193,7 +193,19 @@ __noreturn void barebox_non_pbl_start(unsigned long membase,
 		uint32_t totalsize = 0;
 		const char *name;
 
-		if (blob_is_fdt(boarddata)) {
+		if ((unsigned long)boarddata < 8192) {
+			struct barebox_arm_boarddata *bd;
+			uint32_t machine_type = (uint32_t)boarddata;
+			unsigned long mem = arm_mem_boarddata(membase, endmem,
+							      sizeof(*bd));
+			pr_debug("found machine type %d in boarddata\n",
+				 machine_type);
+			bd = barebox_boarddata = (void *)mem;
+			barebox_boarddata_size = sizeof(*bd);
+			bd->magic = BAREBOX_ARM_BOARDDATA_MAGIC;
+			bd->machine = machine_type;
+			malloc_end = mem;
+		} else if (blob_is_fdt(boarddata)) {
 			totalsize = get_unaligned_be32(boarddata + 4);
 			name = "DTB";
 		} else if (blob_is_compressed_fdt(boarddata)) {
-- 
2.23.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2019-09-18  7:54 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-18  7:54 [PATCH 00/16] ARM: mxs: full multi image support Sascha Hauer
2019-09-18  7:54 ` Sascha Hauer [this message]
2019-09-18  7:54 ` [PATCH 02/16] ARM: tx28: Pass and check machine type Sascha Hauer
2019-09-18  7:54 ` [PATCH 03/16] ARM: tx28: Make locally used function static Sascha Hauer
2019-09-18  7:54 ` [PATCH 04/16] ARM: duckbill: Check machine type in initcalls Sascha Hauer
2019-09-18  7:54 ` [PATCH 05/16] ARM: Freescale mx28evk: " Sascha Hauer
2019-09-18  7:54 ` [PATCH 06/16] ARM: i.MX23 olinuxino: " Sascha Hauer
2019-09-18  7:54 ` [PATCH 07/16] ARM: Crytalfonts cfa10036: " Sascha Hauer
2019-09-18  7:54 ` [PATCH 08/16] ARM: i.MX23 Chumby: " Sascha Hauer
2019-09-18  7:54 ` [PATCH 09/16] ARM: Freescale i.MX23 evk: " Sascha Hauer
2019-09-18  7:54 ` [PATCH 10/16] ARM: mxs: cfa10036: Switch to multi image support Sascha Hauer
2019-09-18  7:54 ` [PATCH 11/16] ARM: mxs: imx23-evk: " Sascha Hauer
2019-09-18  7:54 ` [PATCH 12/16] ARM: mxs: chumby: " Sascha Hauer
2019-09-18  7:54 ` [PATCH 13/16] ARM: mxs: Move HAVE_PBL_MULTI_IMAGES up to ARCH Sascha Hauer
2019-09-18  7:54 ` [PATCH 14/16] ARM: mxs: Allow to compile all boards for a SoC together Sascha Hauer
2019-09-18  7:54 ` [PATCH 15/16] ARM: add common i.MX28 defconfig file Sascha Hauer
2019-09-18  7:54 ` [PATCH 16/16] ARM: add common i.MX23 " 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=20190918075421.20456-2-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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