tizen: sd_fusing.py: Switch VF2 board to A/B partition scheme 07/309507/1
authorMarek Szyprowski <m.szyprowski@samsung.com>
Thu, 11 Apr 2024 11:54:01 +0000 (13:54 +0200)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Thu, 11 Apr 2024 12:55:19 +0000 (14:55 +0200)
Use A/B partition scheme also for VisionFive2 board.

Boot script for VF2 has been updated to discover partitions based on
their GPT name, so it is safe to change layout.

While touching this, lets remove useless 'none' partition, which was
there only to force partitions to have specific numbers, hardcoded
earlier in the boot scripts. Also reduce the size of the 'boot'
partition, as there is nothing so large to store on it.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: If5893114a217dc98766da0afcc925f05b31c0c14

scripts/tizen/sd_fusing.py

index 0500804..38c3019 100755 (executable)
@@ -452,7 +452,7 @@ class RV64(InitParams, SdFusingTarget):
         self.apply_partition_sizes(args.partition_sizes)
         super().__init__(device, 'gpt')
 
-class VF2(InitParams, SdFusingTarget):
+class VF2(InitParams, SdFusingTargetAB):
     long_name = "VisionFive2"
     part_table = [
         {"size": 2,    "fstype": "raw",  "name": "SPL", "start": 4,
@@ -461,10 +461,9 @@ class VF2(InitParams, SdFusingTarget):
         {"size": 4,    "fstype": "raw",  "name": "u-boot",
          "ptype": "5B193300-FC78-40CD-8002-E86C45580B47",
          "binaries": ["u-boot.img", "u-boot.itb"],},
-        {"size": 292,  "fstype": "vfat", "name": "boot_a",
+        {"size": 128,  "fstype": "vfat", "name": "boot_a",
          "ptype": "C12A7328-F81F-11D2-BA4B-00A0C93EC93B",
          "binaries": "boot.img"},
-        {"size": 36,   "fstype": "raw",  "name": "none"},
         {"size": 3072, "fstype": "ext4", "name": "rootfs_a",
          "binaries": "rootfs.img"},
         {"size": 1344, "fstype": "ext4", "name": "system-data",
@@ -480,16 +479,35 @@ class VF2(InitParams, SdFusingTarget):
         {"size": 8,    "fstype": "ext4", "name": "inform"},
         {"size": 256,  "fstype": "ext4", "name": "hal_a",
          "binaries": "hal.img"},
+        {"size": 128,  "fstype": "vfat", "name": "boot_b",
+         "ptype": "C12A7328-F81F-11D2-BA4B-00A0C93EC93B",
+         "binaries_b": "boot.img"},
+        {"size": 3072, "fstype": "ext4", "name": "rootfs_b",
+         "binaries_b": "rootfs.img"},
+        {"size": 32,   "fstype": "ext4", "name": "module_b",
+         "binaries_b": "modules.img"},
+        {"size": 32,   "fstype": "ext4", "name": "ramdisk_b",
+         "binaries_b": "ramdisk.img"},
+        {"size": 32,   "fstype": "ext4", "name": "ramdisk-recovery_b",
+         "binaries_b": "ramdisk-recovery.img"},
+        {"size": 256,  "fstype": "ext4", "name": "hal_b",
+         "binaries_b": "hal.img"},
         {"size": 4,    "fstype": "raw",  "name": "reserved0"},
         {"size": 64,   "fstype": "raw",  "name": "reserved1"},
         {"size": 125,  "fstype": "raw",  "name": "reserved2"},
     ]
     params = (('reboot-param.bin', 'norm'),
-              ('reboot-param.info', 'norm'))
+              ('reboot-param.info', 'norm'),
+              ('partition-ab.info', 'a'),
+              ('partition-ab-cloned.info', '1'),
+              ('upgrade-status.info', '0'),
+              ('partition-a-status.info', 'ok'),
+              ('partition-b-status.info', 'ok'))
 
     def __init__(self, device, args):
-        self.user_partition = 6
+        self.user_partition = 5
         self.reserved_space = 5
+        self.update = args.update
         self.apply_partition_sizes(args.partition_sizes)
         super().__init__(device, 'gpt')