platform/kernel/u-boot.git
3 months agopackaging: Remove armv7hl repack baselibs from aarch64 84/319984/1 accepted/tizen_unified accepted/tizen_unified_x accepted/tizen/unified/20250224.161834 accepted/tizen/unified/x/20250226.020354
Seung-Woo Kim [Thu, 20 Feb 2025 10:36:40 +0000 (19:36 +0900)]
packaging: Remove armv7hl repack baselibs from aarch64

Remove armv7hl repackaging target of baselips from aarch64
because of no armv7hl arch in Tizen-Unified project anymore.

Change-Id: I67fdae1876d79228b6fc091d6f53f4f25141e4ce
Ref: https://review.tizen.org/git/?p=scm/meta/qb.git;a=commit;h=857137156ab2332e8b1324f0b2831e0caf98a5fa
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
5 months agotizen: sd_fusing.py: Remove sd_fusing.py script 10/317510/1
Jaehoon Chung [Fri, 3 Jan 2025 00:44:53 +0000 (09:44 +0900)]
tizen: sd_fusing.py: Remove sd_fusing.py script

sd_fusing.py script was moved to platform/kernel/tizen-fusing-script
repo. Remove this script from this repo.
- Use script in tizen-fusing-script repo.

Change-Id: I0831a53d32a32fe563b79bd224efdaea2a8fc7c1
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
5 months agosamsung: tizen_rpi: Remove tizen_rpi header file 58/316858/1 accepted/tizen_unified_x_asan accepted/tizen/unified/20241227.081616 accepted/tizen/unified/x/20241228.233253 accepted/tizen/unified/x/asan/20250113.002054
Jaehoon Chung [Wed, 18 Dec 2024 04:54:23 +0000 (13:54 +0900)]
samsung: tizen_rpi: Remove tizen_rpi header file

Remove a tizen_rpi header file as dead code.
It's repalced to tizen_rpi.env file. It's not using anymore.

Change-Id: Ide1e6637173d5cfa2c592f599739458968a1d658
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
5 months agoscripts: sd_fusing: Add Notice message to share an information 83/316683/1
Jaehoon Chung [Tue, 17 Dec 2024 00:22:49 +0000 (09:22 +0900)]
scripts: sd_fusing: Add Notice message to share an information

sd_fusing.py script was moved to tizen-fusing-scripts repository.
This script is not valid anymore.
In future, this script will be remove in this repository.

Change-Id: I9ff346d647c47b951f23584ff72d0dbc92e2b27a
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
6 months agocmd: tizendown: Update usbdown usage with proper command 98/315598/2 accepted/tizen/unified/20241204.183314 accepted/tizen/unified/x/20241218.032629 accepted/tizen/unified/x/asan/20241224.004353
Seung-Woo Kim [Tue, 3 Dec 2024 10:25:21 +0000 (19:25 +0900)]
cmd: tizendown: Update usbdown usage with proper command

Update usbdown usage help with 'usbdown' command.

Change-Id: I095adcb3156afe7dc78ead52025598fa3e381320
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
6 months agopackaging: Use the u-boot.spec for u-boot-rpi4-32b 26/315526/1
Jaehoon Chung [Tue, 3 Dec 2024 00:11:56 +0000 (09:11 +0900)]
packaging: Use the u-boot.spec for u-boot-rpi4-32b

xu3 didn't support anymore on Tizen. So it doesn't need to build
anymore. Instead, move the u-boot-rpi4-32b into u-boot.spec.
It will be created same rpm packages like below.

- u-boot-rpi4-32b-2024.10-0.armv7l.rpm
- u-boot-rpi4-32b-debugsource-2024.10-0.armv7l.rpm
- u-boot-tools-2024.10-0.armv7l.rpm
- u-boot-tools-debuginfo-2024.10-0.armv7l.rpm

Change-Id: If53dce0db499137396380bd8c6d3a8c39b2c12e6
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
6 months agoboard: rpi: tizen_rpi: Add the values of GPT_PARTS_DEFAULT 85/320385/1 tizen-next accepted/tizen/unified/20241126.175211
Jaehoon Chung [Thu, 14 Nov 2024 09:04:59 +0000 (18:04 +0900)]
board: rpi: tizen_rpi: Add the values of GPT_PARTS_DEFAULT

GPT_PARTS_DEFAULT was missed when it was updated at initial time.
Add the values of GPT_PARTS_DEFAULT to fix wrong value.

Change-Id: I37be4e8beabffe1d887bc73a663e76cae78a6b00
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
7 months agotizen: bootscript: tizen-boot-vf2: Fix the earlycon value 29/320229/1
Jaehoon Chung [Mon, 11 Nov 2024 06:46:09 +0000 (15:46 +0900)]
tizen: bootscript: tizen-boot-vf2: Fix the earlycon value

When it's set only to "earlycon", it's stucked at Starting kernel.
To fix this problem, add "earylcon=sbi" as correct value.

Change-Id: Id82c8435052b6fb67c72759276fae42b8cee8d33
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
7 months agoboard: rpi: tizen_rpi: Change from CONFIG_ARM64 to CONFIG_PHYS_64BIT 44/319944/1
Jaehoon Chung [Tue, 5 Nov 2024 09:50:54 +0000 (18:50 +0900)]
board: rpi: tizen_rpi: Change from CONFIG_ARM64 to CONFIG_PHYS_64BIT

initrd_high is dependent with CONFIG_PHYS_64BIT configuration.
Even though CONFIG_ARM64 is not enabled, CONFIG_PHYS_64BIT can be
enabled.

Change-Id: I4a6be68f5e0b4a9fb7b98e8adc469a08d6dea998
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
7 months agoboot: image-board: Mismatch a type between variable and return value 43/319943/1
Jaehoon Chung [Tue, 5 Nov 2024 09:39:20 +0000 (18:39 +0900)]
boot: image-board: Mismatch a type between variable and return value

phys_addr_t can be used unsigned long long type with CONFIG_PHYS_64BIT.
But hextoul() is always returning to unsigned long. It can be assigned
to unexpected value. To avoid wrong behavior, change from hextoul() to
simple_strtoull().

Fixes: a4df06e41fa2 ("boot: fdt: Change type of env_get_bootm_low() to phys_addr_t")
Change-Id: Ia7c25f8fbc8e31bdd7abd1f9cf599c4c873dd769
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
7 months agoconfigs: tizen_starfive_visionfive2: Upate defconfig file 85/319785/1
Jaehoon Chung [Fri, 1 Nov 2024 03:19:07 +0000 (12:19 +0900)]
configs: tizen_starfive_visionfive2: Upate defconfig file

Update defconfig file according to upating version.

