platform/kernel/u-boot.git
2 years agotizen: rpi4: use fdt already preloaded by the firmware 23/266923/3 old/tizen_20211124 submit/tizen/20211123.235356
Marek Szyprowski [Mon, 22 Nov 2021 11:29:39 +0000 (12:29 +0100)]
tizen: rpi4: use fdt already preloaded by the firmware

RPi4's firmware loads dtb and performs some fixups depending on the board
hardware revision. Simply reuse the fdt preloaded by the firmware instead
of loading it again from disk.

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

3 years agoscripts: tizen: sd_fusing_rpi3: update the rpi3 script 16/265316/1 accepted/tizen/unified/20211028.122205 submit/tizen/20211027.220247
Jaehoon Chung [Thu, 14 Oct 2021 23:11:37 +0000 (08:11 +0900)]
scripts: tizen: sd_fusing_rpi3: update the rpi3 script

To prevent wrong operation, check the result whether format is succeed
or not. If it's failed, exit this script.
And if there is already "mnt_tmp" directory, remove it to clear the
previous status.

It's changed the location to remove a partition table with dd command
with count is changed  from 16 to 32.
Because  it seems that partition table doesn't clear.

Change-Id: Id3eb739d5add8784d0f41eca8a7e4360a8a0dbfd
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agoscript: sd_fusing_rpi3: fix the version checking 33/264933/1
Jaehoon Chung [Tue, 5 Oct 2021 09:49:25 +0000 (18:49 +0900)]
script: sd_fusing_rpi3: fix the version checking

Fix the version checking about supporting delete option.

Change-Id: I02d638fc30d0b8afd575ca14031a238185e3c2a8
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agoscripts: tizen: sd_fusing_rpi: use delete option about newer sfdisk 41/264841/2
Jaehoon Chung [Fri, 1 Oct 2021 03:09:25 +0000 (12:09 +0900)]
scripts: tizen: sd_fusing_rpi: use delete option about newer sfdisk

Use delete option before format.
It's more stable than using dd.

Change-Id: Ic77b543f49e7633027cbcf524c7c7a76a474d04e
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agoarm: rpi: fix build warning 24/264424/1
Marek Szyprowski [Fri, 17 Sep 2021 08:16:45 +0000 (10:16 +0200)]
arm: rpi: fix build warning

Add 'usb.h' include previously included via 'usb/xhci.h' in the reverted
commit. This fixes following build warning:

board/raspberrypi/rpi/rpi.c:467:2: warning: implicit declaration of function ‘usb_init’; did you mean ‘lmb_init’? [-Wimplicit-function-declaration]

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

3 years agoRevert "usb: xhci: Load Raspberry Pi 4 VL805's firmware" 23/264423/1
Marek Szyprowski [Thu, 16 Sep 2021 13:57:26 +0000 (15:57 +0200)]
Revert "usb: xhci: Load Raspberry Pi 4 VL805's firmware"

After switching to Linux v5.10 based kernel and DTB for RPi4 there is no
need for custom handling of the XHCI firmware upload. It will be properly
handled by the mainline u-boot's raspberry-pi firmware reset driver.

This reverts commit c3d57c4a00cf39aa885aa65a26eb4aa984b7f0fd.

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

3 years agoRevert "rpi: perform xhci firmware upload only once" 22/264422/1
Marek Szyprowski [Thu, 16 Sep 2021 13:57:20 +0000 (15:57 +0200)]
Revert "rpi: perform xhci firmware upload only once"

XHCI firmware upload is handled in arch/arm/mach-bcm283x/msg.c and can be
called both from board/raspberrypi/rpi/rpi.c and raspberry-firmware reset
driver, so the check for the single call has been moved there.

This reverts commit fed1e262867ff54f394e3cddf6ffa7a0fa5becf6.

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

3 years agoarm: rpi: perform XHCI firmware upload only once 21/264421/1
Marek Szyprowski [Thu, 10 Sep 2020 08:31:09 +0000 (10:31 +0200)]
arm: rpi: perform XHCI firmware upload only once

XHCI firmware upload must be performed only once after initializing the
PCI bridge. This fixes USB stack initialization after calling "usb stop;
usb start" on Raspberry Pi 4B.

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

3 years agoscripts: tizen: sd_fusing: increase a ramdisk size to 32M 31/262631/1
Jaehoon Chung [Tue, 17 Aug 2021 04:40:32 +0000 (13:40 +0900)]
scripts: tizen: sd_fusing: increase a ramdisk size to 32M

Increase a ramdisk size to 32M.

Change-Id: I17e062efffd25fb28fd564c529eb853b15327176
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agosamsung: tizen_rpi: change a hal partition size in mbr_check 39/262539/1 accepted/tizen/6.5/unified/20211028.120045 accepted/tizen/unified/20210817.123211 submit/tizen/20210813.054027 submit/tizen_6.5/20211028.163201 submit/tizen_6.5/20211104.014156 tizen_6.5.m2_release
Jaehoon Chung [Fri, 13 Aug 2021 04:33:44 +0000 (13:33 +0900)]
samsung: tizen_rpi: change a hal partition size in mbr_check

Change a hal partition size in mbr_check.
It doesn't affect to check a real size, but it needs to share correct
information.

Change-Id: Iaa792f38c8fde924f6ad1179ed5949f1a2de0885
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agoscript: tizen: sd_fusing_rpi3: increase a hal partition size to 256M 87/262487/1
Jaehoon Chung [Thu, 12 Aug 2021 02:55:05 +0000 (11:55 +0900)]
script: tizen: sd_fusing_rpi3: increase a hal partition size to 256M

Increase a hal partition size from 64M to 256M.

Change-Id: I650f2a5f7d946a6d5b251d7c5682b78afa8dd78f
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agoARM: bcm283x: change the virtual address of the XHCI PCI device base 99/259999/1 accepted/tizen/unified/20210621.123021 submit/tizen/20210621.022000
Marek Szyprowski [Thu, 17 Jun 2021 08:57:02 +0000 (10:57 +0200)]
ARM: bcm283x: change the virtual address of the XHCI PCI device base

