scripts: sd_fusing: Add BananaPi BPI-F3 board
authorJaehoon Chung <jh80.chung@samsung.com>
Thu, 4 Jul 2024 06:21:03 +0000 (15:21 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Mon, 28 Oct 2024 11:28:46 +0000 (20:28 +0900)
Add BananaPi BPI-F3 board to support new RISC-V board.

Change-Id: I4a80af2f2c5faea4be9558972929bff3121d6925
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
scripts/tizen/sd_fusing.py

index ff1ed742c3970a94bd00dd9f2a9f481301d588e5..f2cf8ae55e35e286e2a681a074a73cae93e6b003 100755 (executable)
@@ -15,7 +15,7 @@ import sys
 import tarfile
 import tempfile
 
-__version__ = "1.1.4"
+__version__ = "1.1.5"
 
 Format = False
 Device = ""
@@ -696,6 +696,72 @@ class X86emu(SdFusingTarget):
                 p.ptype = args._rootfs_uuid
                 break
 
+class BpiF3(InitParams, SdFusingTargetAB):
+    long_name = "BananPi BPI-F3"
+    part_table = [
+        {"size": None, "name": "fsbl",
+         "start_sector": 256, "size_sectors": 512,
+         "ptype":      "C12A7328-F81F-11D2-BA4B-00A0C93EC93B",
+         "binaries":  ["FSL.bin"],},
+        {"size": None, "name": "env",
+         "start_sector": 768, "size_sectors": 128,
+         "ptype":      "C12A7328-F81F-11D2-BA4B-00A0C93EC93B",
+         "binaries":  ["u-boot-env-default.bin"],},
+        {"size": None, "name": "opensbi",
+         "start_sector": 2048, "size_sectors": 2048,
+         "ptype":      "C12A7328-F81F-11D2-BA4B-00A0C93EC93B",
+         "binaries":  ["fw_dynamic.itb"],},
+        {"size": None, "name": "uboot",
+         "start_sector": 4096, "size_sectors": 4096,
+         "ptype":      "C12A7328-F81F-11D2-BA4B-00A0C93EC93B",
+         "binaries":  ["u-boot.itb"],},
+        {"size": 256,  "name": "bootfs",
+         "ptype":      "C12A7328-F81F-11D2-BA4B-00A0C93EC93B",
+         "binaries":   "boot.img"},
+        {"size": 3072, "name": "rootfs_a",
+         "binaries":   "rootfs.img"},
+        {"size": 1344, "name": "system-data",
+         "binaries":   "system-data.img"},
+        {"size": None, "name": "user",
+         "binaries":   "user.img"},
+        {"size": 32,   "name": "module_a",
+         "binaries":   "modules.img"},
+        {"size": 32,   "name": "ramdisk_a",
+         "binaries":   "ramdisk.img"},
+        {"size": 32,   "name": "ramdisk-recovery_a",
+         "binaries":   "ramdisk-recovery.img"},
+        {"size": 8,    "name": "inform", "fstype": "ext4"},
+        {"size": 256,  "name": "hal_a",
+         "binaries":   "hal.img"},
+        {"size": 128,  "name": "bootfs_b",
+         "ptype":      "C12A7328-F81F-11D2-BA4B-00A0C93EC93B",
+         "binaries_b": "boot.img"},
+        {"size": 3072, "name": "rootfs_b",
+         "binaries_b": "rootfs.img"},
+        {"size": 32,   "name": "module_b",
+         "binaries_b": "modules.img"},
+        {"size": 32,   "name": "ramdisk_b",
+         "binaries_b": "ramdisk.img"},
+        {"size": 32,   "name": "ramdisk-recovery_b",
+         "binaries_b": "ramdisk-recovery.img"},
+        {"size": 256,  "name": "hal_b",
+         "binaries_b": "hal.img"},
+        {"size": 4,    "name": "reserved0"},
+        {"size": 64,   "name": "reserved1"},
+        {"size": 125,  "name": "reserved2"},
+    ]
+
+    # bootcode written to the protective MBR, aka RV64 'J 0x4400' (sector 34)
+    bootcode = b'\x6f\x40\x00\x40'
+
+    def __init__(self, device, args):
+        self.user_partition = 7
+        self.reserved_space = 5
+        self.update = args.update
+        self.apply_partition_sizes(args.partition_sizes)
+        super().__init__(device, 'gpt')
+
+
 class X86emu32(X86emu):
     long_name = "QEMU x86 32-bit"
 
@@ -720,6 +786,7 @@ TARGETS = {
     'rv64': RV64,
     'lpi4a': LicheePi4A,
     'lpi4as': LicheePi4ASuper,
+    'bpif3': BpiF3,
     'x86emu32': X86emu32,
     'x86emu64': X86emu64,
 }