Change-Id: I03bc380a61147aca8043b1dbe2f1931952899a41
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
7 months agoconfigs: tizen_rpi_4_32b: Enable UNZIP configuration 73/319773/1
Jaehoon Chung [Fri, 1 Nov 2024 00:09:47 +0000 (09:09 +0900)]
configs: tizen_rpi_4_32b: Enable UNZIP configuration

initramfs is decompressing in bootscript with unzip.
But rpi_4_32b doesn't enable its configuration, so it can't boot a
correctly.
Enable additional configurations to keep other board's configuration.

Change-Id: I2fd931ba562d706100506ca246d81f6d5468b9b0
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
7 months agoboard: rpi: tizen_rpi: Change the value of dfu_device 72/319772/1
Jaehoon Chung [Tue, 29 Oct 2024 08:17:54 +0000 (17:17 +0900)]
board: rpi: tizen_rpi: Change the value of dfu_device

Change the value of dfu_device to 0 as integer value.
__stringify() doesn't apply in tizen_rpi.env.
So it's not working a correct behavior.

Change-Id: I45e5a6cbf6da24940b0df6456e45258f8afbd7c2
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
7 months agoconfigs: tizen: Disable CONFIG_TOOLS_MKEFICAPSULE 22/319622/2
Jaehoon Chung [Tue, 29 Oct 2024 01:39:05 +0000 (10:39 +0900)]
configs: tizen: Disable CONFIG_TOOLS_MKEFICAPSULE

CONFIG_TOOLS_MKEFICAPSULE is enabled by EFI_LOADER after updating
version.
It needs to include some headers, but Tizen doesn't support packages.
To avoid a build failure, disable CONFIG_TOOLS_MKEFICAPSULE.

[   25s]   HOSTLD  tools/mkenvimage
[   25s]   HOSTLD  tools/dumpimage
[   25s] tools/mkeficapsule.c:21:10: fatal error: gnutls/gnutls.h: No such file or directory
[   25s]    21 | #include <gnutls/gnutls.h>
[   25s]       |          ^~~~~~~~~~~~~~~~~

Change-Id: I45e511ebd1c11f49d92c9de77395f954445c8cec
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
7 months agoenvtools: make them build again 18/319618/3
Rasmus Villemoes [Wed, 16 Oct 2024 15:10:35 +0000 (17:10 +0200)]
envtools: make them build again

In v2024.10, "make envtools" is broken for at least these defconfigs:

   am335x_evm_defconfig
   rpi_3_defconfig
   rpi_4_defconfig
   mx7dsabresd_defconfig
   wandboard_defconfig
   imx8mp_evk_defconfig

The only defconfig we use for which it is not broken is
stm32mp13_defconfig. They all work just fine in v2024.07.

The symptoms are slightly different, but all related to the fact that
some transitively included header uses IS_ENABLED or CONFIG_IS_ENABLED
without linux/kconfig.h having already been included.

A simple git bisect doesn't produce anything sensible, it ends up at
3a9f642ca94 (crypto: nuvoton: npcm_sha: Support SHA 384/512) which
clearly has nothing to do with this. But digging deeper, one
eventually finds 0f92fa45603 ("env: Remove <common.h> and add needed
includes").

So at first I tried adding "#include <linux/kconfig.h>" in
include/env_default.h and include/env_flags.h. That fixes it for some,
but not all, of the above. For example rpi_3_defconfig still fails,
then in log.h complaining about BIT() and u8 not being defined. At
least BIT() is should have gotten from bitops.h, except that that's
behind ifdef __KERNEL__, so not set for the envtools build.

It turns out that the envtools source code in fw_env_private.h already
has some hackery to deal with all this, in the form of the __ASSEMBLY__
games it plays before including config.h. It seems that if we just
make sure to do that include early enough, so that config.h is indeed
parsed with that __ASSEMBLY__ hackery in place, everything builds
fine.

Fixes: 0f92fa45603 ("env: Remove <common.h> and add needed includes")
Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
[cherry picked from commit 6606a6adfaf8517cff7e5fe0fb206beed80087d5]
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: Ife811033f5edb4cb3585884599e8dee498efff26

7 months agoconfigs: tizen_rpi_4: Enable ENV_SOURCE_FILE as tizen_rpi 86/319586/5
Jaehoon Chung [Mon, 28 Oct 2024 05:56:52 +0000 (14:56 +0900)]
configs: tizen_rpi_4: Enable ENV_SOURCE_FILE as tizen_rpi

Enable ENV_SOURCE_FILE as "tizen_rpi" instead of using rpi.env.

Change-Id: Ibc7d565d1169dc75baa2bb8cddef668cabb757a6
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
7 months agoboard: raspberrypi: rpi: Add tizen_rpi.env file for Tizen 82/319582/4
Jaehoon Chung [Mon, 28 Oct 2024 04:05:59 +0000 (13:05 +0900)]
board: raspberrypi: rpi: Add tizen_rpi.env file for Tizen

Add tizen_rpi.env file for using tizen specific environment.
It will be replaced the rpi.env with CONFIG_ENV_SOURCE_FILE.

Change-Id: Ia5a0d7817ff9f28a30f3a194738659f37a26d158
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
7 months agoconfigs: Sync the tizen configs with latest configuration 73/319573/4
Jaehoon Chung [Mon, 28 Oct 2024 02:09:49 +0000 (11:09 +0900)]
configs: Sync the tizen configs with latest configuration

Sync the tizen configs with latest configurations.
device-tree is using the files under dts/upstream/src.

Change-Id: I51f868a10b596fae1d3ea8473541c022e95a3402
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
7 months agopackaging: Change u-boot version from 2023.10 to 2024.10
Jaehoon Chung [Fri, 25 Oct 2024 01:28:37 +0000 (10:28 +0900)]
packaging: Change u-boot version from 2023.10 to 2024.10

Change u-boot version from 2023.10. to 2024.10.

Change-Id: I84bfe87e0a906a20442ef76ea886e116d88efa4e
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
7 months agotizen: bootscript: unpack initramfs and pass its actual size to kernel
Marek Szyprowski [Mon, 7 Oct 2024 08:48:01 +0000 (10:48 +0200)]
tizen: bootscript: unpack initramfs and pass its actual size to kernel

The initramfs ramdisk image (CPIO compressed archive) is stored on the
separate ramdisk/ramdisk-recovery partitions, thus it is not possible to
determine size of the compresszed archive. Passing the size of the
partition as the size of initramfs image to the kernel instructs the
kernel to check if the remaining bytes are another CPIO archive with more
initramfs data.

Decompressing or interpreting such additional garbage bytes sometimes
fails, what results in kernel ignoring the whole initramfs data as broken
one and thus breaking the Tizen boot sequence.

To avoid such problems and dependency on unknown/garbage data from
ramdisk partitions, lets decompres initramfs data (CPIO gzip archive)
directly in u-boot and pass the kernel only the single, uncompressed CPIO
archive as iniramfs image.

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

7 months agotizen: bootscript: amlogic: unpack initramfs and pass its actual size to kernel
Marek Szyprowski [Mon, 7 Oct 2024 14:40:28 +0000 (16:40 +0200)]
tizen: bootscript: amlogic: unpack initramfs and pass its actual size to kernel

The initramfs ramdisk image (CPIO compressed archive) is stored on the
separate ramdisk/ramdisk-recovery partitions, thus it is not possible to
determine size of the compresszed archive. Passing the size of the
partition as the size of initramfs image to the kernel instructs the
kernel to check if the remaining bytes are another CPIO archive with more
initramfs data.

Decompressing or interpreting such additional garbage bytes sometimes
fails, what results in kernel ignoring the whole initramfs data as broken
one and thus breaking the Tizen boot sequence.

To avoid such problems and dependency on unknown/garbage data from
ramdisk partitions, lets decompres initramfs data (CPIO gzip archive)
directly in u-boot and pass the kernel only the single, uncompressed CPIO
archive as iniramfs image.

In case of Amlogic based boards boot script, kernel load address has to
be recalculated and adjusted to next the 4k page boundary.

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

7 months agoscripts: sd_fusing: Check the minimum required Python version
Jaehoon Chung [Mon, 14 Oct 2024 23:59:48 +0000 (08:59 +0900)]
scripts: sd_fusing: Check the minimum required Python version

"extend" of action was added since python3.8.
If python version is lower than 3.8, it will be occurred the error like below.

Traceback (most recent call last):
  File "./scripts/tizen/sd_fusing.py", line 1375, in <module>
    help="binary to flash, may be used multiple times")
  File "/usr/local/lib/python3.7/argparse.py", line 1358, in add_argument
    raise ValueError('unknown action "%s"' % (action_class,))
