platform/kernel/u-boot.git
4 years agocmd: add generic Tizen Download (NFS & USB) command 16/231516/10
Marek Szyprowski [Mon, 27 Apr 2020 06:45:02 +0000 (08:45 +0200)]
cmd: add generic Tizen Download (NFS & USB) command

This is a quick replacement of the NFSdown and USBdown commands, rewritten
on top of the generic DFU framework. This removes a few limitation of both
obsoleted commands.

Change-Id: Id8a311eabd2bab7d90aeee6adabbd6461897b4e3
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
[sw0312.kim: remove newline from command name]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
4 years agoconfig: Enable support for the XHCI controller on RPI4 board 15/231515/9
Marek Szyprowski [Fri, 15 May 2020 11:40:27 +0000 (13:40 +0200)]
config: Enable support for the XHCI controller on RPI4 board

This requires enabling BRCMSTB PCIe and XHCI_PCI drivers as well as PCI
and USB commands. To get it working one has to call the following commands:
"pci enum; usb start;", thus such commands have been added to the default
"preboot" environment variable. One has to update their environment if it
is already configured to get this feature working out of the box.

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

4 years agopci: Add driver for Broadcom BCM2711 SoC PCIe controller 14/231514/8
Sylwester Nawrocki [Tue, 12 May 2020 18:47:15 +0000 (20:47 +0200)]
pci: Add driver for Broadcom BCM2711 SoC PCIe controller

This patch adds basic driver PCI Express controller found on Broadcom
set-top-box SoCs, e.g. BCM2711.
The code is based on Linux upstream driver (pcie-brcmstb.c) with MSI
handling removed. The inbound access memory region is not currently
parsed from dma-ranges DT property and a fixed 3GB region is used.

The patch has been tested on RPI4 board, i.e. on BCM2711 SoC with VL805
USB Host Controller.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
[mszyprow: rebased onto tizen branch]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Ib2f4e6f3ced902b86b0283fdb0cce390d9688b1f

4 years agopci: Add some PCI Express capability register offset definitions 24/231524/7
Sylwester Nawrocki [Tue, 12 May 2020 18:47:14 +0000 (20:47 +0200)]
pci: Add some PCI Express capability register offset definitions

Add PCI Express capability definitions required by the Broadcom
STB PCIe controller driver.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I7ebba592cfe787bffeb0985ada38f11b721166f7

4 years agolinux/bitfield.h: Add primitives for manipulating bitfields both in host- and fixed... 83/231983/6
Nicolas Saenz Julienne [Tue, 12 May 2020 19:04:32 +0000 (21:04 +0200)]
linux/bitfield.h: Add primitives for manipulating bitfields both in host- and fixed-endian

Imports Al Viro's original Linux commit 00b0c9b82663a, which contains
an in depth explanation and two fixes from Johannes Berg:
 e7d4a95da86e0 "bitfield: fix *_encode_bits()",
 37a3862e12382 "bitfield: add u8 helpers".

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
[s.nawrocki: added empty lines between functions and macros]
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I93e237f1478e59a5a44345ea68aa4ed6a4ab7bed

4 years agorpi4: add a mapping for the PCIe XHCI controller MMIO registers (ARM 32bit) 22/231522/7
Marek Szyprowski [Tue, 12 May 2020 12:44:15 +0000 (14:44 +0200)]
rpi4: add a mapping for the PCIe XHCI controller MMIO registers (ARM 32bit)

Create a non-cacheable mapping for the 0x600000000 physical memory region,
where MMIO registers for the PCIe XHCI controller are instantiated by the
PCIe bridge. Due to 32bit limit in the CPU virtual address space in ARM
32bit mode, this region is mapped at 0xff800000 CPU virtual address.

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

4 years agommc: bcm283x: fix int to pointer cast 24/233724/4
Seung-Woo Kim [Fri, 15 May 2020 10:14:26 +0000 (19:14 +0900)]
mmc: bcm283x: fix int to pointer cast

On build with 32 bit, there is a warning for int-to-pointer-cast.
Fix the int to pointer cast by using uintptr_t.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I590d32437763e6e60f216379e4fb55814d0b1bb2

4 years agoarm: provide a function for boards init code to modify MMU virtual-physical map 86/233586/5
Marek Szyprowski [Tue, 12 May 2020 12:56:37 +0000 (14:56 +0200)]
arm: provide a function for boards init code to modify MMU virtual-physical map

Provide function for setting arbitrary virtual-physical MMU mapping for the given region.

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

4 years agorpi4: add a mapping for the PCIe XHCI controller MMIO registers (ARM 64bit) 21/231521/7
Marek Szyprowski [Tue, 12 May 2020 18:47:12 +0000 (20:47 +0200)]
rpi4: add a mapping for the PCIe XHCI controller MMIO registers (ARM 64bit)

Create a non-cacheable mapping for the 0x600000000 physical memory region,
where MMIO registers for the PCIe XHCI controller are instantiated by the
PCIe bridge.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Idcbaf78228aa87d992020b3fe0a0d4c9fdfa1329

4 years agorpi4: shorten a mapping for the DRAM 20/231520/7
Marek Szyprowski [Tue, 12 May 2020 18:47:11 +0000 (20:47 +0200)]
rpi4: shorten a mapping for the DRAM

Remove the overlap between DRAM and device's IO area.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Ie3a7bfa1dbba32d425b9145197e2e8d1f972ab33

4 years agopci: Move some PCIe register offset definitions to a common header 19/231519/7
Sylwester Nawrocki [Tue, 12 May 2020 18:47:10 +0000 (20:47 +0200)]
pci: Move some PCIe register offset definitions to a common header

Some PCI Express register offsets are currently defined in multiple
drivers, move them to a common header to avoid re-definitions and
as a pre-requisite for adding new PCIe driver.
While at it replace some spaces with tabs.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I2e06710f8ff1195b66cee7dc8d16af26cc6c6a60

4 years agousb: xhci: Use only 32-bit accesses in xhci_writeq/xhci_readq 23/231523/7
Sylwester Nawrocki [Tue, 12 May 2020 18:47:09 +0000 (20:47 +0200)]
usb: xhci: Use only 32-bit accesses in xhci_writeq/xhci_readq

There might be hardware configurations where 64-bit data accesses
to XHCI registers are not supported properly.  This patch removes
the readq/writeq so always two 32-bit accesses are used to read/write
64-bit XHCI registers, similarly as it is done in Linux kernel.

This patch fixes operation of the XHCI controller on RPI4 Broadcom
BCM2711 SoC based board, where the VL805 USB XHCI controller is
connected to the PCIe Root Complex, which is attached to the system
through the SCB bridge.

Even though the architecture is 64-bit the PCIe BAR is 32-bit and likely
the 64-bit wide register accesses initiated by the CPU are not properly
translated to a sequence of 32-bit PCIe accesses.
xhci_readq(), for example, always returns same value in upper and lower
32-bits, e.g. 0xabcd1234abcd1234 instead of 0x00000000abcd1234.

Cc: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Ia886dcae5d63b0d23591948e571ca07907893b58

4 years agousb: xhci: Add missing cache flush in the scratchpad array initialization 18/231518/7
Sylwester Nawrocki [Fri, 24 Apr 2020 16:50:03 +0000 (18:50 +0200)]
usb: xhci: Add missing cache flush in the scratchpad array initialization

