platform/kernel/u-boot.git
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>
3 years agosamsung: tizen_amlogic: update loglevel from 4 to 7 43/249643/1 submit/tizen/20201216.030420
Jaehoon Chung [Tue, 15 Dec 2020 22:27:39 +0000 (07:27 +0900)]
samsung: tizen_amlogic: update loglevel from 4 to 7

Update loglevel from 4 to 7.
It's useful that can see more log message because of kernel isn't stable.
In future, it will be restore to 4.

Change-Id: I162b3a049acd1a6765b4c7f9e5ce610fce238e59
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agotizen: vim3(l)_deconfig: enable THOR mode if Func button is pressed 35/249535/1
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.

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

3 years agocmd: button: store button state in the 'button' env 34/249534/1
Marek Szyprowski [Mon, 14 Dec 2020 09:26:39 +0000 (10:26 +0100)]
cmd: button: store button state in the 'button' env

Save examined button state in 'button' environment variable to enable
checking button state in the scripts.

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

3 years agobutton: add a simple ADC-based button driver 33/249533/1
Marek Szyprowski [Mon, 14 Dec 2020 09:29:47 +0000 (10:29 +0100)]
button: add a simple ADC-based button driver

Add a simple ADC-based button driver. This driver binds to the 'adc-keys'
device tree node.

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

3 years agoadc: meson-saradc: skip hardware init only if ADC is enabled 32/249532/1
Marek Szyprowski [Mon, 14 Dec 2020 10:18:42 +0000 (11:18 +0100)]
adc: meson-saradc: skip hardware init only if ADC is enabled

The driver skips hardware initialization if it is already configured by
the earlier bootloader stage (BL30). Skip the initialization only if the
hardware is really initialized and enabled.

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

3 years agoadc: meson-saradc: add G12A variant 31/249531/1
Marek Szyprowski [Mon, 14 Dec 2020 10:06:59 +0000 (11:06 +0100)]
adc: meson-saradc: add G12A variant

Add support for the SARADC variant found on the G12A SoCs family.

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

3 years agoclk: meson: add minimal driver for g12a-ao clocks 30/249530/1
Marek Szyprowski [Mon, 14 Dec 2020 07:33:30 +0000 (08:33 +0100)]
clk: meson: add minimal driver for g12a-ao clocks

Add minimal driver AO clocks on meson G12A family. Only ADC related clocks
are supported.

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

3 years agotizen: bootscript: amlogic: restore ${opts} support 66/249366/2
Marek Szyprowski [Thu, 10 Dec 2020 13:55:46 +0000 (14:55 +0100)]
tizen: bootscript: amlogic: restore ${opts} support

After unification of the Amlogic based boards boot scripts, support for
appending ${opts} to kernel cmdline has been lost. Restore it to make the
kernel debugging easier.

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

3 years agousb: dwc3-meson-g12a: always configure dr-mode 59/249359/2
Marek Szyprowski [Thu, 10 Dec 2020 10:35:31 +0000 (11:35 +0100)]
usb: dwc3-meson-g12a: always configure dr-mode

dwc3_meson_g12a_force_mode() sets the dr-mode of the USB PHY. However
it skips setting the mode if it matches the one done during driver probe
(stored in private structure). This fails if the mode has been changed
to other value and then back to initial one. Fix this by configuring the
dr-mode always, regadless of the one set at the driver probe).

This fixes operation of USB gadget based drivers when they are initialized
for the second time.

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

3 years agosamsung: tizen_rpi: add hal.img in dfu information 67/249267/2
Jaehoon Chung [Wed, 9 Dec 2020 10:33:04 +0000 (19:33 +0900)]
samsung: tizen_rpi: add hal.img in dfu information

Add hal.img in dfu information.
It's for just prepering to thor download.
- Avoid to fail thor protocol when hal image is created.

Change-Id: I78df372fc0bfa260d120c16c59a4b7bfd6fdddcf
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agomeson: add TIZEN_AMLOGIC_USE_VENDOR_KERNEL config 58/249258/3
Jaehoon Chung [Wed, 9 Dec 2020 09:21:44 +0000 (18:21 +0900)]
meson: add TIZEN_AMLOGIC_USE_VENDOR_KERNEL config