ValueError: unknown action "extend"

Refer to Python Doc:
3.7 - https://docs.python.org/3.7/library/argparse.html#action
3.8 - https://docs.python.org/3.8/library/argparse.html#action

Change-Id: I8d9deafcddbe67f80adc310d01f22891a2d802ae
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
7 months agotizen: sd_fusing.py: correct rootfs partition UUID for x86_64 emulator target
Marek Szyprowski [Fri, 11 Oct 2024 11:48:19 +0000 (13:48 +0200)]
tizen: sd_fusing.py: correct rootfs partition UUID for x86_64 emulator target

According to [1] the x86_64 target should use
4f68bce3-e8cd-4db1-96e7-fbcaf984b709 UUID for the rootfs partition.

[1] https://uapi-group.org/specifications/specs/discoverable_partitions_specification/

Suggested-by: Lukasz Stelmach <l.stelmach@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Id8e7368e4ddfe181def369f79800a2772ff4c8bc

7 months agotizen: sd_fusing.py: add support for all 4 variants of Amlogic targets
Marek Szyprowski [Fri, 11 Oct 2024 07:32:04 +0000 (09:32 +0200)]
tizen: sd_fusing.py: add support for all 4 variants of Amlogic targets

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

7 months agotizen: bootscript: remove outdated/obsolete/unused RPi3 boot script
Marek Szyprowski [Mon, 7 Oct 2024 09:15:26 +0000 (11:15 +0200)]
tizen: bootscript: remove outdated/obsolete/unused RPi3 boot script

To avoid confusion, remove unused files. If needed, it can be restored
from older Tizen releases.

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

7 months agoconfigs: remove unused qemu-riscv64 uboot target
Marek Szyprowski [Thu, 26 Sep 2024 13:19:11 +0000 (15:19 +0200)]
configs: remove unused qemu-riscv64 uboot target

u-boot built from the tizen_qemu-riscv64_defconfig is not used in any
of the possible QEMU use-case scenarios, so remove it to avoid possible
confusion. Keep only the tizen_qemu-riscv64_smode_defconfig based one,
which is used as target for starting Tizen in QEMU/RISCV64 environment.

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

7 months agoRevert "tizen: sd_fusing.py: change partition of vf2* for backward compatibility"
Marek Szyprowski [Tue, 24 Sep 2024 09:09:02 +0000 (11:09 +0200)]
Revert "tizen: sd_fusing.py: change partition of vf2* for backward compatibility"

Remove the unused 'none' partition entry for VF2 boards. The initrd-flash
package has been finally fixed to rely on the GPT partition names instead
of the hardcoded numbers, so there really no need to keep this partition.

This reverts commit 15b42595fc8af2c95943adef62c170c6750f4f0f.

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

7 months agoscripts: sd_fusing: add QEMU RISC-V A/B and super targets
Jacek Kryszyn [Thu, 12 Sep 2024 05:29:42 +0000 (07:29 +0200)]
scripts: sd_fusing: add QEMU RISC-V A/B and super targets

Add QEMU RISC-V targets:
- A/B
- Super (Dynamic Partitions)

Which allow to test upgrade related features in QEMU.

Change-Id: I6d71254f1a881f7c89c511933c9ae856229ec625
Signed-off-by: Jacek Kryszyn <j.kryszyn@samsung.com>
7 months agoscripts: sd_fusing: RV64: remove unnecessary partitions
Jacek Kryszyn [Mon, 23 Sep 2024 04:44:49 +0000 (06:44 +0200)]
scripts: sd_fusing: RV64: remove unnecessary partitions

This change removes unnecessary partitions from RV64 target:
- SPL,
- u-boot,
- none.

Change-Id: I4fc8ab653712d91864fc16be24e8caf0359071a2
Signed-off-by: Jacek Kryszyn <j.kryszyn@samsung.com>
7 months agoscripts: sd_fusing: get rid of user_partition attribute
Jacek Kryszyn [Mon, 23 Sep 2024 04:01:29 +0000 (06:01 +0200)]
scripts: sd_fusing: get rid of user_partition attribute

The SdFusingTarget class has the user_partition
attribute which informs about the index of the user
partition in the part_table. It has to be set manually
for each target. This change removes the attribute and
adds calculation of the index.

Change-Id: I2a0827dac255bd4715ab04cd050e8fd9d14edb40
Signed-off-by: Jacek Kryszyn <j.kryszyn@samsung.com>
7 months agosamsung: tizen_rpi: Fix wrong console environment
Jaehoon Chung [Mon, 19 Aug 2024 02:05:34 +0000 (11:05 +0900)]
samsung: tizen_rpi: Fix wrong console environment

console is reassigned in bootscript with ${console}.
If it'sconsole=ram , $console should be "ram".
To use a correct environment, change from 'console ram' to 'console
console=ram'.