In current code there is no cache flush after initializing the scratchpad
buffer array with the scratchpad buffer pointers. This leads to a failure
of the "slot enable" command on the rpi4 board (Broadcom STB PCIe
controller + VL805 USB hub) - the very first TRB transfer on the command
ring fails and there is a timeout while waiting for the command completion
event. After adding the missing cache flush everything seems to be working
as expected.

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I0a8a482bf452230edd754509b2f1bcdb6b1ea090

4 years agodm: pci: Update the PCI read_config() method to const dev * 85/233585/5
Simon Glass [Mon, 27 Jan 2020 15:49:37 +0000 (08:49 -0700)]
dm: pci: Update the PCI read_config() method to const dev *

At present this method uses a non-const udevice pointer, but the call
should not modify the device. Use a const pointer.

Signed-off-by: Simon Glass <sjg@chromium.org>
Conflicts:
drivers/misc/p2sb_emul.c
drivers/misc/swap_case.c
drivers/pci/pci_mpc85xx.c
drivers/pci/pci_x86.c
drivers/pci/pcie_mediatek.c
drivers/pci/pcie_phytium.c
drivers/power/acpi_pmc/pmc_emul.c

[backport of mainline commit c4e72c4ad8b7c2db9c868bd053c25344b95900b8]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Iee5347f9a131102f691ea79650b33bbb09c50926

4 years agodm: core: Use const where possible in device.h 84/233584/5
Simon Glass [Mon, 27 Jan 2020 15:49:36 +0000 (08:49 -0700)]
dm: core: Use const where possible in device.h

Update this header file to use const devices where possible, to permit
callers to also use const.

Signed-off-by: Simon Glass <sjg@chromium.org>
Conflicts:
drivers/core/device.c
include/dm/device.h

[backport of mainline commit fc347fbdd44a01b1aba6283dec56c1374baca383]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Id883506ac5c20ae7898c576316b64e64a9a52c90

4 years agoscripts: tizen: update script version to distinguish 62/234162/1
Jaehoon Chung [Fri, 22 May 2020 07:52:18 +0000 (16:52 +0900)]
scripts: tizen: update script version to distinguish

Update script minor version to distinguish.
(from 1.3 to 1.3.1)
- 1.3.1 : Enhance write performcne

Change-Id: If9bbc1cbca22d87bc837d03e60d09a3a0e6c6883
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
4 years agonet: fix build without NFS or NFS download enabled 71/233571/5
Marek Szyprowski [Fri, 15 May 2020 10:08:54 +0000 (12:08 +0200)]
net: fix build without NFS or NFS download enabled

Partial NFS download requires setting net_boot_file_{offset,size_limit}
global variables, which are available only when CONFIG_CMD_NFS is set.

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

4 years agoFixup "tools:mkimage_multidtb: Align less than PAD size" 70/233570/5
Marek Szyprowski [Fri, 15 May 2020 05:56:24 +0000 (07:56 +0200)]
Fixup "tools:mkimage_multidtb: Align less than PAD size"

Partially revert commit fe215b2f7ddf30f36b326f7a3fe3734a872a37fe
("tools:mkimage_multidtb: Align less than PAD size"), as it looks that the MFC hack
 accidendly sneaked into that commit.

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

4 years agoconfigs: odroid-xu3: enable NET_RANDOM_ETHADDR for proper USB ethernet support 23/233723/3
Marek Szyprowski [Mon, 18 May 2020 11:56:34 +0000 (13:56 +0200)]
configs: odroid-xu3: enable NET_RANDOM_ETHADDR for proper USB ethernet support

Odroid XU3 and XU3lite has built-in USB SMSC9512/9514 Ethernet controller, which has no
EEPROM for the board MAC address. Force using random one instead of failing.

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

4 years agoRevert "configs: odroid-xu3: disable ENV_VARS_UBOOT_RUNTIME_CONFIG" 22/233722/3
Marek Szyprowski [Mon, 18 May 2020 11:28:58 +0000 (13:28 +0200)]
Revert "configs: odroid-xu3: disable ENV_VARS_UBOOT_RUNTIME_CONFIG"

This reverts commit 91c1e726e5c01cbed34df700f9fdab6d6fedd4fc.

CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG is needed to properly set fdtfile
env depending on the ADC value.

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

4 years agotizen: odroid-xu3: add missing Odroid HC1 support to CONFIG_DFU_ALT_SYSTEM_2 69/233569/4
Marek Szyprowski [Fri, 15 May 2020 06:29:46 +0000 (08:29 +0200)]
tizen: odroid-xu3: add missing Odroid HC1 support to CONFIG_DFU_ALT_SYSTEM_2

Add missing exynos5422-odroidhc1.dtb to DFU_ALT_SYSTEM_2, selected when ramdisk
partition is available.

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

4 years agoarm: dts: exynos: Extend board description 68/233568/4
Marek Szyprowski [Wed, 15 Jan 2020 15:18:03 +0000 (16:18 +0100)]
arm: dts: exynos: Extend board description

u-boot uses the same DTS for the all Odroid XU3-based boards, so list
them in the model description to let user know that those boards are
supported.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
[backport of mainline commit a6ee3fe19d8bdf369edbd9301eb2be283458b920]

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

4 years agoarm: exynos: Use proper PMIC device names 67/233567/4
Marek Szyprowski [Thu, 16 Jan 2020 13:46:04 +0000 (14:46 +0100)]
arm: exynos: Use proper PMIC device names

