mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: [PATCH v1 4/4] ARM: boards: add support for Samsung Galaxy S20 5G (x1s)
Date: Tue, 29 Jul 2025 23:36:59 +0300	[thread overview]
Message-ID: <20250729203659.1858575-5-ivo.ivanov.ivanov1@gmail.com> (raw)
In-Reply-To: <20250729203659.1858575-1-ivo.ivanov.ivanov1@gmail.com>

Add support for Samsung Galaxy S20 5G, based on exynos990, to the
current samsung board support. This platform, just like exynos8895,
needs a bit to be set in order to allow the framebuffer to refresh.

Barebox has to be packaged as an android boot image:

mkbootimg --kernel images/barebox-exynos.img \
--ramdisk ramdisk.bin \
--dt stock.dtb
--cmdline "buildvariant=eng" \
--base 0x10000000 \
--kernel_offset 0x00008000 \
--ramdisk_offset 0x01000000 \
--second_offset 0x00f00000 \
--tags_offset 0x00000100 \
--os_version 9.0.0 \
--os_patch_level 2019-10 \
--pagesize 2048 \
--hash sha1 \
--output boot.img

And then flashed to the boot partition:

heimdall flash --BOOT boot.img

Currently, only a minimal set of features work. An image can be booted by
barebox by configuring barebox to jump to the address where ramdisk gets
loaded by s-boot, and packaging that payload as a ramdisk with mkbootimg.

Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
Tested-by: Umer Uddin <umer.uddin@mentallysanemainliners.org>

---
The tester is also the one who upstreamed support for x1s in mainline
linux. He volunteered for me to upstream barebox support for it
alongside dreamlte, hence why I have my copyright in the x1s overlay
device tree.
---
 arch/arm/boards/samsung-exynos/board.c    |  3 +++
 arch/arm/boards/samsung-exynos/lowlevel.c |  3 +++
 arch/arm/dts/Makefile                     |  3 ++-
 arch/arm/dts/exynos990-x1s.dts            | 13 +++++++++++++
 4 files changed, 21 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/exynos990-x1s.dts

diff --git a/arch/arm/boards/samsung-exynos/board.c b/arch/arm/boards/samsung-exynos/board.c
index 25e4add6..249b1b07 100644
--- a/arch/arm/boards/samsung-exynos/board.c
+++ b/arch/arm/boards/samsung-exynos/board.c
@@ -29,6 +29,8 @@ static int exynos_postcore_init(void)
 	 */
 	if (of_machine_is_compatible("samsung,exynos8895"))
 		decon0_base = IOMEM(0x12860000);
+	else if (of_machine_is_compatible("samsung,exynos990"))
+		decon0_base = IOMEM(0x19050000);
 	else
 		return 0;
 
@@ -49,6 +51,7 @@ static inline int exynos_init(struct device *dev)
 
 static const struct of_device_id exynos_of_match[] = {
 	{ .compatible = "samsung,dreamlte" },
+	{ .compatible = "samsung,x1s" },
 	{ /* Sentinel */},
 };
 
diff --git a/arch/arm/boards/samsung-exynos/lowlevel.c b/arch/arm/boards/samsung-exynos/lowlevel.c
index 9c4a0297..c574535f 100644
--- a/arch/arm/boards/samsung-exynos/lowlevel.c
+++ b/arch/arm/boards/samsung-exynos/lowlevel.c
@@ -12,6 +12,7 @@
 #include <asm/mmu.h>
 
 extern char __dtb_exynos8895_dreamlte_start[];