Change-Id: I05d19b46152033a20dfb9c288275ca0dc0f5d665
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
7 months agoscripts: sd_fusing: Add support for Amlogic Meson based Odroid C4 board
Marek Szyprowski [Wed, 14 Aug 2024 07:49:28 +0000 (09:49 +0200)]
scripts: sd_fusing: Add support for Amlogic Meson based Odroid C4 board

This allows to easily fuse Tizen to SD card or eMMC module in SD card
adapter.

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

7 months agoscripts: sd_fusing: Fix re-reading partition table again
Marek Szyprowski [Wed, 14 Aug 2024 07:42:48 +0000 (09:42 +0200)]
scripts: sd_fusing: Fix re-reading partition table again

Actually it turned out that any direct write access to the block device
might trigger kernel and udev to re-read partition table, so call
'udevadm settle' always after writing boot image directly to block
device.

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

7 months agoscripts: sd_fusing: Add force option to mkfs.ext4
Marek Szyprowski [Wed, 14 Aug 2024 09:30:47 +0000 (11:30 +0200)]
scripts: sd_fusing: Add force option to mkfs.ext4

Add force ('-F') option to mkfs.ext4 to avoid unexpectted filesystem
creation failure caused by some garbage being misdetected as DOS
partition signature:

2024-08-14T08:59:40.904 [sd_fusing.py:956] Formatting /dev/sda9 as ext4
2024-08-14T08:59:40.905 [sd_fusing.py:968] mkfs.ext4 -q -L inform /dev/sda9
Found a dos partition table in /dev/sda9
Proceed anyway? (y,N)
2024-08-14T08:59:40.924 Failed to create ext4 filesystem on /dev/sda9

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

7 months agoscripts: sd_fusing: Update a patch vertion
Jaehoon Chung [Wed, 14 Aug 2024 04:44:58 +0000 (13:44 +0900)]
scripts: sd_fusing: Update a patch vertion

Update a patch version from 9 to 10.

Change-Id: Ic30d9be84d3c4b655e1b807591d819b71946791d
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
7 months agoscripts: sd_fusing: bpif3: rename 'bootfs_b' part label to 'boot_b'
Seung-Woo Kim [Wed, 14 Aug 2024 01:12:12 +0000 (10:12 +0900)]
scripts: sd_fusing: bpif3: rename 'bootfs_b' part label to 'boot_b'

Use common 'boot'_{A/B} name instead of 'bootfs_b'
like 'boot_a' because tizen-boot-bpif3.scr is changed
to use 'boot_${partition_ab}'.

Change-Id: I4b4a934ef2769041d1c2a629a2dfebe5681d9698
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 months agoscripts: sd_fusing: bpif3: change partition type for bootloader partitions
Marek Szyprowski [Tue, 13 Aug 2024 13:18:59 +0000 (15:18 +0200)]
scripts: sd_fusing: bpif3: change partition type for bootloader partitions

Use the semi-standard types of 'HiFive Unleashed FSBL/BBL' for bootloader
related partitions instead of the 'EFI System'. This helps other systems
to avoid trying to mount those partitions as FAT volumes.

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

7 months agoscripts: sd_fusing: bpif3: rename FAT 'boot' partition to the common 'boot_a'
Marek Szyprowski [Tue, 13 Aug 2024 13:15:33 +0000 (15:15 +0200)]
scripts: sd_fusing: bpif3: rename FAT 'boot' partition to the common 'boot_a'

Use common 'boot_a' name for the first 'boot' partition.

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

7 months agoscripts: sd_fusing: bpif3: remove unused 'env' partition
Marek Szyprowski [Tue, 13 Aug 2024 13:13:59 +0000 (15:13 +0200)]
scripts: sd_fusing: bpif3: remove unused 'env' partition

Tizen u-boot for BPif3 has been patched to store its environment on the
first 'boot' partition (FAT filesystem) in uboot.env file, like on other
Tizen boards. The 'env' partition is unused then, so remove it.

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

7 months agosamsung: tizen_rpi: Add enable/disable_delay environment
Jaehoon Chung [Tue, 13 Aug 2024 07:10:57 +0000 (16:10 +0900)]
samsung: tizen_rpi: Add enable/disable_delay environment

Add enable/disable_delay environmenet.
This is to check a booting time without log message and bootdelay.

To disable log mssage and bootdelay
- run disable_delay
To enable log message and bootdelay
- run enable_delay

Change-Id: I5da4a7dda48f71e4d35d33d998695b05438f6063
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
7 months agosamsung: tizen_rpi: Set to slot_a by default when run tfm
Jaehoon Chung [Wed, 7 Aug 2024 22:28:30 +0000 (07:28 +0900)]
samsung: tizen_rpi: Set to slot_a by default when run tfm

In some case, it's resetting to normal mode from download mode.
So it's always running as ramdisk boot mode.

To fix above issue, Set to slot_a by default when run tfm.
"run tfm" means that user tries to flahs entire image.
So it doesn't need that it enters to slot_b mode.

To prevent the overwrite, change the loading address to 0x02500000.
Because scriptaddr is using 0x02400000.

Change-Id: Iad0791484fb30d08d4584763088b80ad05979df1
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
7 months agotizen: rpi4: Load uboot.env from slot_b when booting is a slot_b
Jaehoon Chung [Wed, 7 Aug 2024 08:30:27 +0000 (17:30 +0900)]
tizen: rpi4: Load uboot.env from slot_b when booting is a slot_b

Load uboot.env from slot_b when booting is a slot_b.
Otherwise, it should be using the environment of slot_a.

Change-Id: I8c98b4ce7cf9948feb0582c39f733783562ffc54
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
7 months agoscripts: sd_fusing: simplyfy the code structure in get_raw_binary_sector()
Łukasz Stelmach [Wed, 7 Aug 2024 06:34:33 +0000 (08:34 +0200)]
scripts: sd_fusing: simplyfy the code structure in get_raw_binary_sector()