Since commit 4213609cc7 ("drivers: core: use strcmp when find device by
name") one has to provide full name to get requested object. Fix the code
used to detect enable power regulators on the supported Exynos boards to
use proper PMIC device device name then.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Anand Moon <linux.amoon@gmail.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
[backport of mainline commit 4b8984e969fa8e68f2fdd79c70cd4be8f1f1378c]

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

4 years agoarm: exynos: Use proper ADC device name 66/233566/4
Marek Szyprowski [Tue, 14 Jan 2020 14:04:20 +0000 (15:04 +0100)]
arm: exynos: Use proper ADC device name

Since commit 4213609cc7 ("drivers: core: use strcmp when find device by
name") one has to provide full name to get requested object. Fix the code
used to detect Odroid board revision to use proper ADC device name then.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Anand Moon <linux.amoon@gmail.com>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
[backport of mainline commit fa06669d0181b2c92ba86fb6c40a4cb0c196b13c]

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

4 years agoscripts: sd_fusing: Increase the block size upon the image flashing 91/233991/1
Junghoon Kim [Thu, 21 May 2020 03:56:23 +0000 (12:56 +0900)]
scripts: sd_fusing: Increase the block size upon the image flashing

Fine-grained IO degrades the image flashing performance due to the IO
stack overhead. Increase the block size upon the dd operation to improve
the flashing performance.

Change-Id: I937ca401d07045f055d3f55ca9f52a3261ee4fb4
Signed-off-by: Junghoon Kim <jhoon20.kim@samsung.com>
4 years agoscripts: sd_fusing_xu4.sh: Improve the image flashing performance 64/233664/1
Junghoon Kim [Mon, 18 May 2020 06:22:47 +0000 (15:22 +0900)]
scripts: sd_fusing_xu4.sh: Improve the image flashing performance

The current dd of the pv combination degrades the flashing performance
due to the pipe overhead and is also bad to see due to the duplicate
output. This can be improved by the use of direct mode with progress
status.

Change-Id: Id682683e892181cc2608d1ba811d4ddb847048da
Signed-off-by: Junghoon Kim <jhoon20.kim@samsung.com>
4 years agoscripts: tizen: sd_fusing_rpi3: Check dd version for backward compatibility 85/233385/2
Seung-Woo Kim [Thu, 14 May 2020 08:19:36 +0000 (17:19 +0900)]
scripts: tizen: sd_fusing_rpi3: Check dd version for backward compatibility

Before dd version 8.24, "status=progress" option is not supported.
For backward compatibility, check dd version and use the option
only when it is possible.

Change-Id: Ia90668e9cd22bf2906b4b0ecd574bb45ad14fd95
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
4 years agoscripts: tizen: Improve the image flashing performance for RPI family 52/233352/3
Junghoon Kim [Thu, 14 May 2020 05:51:00 +0000 (14:51 +0900)]
scripts: tizen: Improve the image flashing performance for RPI family

The current dd of the pv combination degrades the performance due to the
pipe overhead and is also bad to see due to the duplicate output.

It can be resolved by the use of direct mode with progress status. This
reduces the flashing time of platform images by 17.5% in my environment.

Change-Id: I986ce72e0294b6f143ca95419364a0f89f289d74
Signed-off-by: Junghoon Kim <jhoon20.kim@samsung.com>
4 years agocmd: thordown: Fix to show stopped message when interrupted 03/231903/1
Seung-Woo Kim [Sat, 25 Apr 2020 06:05:34 +0000 (15:05 +0900)]
cmd: thordown: Fix to show stopped message when interrupted

The thordown command can be interrupted by Ctrl-C, and it can be
identified with error value. Fix to show stopped message when
interrupted.

Change-Id: Idfe1a9dc1e168ea20c94d49ada497dc1b66bde52
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
4 years agogadget: f_thor: Return proper error value for thor_init() 98/231798/1
Seung-Woo Kim [Fri, 24 Apr 2020 07:40:40 +0000 (16:40 +0900)]
gadget: f_thor: Return proper error value for thor_init()

After the commit 17679aed622b ("usb: thor: add screen support"),
caller of thor_init() expects general error value to check
interrupt by Ctrl-C but thor_init() returns wrong error value -1
for Ctrl-C termination during rx or wrong protocol response.
Return proper error for the cases.

Change-Id: I8a637918930673bad953a88e26c79b8e64580bc8
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
4 years agogadget: f_thor: add missing line breaks for pr_err() 77/231777/1
Seung-Woo Kim [Thu, 13 Feb 2020 08:24:11 +0000 (17:24 +0900)]
gadget: f_thor: add missing line breaks for pr_err()

After the commit 9b643e312d52 ("treewide: replace with error()
with pr_err()"), there are pr_err() usages without line break. Add
missing line breaks for pr_err() used in f_thor.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
[sw0312.kim: cherry-pick mainline commit 491cabf067c6 to fix error message]

Change-Id: If1750e46cb3e9d64d5c9460d82c7fd90f7a58acd

4 years agocmd/gpt: Address error cases during gpt rename more correctly 28/231428/2 accepted/tizen/unified/20200424.141632 submit/tizen/20200423.092248
Tom Rini [Tue, 21 Jan 2020 16:53:38 +0000 (11:53 -0500)]
cmd/gpt: Address error cases during gpt rename more correctly

New analysis by the tool has shown that we have some cases where we
weren't handling the error exit condition correctly.  When we ran into
the ENOMEM case we wouldn't exit the function and thus incorrect things
could happen.  Rework the unwinding such that we don't need a helper
function now and free what we may have allocated.

Fixes: 18030d04d25d ("GPT: fix memory leaks identified by Coverity")
Reported-by: Coverity (CID: 275475, 275476)
Cc: Alison Chaiken <alison@she-devel.com>
Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Cc: Jordy <jordy@simplyhacker.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
[jh80.chung: cherry picked from mainline commit 5749faa3d683]
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: Ifdccec243f89b55363ffd6d18bfee971a42f7bc6

4 years agoFix the use of resize2fs 34/231334/2
Junghoon Kim [Tue, 21 Apr 2020 07:59:05 +0000 (16:59 +0900)]
Fix the use of resize2fs

The resize2fs can be used to enlarge or shrink the ext family filesystem
only. Thus, An error occurs when trying to use it with other filesystems
such as vfat. Fix the use of resize2fs for use only with the ext family
filesystem.

Change-Id: I2c9b7c686086d924b003d07a2762bb668dd39ac8
Signed-off-by: Junghoon Kim <jhoon20.kim@samsung.com>
4 years agotizen: rpi2/3/4: fix typo in Tizen boot scripts 38/231138/1
Marek Szyprowski [Fri, 17 Apr 2020 10:43:45 +0000 (12:43 +0200)]
tizen: rpi2/3/4: fix typo in Tizen boot scripts

/s/comdline/cmdline

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

4 years agoscripts: tizen: sd_fusing: Check requested device 74/229774/2
Seung-Woo Kim [Fri, 3 Apr 2020 07:58:36 +0000 (16:58 +0900)]
scripts: tizen: sd_fusing: Check requested device

It is possible to request flashing a device which is non-existent
or unaccessible. Especially, request can flash non-removable
storage disk that user do not really intend. To skip all the case,
Check requested device.
For non removable disk, it will ask user really intended to flash
the device.

Change-Id: I7ee3363fe4075abd7b860acf26b6cbe65e6fa68c
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
4 years agonet: bcmgenet: move PHY initialization from probe() to start() 72/228772/1 accepted/tizen/unified/20200402.155635 submit/tizen/20200331.090714
Marek Szyprowski [Wed, 25 Mar 2020 09:01:48 +0000 (10:01 +0100)]
net: bcmgenet: move PHY initialization from probe() to start()

Fix random network failures on subsequent network access by forcing PHY initialization on
every network access. This also fixes sudden link drop from 100baseT to 10baseT observed
from time to time.

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

4 years agonet: tftp: Fix too small block size 71/228771/1
Andre Przywara [Sat, 23 Nov 2019 17:58:59 +0000 (17:58 +0000)]
net: tftp: Fix too small block size

Commit b618b3707633 ("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")
accidentally set the default *option* TFTP block size to 512 bytes, even
though the comment in the code says that this is a terrible choice. Most
boards didn't define the symbol before, so they got the default block size
of 1468 bytes before, but now use 512 bytes, which is also the fallback.
This leads to both abysmal performance and a lot of hashes printed
on the screen (one character for every 5K), which is both annoying and
slow over serial links.

Set the default block size in Kconfig back to the value it had before.

This improves TFTP performance from 2.8 MB/s to 6.9 MB/s on a Pine64.

Fixes: b618b3707633 ("net: Convert CONFIG_TFTP_BLOCKSIZE to Kconfig")
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
[backport of mainline commit 16cdc2daa07986243751a9f545aa287c60e04ced]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Ib62265400f73d6ecd7780e70a84070158e9d8184

4 years agonet: nfs: show file offset and improve progress display 70/228770/1
Marek Szyprowski [Wed, 25 Mar 2020 09:03:40 +0000 (10:03 +0100)]
net: nfs: show file offset and improve progress display

Always align progress display to the start of the column and show downloaded
file offset.

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

4 years agonet: ping: reset stored IP once the command finishes to avoid interrupting other... 69/228769/1
Marek Szyprowski [Wed, 25 Mar 2020 09:08:16 +0000 (10:08 +0100)]
net: ping: reset stored IP once the command finishes to avoid interrupting other protocols

Reset stored ping IP address before leaving the netloop to ensure that the subsequent calls
to the netloop, especially for the other protocols, won't be interrupted by the received
ICMP_ECHO_REPLY packet.

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

4 years agocmd/nfsdown: fix summary message 68/228768/1
Marek Szyprowski [Wed, 25 Mar 2020 09:02:03 +0000 (10:02 +0100)]
cmd/nfsdown: fix summary message

Adjust summary message format to align properly with
'ramdisk-recovery.img' file.

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

4 years agocmd/nfsdown: fix download image names for all RPi variants 57/228757/1
Marek Szyprowski [Wed, 25 Mar 2020 08:10:11 +0000 (09:10 +0100)]
cmd/nfsdown: fix download image names for all RPi variants

There is no single CONFIG option for all RPi variants, so preprocessor has to check all of them.

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

4 years agocmd/nfsdown: fix wrong null check for argument in do_mmc_init() 98/228498/2
Seung-Woo Kim [Mon, 23 Mar 2020 09:07:32 +0000 (18:07 +0900)]
cmd/nfsdown: fix wrong null check for argument in do_mmc_init()

In do_mmc_init(), there is wrong null check for argument
instead of find_mmc_device() result. Fix wrong null check.

Change-Id: Ibbd2781bed7ae1a812563a5d77b2a4c46cf66523
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
4 years agocmd/nfsdown: fix recently introduced type mismatch issues 70/228470/1
Marek Szyprowski [Mon, 23 Mar 2020 08:05:39 +0000 (09:05 +0100)]
cmd/nfsdown: fix recently introduced type mismatch issues

When u-boot is configured from odroid-xu3_defconfig, the compiler reports following warnings:
In file included from include/config.h:5:0,
                 from include/common.h:23,
                 from cmd/nfsdown.c:11:
cmd/nfsdown.c: In function ‘do_nfs_down’:
include/configs/odroid_xu3.h:16:32: warning: passing argument 1 of ‘do_nfs_to_fat’ makes pointer from integer without a cast [-Wint-conversion]
 #define CONFIG_SYS_SDRAM_BASE  0x40000000
                                ^
cmd/nfsdown.c:24:27: note: in expansion of macro ‘CONFIG_SYS_SDRAM_BASE’
 #define NFS_DOWNLOAD_ADDR CONFIG_SYS_SDRAM_BASE
                           ^~~~~~~~~~~~~~~~~~~~~
cmd/nfsdown.c:429:25: note: in expansion of macro ‘NFS_DOWNLOAD_ADDR’
    size = do_nfs_to_fat(NFS_DOWNLOAD_ADDR, src_path,
                         ^~~~~~~~~~~~~~~~~
cmd/nfsdown.c:328:12: note: expected ‘void *’ but argument is of type ‘int’
 static int do_nfs_to_fat(void *addr, char *file_path, char *file_name,
            ^~~~~~~~~~~~~
In file included from include/config.h:5:0,
                 from include/common.h:23,
                 from cmd/nfsdown.c:11:
include/configs/odroid_xu3.h:16:32: warning: passing argument 2 of ‘do_nfs_to_mmc’ makes pointer from integer without a cast [-Wint-conversion]
 #define CONFIG_SYS_SDRAM_BASE  0x40000000
                                ^
cmd/nfsdown.c:24:27: note: in expansion of macro ‘CONFIG_SYS_SDRAM_BASE’
 #define NFS_DOWNLOAD_ADDR CONFIG_SYS_SDRAM_BASE
                           ^~~~~~~~~~~~~~~~~~~~~
cmd/nfsdown.c:433:30: note: in expansion of macro ‘NFS_DOWNLOAD_ADDR’
    size = do_nfs_to_mmc(mmc, NFS_DOWNLOAD_ADDR, src_path,
                              ^~~~~~~~~~~~~~~~~
cmd/nfsdown.c:282:12: note: expected ‘void *’ but argument is of type ‘int’
 static int do_nfs_to_mmc(struct mmc *mmc, void *addr, char *file_path,
            ^~~~~~~~~~~~~

Fix this by changing addr to unsigned long and adding needed casts.

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

4 years agocmd/nfsdown: add support for partial image download 67/227967/2
Marek Szyprowski [Wed, 18 Mar 2020 07:41:36 +0000 (08:41 +0100)]
cmd/nfsdown: add support for partial image download

Add support for downloading image file in parts, so images larger than the available memory
can be flashed correctly. This allows to flash large (>1GiB) rootfs images on RPi3 or RPi4
boards.

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

4 years agonet: nfs: add support for partial downloads from given offset 66/227966/1
Marek Szyprowski [Tue, 17 Mar 2020 13:03:10 +0000 (14:03 +0100)]
net: nfs: add support for partial downloads from given offset

Add support for downloading file from the given offset (in bytes) and limit the size up to given
bytes.

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

4 years agonet: nfs: reduce the number of printed hashes during data transfer 65/227965/1
Marek Szyprowski [Tue, 17 Mar 2020 13:50:08 +0000 (14:50 +0100)]
net: nfs: reduce the number of printed hashes during data transfer

Downloading large images (about 1GiB) prints a lots of hash characters, so it is hard to follow
what is happenings. Reduce the amount of printed progress marks by a magnitude.

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

4 years agorpi3/4: enable NFS download feature 50/227550/1 submit/tizen/20200317.014342
Marek Szyprowski [Thu, 12 Mar 2020 13:04:56 +0000 (14:04 +0100)]
rpi3/4: enable NFS download feature

Sync RPi3/4 defconfigs and enable NFS download feature for all configs.

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

4 years agommc: exynos_dw_mmc: remove unused code 27/225727/1 accepted/tizen/unified/20200225.224418 submit/tizen/20200225.003030
Jaehoon Chung [Mon, 24 Feb 2020 06:47:42 +0000 (15:47 +0900)]
mmc: exynos_dw_mmc: remove unused code

Remove unused code and fix wrong memory allocation.
- When rebased on v2019.10, it was applied wrong.

Change-Id: I6cc953c511d01ce42c33bf8d461e7bf5629c6428
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
4 years agoRevert "Revert "rpi4: Enable GENET Ethernet controller"" 30/224830/1 accepted/tizen/unified/20200214.050352 submit/tizen/20200213.090905 submit/tizen/20200213.092423
Marek Szyprowski [Thu, 13 Feb 2020 08:52:40 +0000 (09:52 +0100)]
Revert "Revert "rpi4: Enable GENET Ethernet controller""

This reverts commit 59b5cde11b0fed5f7bcdb06d69f92887985d43e7.

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

4 years agoconfig: rpi: Increase malloc buffer size 29/224829/2
Marek Szyprowski [Thu, 13 Feb 2020 08:50:54 +0000 (09:50 +0100)]
config: rpi: Increase malloc buffer size

GENET ethernet driver and THORdown consume more memory than the default
4M, so increase the malloc buffer size to 16M to let them work together.

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

4 years agoRevert "rpi4: Enable GENET Ethernet controller" 15/224815/1 submit/tizen/20200213.081741
Dongwoo Lee [Thu, 13 Feb 2020 07:38:25 +0000 (16:38 +0900)]
Revert "rpi4: Enable GENET Ethernet controller"

Since commit 60857f8ec759 ("rpi4: Enable GENET Ehternet controller")
thor downloder fails with log like below:

U-boot> thordown 0 mmc 0
TIZEN "THOR" Downloader
DFU alt info setting: done
thor_func_set_alt: EPs setup failed!kill ep2out-bulk:  resubmit 4 bytes --> -22thor_init: Data not received!
THOR DOWNLOAD failed: -1
WARNING at drivers/usb/gadget/dwc2_udc_otg.c:730/dwc2_free_request()!
WARNING at drivers/usb/gadget/dwc2_udc_otg.c:730/dwc2_free_request()!

So this disables GENET Ethernet contorller.

Change-Id: I0dd5e5789b0a099768655946122f07ecd1fb609f
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
4 years agorpi4: Enable GENET Ethernet controller 17/224417/1 accepted/tizen/unified/20200212.125728 submit/tizen/20200212.035459
Amit Singh Tomar [Mon, 27 Jan 2020 01:14:44 +0000 (01:14 +0000)]
rpi4: Enable GENET Ethernet controller

The Raspberry Pi 4 SoC features an integrated Gigabit Ethernet
controller, connected as a platform device.

Enable the new driver in the three applicable defconfigs, to allow
TFTP booting on the board.

Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>
[Andre: Add joined and 32-bit configs]
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Corentin Labbe <clabbe@baylibre.com>
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
[backport of mainline commit 095c6eba9d02688e7a1c3cd2093f826d05fe961f]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I666fbda9f027b54c8ec29be324e38a7f53ad0cfe

4 years agorpi4: Update memory map to accommodate scb devices 16/224416/1
Amit Singh Tomar [Mon, 27 Jan 2020 01:14:43 +0000 (01:14 +0000)]
rpi4: Update memory map to accommodate scb devices

Some of the devices(for instance, pcie and gnet controller) sitting on
SCB bus falls behind/below the memory range that we currenty have.

This patch updates the memory range to map those devices correctly.

Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Corentin Labbe <clabbe@baylibre.com>
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
[backport of mainline commit fff5d5499d28dda0b22b44bb57c4525ad7d0a89d]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Ic93d9d00e57f134b1386cd5da17f29d997854d91

4 years agonet: Add support for Broadcom GENETv5 Ethernet controller 15/224415/1
Amit Singh Tomar [Mon, 27 Jan 2020 01:14:42 +0000 (01:14 +0000)]
net: Add support for Broadcom GENETv5 Ethernet controller

The Broadcom GENET Ethernet MACs are used in several MIPS based SoCs
and in the Broadcom 2711/2838 SoC used on the Raspberry Pi 4.
There is no publicly available documentation, so this driver is based
on the Linux driver. Compared to that the queue management is
drastically simplified, also we only support version 5 of the IP and
RGMII connections between MAC and PHY, as used on the RPi4.

Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
[Andre: heavy cleanup and a few fixes]
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Corentin Labbe <clabbe@baylibre.com>
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
[backport of mainline commit d53e3fa3853d5dad9ac4c39128cd08e0ae7a33ef]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I578e251809583314695e0212e5f954dac366ddef

4 years agowaitbit: Add the generic wait_for_bit macros for 16 and 32 bits. 14/224414/1
Kursad Oney [Wed, 14 Aug 2019 13:18:33 +0000 (15:18 +0200)]
waitbit: Add the generic wait_for_bit macros for 16 and 32 bits.

wait_for_bit_le32 and wait_for_bit_le16 use the raw I/O functions
which would default to big-endian on BE systems. Create the generic
equivalents to use the native endianness.

Signed-off-by: Kursad Oney <kursad.oney@broadcom.com>
Reviewed-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
[backport of mainline commit c50d670c56109c001875cd72930810b2ddfb29e6]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I4a808d9a343ce1fc259cc973ef222668fe3ff0fd

4 years agocommon: Move older CPU functions to their own header 13/224413/1
Simon Glass [Thu, 14 Nov 2019 19:57:09 +0000 (12:57 -0700)]
common: Move older CPU functions to their own header

These should be moved to driver model, but in the meantime, move them
out of the common header to help reduce its size.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
[backport of mainline commit bdf30e84909d8d99c2700a0fc6c3e799e3d8e2d4]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I620725bda17233e4c0901d2050a6bb7754cde2f1

4 years agommc: bcm2835_sdhci: remove QUIRK_BROKEN_SDMA flag 97/223097/1
Jaehoon Chung [Wed, 22 Jan 2020 23:45:52 +0000 (08:45 +0900)]
mmc: bcm2835_sdhci: remove QUIRK_BROKEN_SDMA flag

Remove QUIRK_BROKEN_SDMA flag.

Change-Id: I6206ccb6ade14f51786d5603ae5207840ac51f63
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
4 years agommc: sdhci: not return error when SDMA is not suppported 96/223096/1
Jaehoon Chung [Wed, 22 Jan 2020 23:43:42 +0000 (08:43 +0900)]
mmc: sdhci: not return error when SDMA is not suppported

If host controller doesn't support SDMA mode, it doesn't need to return
error. Because it can be worked with PIO mode.
It doesn't need to use QUIRK_BROKEN_SDMA.

Change-Id: Iafbb915b3fd33209ba689e856bfd934acac9a03e
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
4 years agosamsung: tizen_rpi: add dfu setup informations 45/222845/2 accepted/tizen/unified/20200121.121258 submit/tizen/20200121.034330
Jaehoon Chung [Mon, 20 Jan 2020 21:55:14 +0000 (06:55 +0900)]
samsung: tizen_rpi: add dfu setup informations

Add dfu setup informations.
- usb controller index : 0
- dfu interface : mmc(eMMC/SD)
- default dfu device : 0

After applied this patch, it will be worked with "thor" instead of "thor 0 mmc 0".

Change-Id: I32294af8531532ea86333853fb208c2c23deb33d
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
4 years agoconfigs: rpi_4_32b_defconfig: enable SDHCI_SDMA config 27/222827/2
Jaehoon Chung [Tue, 14 Jan 2020 03:43:06 +0000 (12:43 +0900)]
configs: rpi_4_32b_defconfig: enable SDHCI_SDMA config

Enable SDHCI_SDMA configuration.

Change-Id: If9ca4199125b13ac225697dfb631c2d4a13ed4df
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
4 years agommc: bcm2835_sdhci: set SDHCI_QUIRK_BROKEN_SDMA flag 26/222826/2
Jaehoon Chung [Mon, 20 Jan 2020 09:50:45 +0000 (18:50 +0900)]
mmc: bcm2835_sdhci: set SDHCI_QUIRK_BROKEN_SDMA flag

RPI4 is used device-tree that taken from firmware.
mmcnr@73e00000 is enabled on device-tree, so it's probed on u-boot side.
Because it's for SDIO interface, it doesn't need to probe.
When SDMA is enabled, mmcnr's probe is always failed.

Below log is unnecessary :
  sdhci_setup_cfg: Your controller doesn't support SDMA!!
  mmcnr@7e30000 - probe failed: -22

Change-Id: Icb1cbebf9172d8bf6d14bd167e28eb3d570a21cd
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
4 years agommc: sdhci: add quriks relevant to broken SDMA 25/222825/2
Jaehoon Chung [Mon, 20 Jan 2020 09:47:35 +0000 (18:47 +0900)]
mmc: sdhci: add quriks relevant to broken SDMA

ADd quirks relevant to broken SDMA.
If set to SDHCI_QUIRK_BROKEN_SDMA, it should be run the pio mode.

Change-Id: Iddae84fea4d1de0301b9afd45f9f55d7d3f8de74
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
4 years agommc: sdhci: use phys2bus macro when dma address is accessed 24/222824/2
Jaehoon Chung [Mon, 20 Jan 2020 09:33:26 +0000 (18:33 +0900)]
mmc: sdhci: use phys2bus macro when dma address is accessed

Use phys2bus macro when dma address is accessed.
Some targets need to use phys2bus macro.(e.g, RPI4)
After applied it, SDMA mode can be used.

When thor download is used,
- Before : 1.8MB/s
- After : 7.23MB/s

Change-Id: Id63dbdc4bd48198ca33c2b55d9bdf3d9f1a4b570
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
4 years agospl: atf: cast NULL to uintptr_t explictly 26/221626/1 accepted/tizen/unified/20200108.131627 submit/tizen/20200107.060950
Seung-Woo Kim [Mon, 6 Jan 2020 09:46:08 +0000 (18:46 +0900)]
spl: atf: cast NULL to uintptr_t explictly

The bl31_entry() requires uintptr_t for its 3rd argument but NULL
is used calling the function. Cast it explictly to avoid
int-conversion build warning.

Change-Id: I0033c1bdcb9e115745ecec67950487cb85aeaba2
Fixes: d332415fe82f ("spl: atf: call bl31_entry function before jump to u-boot")
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
4 years agolib: errno: avoid error format-overflow 25/221625/1
Heinrich Schuchardt [Sun, 6 Oct 2019 11:58:57 +0000 (13:58 +0200)]
lib: errno: avoid error format-overflow

In cmd/regulator.c an error occurs with GCC 9.2.1 if CONFIG_ERRNO_STR is
not defined:

cmd/regulator.c: In function ‘failure’:
cmd/regulator.c:20:2: error: ‘%s’ directive argument is null
[-Werror=format-overflow=]
   20 |  printf("Error: %d (%s)\n", ret, errno_str(ret));
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function ‘constraint’,
    inlined from ‘constraint’ at cmd/regulator.c:111:12:
cmd/regulator.c:115:3: error: ‘%s’ directive argument is null
[-Werror=format-overflow=]
  115 |   printf(" %s (err: %d)\n", errno_str(val), val);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

errno_str() should return a valid string instead of NULL if
CONFIG_ERRNO_STR is not defined.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
[sw0312.kim: cherry-pick mainline commit f279e1d9167f to remove gcc 9 build warning]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: Ib7819bfd2bb93bd44801229c5fce8f4c511765c5

4 years agoconfigs: rpi_4_32b_defconfig: enable btrfs config 05/220505/1 accepted/tizen/unified/20191219.143702 submit/tizen/20191219.051336
Jaehoon Chung [Thu, 19 Dec 2019 04:25:19 +0000 (13:25 +0900)]
configs: rpi_4_32b_defconfig: enable btrfs config

Enable btrfs configuration to support BTRFS on u-boot.

Change-Id: I883ab759f48724bb6bac6804d95f58a2b07b1ab5
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
4 years agoconfigs: rpi_4_32b_defconfig: enable UMS configuration 88/220488/3
Jaehoon Chung [Thu, 19 Dec 2019 00:53:45 +0000 (09:53 +0900)]
configs: rpi_4_32b_defconfig: enable UMS configuration

Enable UMS configuration.
It can be used to usb-mass storage.
Usage: U-Boot> ums 0 mmc 0
- Then you can see block device node on your local host.

It's useful to flash or format for using Tizen.

Change-Id: Ic3a27a69a03d05691f60e764990d33d8bfef2275
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
4 years agosamsung: tizen_rpi: fix typo about boot.scr.uimg 87/220487/3
Jaehoon Chung [Thu, 19 Dec 2019 00:44:18 +0000 (09:44 +0900)]
samsung: tizen_rpi: fix typo about boot.scr.uimg

Fix typo about boot.scr.uimg.
- s/boot.src.uimg/boot.scr.uimg

Change-Id: I656f8f856cc918ca0239e12a709662269f6c10c9
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
4 years agousb: dwc2: fix possible alignment issues 27/220427/2
Simon Goldschmidt [Thu, 21 Nov 2019 21:15:23 +0000 (22:15 +0100)]
usb: dwc2: fix possible alignment issues

Since upgrading to gcc9, warnings are issued:
"taking address of packed member of ‘...’ may result in an unaligned
pointer value"

Fix this by converting dwc2_fifo_read to use unaligned access since packed
structures may be on an unaligned address, depending on USB hardware.

Change-Id: I4d86812b06e8c16f3e1cc8fdbe03f26653ecdac5
Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
4 years agousb: composite: fix possible alignment issues 26/220426/2
Simon Goldschmidt [Thu, 21 Nov 2019 21:15:22 +0000 (22:15 +0100)]
usb: composite: fix possible alignment issues

Since upgrading to gcc9, warnings are issued:
"taking address of packed member of ‘...’ may result in an unaligned
pointer value"

Fix this by converting two functions to use unaligned access since packed
structures may be on an unaligned address, depending on USB hardware.

Change-Id: I3dd21a85f104b68b0af8af08425133f258758e56
Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
4 years agousb: composite: add BOS descriptor support to composite framework 25/220425/2
T Karthik Reddy [Mon, 14 Oct 2019 12:52:50 +0000 (14:52 +0200)]
usb: composite: add BOS descriptor support to composite framework

To add usb-3.0 support to peripheral device add BOS & SS capability
descriptors to gadget composite framework.

Change-Id: I34fde7525fd88b69eff7d6456b247d0d00ae1821
Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
4 years agoconfigs: tizen_rpi: add bcm2711-rpi-4-b.dtb in dfu information 43/220243/1
Jaehoon Chung [Mon, 16 Dec 2019 10:30:31 +0000 (19:30 +0900)]
configs: tizen_rpi: add bcm2711-rpi-4-b.dtb in dfu information

Add bcm2711-rpi-4-b.dtb in dfu information.
It's used when thor command is run.

Change-Id: I55c0397647457af94301007763b5732a28d20d42
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
4 years agoARM: defconfig: Fix 32bit config for RPi4 05/220205/1 accepted/tizen/unified/20191216.222255 submit/tizen/20191216.054629
Matthias Brugger [Thu, 5 Dec 2019 17:53:15 +0000 (18:53 +0100)]
ARM: defconfig: Fix 32bit config for RPi4

The rpi_4_32b_defconfig states that only one DRAM bank is present. This
leads to a wrong configuration of the available DRAM. Fix this by
setting the DRAM bank config accordingly.

Fixes: 193279d784 ("RPI: Add defconfigs for rpi4 (32/64)")

Change-Id: I067ba66d80f636d6a56dfb7a14e3ee8da78829d4
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
4 years agorpi: Enable DRAM bank initialization on arm64 04/220204/1
Matthias Brugger [Thu, 5 Dec 2019 17:53:14 +0000 (18:53 +0100)]
rpi: Enable DRAM bank initialization on arm64

Up to now we only update the DRAM banks when we are define
CONFIG_BCM2711. But our one binary approach uses a config that supports
BCM2837 and BCM2711. As a result we only see one gibibyte of RAM on
Raspberry Pi 4, even if it has more RAM.
Fix this by calling dram_init_banksize.

Fixes: 5694090670 ("ARM: defconfig: add unified config for RPi3 and RPi4")

Change-Id: Id7f3fec63777360d4536b836d98ad77f4b3a5a4e
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
4 years agorpi: fix dram bank initialization 03/220203/1
Matthias Brugger [Thu, 5 Dec 2019 17:53:13 +0000 (18:53 +0100)]
rpi: fix dram bank initialization

To update the dram bank information from device-tree we use
fdtdec_decode_ram_size() which expectes the the size-cells and
address-cells to be defined in the memory node. For normal system RAM
these values are defined in the root node. When the values differ from
the default values defined in the spec, we can end up with wrong RAM
bank information.

Switch to the "standard" way to update the RAM bank information to
avoid this.

Fixes: 9de5b89e4c ("rpi4: enable dram bank initialization")

Change-Id: I5c6148bf322d46aaff7e425b9ba9e3f84eef6f09
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
4 years agoboard: rpi: remove unnecessary #ifdef CONFIG_NO_TIZEN 02/220202/1
Jaehoon Chung [Mon, 16 Dec 2019 04:24:00 +0000 (13:24 +0900)]
board: rpi: remove unnecessary #ifdef CONFIG_NO_TIZEN

Remove #ifdef CONFIG_NO_TIZEN comment.

Change-Id: I0d125b66bc40f22f4a88ab7a41bfedeb5570ce4a
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
4 years agoARM: bcm283x: Set memory map at run-time 62/219662/1 accepted/tizen/unified/20191212.123635 submit/tizen/20191212.015755
Matthias Brugger [Tue, 19 Nov 2019 15:01:05 +0000 (16:01 +0100)]
ARM: bcm283x: Set memory map at run-time

For bcm283x based on arm64 we also have to change the mm_region.
Add assign this in mach_cpu_init() so we can create now one binary
for RPi3 and RPi4.

Change-Id: Ie81a14eaf99d114524cf2225f57706228613e43b
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
4 years agoARM: bcm283x: Set rpi_bcm283x_base at run-time 61/219661/1
Matthias Brugger [Tue, 19 Nov 2019 15:01:04 +0000 (16:01 +0100)]
ARM: bcm283x: Set rpi_bcm283x_base at run-time

As part of the effort to create one binary for several bcm83x SoCs
we read the IO base address from device-tree.

Change-Id: I9816b3576a4fd6637bbf11bb6aeb6fa3bb8de456
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
4 years agoARM: bcm283x: Move BCM283x_BASE to a global variable 60/219660/1
Matthias Brugger [Tue, 19 Nov 2019 15:01:03 +0000 (16:01 +0100)]
ARM: bcm283x: Move BCM283x_BASE to a global variable

We move the per SOC define BCM283x_BASE to a global variable.
This is a first step to provide a single binary for several bcm283x
SoCs.

Change-Id: If32915d693b26e9d3ddbbddbcac004140623afd0
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
4 years agorpi: push fw_dtb_pointer in the .data section 59/219659/1
Matthias Brugger [Tue, 19 Nov 2019 15:01:02 +0000 (16:01 +0100)]
rpi: push fw_dtb_pointer in the .data section

The fw_dtb_pointer was defined in the assembly code, which makes him
live in section .text_rest
Put that's not necessary, we can push the variable in the .data section.

This will prevent relocation errors like:
board/raspberrypi/rpi/rpi.c:317:(.text.board_get_usable_ram_top+0x8):
relocation truncated to fit: R_AARCH64_LDST64_ABS_LO12_NC against symbol
`fw_dtb_pointer' defined in .text section in board/raspberrypi/rpi/built-in.o

Change-Id: I16e0ca281c9dc9871d5fb9af23ddfc29f57e8f63
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
4 years agodrivers: bcm283x: Set pre-location flag for OF_BOARD 58/219658/1
Matthias Brugger [Fri, 8 Nov 2019 13:49:48 +0000 (14:49 +0100)]
drivers: bcm283x: Set pre-location flag for OF_BOARD

U-Boot support on Raspberry Pi 4 relies on the device-tree
provided by the firmware. The blob does not contain the
U-Boot specific pre-loc-rel properties. The result is, that
the U-Boot banner is not printed.

We fix this by setting the DM_FLAG_PRE_RELOC flag in the driver,
if we rely on a device-tree provided by the firmware.

Change-Id: I7b9d5958ba00643e1feb17a570d748f80e6e660a
Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
4 years agoarm: dts: bcm283x: Rename U-Boot file 57/219657/1
Matthias Brugger [Fri, 8 Nov 2019 13:49:47 +0000 (14:49 +0100)]
arm: dts: bcm283x: Rename U-Boot file

Rename the file bcm283x-uboot.dtsi so that it get
automatically include through the scripts/Makefile.lib
using $(CONFIG_SYS_SOC))-u-boot.dtsi

Without this uarts and pincontroller miss the property dm-pre-reloc
and the first call to bcm283x_mu_serial_ofdata_to_platdata() fails
as the pins are not set correctly.
As a result the U-Boot banner isn't shown on boot.

Before commmit
143256b353 ("fdt: update bcm283x device tree sources to Linux 5.1-rc6 state")
we included bcm283x-uboot.dtsi directly in the device-tree file.
Which got deleted by the metioned commit.
This is a much robuster solution.

Change-Id: Ife219ee0a0b24cb4a677d826b002f93946cc4ac4
Reported-by: Tom Rini <trini@konsulko.com>
Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Tested-by: Tom Rini <trini@konsulko.com> [RPi 3, 32b and 64b modes]
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
4 years agofdt: fix bcm283x dm-pre-reloc definitions 56/219656/1
Matthias Brugger [Fri, 8 Nov 2019 13:49:46 +0000 (14:49 +0100)]
fdt: fix bcm283x dm-pre-reloc definitions

In commmit
143256b353 ("fdt: update bcm283x device tree sources to Linux 5.1-rc6 state")
we deleted the label for the node soc from bcm283x.dtsi

As we don't need to add the property dm-pre-reloc to the soc node,
we can delete it from bcm283x-uboot.dtsi

Change-Id: I9ad615435e0c600a35df151e5cfde03d0abbcb95
Tested-by: Tom Rini <trini@konsulko.com> [RPi 3, 32b and 64b modes]
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
4 years agopinctrl: bcm283x: Add compatible for RPi4 55/219655/1
Matthias Brugger [Wed, 6 Nov 2019 14:28:25 +0000 (15:28 +0100)]
pinctrl: bcm283x: Add compatible for RPi4

The Raspberry Pi 4 upstream kernel device tree instroduces
a new compatible for the pinctroller. Add this to the driver
so that we can boot with the upstream kernel DT.

Change-Id: I650d150a37df0ebf654eed2bd289aa7b8a9ae807
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
4 years agoinclude: samsung: tizen_rpi: separate vc_mem base/size value 30/219430/1
Jaehoon Chung [Thu, 5 Dec 2019 00:28:35 +0000 (09:28 +0900)]
include: samsung: tizen_rpi: separate vc_mem base/size value

Separate vc_mem base/size value according to target.
RPI4 and RPI3 have different value about vc_mem base and size.

This value has been taken from raspbian kernel image.

Change-Id: I95274e2acab9e3ef6af90759d2141428b82f86a8
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
4 years agoscripts: tizen: sd_fusing: increase minor version information 66/218766/1
Jaehoon Chung [Thu, 28 Nov 2019 04:02:17 +0000 (13:02 +0900)]
scripts: tizen: sd_fusing: increase minor version information

Increase minor version information from 1.0. to 1.1.

Change-Id: I15612f6ecb73d77c58e5690e542d8e51af41257a
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
4 years agommc: exynos_dw_mmc: add tizen specific bind codes 11/218011/1 accepted/tizen/unified/20191118.234504 submit/tizen/20191118.215102
Jaehoon Chung [Mon, 18 Nov 2019 11:32:11 +0000 (20:32 +0900)]
mmc: exynos_dw_mmc: add tizen specific bind codes

Add tizen specific bind codes.
Device number is defined according to boot from SD or eMMC.

Change-Id: I05876b0600d2e19e2642fd46742183d0d8cbe5c4
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
4 years agosamsung: odroid: add CONFIG_TIZEN_XU3 config 10/218010/1
Jaehoon Chung [Mon, 18 Nov 2019 11:22:55 +0000 (20:22 +0900)]
samsung: odroid: add CONFIG_TIZEN_XU3 config

Add CONFIG_TIZEN_XU3 configuration.
And enable it to boot tizen specific boot.

Change-Id: I98c533a0d044ebc017fb59a00d98c32ef6af2047
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
4 years agoscripts: tizen: sd_fusing_xu4: Fix start position of extended partitions 68/217968/1
Seung-Woo Kim [Mon, 18 Nov 2019 05:45:46 +0000 (14:45 +0900)]
scripts: tizen: sd_fusing_xu4: Fix start position of extended partitions

Older version sfdisk than 2.26 does not align the start and end
of partitions to block, and it breaks the size of paritions less
than requested. Fix start position of extended partitions by
calculation to guarantee the requested size.

Change-Id: I2e5a6c72550f71f213c2d7352b537c1b12d13670
Ref: http://man7.org/linux/man-pages/man8/sfdisk.8.html
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
4 years agoscripts: tizen: sd_fusing_rpi3: Fix start position of extended partitions 02/217902/2
Seung-Woo Kim [Fri, 15 Nov 2019 10:46:40 +0000 (19:46 +0900)]
scripts: tizen: sd_fusing_rpi3: Fix start position of extended partitions

Older version sfdisk than 2.26 does not align the start and end
of partitions to block, and it breaks the size of paritions less
than requested. Fix start position of extended partitions by
calculation to guarantee the requested size.

Change-Id: I6d5bae06e4cd871075259d406d349c4ac63fab40
Ref: http://man7.org/linux/man-pages/man8/sfdisk.8.html
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
4 years agosamsung: tizen_rpi: change rebootparam address 31/217931/1
Jaehoon Chung [Sun, 17 Nov 2019 23:52:42 +0000 (08:52 +0900)]
samsung: tizen_rpi: change rebootparam address

Change rebootparam address from 0x02700000 to 0x02100000.
0x02700000 is used as ramdisk_addr_r.

Change-Id: Iee69f582b44cbcf7cbcd9c29c5b2bd0efbaf349c
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
5 years agorpi: tizen-boot: rpi4-32b; sync boot script with rpi3-32b 84/217484/1 accepted/tizen/unified/20191112.125059 submit/tizen/20191112.094942
Jaehoon Chung [Tue, 12 Nov 2019 05:35:18 +0000 (14:35 +0900)]
rpi: tizen-boot: rpi4-32b; sync boot script with rpi3-32b

Sync boot script with rpi3-32b.
It's fixed wrong statement and condition check.

Change-Id: I3179f1fa9909443bbe8b1711232396f042228877
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
5 years agorpi: tizen-boot: rpi3-32b: Enable custom network configuration 08/217408/1 accepted/tizen/unified/20191111.105607 submit/tizen/20191111.082427
Dongwoo Lee [Fri, 3 May 2019 06:08:01 +0000 (15:08 +0900)]
rpi: tizen-boot: rpi3-32b: Enable custom network configuration

To apply custom network configuration, this patch adds ip_opt to
bootcmd.

Fixes: 653d68709c27 ("rpi: tizen-boot: rpi3-32b: pass network arguments on flash mode")
Change-Id: I42d113f2c1591d62602128bc2e75a464d7cefebc
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
5 years agorpi: tizen-boot: rpi3-32b: support to enter the flash mode with command 07/217407/1
Seung-Woo Kim [Mon, 29 Apr 2019 06:25:36 +0000 (15:25 +0900)]
rpi: tizen-boot: rpi3-32b: support to enter the flash mode with command

Support to enter the flash mode with command.

- Refer to below command:
U-boot> run tfm

Note: this applies, to rpi3-32b from rpi3, the commit cf212f48a110
("config: tizen_rpi: support to enter the flash mode with command").

Change-Id: I3a801aed172557385abd8651c811708f1f27feec
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
5 years agorpi: tizen-boot: rpi3-32b: pass network arguments on flash mode 06/217406/1
Seung-Woo Kim [Mon, 29 Apr 2019 06:23:27 +0000 (15:23 +0900)]
rpi: tizen-boot: rpi3-32b: pass network arguments on flash mode

To setup network environment for flash manager, this patch makes
passing parameters such as 'ipaddr', 'netmask', and 'gateway' through
kernel bootcmd. Those parameters can be assigned by user-self before
using flash mode.

Note: this is applying below patches from rpi3 to rpi3-32b:
f6f75b5bb37d ("rpi: tizen-boot: rpi3: pass network arguments on flash mode")
e2e0f18b9f3e ("rpi: tizen-boot: rpi3: remove dhcp as default network configuration")

Change-Id: I8de2c8f26f0a5c276ac32e46a83d8fc71eb1e7fd
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
5 years agorpi: tizen-boot: rpi3-32b: fix to use setenv for bootmode 05/217405/1
Seung-Woo Kim [Mon, 29 Apr 2019 06:16:53 +0000 (15:16 +0900)]
rpi: tizen-boot: rpi3-32b: fix to use setenv for bootmode

Fix to use setenv for bootmode instead of assignment for remaining
part from the commit 5c008029d782 ("config: tizen_rpi: move env
values from boot script to tizen_rpi.h").

Change-Id: I2ae5d58706bc1e5a8c39ee2952bf3ca2355054ec
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
5 years agoconfigs: rpi: remove lcd from console output 65/217365/2 accepted/tizen/unified/20191111.070008 accepted/tizen/unified/20191111.091228 submit/tizen/20191111.033315 submit/tizen/20191111.075256
Seung-Woo Kim [Mon, 11 Nov 2019 02:36:50 +0000 (11:36 +0900)]
configs: rpi: remove lcd from console output

From RPI3, log printing to lcd video console causes slow down of
uart rx getc called and fifo overrun occured from uart rx because
rpi3 mini uart has small h/w fifo. Remove lcd from console output.

It's changed from lcd to videoconsole.

Change-Id: I1d96ceab2ee796b4757032400c659fe40ab2f08d
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
5 years agopackaging: u-boot: remove u-boot-tools package 32/217232/1
Seung-Woo Kim [Fri, 8 Nov 2019 01:48:55 +0000 (10:48 +0900)]
packaging: u-boot: remove u-boot-tools package

Remove u-boot-tools package in u-boot.spec. For armv7l, The
u-boot-tools rpm is also building from u-boot-rpi3-32b.spec, so
no need duplicated packaging.

Change-Id: I7280e3add4079c66e1c8340f739b067427e49a58
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
5 years agopackaging: u-boot-xu3: remove u-boot-tools package
Jaehoon Chung [Thu, 7 Nov 2019 21:28:25 +0000 (06:28 +0900)]
packaging: u-boot-xu3: remove u-boot-tools package

Remove u-boot-tools package in u-boot-xu3.spec.
u-boot-tools is also building from u-boot-rpi3-32b.spec.
So it's created duplicated rpm on download.tizen.org.
- u-boot-tools-2019.10-38.1.armv7l.rpm
- u-boot-tools-2019.10-39.1.armv7l.rpm

Change-Id: I5c1e83935d4c37f8bff3f2bcf53283b3a7cc116c
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
5 years agoconfigs: rpi_4_32b_defconfig: enable memory fixup configuration 96/217196/2
Jaehoon Chung [Thu, 7 Nov 2019 09:56:22 +0000 (18:56 +0900)]
configs: rpi_4_32b_defconfig: enable memory fixup configuration

Enable Memory fixup configuration.
It's fixup memory during jump to kernel.

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