+extern char __dtb_exynos990_x1s_start[];
 
 static bool is_compat(const void *fdt, const char *prefix)
 {
@@ -42,6 +43,8 @@ static noinline void exynos_continue(void *downstream_fdt)
 	/* select device tree dynamically */
 	if (is_compat(downstream_fdt, "Samsung DREAMLTE")) {
 		__dtb_start = __dtb_exynos8895_dreamlte_start;
+	} else if (is_compat(downstream_fdt, "Samsung X1S")) {
+		__dtb_start = __dtb_exynos990_x1s_start;
 	} else {
 		/* we didn't match any device */
 		return;
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index a53834f7..58f05871 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -13,7 +13,8 @@ lwl-$(CONFIG_MACH_BEAGLEPLAY) += k3-am625-beagleplay.dtb.o k3-am625-r5-beaglepla
 lwl-$(CONFIG_MACH_CLEP7212) += ep7212-clep7212.dtb.o
 lwl-$(CONFIG_MACH_CM_FX6) += imx6dl-cm-fx6.dtb.o imx6q-cm-fx6.dtb.o imx6q-utilite.dtb.o
 lwl-$(CONFIG_MACH_DFI_FS700_M60) += imx6q-dfi-fs700-m60-6q.dtb.o imx6dl-dfi-fs700-m60-6s.dtb.o
-lwl-$(CONFIG_MACH_EXYNOS) += exynos8895-dreamlte.dtb.o
+lwl-$(CONFIG_MACH_EXYNOS) += exynos8895-dreamlte.dtb.o \
+			exynos990-x1s.dtb.o
 lwl-$(CONFIG_MACH_DUCKBILL) += imx28-duckbill.dtb.o
 lwl-$(CONFIG_MACH_KINDLE_MX50) += imx50-kindle-d01100.dtb.o imx50-kindle-d01200.dtb.o imx50-kindle-ey21.dtb.o
 lwl-$(CONFIG_MACH_EFIKA_MX_SMARTBOOK) += imx51-genesi-efika-sb.dtb.o
diff --git a/arch/arm/dts/exynos990-x1s.dts b/arch/arm/dts/exynos990-x1s.dts
new file mode 100644
index 00000000..19d59eaa
--- /dev/null
+++ b/arch/arm/dts/exynos990-x1s.dts
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
+/*
+ * Samsung Galaxy S20 5G (x1s/SM-G981B) barebox device tree source
+ *
+ * Copyright (c) 2025, Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
+ */
+
+/dts-v1/;
+#include <arm64/exynos/exynos990-x1s.dts>
+
+/ {
+	barebox,disable-deep-probe;
+};
-- 
2.43.0




  parent reply	other threads:[~2025-07-29 20:37 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-29 20:36 [PATCH v1 0/4] ARM: boards: add support for Samsung Galaxy S8 and S20 5G Ivaylo Ivanov
2025-07-29 20:36 ` [PATCH v1 1/4] video: simplefb-client: switch to dev_get_resource Ivaylo Ivanov
2025-07-30  8:11   ` Ahmad Fatoum
2025-07-30 11:28     ` Ivaylo Ivanov
2025-07-30 12:31       ` Ahmad Fatoum
2025-07-29 20:36 ` [PATCH v1 2/4] clocksource: arm_architected_timer: support clock-frequency Ivaylo Ivanov
2025-07-30  8:13   ` Ahmad Fatoum
2025-08-05  7:40   ` (subset) " Sascha Hauer
2025-07-29 20:36 ` [PATCH v1 3/4] ARM: boards: add support for Samsung Galaxy S8 (dreamlte) Ivaylo Ivanov
2025-07-30  8:31   ` Ahmad Fatoum
2025-07-30  9:09     ` Ivaylo Ivanov
2025-07-30  9:33       ` Ahmad Fatoum
2025-07-30 11:12         ` Ivaylo Ivanov
2025-07-29 20:36 ` Ivaylo Ivanov [this message]
2025-07-30  8:48   ` [PATCH v1 4/4] ARM: boards: add support for Samsung Galaxy S20 5G (x1s) Ahmad Fatoum
2025-07-30  9:16     ` Ivaylo Ivanov
2025-07-30  9:44       ` Ahmad Fatoum
2025-07-30 11:18         ` Ivaylo Ivanov
2025-07-30 12:50           ` Ahmad Fatoum
2025-07-30 13:12             ` Ivaylo Ivanov
2025-07-30 13:26               ` Ahmad Fatoum

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=20250729203659.1858575-5-ivo.ivanov.ivanov1@gmail.com \
    --to=ivo.ivanov.ivanov1@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@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