Move the XHCI PCI device base up in the virtual address space. This fixes
initialization failure observed on newer Raspberry Pi firmware (later
than 63b1922311 ("firmware: arm_loader: Update armstubs with those from
PR 117). It looks that chosing 0xff800000 as the XHCI PCI device base
conflicts with the updated ARM/VideoCore firmware.

This also requires to reduce the size of the mapped PCI device region
from 8MiB to 4MiB to fit into 32bit address space.

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

3 years agosamsung: tizen_amlogic: fix wrong dfu_info 96/259596/1 accepted/tizen/unified/20210611.014702 submit/tizen/20210610.055703
Jaehoon Chung [Thu, 10 Jun 2021 05:50:15 +0000 (14:50 +0900)]
samsung: tizen_amlogic: fix wrong dfu_info

Fix wrong dfu_info without ";".

Change-Id: Iefbb1ffb43ee10e17977935e16618f7fc353f34d
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agoscripts: tizen: sd_fusing: umount block part only when mounted 01/256401/1 accepted/tizen/unified/20210412.012052 submit/tizen/20210409.001625
Seung-Woo Kim [Fri, 2 Apr 2021 02:28:48 +0000 (11:28 +0900)]
scripts: tizen: sd_fusing: umount block part only when mounted

The umount command is used without checking the block part is
really mounted. Umount part only when mounted.

The series for cleaning up fusing script is done, so bump up
minor version instead of sub version.

Change-Id: Ic665936838be4529973d63c6123db9a2c7acc7d7
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agoscripts: tizen: sd_fusing: Fix to check file existence 00/256400/1
Seung-Woo Kim [Fri, 2 Apr 2021 02:14:04 +0000 (11:14 +0900)]
scripts: tizen: sd_fusing: Fix to check file existence

The script can be executed with absent file. Fix to check
file existence.

Change-Id: I2409c73a5dcf4ca011e029b2e3fca9525cd6026a
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agoscripts: tizen: sd_fusing: Fix error only with -b option 99/256399/1
Seung-Woo Kim [Fri, 2 Apr 2021 01:55:52 +0000 (10:55 +0900)]
scripts: tizen: sd_fusing: Fix error only with -b option

If there is only -b option without real binary name, there was
error. Fix the error only with -b option.

Change-Id: I4affff4ae5f567b81601727f33161251db2457c3
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agoscripts: tizen: sd_fusing: Adjust log print 48/256248/2
Seung-Woo Kim [Wed, 31 Mar 2021 07:40:22 +0000 (16:40 +0900)]
scripts: tizen: sd_fusing: Adjust log print

Show with proper tab indent for partition table when formatting
and show default behavior from warnning about format.

Change-Id: I36aac38f40780cf936a450c8f083c5ec1f207e6c
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agoscripts: tizen: sd_fusing: Use array for partition information 70/256170/2
Seung-Woo Kim [Tue, 30 Mar 2021 07:40:27 +0000 (16:40 +0900)]
scripts: tizen: sd_fusing: Use array for partition information

Use array for partition information to remove duplication.

Change-Id: I6a8c5e3921cda24dc075321dcd5383dfda64149b
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agoscripts: tizen: sd_fusing_rpi3.sh: Add flashing hal.img 64/256264/1
Seung-Woo Kim [Wed, 31 Mar 2021 11:31:57 +0000 (20:31 +0900)]
scripts: tizen: sd_fusing_rpi3.sh: Add flashing hal.img

As like dfu information of tizen_rpi, add flashing hal.img.

Change-Id: Ibfc26456dd6bf3a56df25573b9fb7b5f05d38dee
Ref: commit 9809b292e7c3 ("samsung: tizen_rpi: add hal.img in dfu information")
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agoscripts: tizen: sd_fusing_rpi3.sh: Change variable name properly 69/256169/1
Seung-Woo Kim [Tue, 30 Mar 2021 07:33:05 +0000 (16:33 +0900)]
scripts: tizen: sd_fusing_rpi3.sh: Change variable name properly

The variable names, COL and ROW are used crossly from meaning.
Change the variable name properly.

Change-Id: If0ea313d2a275baf2c23261b2145141d2d79c276
Ref: commit 5dacf71810d7 ("scripts: odroid-xu4: remove non-necessary FUSE struct")
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agoscripts: tizen: sd_fusing: Use only part type from block device for fusing 32/256132/3
Seung-Woo Kim [Tue, 30 Mar 2021 02:14:30 +0000 (11:14 +0900)]
scripts: tizen: sd_fusing: Use only part type from block device for fusing

Current block device parsing result gives both disk and part
types of block device and this can break parsing 1st partition
for "mmcblk1" case. Use only part type from block device for
fusing when flashing partition image.

Change-Id: I0ca393fd5ecd26d77939f16c9c412d00d18cb912
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agopackaging: update u-boot git repository url 77/254377/1 sandbox/songinha/upstream
Jaehoon Chung [Mon, 1 Mar 2021 22:50:05 +0000 (07:50 +0900)]
packaging: update u-boot git repository url

Update u-boot git repository URL from git.denx.de
to source.denx.de.

Change-Id: Ib9645ae340d9d0c45546baa0bc819d2ca1a1e395
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agoboard: amlogic: odroid: add runtime detection of the N2/N2+/C4/HC4 variants 74/253074/4 accepted/tizen/unified/20210210.052157 submit/tizen/20210209.230141
Marek Szyprowski [Wed, 3 Feb 2021 14:36:14 +0000 (15:36 +0100)]
board: amlogic: odroid: add runtime detection of the N2/N2+/C4/HC4 variants

Use the ADC channel 1 to check the hardware revision of the board and
detect the N2 vs. N2+ and the C4 vs. HC4 variants. Each of them use
different dtb file, so adjust fdtfile environment variable to the
detected variant.

The ADC min/max values for each variant are taken from the vendor code,
adjusted to the 12-bit ADC driver operation mode (vendor code use 10-bit
mode).

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

3 years agosamsung: tizen_amlogic: add support for optional mainline kernel boot 64/252964/2
Marek Szyprowski [Wed, 3 Feb 2021 08:35:48 +0000 (09:35 +0100)]
samsung: tizen_amlogic: add support for optional mainline kernel boot

Add support for optional mainline Linux kernel and DTBs. This requires
adjusting DTB file nameand console kernel cmdline parameters.

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

3 years agosamsung: tizen_amlogic: Use only meson64_odroidn2.dtb for OdroidN2 boards 20/253220/1
Marek Szyprowski [Fri, 5 Feb 2021 13:58:20 +0000 (14:58 +0100)]
samsung: tizen_amlogic: Use only meson64_odroidn2.dtb for OdroidN2 boards

Switch OdroidN2 board to use meson64_odroidn2.dtb. For Tizen, the DRM
subsystem is enabled for the all Amlogic boards, so there is no need to
have separate dtb with the DRM enabled for OdroidN2 board.

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

3 years agotizen: amlogic: remove obsolete TIZEN_AMLOGIC_USE_VENDOR_KERNEL option 63/252963/1
Marek Szyprowski [Wed, 3 Feb 2021 07:20:23 +0000 (08:20 +0100)]
tizen: amlogic: remove obsolete TIZEN_AMLOGIC_USE_VENDOR_KERNEL option

After a fix to vendor kernel, the workaround enabled by the
TIZEN_AMLOGIC_USE_VENDOR_KERNEL option is no longer needed.

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

3 years agosamsung: tizen_amlogic: improve messages on boot 62/252962/1
Marek Szyprowski [Wed, 3 Feb 2021 07:11:29 +0000 (08:11 +0100)]
samsung: tizen_amlogic: improve messages on boot

Show proper button name while checking THOR download mode and change
'reboot' to 'reboot reason' to make it clear what it is being checked.

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

3 years agorpi: limit size of the RAM to the multiple of the MMU_SECTION_SIZE 06/252606/2 accepted/tizen/unified/20210207.235255 submit/tizen/20210205.105645
Marek Szyprowski [Mon, 1 Feb 2021 10:53:07 +0000 (11:53 +0100)]
rpi: limit size of the RAM to the multiple of the MMU_SECTION_SIZE

When RPi4 is booted from USB Mass Storage, the firmware reports 947MiB of
the ARM memory (948 in case of the standard SD-card boot). This value is
not MMU_SECTION_SIZE aligned, so the dram_bank_mmu_setup() skips mapping
of the last 1MiB. This later causes u-boot in ARM 32bit mode to freeze,
because it relocated itself into that unmapped memory and fails to
execute.

Fix this by limiting the size of the first bank to the multiple of
MMU_SECTION_SIZE.

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

3 years agorpi: use board_early_init_r to init PCI/USB and detect boot device 05/252605/1
Marek Szyprowski [Fri, 29 Jan 2021 12:03:03 +0000 (13:03 +0100)]
rpi: use board_early_init_r to init PCI/USB and detect boot device

Move initialization of the PCI and the USB subsystems from the 'preboot'
command to the board's early_init_r() function and then try to detect a
boot device by accessing the MMC0 device. If it works, then set boot
device interface to 'mmc', if not, use 'usb'.

This allows the environment variales to be loaded from the proper
storage interface.

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

3 years agoenv: fat: allow to dynamically set storage interface 04/252604/1
Marek Szyprowski [Fri, 29 Jan 2021 12:01:31 +0000 (13:01 +0100)]
env: fat: allow to dynamically set storage interface

Add support for setting the FAT env storage interface dynamically by
defining board's own env_fat_get_interface() function.

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

3 years agotizen: rpi: add temporary workaround for usb boot 56/252456/2
Marek Szyprowski [Thu, 28 Jan 2021 10:08:57 +0000 (11:08 +0100)]
tizen: rpi: add temporary workaround for usb boot

rootfs on USB device requires a bit more time to initialize and it is
probed asynchronously. This might happen after the initramfs is mounted
and init started, so add 2 seconds delay in case of USB boot to let
initramfs to detect the rootfs.

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

3 years agotizen: rpi: move MBR check to tizen-boot-rpi{3,4}.scr 55/252455/2
Marek Szyprowski [Thu, 28 Jan 2021 08:55:49 +0000 (09:55 +0100)]
tizen: rpi: move MBR check to tizen-boot-rpi{3,4}.scr

Move the MBR check to tizen-boot-rpi{3,4}.scr and adjust it to the
optional USB boot. User request is changed to 'Press ENTER to continue'
if verify fails to allow script continuation.

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

3 years agotizen: rpi: adjust commands to the optional usb boot 11/252411/2
Marek Szyprowski [Wed, 27 Jan 2021 22:01:15 +0000 (23:01 +0100)]
tizen: rpi: adjust commands to the optional usb boot

Properly set and use $bootdev instead of mmc to support optional usb boot
in the future.

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

3 years agosamsung: tizen_amlogic: use 'reserved1' partition for HAL 11/252311/1 accepted/tizen/unified/20210201.055424 submit/tizen/20210201.023843
Marek Szyprowski [Tue, 26 Jan 2021 11:11:59 +0000 (12:11 +0100)]
samsung: tizen_amlogic: use 'reserved1' partition for HAL

Use the 'reserved1' (64M) partition for the Tizen HAL partition image and
adjust the name of the remaining reserved partitions.

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

3 years agosamsung: tizen_rpi: check MBR partition layout from preboot 07/252107/2 accepted/tizen/unified/20210126.141625 submit/tizen/20210126.025856
Marek Szyprowski [Fri, 22 Jan 2021 10:24:04 +0000 (11:24 +0100)]
samsung: tizen_rpi: check MBR partition layout from preboot

Verify if the MBR partition layout on SD card matches the one defined in
the bootloader.

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

3 years agosamsung: tizen_rpi: remove support for the obsolete files 63/252063/3
Marek Szyprowski [Thu, 21 Jan 2021 15:21:11 +0000 (16:21 +0100)]
samsung: tizen_rpi: remove support for the obsolete files

Remove no longer used 'u-boot.img' and 'optee.bin' images from the 'boot'
partition and dfu_alt_info image list.

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

3 years agosamsung: tizen_rpi: make 'dfu_alt_info' static 62/252062/3
Marek Szyprowski [Tue, 17 Nov 2020 10:16:28 +0000 (11:16 +0100)]
samsung: tizen_rpi: make 'dfu_alt_info' static

The data layout on the storage device is the same all the time for RPi3/4
boards and fully known during the compile time. Use this simple approach,
which is a bit more error proof for future changes. It also obsoletes the
custom code added to RPi boards.

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

3 years agosamsung: tizen_rpi: add support for the MBR command 61/252061/3
Marek Szyprowski [Thu, 21 Jan 2021 14:52:05 +0000 (15:52 +0100)]
samsung: tizen_rpi: add support for the MBR command

Enable recently added 'mbr' command and define MBR partition table layout
based on the values from the current sd_fusing_rpi3.sh script.

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

3 years agocmd: misc: Fix return value for sleep command 06/252106/2
Marek Szyprowski [Fri, 22 Jan 2021 10:43:35 +0000 (11:43 +0100)]
cmd: misc: Fix return value for sleep command

If sleeping has been interrupted, return CMD_RET_FAILURE instead of -1
(CMD_RET_USAGE).

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

3 years agoscripts: tizen: sd_fusing_rpi3: rename 'RESERVED1' to 'HAL' 93/252193/1
Marek Szyprowski [Mon, 25 Jan 2021 08:48:31 +0000 (09:48 +0100)]
scripts: tizen: sd_fusing_rpi3: rename 'RESERVED1' to 'HAL'

10th partition is used for HAL partition image, so use that name instead
of the 'RESERVED1'.

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

3 years agoscripts: tizen: sd_fusing_rpi3: fix size of the RESERVED2 partition 92/252192/1
Marek Szyprowski [Mon, 25 Jan 2021 08:42:32 +0000 (09:42 +0100)]
scripts: tizen: sd_fusing_rpi3: fix size of the RESERVED2 partition

Older version of sd_fusing_rpi3.sh script had a bug, which results in
reduced size of the RESERVED2 partition to 125.5M instead of 128M. Adjust
the size of the RESERVED2 partition to 125M after the fixing sd_fusing
script to avoid further confusion, especially with the upcoming MBR
layout validation in the u-boot.

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

3 years agoscripts: tizen: sd_fusing_rpi3: adjust extended partition size calculation 05/252105/2
Marek Szyprowski [Fri, 22 Jan 2021 10:57:03 +0000 (11:57 +0100)]
scripts: tizen: sd_fusing_rpi3: adjust extended partition size calculation

With so many partitions defined (currently 11), the extended partition
has to be larger regardless the sfdisk tool version, otherwise, the last
partition will be smaller than the requested size.

Without this fix, fdisk from util-linux 2.33.1 creates the last partition
of 125,5M instead of 128M.

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

3 years agoscript: tizen: remove sd_fusing_amlogic script 46/251746/1
Jaehoon Chung [Tue, 19 Jan 2021 04:45:11 +0000 (13:45 +0900)]
script: tizen: remove sd_fusing_amlogic script

Remove sd_fusing_amlogic script.
Insteade, use 0-format.cmd file that is created from build script.
- ./tizen/build-amlogic.sh all
- It will be created tar file under output directory
- There should be amlogic_format_bootloader.tar.gz
- Use its format_bootloader.tar.gz

Change-Id: I9ef4dceb71d0830ebb2f69380f38d3ff63213bd9
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agosamsung: tizen_amlogic: increase system-data size to 1.3G 45/251745/1
Jaehoon Chung [Tue, 19 Jan 2021 04:44:09 +0000 (13:44 +0900)]
samsung: tizen_amlogic: increase system-data size to 1.3G

Increase system-data size from 512M to 1.3G.

Change-Id: I39398a900260eca7fd96d232ea95dc348a593804
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agoconfigs: rpi4: disable CONFIG_USB_KEYBOARD 70/251670/1 accepted/tizen/unified/20210119.130217 submit/tizen/20210118.100507
Jaehoon Chung [Mon, 18 Jan 2021 09:18:16 +0000 (18:18 +0900)]
configs: rpi4: disable CONFIG_USB_KEYBOARD

It doesn't need to enable CONFIG_USB_KEYBOARD on Tizen.
- It needs to enable USB_KEYBOARD when grub mode is used.

Change-Id: I8c7572d6f903037a9367351422010f72306e252f
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agoboard: rpi: add print_archinfo to display arch information 59/251559/2
Jaehoon Chung [Fri, 15 Jan 2021 04:27:34 +0000 (13:27 +0900)]
board: rpi: add print_archinfo to display arch information

Current U-boot doesn't display a message about which architecture is
used. So Developer is difficult to know it by intuition.
This patch is displaying to CPU information with CONFIG_SYS_CPU.
- In mainline, it's used to display cpuinfo with CONFIG_DISPLAY_CPUINFO.
  But PRI4 doesn't implement print_cpuinfo(). Instead, display a cpuinfo
  in get_board_rev about RPI4 boards.

In RPI4 case,

U-Boot 2020.10-drity (Jan 15 2021 - 13:24:55 +0900)

DARM:  3.9 GiB
RPI 4 Model B (0xc03111)
CPU: armv7

Change-Id: I485194baa965065f44bac966d014ccfb31b9da60
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agoamlogic: vim3: fix MAC address reading code 32/251332/1 accepted/tizen/unified/20210113.121025 submit/tizen/20210112.220723
Marek Szyprowski [Tue, 12 Jan 2021 20:03:16 +0000 (21:03 +0100)]
amlogic: vim3: fix MAC address reading code

It turned out that MAC address is stored in ASCII format in EFUSE, so fix
the code reading it to use ASCII format.

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

3 years agosamsung: tizen_rpi: add swiotlb value to 8192 on 32bit 01/251201/2 accepted/tizen/unified/20210112.123501 submit/tizen/20210112.000219
Jaehoon Chung [Mon, 11 Jan 2021 07:36:57 +0000 (16:36 +0900)]
samsung: tizen_rpi: add swiotlb value to 8192 on 32bit

When 32bit kernel is booting, kernel is reserving memory for SWIOTLB about
64MB. It seems that doesn't need to use full size.
After set 'swiotlb=8192', SWIOTLB is reserved to 16MB.
Then it can save 48MB memory to use ZONE_DMA.

Change-Id: I1a1659cbff2120da755b14f1b373715bc10027c4
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agotizen: support recovery and fota mode 57/251057/1 accepted/tizen/unified/20210108.125921 submit/tizen/20210107.224559
Jaehoon Chung [Thu, 7 Jan 2021 07:54:47 +0000 (16:54 +0900)]
tizen: support recovery and fota mode

Support recovery and fota mode.
It will be entered to recovery or fota mode with value by passed
from reboot command.

Change-Id: Ia7d3c80de2fb28491e6cabfcfb37059e7325f259
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agotizen: bootscript: amlogic: support gpio power key for odroid-c4 95/250995/1 accepted/tizen/unified/20210107.123417 submit/tizen/20210106.231623
Seung-Woo Kim [Wed, 6 Jan 2021 10:46:42 +0000 (19:46 +0900)]
tizen: bootscript: amlogic: support gpio power key for odroid-c4

With gpio button, odroid-c4 can support gpio power. Set gpio power
key with PIN_11 from kernel boot_args.

GPIO pins are connected for ELB060675 button as like below:
    - out : PIN_11
    - vcc : PIN_9 (ground)
    - gnd : Not used.

Change-Id: I3aac017fe4a699b8576100cf3ee025a82054ee2d
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agoARM: dts: meson: change from ACTIVE_HIGH to ACTIVE_LOW 94/250994/1
Jaehoon Chung [Wed, 6 Jan 2021 10:33:57 +0000 (19:33 +0900)]
ARM: dts: meson: change from ACTIVE_HIGH to ACTIVE_LOW

Whne button doesn't connect, it's always high.
So it needs to fix its case.
In our button's case,
- out : PIN_11
- vcc : GND
- gnd : Not used.

Change-Id: Ic8cf0f5853045cf181ad3c1c53e14e0fceb73b41
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agosamsung: tizen_amlogic: fix build error about not defined BUTTON_LAEBL 79/250979/2
Jaehoon Chung [Wed, 6 Jan 2021 08:20:35 +0000 (17:20 +0900)]
samsung: tizen_amlogic: fix build error about not defined BUTTON_LAEBL

Fix build error about not defined BUTTON_LABEL.

Change-Id: Ifdc916c56c82aaac129ca764d8d501f4c0edcb26
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agoconfigs: odroid-c4: support a button download mode 53/250953/2 submit/tizen/20210106.061157
Jaehoon Chung [Wed, 6 Jan 2021 05:10:03 +0000 (14:10 +0900)]
configs: odroid-c4: support a button download mode

Support a button download mode.
If button is pressed, it will be entered to thor mode.

Change-Id: I1c1a4b8ff0d5d8b9b10b277876109b69ce2f02f8
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agosamsung: tizen_amlogic: add button_label variable 52/250952/2
Jaehoon Chung [Wed, 6 Jan 2021 05:08:36 +0000 (14:08 +0900)]
samsung: tizen_amlogic: add button_label variable

Add button_label variable to clarify button about each boards.
- KVIM3(L)  : Function
- Odroid-C4 : PowerKey

Change-Id: I7580cce0c580df14debbe40c48a70f5b6aa532bd
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agoARM: dts: meson: add gpio-keys node to use PowerKey 51/250951/2
Jaehoon Chung [Wed, 6 Jan 2021 05:01:03 +0000 (14:01 +0900)]
ARM: dts: meson: add gpio-keys node to use PowerKey

Add gpio-keys node to use PowerKey.
PowerKey - GPIOX_3 <PIN_11>

Change-Id: I99dae986119d4dc355c02b114a318a727134374c
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agotizen: bootscript: rpi3: fix booting issue on 32bit 57/250957/1
Seung-Woo Kim [Wed, 6 Jan 2021 05:50:04 +0000 (14:50 +0900)]
tizen: bootscript: rpi3: fix booting issue on 32bit

For 32bit, it should use bootz, but there was typo. Fix the
booting issue on 32bit.

Change-Id: I98ab0cd8cd88f1998c5dd30d649cfc7c4cf0e495
Fixes: commit 01cd50f4c3af ("tizen: rpi: move bootscripts to tizen specific directory")
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agoconfigs: enable SQUASFS configurations 90/250890/2 accepted/tizen/unified/20210106.123546 submit/tizen/20210106.015723
Jaehoon Chung [Tue, 5 Jan 2021 08:06:27 +0000 (17:06 +0900)]
configs: enable SQUASFS configurations

Enable SQUASHFS configuration about reference targets.
It will be used when checking ramdisk image.

Change-Id: I42adf176d352508836b202fecf81f83a09bafd66
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agofs/squashfs: sqfs_close/sqfs_read_sblk: set ctxt.sblk to NULL after free 89/250889/1
Richard Genoud [Tue, 24 Nov 2020 17:07:52 +0000 (18:07 +0100)]
fs/squashfs: sqfs_close/sqfs_read_sblk: set ctxt.sblk to NULL after free

This will prevent a double free error if sqfs_close() is called twice.

Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
[jh80.chung: cherry picked from mainline commit 7e932ac790b3615a67a3c24041c194aa748c0d98]
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: I31166f8f9d6ec6d4772e7b51b5d0bb8d20ef1a4b

3 years agofs/squashfs: implement exists() function 88/250888/1
Richard Genoud [Tue, 3 Nov 2020 11:11:26 +0000 (12:11 +0100)]
fs/squashfs: implement exists() function

This permits to find a file and use the distro_bootcmd

Reviewed-by: Joao Marcos Costa <jmcosta944@gmail.com>
Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
[jh80.chung: cherry picked from mainline commit dd4866b43754b18f0c06672e341d93e16b8bf674]
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: Idafbcb37c30445e3731d40924f1c43499f149b1a

3 years agofs/squashfs: sqfs_read: remove buggy offset functionality 87/250887/1
Richard Genoud [Tue, 3 Nov 2020 11:11:24 +0000 (12:11 +0100)]
fs/squashfs: sqfs_read: remove buggy offset functionality

offset is the offset in the file read, not the offset in the destination
buffer.
If the offset is not null, this will lead to a memory corruption.
So, for now, we are returning an error if the offset is used.

Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
[jh80.chung: cherry picked from mainline commit 21b1b3bad58b50e5464b1bf016e7c96bf18ddb8d]
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: Ie50645e5fcb2f06a21c8f88e16da9b0d1db35cca

3 years agofs/squashfs: sqfs_read: don't write beyond buffer size 86/250886/1
Richard Genoud [Tue, 3 Nov 2020 11:11:23 +0000 (12:11 +0100)]
fs/squashfs: sqfs_read: don't write beyond buffer size

The length of the buffer wasn't taken into account when writing to the
given buffer.

Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
[jh80.chung: cherry picked from mainline commit cbd5e40ede4e5c6aedce9475325bdf80b7fa839b]
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: I14d9af77ac0a2c0d3e52c39824f3854dbbc4d58a

3 years agofs/squashfs: sqfs_probe: use sqfs_decompressor_init() return value 85/250885/1
Richard Genoud [Tue, 3 Nov 2020 11:11:22 +0000 (12:11 +0100)]
fs/squashfs: sqfs_probe: use sqfs_decompressor_init() return value

sqfs_decompressor_init() returns a value, so it's better to use it than
to force the return value to EINVAL (it could be ENOMEM)

Reviewed-by: Joao Marcos Costa <jmcosta944@gmail.com>
Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
[jh80.chung: cherry picked from mainline commit 6d25bd3e9c1d317cdbd52a4c6bba11f912bb4d6a]
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: I7fcad9cd4d7ecb4aff6aa353aee78c7aac69a0e6

3 years agofs/squashfs: sqfs_probe: reset cur_dev/cur_part_info to NULL on error 84/250884/1
Richard Genoud [Tue, 3 Nov 2020 11:11:21 +0000 (12:11 +0100)]
fs/squashfs: sqfs_probe: reset cur_dev/cur_part_info to NULL on error

Resetting the context on error will prevent some checks like:
if (!ctx.cur_dev)
To pass when the probe method has failed

Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
[jh80.chung: cherry picked from mainline commit 56cf1ceee38435a0c105d40336d12d19e1db8b1d]
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: I998b1fa2d790bf9618d0d652663edb220a32c610

3 years agofs/squashfs: sqfs_probe: fix possible memory leak on error 83/250883/1
Richard Genoud [Tue, 3 Nov 2020 11:11:19 +0000 (12:11 +0100)]
fs/squashfs: sqfs_probe: fix possible memory leak on error

If SquashFS magic number is invalid, there's a memory leak.

Reviewed-by: Joao Marcos Costa <jmcosta944@gmail.com>
Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
[jh80.chung: cherry picked from mainline commit ccd4c08a452b3703ee16ba730a84b7caadcff97a]
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: I3be0a354f3407d13902c244580109eb0a9ff71e9

3 years agofs/squashfs: sqfs_read: fix memory leak on finfo.blk_sizes 82/250882/1
Richard Genoud [Tue, 3 Nov 2020 11:11:18 +0000 (12:11 +0100)]
fs/squashfs: sqfs_read: fix memory leak on finfo.blk_sizes

finfo.blk_sizes may not be freed in case of error in the for loop
Setting it to null and freeing it at the end makes prevents that from
happening.

Reviewed-by: Joao Marcos Costa <jmcosta944@gmail.com>
Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
[jh80.chung: cherry picked from mainline commit 571b67ee1dcb989dc50575f14e87bfdef6bfd8db]
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: I97086373caa5a031f3ba12aa4997de3eab10c530

3 years agofs/squashfs: sqfs_get_abs_path: fix possible memory leak on error 81/250881/1
Richard Genoud [Tue, 3 Nov 2020 11:11:17 +0000 (12:11 +0100)]
fs/squashfs: sqfs_get_abs_path: fix possible memory leak on error

if  sqfs_tokenize(rel_tokens, rc, rel); fails, the function exits
without freeing the array base_tokens.

Reviewed-by: Joao Marcos Costa <jmcosta944@gmail.com>
Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
[jh80.chung: cherry picked from mainline commit 33686804d29e676177d408f1ce047b8c35185ddb]
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: I377f5aeda3ed3f6b889ce9f9c506629c21f45d3d

3 years agofs/squashfs: sqfs_get_abs_path: fix error check 80/250880/1
Richard Genoud [Tue, 3 Nov 2020 11:11:16 +0000 (12:11 +0100)]
fs/squashfs: sqfs_get_abs_path: fix error check

the return value of sqfs_tokenize(rel_tokens, rc, rel); wasn't checked.
(but "ret" value was !)
This is obviouly a typo.

Reviewed-by: Joao Marcos Costa <jmcosta944@gmail.com>
Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
[jh80.chung: cherry picked from mainline commit 53db0e24a8f981c1e303a1c745b8f0e28544096f]
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: Ib9ff7ebded9de101a0d929414c8ecdf6137e8621

3 years agofs/squashfs: sqfs_frag_lookup: simplify error handling 79/250879/1
Richard Genoud [Tue, 3 Nov 2020 11:11:15 +0000 (12:11 +0100)]
fs/squashfs: sqfs_frag_lookup: simplify error handling

For consistency with other functions.

Reviewed-by: Joao Marcos Costa <jmcosta944@gmail.com>
Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
[jh80.chung: cherry picked from mainline commit c9b8e86f8bd238421b35ec15d88b4d3cac8a0992]
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: If6a955583f876fe4399982e58ade2784c2da1b30

3 years agofs/squashfs: sqfs_read: fix another memory leak 78/250878/1
Richard Genoud [Tue, 3 Nov 2020 11:11:14 +0000 (12:11 +0100)]
fs/squashfs: sqfs_read: fix another memory leak

data_buffer was allocated in a loop and freed only once.

Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
[jh80.chung: cherry picked from mainline commit 555459e7931f7ae34a4e10d1e21ce7aada7aa59b]
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: I69dc9bf407d07c7af28f7c3bb1b1b2966f1ee216

3 years agofs/squashfs: sqfs_read: fix memory leak 77/250877/1
Richard Genoud [Tue, 3 Nov 2020 11:11:13 +0000 (12:11 +0100)]
fs/squashfs: sqfs_read: fix memory leak

sqfs_closedir() should be called to free memory allocated by
sqfs_opendir()

Reviewed-by: Joao Marcos Costa <jmcosta944@gmail.com>
Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
[jh80.chung: cherry picked from mainline commit 7ce9745cbeae7733a7068f19a7fc3ec8f21dc38c]
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: I200f764bb6ce2bb828e2217d1b0f949e1db14597

3 years agofs/squashfs: sqfs_read: remove useless sqfs_closedir() 76/250876/1
Richard Genoud [Tue, 3 Nov 2020 11:11:12 +0000 (12:11 +0100)]
fs/squashfs: sqfs_read: remove useless sqfs_closedir()

as sqfs_opendir failed, there's no need to call sqfs_closedir

Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
[jh80.chung: cherry picked from mainline commit b34949fe9baaae49003b2981213495bab3afef9b]
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: Id61d825b7976f151a77738dadf5c99ba0613d955

3 years agofs/squashfs: sqfs_read: fix dangling pointer dirs->entry 75/250875/1
Richard Genoud [Tue, 3 Nov 2020 11:11:11 +0000 (12:11 +0100)]
fs/squashfs: sqfs_read: fix dangling pointer dirs->entry

dirs->entry shouldn't be left dangling as it could be freed twice.

Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
[jh80.chung: cherry picked from mainline commit d1d8d75f69f82f7ef7c55b58a7d9e73055956f3c]
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: Ie76becc6bfb30341d1964a34154ebe4014def678

3 years agofs/squashfs: sqfs_size: remove useless sqfs_closedir() 74/250874/1
Richard Genoud [Tue, 3 Nov 2020 11:11:10 +0000 (12:11 +0100)]
fs/squashfs: sqfs_size: remove useless sqfs_closedir()

as sqfs_opendir failed, there's no need to call sqfs_closedir

Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
[jh80.chung: cherry picked from mainline commit 35475f83a107901551c31f7bc70f5266862a33e4]
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: I809ae83d5949f86d547b52982cf318e7202a6868

3 years agofs/squashfs: sqfs_size: fix dangling pointer dirs->entry 73/250873/1
Richard Genoud [Tue, 3 Nov 2020 11:11:09 +0000 (12:11 +0100)]
fs/squashfs: sqfs_size: fix dangling pointer dirs->entry

dirs->entry shouldn't be left dangling as it could be freed twice.

Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
[jh80.chung: cherry picked from mainline commit 508a9dc7f694df11c7de7460f888f508e40a2046]
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: I9f03d0d18e49f3ad0b5b7f1ca6f48625c00e46aa

3 years agofs/squashfs: sqfs_concat_tokens: check if malloc succeeds 72/250872/1
Richard Genoud [Tue, 3 Nov 2020 11:11:08 +0000 (12:11 +0100)]
fs/squashfs: sqfs_concat_tokens: check if malloc succeeds

memory allocation should always be checked

Reviewed-by: Joao Marcos Costa <jmcosta944@gmail.com>
Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
[jh80.chung: cherry picked from mainline commit dc3312c43c82ff9335b2bf4ee4f72365e824adfd]
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: I160a321fe56fc63476d19adbbaa62129daa03f79

3 years agofs/squashfs: sqfs_read_inode_table: fix dangling pointer 71/250871/1
Richard Genoud [Tue, 3 Nov 2020 11:11:07 +0000 (12:11 +0100)]
fs/squashfs: sqfs_read_inode_table: fix dangling pointer

inode_table should not be left dangling as it may be freed in sqfs_opendir

Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
[jh80.chung: cherry picked from mainline commit 4c83d2755776d4dd5e15a930d48db1082fc0d1cc]
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: I0d63396f7885f68140e78623df8e06b8b00049ac

3 years agofs/squashfs: sqfs_search_dir: fix memory leaks 70/250870/1
Richard Genoud [Tue, 3 Nov 2020 11:11:06 +0000 (12:11 +0100)]
fs/squashfs: sqfs_search_dir: fix memory leaks

path, target, res, rem and sym_tokens were not free on error nor success.

Reviewed-by: Joao Marcos Costa <jmcosta944@gmail.com>
Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
[jh80.chung: cherry picked from mainline commit cd54591afd42c547f43a7d509862f20e09264cde]
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: I9417cb0f010dc267eeef4d0ee1aa8ba45a6678bd

3 years agofs/squashfs: sqfs_search_dir: fix dangling pointer 69/250869/1
Richard Genoud [Tue, 3 Nov 2020 11:11:05 +0000 (12:11 +0100)]
fs/squashfs: sqfs_search_dir: fix dangling pointer

dirs->entry shouldn't be left dangling as it could be freed twice.

Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
[jh80.chung: cherry picked from mainline commit 01e71ec61ab84bcdd4df708f8930d5acf1c2674d]
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: I51db60ce9c428536c10a72a9ff4a6466629b6a4a

3 years agofs/squashfs: sqfs_read_directory_table: fix memory leak 68/250868/1
Richard Genoud [Tue, 3 Nov 2020 11:11:04 +0000 (12:11 +0100)]
fs/squashfs: sqfs_read_directory_table: fix memory leak

pos_list wasn't freed on every error

Reviewed-by: Joao Marcos Costa <jmcosta944@gmail.com>
Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
[jh80.chung: cherry picked from mainline commit 7d23b2c5fb093142400467d8b81ba84786ed6f2c]
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: I152e9c306a194261b7b98e408a02000830194ba1

3 years agofs/squashfs: sqfs_split_path: fix memory leak and dangling pointers 67/250867/1
Richard Genoud [Tue, 3 Nov 2020 11:11:03 +0000 (12:11 +0100)]
fs/squashfs: sqfs_split_path: fix memory leak and dangling pointers

*file and *dir were not freed on error

Reviewed-by: Joao Marcos Costa <jmcosta944@gmail.com>
Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
[jh80.chung: cherry picked from mainline commit 5487477802e0ad7bfad046af25f4a04cfd98cb7a]
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: I185e3bb66f52d16eb02a2b2076aa723aab5cb753

3 years agofs/squashfs: sqfs_closedir: fix memory leak 66/250866/1
Richard Genoud [Tue, 3 Nov 2020 11:11:02 +0000 (12:11 +0100)]
fs/squashfs: sqfs_closedir: fix memory leak

sqfs_dirs wasn't freed anywhere.

Reviewed-by: Joao Marcos Costa <jmcosta944@gmail.com>
Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
[jh80.chung: cherry picked from mainline commit 87d11e08e4792b3d188143972ba3a1651a52beee]
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: Icd463416ec6b70ee90c912faf077d3795f055f29

3 years agofs/squashfs: sqfs_opendir: fix some memory leaks and dangling pointers 65/250865/1
Richard Genoud [Tue, 3 Nov 2020 11:11:00 +0000 (12:11 +0100)]
fs/squashfs: sqfs_opendir: fix some memory leaks and dangling pointers

When trying to load an non-existing file, the cpu hangs!

Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
[jh80.chung: cherry picked from mainline commit f268768d43bbf11c7107597abef57c6b86b6b229]
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: I8273a22d76a36e39cf4ca0f48afd9fd409280217

3 years agofs/squashfs: Fix index off by 1 for inode SQFS_LDIR_TYPE 64/250864/1
Gerard Koskamp [Fri, 30 Oct 2020 13:41:58 +0000 (13:41 +0000)]
fs/squashfs: Fix index off by 1 for inode SQFS_LDIR_TYPE

I've created a squashfs file system with Yocto (it use squashfs-tools)
and u-boot command sqfsls give the error:'Error while searching inode:
unknown type.'
After some digging in the code I found that the index is off by 1.
This patch fix this issue and I can successful use the sqfsls command.
After search for the squashfs format I found a link talk about a
similar issue but this time in the documentation. The link is:
https://github.com/AgentD/squashfs-tools-ng/commit/e6588526838caece9529

Signed-off-by: Gerard Koskamp <gerard.koskamp@nedap.com>
Tested-by: Joao Marcos Costa <joaomarcos.costa@bootlin.com>
[jh80.chung: cherry picked from mainline commit c49b0eb034710f08fc68cbfa2c23811e10667ad9]
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: I02ba72c07ea7c57ebace7103357e2b81bcf48772

3 years agotizen: rpi: move bootscripts to tizen specific directory 76/250676/1 accepted/tizen/unified/20210105.125826 submit/tizen/20210104.215357
Jaehoon Chung [Thu, 31 Dec 2020 06:18:17 +0000 (15:18 +0900)]
tizen: rpi: move bootscripts to tizen specific directory

Move bootscripts from board/raspberrypi/rpi to tizen/bootscript/.
And combine to one script, because those are duplicated almost codes.

Change-Id: I2ee929bbcd6cb68566d441a272a1ba3d84beb100
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agotizen: bootscript: amlogic: support recovery mode 54/250454/1
Jaehoon Chung [Mon, 28 Dec 2020 02:25:16 +0000 (11:25 +0900)]
tizen: bootscript: amlogic: support recovery mode

Support recovery mode.

Change-Id: Idf6dca45c0e3636c0579b674223e4af7c59d767f
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agotizen: bootscript: amlogic: remove tizen specific kernel loading address 53/250453/1
Jaehoon Chung [Mon, 28 Dec 2020 02:00:20 +0000 (11:00 +0900)]
tizen: bootscript: amlogic: remove tizen specific kernel loading address

Remove tizen specific kernel loading address.
When it's entered to recovery mode, "Synchronous Abort" is occurred.

Change-Id: I6ff3afc52299b12714a25bb83fe114467c007573
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agotizen: bootscript: amlogic: remove voutmode in bootargs 52/250452/1
Jaehoon Chung [Mon, 28 Dec 2020 01:28:38 +0000 (10:28 +0900)]
tizen: bootscript: amlogic: remove voutmode in bootargs

Remove voutmode in bootargs.
If it's defined, it will be passed from boot_args.
- It's used in only odroid-n2/c4.

Change-Id: I112c4932c31b8e33cdb8c073712f443c5c88c1ac
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agotizen: script: ignore when no file in output directory 85/250185/1
Seung-Woo Kim [Tue, 22 Dec 2020 01:51:15 +0000 (10:51 +0900)]
tizen: script: ignore when no file in output directory

The build output directory can have no file. Ignore when no file
in the output directory.

Change-Id: Ia2ce4c25f7f386915c2606a36d4ea66ca46747e3
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agotizen: move Function button check to separate env script 64/250164/1 accepted/tizen/unified/20201222.122550 submit/tizen/20201222.005612
Marek Szyprowski [Mon, 21 Dec 2020 10:25:56 +0000 (11:25 +0100)]
tizen: move Function button check to separate env script

This will make CONFIG_PREBOOT a bit more readable and easier to
understand.

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

3 years agoconfigs: amlogic: check a reboot reason to enter download mode 26/250126/2
Jaehoon Chung [Mon, 21 Dec 2020 05:06:57 +0000 (14:06 +0900)]
configs: amlogic: check a reboot reason to enter download mode

Check a reboot reason to enter download mode.
If reboot reason is download, it will be entered to download mode.

Change-Id: I9a2223962ad49a19a2b084711107dd23e6c17b95
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agoARM: meson: add a reboot reason about DOWNLOAD 25/250125/1
Jaehoon Chung [Mon, 21 Dec 2020 05:06:46 +0000 (14:06 +0900)]
ARM: meson: add a reboot reason about DOWNLOAD

Tizen is using "reboot download" as download mode.

Change-Id: Ia53d1605982957bc2388552e81c4d3cd99eac1e8
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agotizen: make version parsing insensitive to message tranlations 94/250094/3
Łukasz Stelmach [Fri, 18 Dec 2020 19:11:50 +0000 (20:11 +0100)]
tizen: make version parsing insensitive to message tranlations

Localised versions of version messages present version number at different
positions. Matching numbers with grep(1) ensures that version number is
extracted properly regardles of the message format.

Change-Id: I6dd4bc476aaa43c1a736f269dc14910d8653b730
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
3 years agoARM: dts: meson: switch TFLASH_VDD_EN pin to open drain on Odroid-C4 86/250086/2
Marek Szyprowski [Fri, 18 Dec 2020 10:32:32 +0000 (11:32 +0100)]
ARM: dts: meson: switch TFLASH_VDD_EN pin to open drain on Odroid-C4

For the proper reboot Odroid-C4 board requires to switch TFLASH_VDD_EN
pin to the high impedance mode, otherwise the board is stuck in the
middle of loading early stages of the bootloader from SD card.

This can be achieved by using the OPEN_DRAIN flag instead if the
ACTIVE_HIGH, what will leave the pin in input to achieve high state (pin
has the pull-up) and solve the issue.

Suggested-by: Neil Armstrong <narmstrong@baylibre.com>
Change-Id: Id91d0c5e354ed58fcba3b2e8a5ebe7f2953f2142
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
3 years agoRevert "ARM: meson: Temporary fix for OdroidC4 SD card reboot issue" 85/250085/2
Marek Szyprowski [Fri, 18 Dec 2020 14:32:10 +0000 (15:32 +0100)]
Revert "ARM: meson: Temporary fix for OdroidC4 SD card reboot issue"

This reverts commit 394a3fc1a2f2ab0eb61dc32231cb94e8ed55e845.

It will be replaced by a patch accepted in mainline uboot.

Change-Id: If335526aee08221fcbcd200fb7dbc4b7635d5415
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
3 years agotizen: vim3(l)_deconfig: enable THOR mode if Func button is pressed 84/250084/2
Marek Szyprowski [Mon, 14 Dec 2020 07:33:30 +0000 (08:33 +0100)]
tizen: vim3(l)_deconfig: enable THOR mode if Func button is pressed

Extend the preboot script with a check of the Func button state. If it is
pressed, enter the THOR download mode.

Change-Id: Ic026c345078adbd9030b65e250b18afcc171553b
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
3 years agocmd/button: return button status 83/250083/2
Heinrich Schuchardt [Mon, 14 Sep 2020 10:50:56 +0000 (12:50 +0200)]
cmd/button: return button status

To make the button command useful in a shell script it should return the
status of the button:

* 0 (true) - pressed, on
* 1 (false) - not pressed, off

The button command takes only one argument. Correct maxargs.

Adjust the Python unit test.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Philippe Reynes <philippe.reynes@softathome.com>
[backport of mainline commit a6bfd71a96201127836d59736abcb54dc2d5e1a5]
Change-Id: Ic799b7e189e3fb6793083a92b2ceadb0f5884889
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
3 years agoRevert "tizen: vim3(l)_deconfig: enable THOR mode if Func button is pressed" 82/250082/2
Marek Szyprowski [Wed, 16 Dec 2020 07:24:37 +0000 (08:24 +0100)]
Revert "tizen: vim3(l)_deconfig: enable THOR mode if Func button is pressed"

This reverts commit 0548fab316eac104e8cdd77cb505407facfbc115.

This commit will be changed to use the solution applied in mainline
uboot.

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

3 years agoRevert "cmd: button: store button state in the 'button' env" 81/250081/2
Marek Szyprowski [Wed, 16 Dec 2020 07:24:21 +0000 (08:24 +0100)]
Revert "cmd: button: store button state in the 'button' env"

This reverts commit 5c353ca0b9e417b5f0d0705cc47abc090254a2e4.

It will be replaced by the other solution backported from mainline uboot.

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

3 years agotizen: script: fix wrong indent for case 69/249969/1
Seung-Woo Kim [Fri, 18 Dec 2020 04:43:35 +0000 (13:43 +0900)]
tizen: script: fix wrong indent for case

There are unmet indent for case statement. Fix the wrong indent.

Change-Id: Iafb7e9586c5b401f481cef5afbc879c8f12f90e2
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agolib: tizen: fix build error with tizen_defconfig 58/249658/1 accepted/tizen/unified/20201216.215949 submit/tizen/20201216.044245
Jaehoon Chung [Wed, 16 Dec 2020 04:33:24 +0000 (13:33 +0900)]
lib: tizen: fix build error with tizen_defconfig

Fix build error with tizen_defconfig.
tizen_defconfig doesn't support DM_VIDEO.

Change-Id: Ie86a45e97c8d8c4c70e13dfaba70f23b0bdccd93
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>