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 03/12] filetype: Add Rockchip boot image type
Date: Mon, 21 Jun 2021 11:27:53 +0200	[thread overview]
Message-ID: <20210621092802.27275-4-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20210621092802.27275-1-s.hauer@pengutronix.de>

Newer Rockchip SoCs boot images starting with the magic "RKNS". There
are older image formats currently not supported, this one is at least
supported on the RK3568.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Link: https://lore.barebox.org/20210615141641.31577-4-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 common/filetype.c  | 3 +++
 include/filetype.h | 1 +
 2 files changed, 4 insertions(+)

diff --git a/common/filetype.c b/common/filetype.c
index 0cae00abaa..9edebb2cd8 100644
--- a/common/filetype.c
+++ b/common/filetype.c
@@ -73,6 +73,7 @@ static const struct filetype_str filetype_str[] = {
 	[filetype_stm32_image_v1] = { "STM32 image (v1)", "stm32-image-v1" },
 	[filetype_zynq_image] = { "Zynq image", "zynq-image" },
 	[filetype_mxs_sd_image] = { "i.MX23/28 SD card image", "mxs-sd-image" },
+	[filetype_rockchip_rkns_image] = { "Rockchip boot image", "rk-image" },
 };
 
 const char *file_type_to_string(enum filetype f)
@@ -309,6 +310,8 @@ enum filetype file_detect_type(const void *_buf, size_t bufsize)
 		return filetype_riscv_linux_image;
 	if (le32_to_cpu(buf[14]) == 0x56435352 && !memcmp(&buf[12], "barebox", 8))
 		return filetype_riscv_barebox_image;
+	if (strncmp(buf8, "RKNS", 4) == 0)
+		return filetype_rockchip_rkns_image;
 	if ((buf8[0] == 0x5a || buf8[0] == 0x69 || buf8[0] == 0x78 ||
 	     buf8[0] == 0x8b || buf8[0] == 0x9c) &&
 	    buf8[0x1] == 0 && buf8[0x2] == 0 && buf8[0x3] == 0 &&
diff --git a/include/filetype.h b/include/filetype.h
index fd339f9564..4d4481effd 100644
--- a/include/filetype.h
+++ b/include/filetype.h
@@ -54,6 +54,7 @@ enum filetype {
 	filetype_stm32_image_v1,
 	filetype_zynq_image,
 	filetype_mxs_sd_image,
+	filetype_rockchip_rkns_image,
 	filetype_max,
 };
 
-- 
2.29.2


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


  parent reply	other threads:[~2021-06-21  9:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-21  9:27 [PATCH v2 00/12] Rockchip RK3568 support Sascha Hauer
2021-06-21  9:27 ` [PATCH 01/12] clk: Add clk_name_* functions Sascha Hauer
2021-06-21  9:27 ` [PATCH 02/12] clk: rockchip rk3568: Initialize clocks Sascha Hauer
2021-06-21  9:27 ` Sascha Hauer [this message]
2021-06-21  9:27 ` [PATCH 04/12] ARM: Rockchip: Add rkimage tool Sascha Hauer
2021-06-21  9:27 ` [PATCH 05/12] ARM: Add relocate_to_adr_full() Sascha Hauer
2021-06-21  9:27 ` [PATCH 06/12] ARM: Rockchip: Add rk3568 dtsi files Sascha Hauer
2021-06-21  9:27 ` [PATCH 07/12] ARM: Rockchip: Add rk3568 support Sascha Hauer
2021-06-21  9:27 ` [PATCH 08/12] ARM: Add atf common support Sascha Hauer
2021-06-21  9:27 ` [PATCH 09/12] ARM: rockchip: Add bootm handler for RKNS images Sascha Hauer
2021-06-21  9:28 ` [PATCH 10/12] ARM: Rockchip: Add rk3568 evb board support Sascha Hauer
2021-06-21  9:28 ` [PATCH 11/12] Add rockchip_v8_defconfig Sascha Hauer
2021-06-21  9:28 ` [PATCH 12/12] fixup! clk: Rockchip: Add rk3568 clk support 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=20210621092802.27275-4-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