Add TIZEN_AMLOGIC_USE_VENDOR_KERNEL config.
It's more claar than just using CONFIG_TIZEN.
If someone wants to use mainline kernel, just disable it.

Enable CONFIG_TIZEN_AMLOGIC_USE_VENDOR_KERNEL.
- odroid-{c4,n2}_defconfig
- khadas-{vim3,vim3l}_defconfig
Tizen is using each board's vendor kernel.

Change-Id: I2a11e3e08e58ced7ef286487044a1616ac3ac8f4
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agolib: tizen: Add support for thor status notifications on video console 14/249214/3
Sylwester Nawrocki [Tue, 8 Dec 2020 18:28:58 +0000 (19:28 +0100)]
lib: tizen: Add support for thor status notifications on video console

This patch implements thor flashing progress bar and status notifications
on graphics console.

Change-Id: Iba4945ae26358936de1e1847d0095f97e6ab3498
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
3 years agothor: Add API for thor status notifications 13/249213/1
Sylwester Nawrocki [Wed, 25 Nov 2020 17:54:28 +0000 (18:54 +0100)]
thor: Add API for thor status notifications

This patch adds an empty by default thor_status_notify() function which
can be reimplemented as required and which allows to add notifications
of thor status and flashing progress, e.g. on external monitor.

Change-Id: Ic1eaad7f3f5adbca404162b745a9287d5a9ae247
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
3 years agoamlogic: vim3: add code for reading ethernet MAC address from efuse 37/249137/3 accepted/tizen/unified/20201209.060746 submit/tizen/20201208.071016
Marek Szyprowski [Mon, 7 Dec 2020 13:33:54 +0000 (14:33 +0100)]
amlogic: vim3: add code for reading ethernet MAC address from efuse

Add a simple code for reading built-in ethernet MAC address from efuse.

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

3 years agopackaging: u-boot-amlogic: add a spec file for all amlogic boards 25/249125/3
Jaehoon Chung [Mon, 7 Dec 2020 03:42:46 +0000 (12:42 +0900)]
packaging: u-boot-amlogic: add a spec file for all amlogic boards

Add a spec file for all amlogic boards.
- It will be provided u-boot-{n2,c4,vim3,vim3l} packages
- Remove each spec files