Simplify the structure introduced in 098472c46d ("scripts: sd_fusing:
Check the raw_binary_table attribute").

Change-Id: Iaf844529d7db2b1df28175689980f0f843e5b86e
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
7 months agoscripts: sd_fusing: Wait for udev also after writing to the zero sector
Marek Szyprowski [Wed, 7 Aug 2024 06:50:34 +0000 (08:50 +0200)]
scripts: sd_fusing: Wait for udev also after writing to the zero sector

Writing to the zero sector might trigger kernel/udev to re-read partition
table, so wait for udev to settle in such case.

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

7 months agoscripts: sd_fusing: Check the raw_binary_table attribute
Jaehoon Chung [Wed, 7 Aug 2024 00:38:07 +0000 (09:38 +0900)]
scripts: sd_fusing: Check the raw_binary_table attribute

If there is no raw_binary_table, it doesn't work fine with below
message. RPI4/VF2 don't have raw_binary_table attribute.

AttributeError: 'Rpi4' object has no attribute 'raw_binary_table'

Change-Id: I379a87d9731fe82a3a32f54b38eb533b1ca4f885
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
7 months agoscripts: sd_fusing: Update a patch version
Marek Szyprowski [Fri, 5 Apr 2024 01:53:23 +0000 (10:53 +0900)]
scripts: sd_fusing: Update a patch version

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

7 months agoscripts: sd_fusing: Add support for writing bootinfo_sd.bin for BananaPiF3
Marek Szyprowski [Tue, 6 Aug 2024 11:57:10 +0000 (13:57 +0200)]
scripts: sd_fusing: Add support for writing bootinfo_sd.bin for BananaPiF3

Add support for writing bootinfo_sd.bin to the protective MBR bootcode
(sector zero) are of the SD card for BananaPiF3 boards.

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

7 months agoscripts: sd_fusing: Remove code for handling hardcoded bootcode
Marek Szyprowski [Tue, 6 Aug 2024 12:13:25 +0000 (14:13 +0200)]
scripts: sd_fusing: Remove code for handling hardcoded bootcode

Remove the code for handling hardcoded bootcode as it is no longer used.

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

7 months agoscripts: sd_fusing: Add support for writing image at specified absolute sector
Marek Szyprowski [Mon, 5 Aug 2024 15:42:12 +0000 (17:42 +0200)]
scripts: sd_fusing: Add support for writing image at specified absolute sector

Add support for writing raw images at the specified absolute sector of the
target device without the need to create a MBR or GPT partition for it.

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

7 months agoscripts: sd_fusing: Add entry for raw binary bootcode for LicheePi4A
Marek Szyprowski [Tue, 6 Aug 2024 12:12:30 +0000 (14:12 +0200)]
scripts: sd_fusing: Add entry for raw binary bootcode for LicheePi4A

The content of the bootcode will be moved from sd_fusing.py script to the
boot images, so add a new raw binary entry for the bootcode.bin file for
the LicheePi4A platform.

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

7 months agoscripts: sd_fusing: Write bootcode before calling 'udevadm settle'
Marek Szyprowski [Thu, 1 Aug 2024 10:26:08 +0000 (12:26 +0200)]
scripts: sd_fusing: Write bootcode before calling 'udevadm settle'

Writing bootcode to the first sector of the device might trigger kernel
or udev to reread partition table, so do this before calling 'udevadm
settle' command.

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

7 months agoscripts: sd_fusing: Fix to write both a/b partition
SangYoun Kwak [Thu, 11 Jul 2024 11:46:50 +0000 (20:46 +0900)]
scripts: sd_fusing: Fix to write both a/b partition

If sd_fusing script is executed with '--update ab' option, it should
write images to both a/b partitions.

When writing images, first, script reads image and writes to the
partition a until the image reaches the end.
Next, script reads image and writes to the partition b but it uses same
file object so there is nothing left to read. Thus, script writes
nothing to the partition b.

To fix this issue, a method call of the file object ".seek(0)" is added
before writing to the partitions. This will set cursor to the initial
position and the the image can be written to the partition b.

Change-Id: I78c1b3c77b6666a133527ba544911de8c4de44d4
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
7 months agoscripts: sd_fusing: Modifiy size of slots on super
Jacek Kryszyn [Wed, 10 Jul 2024 14:11:21 +0000 (16:11 +0200)]
scripts: sd_fusing: Modifiy size of slots on super

Size of a slot on the super partition is now determined
using value given in the partition table of the rpi4s
target. This way it is guaranteed that the super.img
will fit on the designated partition.

Change-Id: Icdf07228156d7ac78322767c906f502abfa03c79
Signed-off-by: Jacek Kryszyn <j.kryszyn@samsung.com>
7 months agoscripts: Add new param file upgrade-type.info
SangYoun Kwak [Tue, 9 Jul 2024 07:37:01 +0000 (16:37 +0900)]
scripts: Add new param file upgrade-type.info

File for the new parameter 'upgrade-type' is added.
The boot partition is selected by this parameter.

Available values(and boot partition for this value):
 * "offline" (ramdisk-recovery)
 * "online" (ramdisk)

The default value is "offline".

Change-Id: I929a5236c7f506708dda9a454af53648eef7e393
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
7 months agoscripts: sd_fusing: Fix a typo about fsbl file name
Jaehoon Chung [Tue, 9 Jul 2024 02:05:13 +0000 (11:05 +0900)]
scripts: sd_fusing: Fix a typo about fsbl file name

Fix a typo about fsbl file name.
FSBL.bin is a correct. And remove unnecessary bootcode.

Change-Id: I54adc6bc30bc30446233722dd446c0c9a49d4ec6
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
7 months agoscripts: sd_fusing: Add BananaPi BPI-F3 board
Jaehoon Chung [Thu, 4 Jul 2024 06:21:03 +0000 (15:21 +0900)]
scripts: sd_fusing: Add BananaPi BPI-F3 board

Add BananaPi BPI-F3 board to support new RISC-V board.

Change-Id: I4a80af2f2c5faea4be9558972929bff3121d6925
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
7 months agoAdd support for setting upgrade type
Mateusz Moscicki [Fri, 28 Jun 2024 10:54:06 +0000 (12:54 +0200)]
Add support for setting upgrade type

Upgrade type (online or offline) is set by HAL API.
Depending on the type selected during bootmode=FOTA ramdisk (online) or
ramdisk-recovery (offline) will be picked as boot partition.

Change-Id: Ifb7372b0da9a3df83bbf7a979fdb4035feade8ee

7 months agoscripts: sd_fusing: Add sfdisk error handling
Mateusz Moscicki [Wed, 19 Jun 2024 08:51:03 +0000 (10:51 +0200)]
scripts: sd_fusing: Add sfdisk error handling

Change-Id: I46519635e252de19a131a65bbd177eb9500b0138

7 months agoscripts: sd_fusing: support device symlinks in ensure_parttable()
Łukasz Stelmach [Thu, 13 Jun 2024 11:12:41 +0000 (13:12 +0200)]
scripts: sd_fusing: support device symlinks in ensure_parttable()

sd_fusing needs to support referring to devices by symlinks created by udev like
/dev/disk/by-id/usb-Generic_STORAGE_DEVICE_000000000272-0. Their partitions
are named /dev/disk/by-id/usb-Generic_STORAGE_DEVICE_000000000272-0-partX. Therefore
there is no universal way to access both /dev/sdXY and the symlinked
partitions and using get_partition_device() is the way to go.

Change-Id: I4c586f8e9b6e3940faa6055c90835bbff1777ec5
Fixes: 43ab41c7e7 ("sd_fusing.py: Ensure selected flashing target actually matches what is on device")
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
7 months agoscripts: sd_fusing: Update a patch version to 2
Jaehoon Chung [Thu, 13 Jun 2024 04:51:00 +0000 (13:51 +0900)]
scripts: sd_fusing: Update a patch version to 2

Update a patch version from 1 to 2.
- Changed the name of update-status param to update-progress-status.

Change-Id: I2d3635872fdd06a10660724244e54e759e00dc0a
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
7 months agoModify param files (upgrade-progress-status, upgrade-state)
SangYoun Kwak [Thu, 13 Jun 2024 04:33:12 +0000 (13:33 +0900)]
Modify param files (upgrade-progress-status, upgrade-state)

Since the file name for storing parameters are changed and added, the
tuple for params should be modified.
 * upgrade-status.info -> upgrade-progress-status.info (renamed)
 * upgrade-state.info (added)

Change-Id: Idb1e6536884cbb2a47cc5c92983eaffafd37445f
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
7 months agoscripts: sd_fusing: handle lsblk errors better
Mateusz Majewski [Fri, 7 Jun 2024 10:44:44 +0000 (12:44 +0200)]
scripts: sd_fusing: handle lsblk errors better

This makes the error handling a bit more consistent with the rest of the
script by logging an error and doing a sys.exit(1).

Returning an error by returning None would mean that it would need to be
handled elsewhere. However this does not happen, resulting in a
confusing runtime error

    TypeError: can only concatenate str (not "NoneType") to str

as well as warnings in some editors.

Change-Id: I6b3f382e93846c3165d1a8221e2faf7dbf295a86

7 months agoscripts: sd_fusing: fixes in check_sfdisk()
Jacek Kryszyn [Mon, 10 Jun 2024 07:44:10 +0000 (09:44 +0200)]
scripts: sd_fusing: fixes in check_sfdisk()

sfdisk can have a version number consisting of
{major}.{minor} or {major}.{minor}.{patch}. The new
version of check_sfdisk() handles this. In case of
a wrong version, a nicer error message which
explicitly shows minimum required version is printed.

Change-Id: I09614eabad8958ec4ac1bcc906ac09c2f5c6cbf2
Signed-off-by: Jacek Kryszyn <j.kryszyn@samsung.com>
7 months agoscripts: sd_fusing: change log.* to logging.*
Jacek Kryszyn [Mon, 10 Jun 2024 07:27:35 +0000 (09:27 +0200)]
scripts: sd_fusing: change log.* to logging.*

There were several occursences of log.* instead of
logging.* which are fixed in this commit.

Change-Id: Ic30fa959f5cb4c3b3a820ae716183738c6bdddac
Signed-off-by: Jacek Kryszyn <j.kryszyn@samsung.com>
7 months agoscripts: sd_fusing: wait for udev after sfdisk
Jacek Kryszyn [Mon, 10 Jun 2024 06:45:41 +0000 (08:45 +0200)]
scripts: sd_fusing: wait for udev after sfdisk

It was observed that errors related to wrong partition table
were thrown from time to time after repartitoning the device
with sfdisk. It seems that this was due to udev trying to
automatically rescan devices after being notified that some
changes were made.

This commit adds execution of udevadm settle after sfdisk.
The added command exits only after the udev event queue is
empty (or the timeout occured).

This commit reverts changes made by commit 5a7f3c8 (Invoke
ioctl to reread partitions directly) which are not needed
anymore. Running blockdev after sfdisk is also unnecessary
since sfdisk rereads the partition table anyway.

Change-Id: Ic89ea65846b4e064c85a316fdf6c07be42eb51e7
Signed-off-by: Jacek Kryszyn <j.kryszyn@samsung.com>
7 months agosd_fusing: Drop most "fstype" definitions
Karol Lewandowski [Fri, 7 Jun 2024 06:12:14 +0000 (08:12 +0200)]
sd_fusing: Drop most "fstype" definitions

This commit drops most "fstype" from target classes as its
definition forces creating new filesystem using mkfs.<fstype>,
which is normally not needed as the partitions are overwriten
by flashed binaries.

Additionally, this commit also drops fstype checking from
partition table verfication as it became useless.

Change-Id: Ief2034f0a1452ab48bd3f2b54b07a709126b000e

7 months agoscripts: sd_fusing: Fix wrong filesystem type about user
Jaehoon Chung [Wed, 5 Jun 2024 07:00:32 +0000 (16:00 +0900)]
scripts: sd_fusing: Fix wrong filesystem type about user

Tizen is using a user partition as f2fs filesystem.
It doesn't update the image because of mismatched filesystem type.

2024-06-05T15:52:37.819 Verifying that partition table on /dev/sdh matches target specification
2024-06-05T15:52:38.2 On-device partition mismatch with selected target: fstype=ext4, on-device:
DEVNAME=/dev/sdh5
UUID=c3237c35-3bee-45c0-80d6-599734b35701
TYPE=f2fs
PARTLABEL=user
PARTUUID=82d95111-8032-5c40-a80a-5138537eb66e

Change-Id: I801061da2176ee7ee125f95f0b808cddb181df17
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
7 months agosd_fusing.py: Update a minor version from 0 to 1
Jaehoon Chung [Fri, 31 May 2024 04:58:14 +0000 (13:58 +0900)]
sd_fusing.py: Update a minor version from 0 to 1

Update a minor version from 0 to 1.

Change-Id: I9fa42c53895dfbbfcd3fa9237f2875d45258e103
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
7 months agosd_fusing.py: Ensure selected flashing target actually matches what is on device
Karol Lewandowski [Thu, 23 May 2024 09:14:40 +0000 (11:14 +0200)]
sd_fusing.py: Ensure selected flashing target actually matches what is on device

Currently only partition label and filesystem type are checked, if available.

Change-Id: I64c43c7b80843e70876ce16ee7de24a7dc76378d
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
7 months agosd_fusing.py: Invoke ioctl to reread partitions directly
Karol Lewandowski [Wed, 22 May 2024 12:57:56 +0000 (14:57 +0200)]
sd_fusing.py: Invoke ioctl to reread partitions directly

This commit drops blockdev(8) in favor for invoking ioctl(2) directly,
to be able to catch EBUSY errors that happen to occur due to not yet
known kernel/udev timinig issue.

This commit also drops sfdisk --no-reread flag, which affects issuing
ioctl to reread partition table _before_ actual repartitioning.  ioctl
to reread partition table after writing changes is invoked unconditionally
and can't be disabled.

Change-Id: I105c445f9fdb3d1d2eee7ffd2de3f7ad04920f13
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
7 months agosd_fusing.py: Refactor parameters writing
Karol Lewandowski [Tue, 21 May 2024 21:57:15 +0000 (23:57 +0200)]
sd_fusing.py: Refactor parameters writing

This commit considerably alters when and which parameters are written
to "inform" partition:

 - Parameters are now updated always, not only when --format has been
   specified (this is compatible with old sd_fusing.sh behaviour)

 - Initial parameters are collected from configuration and from user
   input to reflect actual flashing options, eg. if user chosen to
   update only 'a' partition script won't set the flag that both
   partitions are cloned

   Dynamic parameters generation allowed to drop a lot of duplicated
   params.

Change-Id: I597f104b2b7972728663e2d85555407c721b7bb0
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
7 months agosd_fusing.py: Improve parameter write error message
Karol Lewandowski [Wed, 22 May 2024 10:36:48 +0000 (12:36 +0200)]
sd_fusing.py: Improve parameter write error message

Change-Id: If42e16e310b1454f190b21d6cd5b662e1f17f598
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
7 months agoDynamic partitions: fuse tarballs containing super.img
Jacek Kryszyn [Thu, 23 May 2024 10:25:47 +0000 (12:25 +0200)]
Dynamic partitions: fuse tarballs containing super.img

Allow to fuse tarballs prepared in such a way that they already
contain super.img and do not contain rootfs.img and hal.img.

Change-Id: Iac09011bd92f51354e16e70d3bb5f9ab12f299b2
Signed-off-by: Jacek Kryszyn <j.kryszyn@samsung.com>
7 months agoDynamic partitions: change size of a slot
Jacek Kryszyn [Wed, 22 May 2024 08:02:42 +0000 (10:02 +0200)]
Dynamic partitions: change size of a slot

Slot size was incorrect due to missing brackets. Now it is
equal to double size of hal and rootfs. Some additional code
is added to take into account metadata size and alignment of
super.

Change-Id: I7f163d7e4a74b3f5e7a1a2f207ebece9581b4876
Signed-off-by: Jacek Kryszyn <j.kryszyn@samsung.com>
7 months agorpi4: restore USB support in ARM64 build
Marek Szyprowski [Fri, 26 Apr 2024 20:51:04 +0000 (22:51 +0200)]
rpi4: restore USB support in ARM64 build

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

7 months agotizen: bootscript: rpi4: update boot scripts
Marek Szyprowski [Thu, 11 Apr 2024 09:11:56 +0000 (11:11 +0200)]
tizen: bootscript: rpi4: update boot scripts

Update RPi4 boot script to match the one developed recently for
LicheePi4A/VF2. This improves the following things:
- switch to generic devtype/devnum envs like for typical distro_boot case
- correctly load script and kernel from boot_b
- root= kernel parameter is correctly set for partitions up to 19th
- reordered some operations and added more comments
- tested A/B booting
- tested booting from legacy MBR based layout
- tested USB booting

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

7 months agorpi: set devtype/devnum envs for the detected boot medium
Marek Szyprowski [Thu, 25 Apr 2024 16:32:24 +0000 (18:32 +0200)]
rpi: set devtype/devnum envs for the detected boot medium

Set 'devtype' and 'devnum' envs (same as in the standard distro_boot) for
the detected boot medium, so they can be used in the boot scripts.

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

7 months agotizen: rpi4: drop obsolete, unused SPL-related defines
Marek Szyprowski [Fri, 26 Apr 2024 11:38:15 +0000 (13:38 +0200)]
tizen: rpi4: drop obsolete, unused SPL-related defines

u-boot for RPi4 never used SPL, so drop these SPL-related defines inherited
from the old RPi3 and OpTEE code.

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

7 months agotizen: rpi4: drop outdated MBR support
Marek Szyprowski [Fri, 26 Apr 2024 08:58:33 +0000 (10:58 +0200)]
tizen: rpi4: drop outdated MBR support

Tizen use GPT partition layout, so there is no point keeping MBR support.

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

7 months agotizen: bootscript: vf2: use only ramdisk_size name in the scripts
Marek Szyprowski [Fri, 26 Apr 2024 20:35:02 +0000 (22:35 +0200)]
tizen: bootscript: vf2: use only ramdisk_size name in the scripts

Avoid confusion with ramdisk_size/ramdisksize env names and use only the
first one consistently.

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

7 months agoEnable network on VF2 board
Daniil Ruban [Thu, 2 May 2024 07:11:31 +0000 (09:11 +0200)]
Enable network on VF2 board

- This MR enables network on VF2 boards. This is needed
 to have network boot on CI device under test
- Patch adds some fixes from: https://patchwork.ozlabs.org/project/uboot/list/?series=346678&state=*
 which was suddenly removed

Change-Id: I3f61728d04401fff57e829d2ac4ab1314aaa16b5
Signed-off-by: Daniil Ruban <intx82@gmail.com>
7 months agotizen: sd_fusing.py: Fix wrong user_partition count for vf2*
Seung-Woo Kim [Mon, 29 Apr 2024 11:16:01 +0000 (20:16 +0900)]
tizen: sd_fusing.py: Fix wrong user_partition count for vf2*

Fix wrong user_partition count for vf2* properly

Change-Id: I8a56c5673e07629d7cd4797b8e687619be97d48c
Fixes: commit 15b42595fc8a ("tizen: sd_fusing.py: change partition of vf2* for backward compatibility")
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 months agotizen: sd_fusing.py: Allow updating a & b partitions in one invocation
Karol Lewandowski [Thu, 25 Apr 2024 20:47:53 +0000 (22:47 +0200)]
tizen: sd_fusing.py: Allow updating a & b partitions in one invocation

This commit adds '--update ab' option, allowing both partition sets to
be updated at once.

Change-Id: I007392f0978753589a05d9e8586877c463ac1798
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 months agotizen: sd_fusing.py: change partition of vf2* for backward compatibility
Seung-Woo Kim [Mon, 29 Apr 2024 08:58:12 +0000 (17:58 +0900)]
tizen: sd_fusing.py: change partition of vf2* for backward compatibility

Before A/B partition support, there was the empty 4th part and
user flashing partition map in initrd-flash has partition number
with the empty partition. For backward compatibility, add the 4th
partition again.

Change-Id: Ic9417218ee3bd2d20cf8c82869d0e856a8600024
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 months agotizen: packaging: Repackage 64-bit rpi4 bootloader for use in mixed 64-bit boot/32...
Karol Lewandowski [Thu, 14 Mar 2024 12:39:42 +0000 (13:39 +0100)]
tizen: packaging: Repackage 64-bit rpi4 bootloader for use in mixed 64-bit boot/32-bit userspace scenarios

Change-Id: I02fe3ac88b49b8f15b2ff7153842613331b19cda
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
7 months agoscripts: sd_fusing.py: Update a patch version
Marek Szyprowski [Fri, 5 Apr 2024 01:53:23 +0000 (10:53 +0900)]
scripts: sd_fusing.py: Update a patch version

Update a patch version to 2.

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

7 months agotizen: sd_fusing.py: add support for VisionFive2 with Super partition
Marek Szyprowski [Thu, 11 Apr 2024 12:40:39 +0000 (14:40 +0200)]
tizen: sd_fusing.py: add support for VisionFive2 with Super partition

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

7 months agotizen: sd_fusing.py: Switch VF2 board to A/B partition scheme
Marek Szyprowski [Thu, 11 Apr 2024 11:54:01 +0000 (13:54 +0200)]
tizen: sd_fusing.py: Switch VF2 board to A/B partition scheme

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

7 months agotizen: bootscript: vf2: update boot scripts
Marek Szyprowski [Thu, 11 Apr 2024 09:11:56 +0000 (11:11 +0200)]
tizen: bootscript: vf2: update boot scripts

Update VF2 boot script to match the one developped recently for
LicheePi4A. This improves the following things:
- partitions are discovered by GPT name, not by hardcoded number
- root= kernel parameter is correctly set for partitions up to 19th
- switch to generic devtype/devnum envs like for typical distro_boot case
- reordered some operations and added more comments
- tested A/B booting

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

7 months agotizen: sd_fusing.py: add LicheePi4A with Super partition support
Marek Szyprowski [Wed, 10 Apr 2024 11:37:27 +0000 (13:37 +0200)]
tizen: sd_fusing.py: add LicheePi4A with Super partition support

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

7 months agotizen: sd_fusing.py: change bogus 'param' name to 'reserved0'
Marek Szyprowski [Wed, 10 Apr 2024 10:00:33 +0000 (12:00 +0200)]
tizen: sd_fusing.py: change bogus 'param' name to 'reserved0'

The original sd_fusing_rpi4.sh had following content:

[...]
size=${PARAM_SZ}MiB, name=reserved0
size=${RESERVED1_SZ}MiB, name=reserved1
size=${RESERVED2_SZ}MiB, name=reserved2

It looks that while rewriting the above to python, the size and name has
been mixed resulting in creating 'param' partition. Then this bogus name
was copied to the Rpi4AoT and LicheePi4A variants. Restore proper
'reserved0' name for all variants.

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

7 months agotizen: sd_fusing.py: rpi4s: getting rid of unnecessary alignments
Jacek Kryszyn [Thu, 4 Apr 2024 13:17:27 +0000 (15:17 +0200)]
tizen: sd_fusing.py: rpi4s: getting rid of unnecessary alignments

In case of rpi4s target (Tizen with dynamic partitions
on rpi4) do not perform unnecessary calculations of aligned
size of partitions.

Change-Id: Ieea75f133d35d29f72a5b2336181b200809e5f14
Signed-off-by: Jacek Kryszyn <j.kryszyn@samsung.com>
7 months agoscripts: sd_fusing.py: Update a patch version
Jaehoon Chung [Fri, 5 Apr 2024 01:53:23 +0000 (10:53 +0900)]
scripts: sd_fusing.py: Update a patch version

Update a patch version from 0 to 1.

Change-Id: I0282bb3f625331f58a9802133a0b32ac664d9d9f
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
7 months agotizen: sd_fusing.py: Catch kernel not being able to re-read partition table
Karol Lewandowski [Thu, 4 Apr 2024 12:15:27 +0000 (14:15 +0200)]
tizen: sd_fusing.py: Catch kernel not being able to re-read partition table

sfdisk(8) by default request kernel to reread partition table but does not
seem to return error code when it fails to do so.  This commit fixes followig
error:

    The partition table has been altered.
    Calling ioctl() to re-read partition table.
    Re-reading the partition table failed.: Permission denied
    The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or partx(8).
    Syncing disks.
    Traceback (most recent call last):
      File "/usr/local/bin/sd_fusing.py", line 958, in <module>
        check_partition_format(args, target)
      File "/usr/local/bin/sd_fusing.py", line 711, in check_partition_format
        mkpart(args, target)
      File "/usr/local/bin/sd_fusing.py", line 596, in mkpart
        d = "/dev/" + get_partition_device(target.device, i+1)
            ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    TypeError: can only concatenate str (not "NoneType") to str

Change-Id: I32e6636f0d374e5f4327d425373d8e38f48b7916
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
7 months agotizen: sd_fusing.py: Exit if A/B update is requested on unsupported target
Łukasz Stelmach [Thu, 4 Apr 2024 10:50:07 +0000 (12:50 +0200)]
tizen: sd_fusing.py: Exit if A/B update is requested on unsupported target

This error occurs if the target class improperly inherits from
SdFusingTarget instead of SdFusingTargetAB.

Change-Id: I83379fff92566d0036a868837e613a9a9cd94f7e
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
7 months agotizen: sd_fusing.py: add LicheePi4A board support
Marek Szyprowski [Fri, 29 Mar 2024 12:03:55 +0000 (13:03 +0100)]
tizen: sd_fusing.py: add LicheePi4A board support

Add support for preparing SD-card bootable on LicheePi4A board (with
A/B partitions on GPT layout).

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

7 months agotizen: sd_fusing.py: add support for writing bootcode to sector zero
Marek Szyprowski [Tue, 2 Apr 2024 07:42:08 +0000 (09:42 +0200)]
tizen: sd_fusing.py: add support for writing bootcode to sector zero

Some boards require special binary bootcode in sector zero (MBR or
protective MBR) to boot properly. Add support for such case.

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

7 months agotizen: sd_fusing.py: add support for partition start & size specified in sectors
Marek Szyprowski [Thu, 28 Mar 2024 19:23:46 +0000 (20:23 +0100)]
tizen: sd_fusing.py: add support for partition start & size specified in sectors

Add support for specifying partition's start & size in sectors and adjust
lba-start parameter (first allowed sector of the first partition) to 34,
what is the minimal possible value for the GPT layout. This doesn't affect
any start or size of the partitions specified in MBytes, because according
to sfdisk manual, they are always aligned to 1MB.

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

7 months agoscripts: tizen: sd_fusing.py: Add NOTICE log level
Łukasz Stelmach [Thu, 28 Mar 2024 08:59:37 +0000 (09:59 +0100)]
scripts: tizen: sd_fusing.py: Add NOTICE log level

Add a second normal logging level. This level should be used
for essential progress messages. Use with caution to avoid
overwhelming users with output.

Change-Id: Ib22446978af5289f647cdffbb4ccd56d56c7d086
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
7 months agoRevert "scripts: tizen: sd_fusing.py: Display an information during flashing"
Łukasz Stelmach [Thu, 28 Mar 2024 07:20:58 +0000 (08:20 +0100)]
Revert "scripts: tizen: sd_fusing.py: Display an information during flashing"

This partially reverts commit 8f78bf12c0eba95ebb203868856899fdcec2935c.

Only the logging module should be used for printing messages to enable
consistent control over script's output.

Change-Id: I3c9b91ff8a8accdef910700348e24be0ca1b7890
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>