summaryrefslogtreecommitdiff
path: root/board/samsung
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2025-07-25 07:50:44 -0600
committerTom Rini <[email protected]>2025-07-25 07:50:44 -0600
commit088d24eb96fb8ba64e3afee310a9f32ee36c22b0 (patch)
tree314a85b5d08edf7f99df165e04aee19e6280058a /board/samsung
parent021783860f7e628f7c4e0c101707cd4250e6d61f (diff)
parentf83f2397a1f3ebb3136618332e1549687eb8dd52 (diff)
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-samsung
- Enhanced e850-96 support
Diffstat (limited to 'board/samsung')
-rw-r--r--board/samsung/e850-96/e850-96.c77
-rw-r--r--board/samsung/e850-96/e850-96.env44
2 files changed, 121 insertions, 0 deletions
diff --git a/board/samsung/e850-96/e850-96.c b/board/samsung/e850-96/e850-96.c
index 4d4f8d14c6d..a6c264d1248 100644
--- a/board/samsung/e850-96/e850-96.c
+++ b/board/samsung/e850-96/e850-96.c
@@ -4,9 +4,57 @@
* Author: Sam Protsenko <[email protected]>
*/
+#include <efi_loader.h>
+#include <env.h>
#include <init.h>
+#include <mapmem.h>
+#include <asm/io.h>
#include "fw.h"
+/* OTP Controller base address and register offsets */
+#define EXYNOS850_OTP_BASE 0x10000000
+#define OTP_CHIPID0 0x4
+#define OTP_CHIPID1 0x8
+
+struct efi_fw_image fw_images[] = {
+ {
+ .image_type_id = E850_96_FWBL1_IMAGE_GUID,
+ .fw_name = u"E850-96-FWBL1",
+ .image_index = 1,
+ },
+ {
+ .image_type_id = E850_96_EPBL_IMAGE_GUID,
+ .fw_name = u"E850-96-EPBL",
+ .image_index = 2,
+ },
+ {
+ .image_type_id = E850_96_BL2_IMAGE_GUID,
+ .fw_name = u"E850-96-BL2",
+ .image_index = 3,
+ },
+ {
+ .image_type_id = E850_96_BOOTLOADER_IMAGE_GUID,
+ .fw_name = u"E850-96-BOOTLOADER",
+ .image_index = 4,
+ },
+ {
+ .image_type_id = E850_96_EL3_MON_IMAGE_GUID,
+ .fw_name = u"E850-96-EL3-MON",
+ .image_index = 5,
+ },
+};
+
+struct efi_capsule_update_info update_info = {
+ .dfu_string = "mmc 0="
+ "fwbl1.img raw 0x0 0x18 mmcpart 1;"
+ "epbl.img raw 0x18 0x98 mmcpart 1;"
+ "bl2.img raw 0xb0 0x200 mmcpart 1;"
+ "bootloader.img raw 0x438 0x1000 mmcpart 1;"
+ "el3_mon.img raw 0x1438 0x200 mmcpart 1",
+ .num_images = ARRAY_SIZE(fw_images),
+ .images = fw_images,
+};
+
int dram_init(void)
{
return fdtdec_setup_mem_size_base();
@@ -17,10 +65,39 @@ int dram_init_banksize(void)
return fdtdec_setup_memory_banksize();
}
+/* Read the unique SoC ID from OTP registers */
+static u64 get_chip_id(void)
+{
+ void __iomem *otp_base;
+ u64 val;
+
+ otp_base = map_sysmem(EXYNOS850_OTP_BASE, 12);
+ val = readl(otp_base + OTP_CHIPID0);
+ val |= (u64)readl(otp_base + OTP_CHIPID1) << 32UL;
+ unmap_sysmem(otp_base);
+
+ return val;
+}
+
+static void setup_serial(void)
+{
+ char serial_str[17] = { 0 };
+ u64 serial_num;
+
+ if (env_get("serial#"))
+ return;
+
+ serial_num = get_chip_id();
+ snprintf(serial_str, sizeof(serial_str), "%016llx", serial_num);
+ env_set("serial#", serial_str);
+}
+
int board_late_init(void)
{
int err;
+ setup_serial();
+
/*
* Do this in board_late_init() to make sure MMC is not probed before
* efi_init_early().
diff --git a/board/samsung/e850-96/e850-96.env b/board/samsung/e850-96/e850-96.env
index 5ac76bcef02..aed7a71046d 100644
--- a/board/samsung/e850-96/e850-96.env
+++ b/board/samsung/e850-96/e850-96.env
@@ -7,5 +7,49 @@ pxefile_addr_r=0x8c200000
ramdisk_addr_r=0x8c300000
fdtfile=CONFIG_DEFAULT_FDT_FILE
+dfu_alt_info=
+ rawemmc raw 0 0x747c000 mmcpart 1;
+ esp part 0 1;
+ rootfs part 0 2;
+ fwbl1 raw 0x0 0x18 mmcpart 1;
+ epbl raw 0x18 0x98 mmcpart 1;
+ bl2 raw 0xb0 0x200 mmcpart 1;
+ dram_train raw 0x2b0 0x20 mmcpart 1;
+ ect_test raw 0x2d0 0x64 mmcpart 1;
+ acpm_test raw 0x334 0x104 mmcpart 1;
+ bootloader raw 0x438 0x1000 mmcpart 1;
+ el3_mon raw 0x1438 0x200 mmcpart 1
+
partitions=name=esp,start=512K,size=128M,bootable,type=system;
partitions+=name=rootfs,size=-,bootable,type=linux
+
+partitions_android=name=esp,start=512K,size=128M,bootable,type=system;
+partitions_android+=name=efs,size=20M,uuid=${uuid_gpt_efs};
+partitions_android+=name=env,size=16K,uuid=${uuid_gpt_env};
+partitions_android+=name=kernel,size=30M,uuid=${uuid_gpt_kernel};
+partitions_android+=name=ramdisk,size=26M,uuid=${uuid_gpt_ramdisk};
+partitions_android+=name=dtbo_a,size=1M,uuid=${uuid_gpt_dtbo};
+partitions_android+=name=dtbo_b,size=1M,uuid=${uuid_gpt_dtbo};
+partitions_android+=name=ldfw,size=4016K,uuid=${uuid_gpt_ldfw};
+partitions_android+=name=keystorage,size=8K,uuid=${uuid_gpt_keystorage};
+partitions_android+=name=tzsw,size=1M,uuid=${uuid_gpt_tzsw};
+partitions_android+=name=harx,size=2M,uuid=${uuid_gpt_harx};
+partitions_android+=name=harx_rkp,size=2M,uuid=${uuid_gpt_harx_rkp};
+partitions_android+=name=logo,size=40M,uuid=${uuid_gpt_logo};
+partitions_android+=name=super,size=3600M,uuid=${uuid_gpt_super};
+partitions_android+=name=cache,size=300M,uuid=${uuid_gpt_cache};
+partitions_android+=name=modem,size=100M,uuid=${uuid_gpt_modem};
+partitions_android+=name=boot_a,size=100M,uuid=${uuid_gpt_boot};
+partitions_android+=name=boot_b,size=100M,uuid=${uuid_gpt_boot};
+partitions_android+=name=persist,size=30M,uuid=${uuid_gpt_persist};
+partitions_android+=name=recovery_a,size=40M,uuid=${uuid_gpt_recovery};
+partitions_android+=name=recovery_b,size=40M,uuid=${uuid_gpt_recovery};
+partitions_android+=name=misc,size=40M,uuid=${uuid_gpt_misc};
+partitions_android+=name=mnv,size=20M,uuid=${uuid_gpt_mnv};
+partitions_android+=name=frp,size=512K,uuid=${uuid_gpt_frp};
+partitions_android+=name=vbmeta_a,size=64K,uuid=${uuid_gpt_vbmeta};
+partitions_android+=name=vbmeta_b,size=64K,uuid=${uuid_gpt_vbmeta};
+partitions_android+=name=metadata,size=16M,uuid=${uuid_gpt_metadata};
+partitions_android+=name=dtb_a,size=1M,uuid=${uuid_gpt_dtb};
+partitions_android+=name=dtb_b,size=1M,uuid=${uuid_gpt_dtb};
+partitions_android+=name=userdata,size=-,uuid=${uuid_gpt_userdata}