Change-Id: Ic4f8ab6f5608fbe8606fdc3cca591e53c7bdfe18
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agoconfigs: put a space to sys prompt in odroid-{c4,n2}_defconfig and khadas-vim3(l... 02/249102/2
Seung-Woo Kim [Mon, 7 Dec 2020 06:13:15 +0000 (15:13 +0900)]
configs: put a space to sys prompt in odroid-{c4,n2}_defconfig and khadas-vim3(l)_defconfig

Like all other targets, put a space to sys prompt.

Change-Id: Ie106f61406b686dfc7ec98079cb6adf96a7d6fff
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agocommon: splash_source: fix -Wint-to-pointer-cast warning 75/249075/1
Jaehoon Chung [Sun, 6 Dec 2020 23:39:05 +0000 (08:39 +0900)]
common: splash_source: fix -Wint-to-pointer-cast warning

Fix -Wint-to-pointer-cast warning

common/splash_source.c: In function 'splash_load_raw':
common/splash_source.c:100:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  100 |  bmp_hdr = (struct bmp_header *)bmp_load_addr;
      |            ^
common/splash_source.c: In function 'splash_sf_read_raw':
common/splash_source.c:39:47: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   39 |  return spi_flash_read(sf, offset, read_size, (void *)bmp_load_addr);
      |                                               ^

Change-Id: I3ab5875a7c33c0b22b2824dc8534dafcf70abd26
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agoconfigs: Enable options for splash image in odroid-{c4,n2}_defconfig 20/249020/4
Marek Szyprowski [Tue, 1 Dec 2020 17:38:51 +0000 (18:38 +0100)]
configs: Enable options for splash image in odroid-{c4,n2}_defconfig

These options are needed for the splash image loading.

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

3 years agotizen: amlogic: Add hdmimode env variable 47/248847/4
Sylwester Nawrocki [Wed, 2 Dec 2020 15:32:54 +0000 (16:32 +0100)]
tizen: amlogic: Add hdmimode env variable

The hdmimode variable set to "1080p60hz" value allows the HDMI driver
to switch to default full HD timings for QHD/UHD monitors and such
monitors can still be used in lower resolution mode.
This a workaround until proper support for QHD/UHD is implemented
in the VPU driver.
The new variable is also used in kernel bootargs.

Change-Id: Ib1b58ee9173fa380c1c79bf819b0ffaca1a6aab9
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
3 years agovideo: meson: Add fallback to default timings for QHD/UHD monitors 46/248846/3
Sylwester Nawrocki [Wed, 25 Nov 2020 19:13:55 +0000 (20:13 +0100)]
video: meson: Add fallback to default timings for QHD/UHD monitors

The HDMI driver currently supports only up to 1920x1200 resolutions
and QHD/UHD monitors might not specify detailed timings in EDID other
than those for their maximum resolution, even though they work with
lower resolutions like full HD. In such cases display_read_timings()
will fail breaking the video output driver initialization.

As a workaround fallback to full HD timings is added for QHD or UHD
monitors. The default timing will only be used when "hdmimode"
environment variable is set to "1080p60hz", otherwise the driver
switches to CVBS mode as before, when display timings are
unsupported/could not be read.

The proper solution would be to implement support for 2K/4K HDMI
modes, which are also not supported yet by driver in the kernel.

Change-Id: I407228392a6b1b6e8b0c55a6962235111df0c69c
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
3 years agotizen: Add splash image file to the bootloader tar image 06/248806/4
Sylwester Nawrocki [Wed, 2 Dec 2020 09:37:27 +0000 (10:37 +0100)]
tizen: Add splash image file to the bootloader tar image

Change-Id: Ie3e1f76a663eddb65887ec42c651dedbd6b07f81
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
3 years agoconfigs: Enable options for splash image in khadas-vim3(l)_defconfig 03/248803/3
Sylwester Nawrocki [Tue, 1 Dec 2020 17:38:51 +0000 (18:38 +0100)]
configs: Enable options for splash image in khadas-vim3(l)_defconfig

These options are needed for the splash image loading.

Change-Id: Ieeddd2e2d9ff6872297b9eb3f3d899702ee717a7
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
3 years agotizen: amlogic: add CONFIG entries for splash image loading 02/248802/3
Sylwester Nawrocki [Thu, 26 Nov 2020 16:42:18 +0000 (17:42 +0100)]
tizen: amlogic: add CONFIG entries for splash image loading

These options are needed for decompressing the logo image file
(gzipped BMP).

Change-Id: Ieb3c35adf5007e2f795f2cecc3cf365e7a40b629
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
3 years agoconfigs: tizen_amlogic: Add environment variables for splash image 01/248801/3
Sylwester Nawrocki [Thu, 26 Nov 2020 18:45:01 +0000 (19:45 +0100)]
configs: tizen_amlogic: Add environment variables for splash image

Set the splash file location, bmp image load address and logo position
on the display.

The compressed bitmap file should be installed on first mmc partition.

Change-Id: Ic1ce517460beaf318821f53ed3adbe6c41e091e8
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
3 years agopackaging: u-boot-vim3(l): Add tizen logo bitmap file 00/248800/3
Sylwester Nawrocki [Tue, 1 Dec 2020 17:37:40 +0000 (18:37 +0100)]
packaging: u-boot-vim3(l): Add tizen logo bitmap file

This image will be used as u-boot splash image.

Change-Id: I262cc2219435afc7c8f208ff39b2bf7cce6a636c
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
3 years agogitattributes: Set binary attribute for *.gz and *.png files 99/248799/2
Sylwester Nawrocki [Wed, 2 Dec 2020 08:36:29 +0000 (09:36 +0100)]
gitattributes: Set binary attribute for *.gz and *.png files

After commit ("1f35137 Add .gitattributes for line endings") all files
have text attribute set and we need such change to ensure content of
the *.gz and *.png files remains unmodified.

$ git check-attr -a -- *.gz *.png
*.gz: binary: set
*.gz: diff: unset
*.gz: merge: unset
*.gz: text: unset
*.gz: eol: lf
*.png: binary: set
*.png: diff: unset
*.png: merge: unset
*.png: text: unset
*.png: eol: lf

Change-Id: Ie7b1d48761c01c045bdcdae3b0ac66e64af79326
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
3 years agotizen: enable support for formatting MBR partition layout during flashing 44/248844/2
Marek Szyprowski [Thu, 26 Nov 2020 14:32:03 +0000 (15:32 +0100)]
tizen: enable support for formatting MBR partition layout during flashing

This is ensured by the following steps:
1. enable 'mbr' command and provide default partiton layout,
2. add support for formating block device from THOR downloaded script,
3. check MBR partition layout on boot and enter THOR mode if invalid
4. provide a script for formating MBR for THOR download

MBR partition layout is checked on boot if it mathes the one defined
during u-boot compilation. If not, set dfu_alt_info to the minimal safe
list and enter THOR download mode to flash the new, proper partition
layout and the complete Tizen image.

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

3 years agothor: add support for dfu_alt_info reintialization from the downloaded script 43/248843/2
Marek Szyprowski [Fri, 27 Nov 2020 15:10:34 +0000 (16:10 +0100)]
thor: add support for dfu_alt_info reintialization from the downloaded script

Reinitialize dfu_env_entities after flashing the 'SCRIPT' entity to
ensure that the potential changes to the 'dfu_alt_info' environment
variable are applied.

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

3 years agodfu: add support for dfu_alt_info reintialization from the flashed script 42/248842/2
Marek Szyprowski [Wed, 2 Dec 2020 12:56:19 +0000 (13:56 +0100)]
dfu: add support for dfu_alt_info reintialization from the flashed script

Reinitialize DFU USB gadget after flashing the 'SCRIPT' entity to ensure
that the potential changes to the 'dfu_alt_info' environment variable are
applied.

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

3 years agodfu: add 'SCRIPT' entity support 41/248841/2
Marek Szyprowski [Fri, 27 Nov 2020 15:08:28 +0000 (16:08 +0100)]
dfu: add 'SCRIPT' entity support

Define a new 'SCRIPT' type for DFU entities. The downloaded data are
treated as simple u-boot's scripts and executed with run_command_list()
function.

Flashing the 'SCRIPT' entity might result in changing the 'dfu_alt_info'
from that script. Add a global variable for tracking the potential need
to reinitialize the dfu_alt_info structures.

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

3 years agocmd: Add MBR partition layout control utility 40/248840/2
Marek Szyprowski [Thu, 26 Nov 2020 14:27:00 +0000 (15:27 +0100)]
cmd: Add MBR partition layout control utility

Add a 'mbr' command to let user create or verify MBR partition layout
based on the provided text description. The partition layout is
altearnatively read from 'mbr_parts' environment variable. This can be
used in scripts to help system image flashing tools to ensure proper
partition layout.

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

3 years agopart: dos: add code for creating MBR partition layout 39/248839/2
Marek Szyprowski [Thu, 26 Nov 2020 14:25:01 +0000 (15:25 +0100)]
part: dos: add code for creating MBR partition layout

Add code for creating and writing MBR partition layout. The code generates
similar layout of EBRs (Exteneded Block Records) and logical volumes as
Linux's fdisk utility.

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

3 years agodisk: dos: make some functions static 38/248838/2
Marek Szyprowski [Thu, 26 Nov 2020 14:23:41 +0000 (15:23 +0100)]
disk: dos: make some functions static

Make function not used outside this file static.

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

3 years agodisk: dos: use generic macro for unaligned le32 access 37/248837/2
Marek Szyprowski [Thu, 26 Nov 2020 14:22:32 +0000 (15:22 +0100)]
disk: dos: use generic macro for unaligned le32 access

Use a generic helper for reading LE32 integers.

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