platform/kernel/u-boot.git
2 years agoconfigs: am64x_evm_a53_defconfig: Move TF-A load address to 0x701c0000
Aswath Govindraju [Wed, 16 Jun 2021 16:38:20 +0000 (22:08 +0530)]
configs: am64x_evm_a53_defconfig: Move TF-A load address to 0x701c0000

Earlier, the region 0x701c0000 to 0x701dffff was firewalled off because of
a bug in SYSFW. In the v2021.05 release of SYSFW this bug has been fixed
and this region can now be used for other allocations.

Therefore, move TF-A's load address to 0x701c0000 and update its location
in the device tree node. Also, increase the size allocated for TF-A to
account for future expansions.

Fixes: defd62ca137b ("arm: dts: k3-am64-main: Update the location of ATF in SRAM and increase its max size")
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Suman Anna <s-anna@ti.com>
Link: https://lore.kernel.org/r/20210616163821.20457-2-a-govindraju@ti.com
2 years agoti: am335x_evm: Switch to DISTRO_BOOT only
Tom Rini [Thu, 10 Jun 2021 23:01:47 +0000 (19:01 -0400)]
ti: am335x_evm: Switch to DISTRO_BOOT only

Remove the environment support for various legacy boot methods.  With
this, we will now default to booting any distribution that follows the
generic distro boot framework and no longer attempt to boot various
legacy (to this SoC) scripts/etc.

Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Link: https://lore.kernel.org/r/20210610230147.22475-1-trini@konsulko.com
2 years agoconfigs: am335x_guardian: add register maps support
Gireesh Hiremath [Fri, 11 Jun 2021 16:13:50 +0000 (16:13 +0000)]
configs: am335x_guardian: add register maps support

add support to direct memory access of hardware peripherals registers

Signed-off-by: Gireesh Hiremath <Gireesh.Hiremath@in.bosch.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Link: https://lore.kernel.org/r/20210611161350.2141-19-Gireesh.Hiremath@in.bosch.com
2 years agoconfigs: am335x_guardian: Enable bootcount nvmem support
Gireesh Hiremath [Fri, 11 Jun 2021 16:13:49 +0000 (16:13 +0000)]
configs: am335x_guardian: Enable bootcount nvmem support

include bootcount nvmem support

Signed-off-by: Gireesh Hiremath <Gireesh.Hiremath@in.bosch.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Link: https://lore.kernel.org/r/20210611161350.2141-18-Gireesh.Hiremath@in.bosch.com
2 years agoam335x, guardian: software update available status is stored in AM3352 RTC scracth...
Gireesh Hiremath [Fri, 11 Jun 2021 16:13:48 +0000 (16:13 +0000)]
am335x, guardian: software update available status is stored in AM3352 RTC scracth register

RTC second scratch register[32-bit]:
  -zero byte hold boot count value
  -first byte hold update available state
  -second byte hold version
  -third byte hold magic number

Signed-off-by: Gireesh Hiremath <Gireesh.Hiremath@in.bosch.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Link: https://lore.kernel.org/r/20210611161350.2141-17-Gireesh.Hiremath@in.bosch.com
Gbp-Pq: Topic apertis/guardian
Gbp-Pq: Name am335x-guardian-software-update-available-status-is-store.patch

2 years agoam335x, guardian: Enable panel driver Himax HX8238D
Gireesh Hiremath [Fri, 11 Jun 2021 16:13:47 +0000 (16:13 +0000)]
am335x, guardian: Enable panel driver Himax HX8238D

- Enable lcd controller
- Display splash screen

Signed-off-by: Gireesh Hiremath <Gireesh.Hiremath@in.bosch.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Link: https://lore.kernel.org/r/20210611161350.2141-16-Gireesh.Hiremath@in.bosch.com
2 years agodrivers: video: hx8238 fix build bug
Gireesh Hiremath [Fri, 11 Jun 2021 16:13:46 +0000 (16:13 +0000)]
drivers: video: hx8238 fix build bug

update panel driver hx8238
fix build bug

Signed-off-by: Gireesh Hiremath <Gireesh.Hiremath@in.bosch.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Link: https://lore.kernel.org/r/20210611161350.2141-15-Gireesh.Hiremath@in.bosch.com
2 years agoconfigs: am335x_guardian: Enable display config
Gireesh Hiremath [Fri, 11 Jun 2021 16:13:45 +0000 (16:13 +0000)]
configs: am335x_guardian: Enable display config

-Enable configuration for display driver
-Disable support for SPL GPIO, CMD LED & SPL GPIO

Signed-off-by: Gireesh Hiremath <Gireesh.Hiremath@in.bosch.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Link: https://lore.kernel.org/r/20210611161350.2141-14-Gireesh.Hiremath@in.bosch.com
2 years agoam335x, guardian: Enable backlight
Gireesh Hiremath [Fri, 11 Jun 2021 16:13:44 +0000 (16:13 +0000)]
am335x, guardian: Enable backlight

Enable backlight, set brightness value and dimming frequency

Signed-off-by: Gireesh Hiremath <Gireesh.Hiremath@in.bosch.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Link: https://lore.kernel.org/r/20210611161350.2141-13-Gireesh.Hiremath@in.bosch.com
2 years agoam335x, guardian: update swi logic
Gireesh Hiremath [Fri, 11 Jun 2021 16:13:43 +0000 (16:13 +0000)]
am335x, guardian: update swi logic

read boot mode gpio and set the swi status

Signed-off-by: Gireesh Hiremath <Gireesh.Hiremath@in.bosch.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Link: https://lore.kernel.org/r/20210611161350.2141-12-Gireesh.Hiremath@in.bosch.com
2 years agoconfigs: am335x_guardian: disable spl command
Gireesh Hiremath [Fri, 11 Jun 2021 16:13:42 +0000 (16:13 +0000)]
configs: am335x_guardian: disable spl command

- disable support for spl command

Signed-off-by: Gireesh Hiremath <Gireesh.Hiremath@in.bosch.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Link: https://lore.kernel.org/r/20210611161350.2141-11-Gireesh.Hiremath@in.bosch.com
2 years agoconfigs: am335x_guardian: set boot delay
Gireesh Hiremath [Fri, 11 Jun 2021 16:13:41 +0000 (16:13 +0000)]
configs: am335x_guardian: set boot delay

- set boot delay to zero, to increase boot speed

Signed-off-by: Gireesh Hiremath <Gireesh.Hiremath@in.bosch.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Link: https://lore.kernel.org/r/20210611161350.2141-10-Gireesh.Hiremath@in.bosch.com
2 years agoam335x, guardian: code cleanup and boot optimization
Gireesh Hiremath [Fri, 11 Jun 2021 16:13:40 +0000 (16:13 +0000)]
am335x, guardian: code cleanup and boot optimization

- remove redundant headers and boot modes from board file

Signed-off-by: Gireesh Hiremath <Gireesh.Hiremath@in.bosch.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Link: https://lore.kernel.org/r/20210611161350.2141-9-Gireesh.Hiremath@in.bosch.com
2 years agoam335x, guardian: set environment variable autoload to no
Gireesh Hiremath [Fri, 11 Jun 2021 16:13:39 +0000 (16:13 +0000)]
am335x, guardian: set environment variable autoload to no

autoload: if set to "no" then rarpb, bootp or dhcp commands will
just perform a configuration lookup from the BOOTP / DHCP server,
but not try to load any image using TFTP

Signed-off-by: Gireesh Hiremath <Gireesh.Hiremath@in.bosch.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Link: https://lore.kernel.org/r/20210611161350.2141-8-Gireesh.Hiremath@in.bosch.com
2 years agoam335x, guardian: Update pinmux configuration
Moses Christopher [Fri, 11 Jun 2021 16:13:38 +0000 (16:13 +0000)]
am335x, guardian: Update pinmux configuration

pinmux update for guardian board
- control ASP Board Power: GPIO, on/off ASP Board Power
- control Coincell Voltage Measurement: GPIO, enable/disable
  ADC measurements
- powerOff Device GPIO-PowerOff, cut the PMIC supply

Signed-off-by: Moses Christopher <BollavarapuMoses.Christopher@in.bosch.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Link: https://lore.kernel.org/r/20210611161350.2141-7-Gireesh.Hiremath@in.bosch.com
2 years agoconfigs: am335x_guardian: add memtest configs
Gireesh Hiremath [Fri, 11 Jun 2021 16:13:37 +0000 (16:13 +0000)]
configs: am335x_guardian: add memtest configs

- Add mtest, meminfo commands

Signed-off-by: Gireesh Hiremath <Gireesh.Hiremath@in.bosch.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Link: https://lore.kernel.org/r/20210611161350.2141-6-Gireesh.Hiremath@in.bosch.com
2 years agoam335x, guardian: set tftp_load_addr in environment
Moses Christopher [Fri, 11 Jun 2021 16:13:36 +0000 (16:13 +0000)]
am335x, guardian: set tftp_load_addr in environment

Set tftp_load_addr to 0x82000000 in MEM_LAYOUT_ENV_SETTINGS

Signed-off-by: Moses Christopher <BollavarapuMoses.Christopher@in.bosch.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Link: https://lore.kernel.org/r/20210611161350.2141-5-Gireesh.Hiremath@in.bosch.com
2 years agoconfigs: am335x_guardian: add ubi fastmap support
Gireesh Hiremath [Fri, 11 Jun 2021 16:13:35 +0000 (16:13 +0000)]
configs: am335x_guardian: add ubi fastmap support

- Trigger fastmap automatically

Signed-off-by: Gireesh Hiremath <Gireesh.Hiremath@in.bosch.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Link: https://lore.kernel.org/r/20210611161350.2141-4-Gireesh.Hiremath@in.bosch.com
2 years agoam335x, guardian: mem: Add board dependent mem values
Moses Christopher [Fri, 11 Jun 2021 16:13:34 +0000 (16:13 +0000)]
am335x, guardian: mem: Add board dependent mem values

  - Add mem-guardian.h derived from am33xx/mem.h

    * Add GPMC config values optimized for Bosch Guardian Board
    * NAND Chip used by Bosch Guardian Board is Micron MT29F4G08ABBFA

Signed-off-by: Moses Christopher <BollavarapuMoses.Christopher@in.bosch.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Link: https://lore.kernel.org/r/20210611161350.2141-3-Gireesh.Hiremath@in.bosch.com
2 years agoconfigs: am335x_guardian: Enable clock driver
Gireesh Hiremath [Fri, 11 Jun 2021 16:13:33 +0000 (16:13 +0000)]
configs: am335x_guardian: Enable clock driver

Enable TI clock driver support for guardian board

Signed-off-by: Gireesh Hiremath <Gireesh.Hiremath@in.bosch.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Link: https://lore.kernel.org/r/20210611161350.2141-2-Gireesh.Hiremath@in.bosch.com
2 years agoMerge branch '2021-07-14-build-and-host-updates'
Tom Rini [Thu, 15 Jul 2021 00:10:34 +0000 (20:10 -0400)]
Merge branch '2021-07-14-build-and-host-updates'

- Resync Kbuild with the v4.20 Linux Kernel release
- Update checkpatch.pl
- Assorted other tooling updates

2 years agoscripts/get_default_envs.sh: Update for thin archive support
Tom Rini [Mon, 21 Jun 2021 20:14:18 +0000 (16:14 -0400)]
scripts/get_default_envs.sh: Update for thin archive support

This script was broken by the change to default archives for linking.
This is due to objcopy specifically disallowing copying of thin
archives.  To fix this and re-support external users of this script,
switch to using the same logic the u-boot-initial-env make target uses
to dump the section from the object file.

Reported-by: Jan Kiszka <jan.kiszka@web.de>
Fixes: 958f2e57eff7 ("build: use thin archives instead of incremental linking")
Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoMakefile: Conditionally add defaultenv_h to envtools target
Joel Stanley [Fri, 18 Jun 2021 02:05:59 +0000 (11:35 +0930)]
Makefile: Conditionally add defaultenv_h to envtools target

When building the envtools target with CONFIG_USE_DEFAULT_ENV_FILE=y,
the tools require generated/defaultenv_autogenerated.h.

 In file included from tools/env/fw_env.c:126:
 include/env_default.h:115:10: fatal error: generated/defaultenv_autogenerated.h: No such file or directory
   115 | #include "generated/defaultenv_autogenerated.h"
       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Joel Stanley <joel@jms.id.au>
2 years agokconfig / kbuild: Re-sync with Linux 4.20
Tom Rini [Thu, 17 Jun 2021 22:07:25 +0000 (18:07 -0400)]
kconfig / kbuild: Re-sync with Linux 4.20

Align Kconfig and Kbuild logic to Linux 4.20 release with minimal impact
on files outside of this scope.

Our previous Kconfig sync was done by commit 587e4a429698 ("kconfig /
kbuild: Re-sync with Linux 4.19").

As part of this re-sync, a few related changes from previous Linux
releases were found to have been missed and merged in, and are not in
the following list.

The imported Linux commits are:

[From prior to v4.19]
b1e0d8b70fa3 kbuild: Fix gcc -x syntax
a4353898980c kconfig: add CC_IS_GCC and GCC_VERSION
469cb7376c06 kconfig: add CC_IS_CLANG and CLANG_VERSION

[From v4.19 to v4.20]
487c7c7702ab kbuild: prefix Makefile.dtbinst path with $(srctree) unconditionally
0d91bf584fe5 kbuild: remove old check for CFLAGS use
25815cf5ffec kbuild: hide most of targets when running config or mixed targets
00d78ab2ba75 kbuild: remove dead code in cmd_files calculation in top Makefile
23066c3f4e21 Compiler Attributes: enable -Wstringop-truncation on W=1 (gcc >= 8)
37c8a5fafa3b kbuild: consolidate Devicetree dtb build rules
80463f1b7bf9 kbuild: add --include-dir flag only for out-of-tree build
77ec0c20c7e0 kbuild: remove VERSION and PATCHLEVEL from $(objtree)/Makefile
74bc0c09b2da kbuild: remove user ID check in scripts/mkmakefile
4fd61277f662 kbuild: do not pass $(objtree) to scripts/mkmakefile
80d0dda3a4e5 kbuild: simplify command line creation in scripts/mkmakefile
fb073a4b473e kbuild: add -Wno-pointer-sign flag unconditionally
9df3e7a7d7d6 kbuild: add -Wno-unused-but-set-variable flag unconditionally
69ea912fda74 kbuild: remove unneeded link_multi_deps
7d0ea2524202 kbuild: use 'else ifeq' for checksrc to improve readability
04c459d20448 kconfig: remove oldnoconfig target
0085b4191f3e kconfig: remove silentoldconfig target
3f80babd9ca4 kbuild: remove unused cc-fullversion variable
2cd3faf87d2d merge_config.sh: Allow to define config prefix
076f421da5d4 kbuild: replace cc-name test with CONFIG_CC_IS_CLANG
6bbe4385d035 kconfig: merge_config: avoid false positive matches from comment lines

[From post v4.20]
885480b08469 Makefile: Move -Wno-unused-but-set-variable out of GCC only block

There are a number of changes related to additional warnings as well as
being able to drop cc-name entirely that have been omitted for now as
additional work is required first.

Cc: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoget_maintainer.pl: update from Linux kernel v5.13-rc6
Trevor Woerner [Tue, 15 Jun 2021 07:30:29 +0000 (03:30 -0400)]
get_maintainer.pl: update from Linux kernel v5.13-rc6

Update U-Boot's version of scripts/get_maintainer.pl to sync it up with the
latest changes to the Linux kernel's version of the same script.

The last sync was with Linux kernel version v4.16. The commits to the kernel's
get_maintainer.pl since then (starting with the most recent) are:

6343f6b71f83 get_maintainer: exclude MAINTAINERS file(s) from --git-fallback
cdfe2d220476 get_maintainer: add test for file in VCS
e33c9fe8b80c get_maintainer: fix unexpected behavior for path/to//file (double slashes)
0c78c0137621 get_maintainer: add email addresses from .yaml files
0ef82fcefb99 scripts/get_maintainer.pl: deprioritize old Fixes: addresses
ef0c08192ac0 get_maintainer: remove uses of P: for maintainer name
2f5bd343694e scripts/get_maintainer.pl: add signatures from Fixes: <badcommit> lines in commit message
49662503e8e4 get_maintainer: add ability to skip moderated mailing lists
0fbd75fd7fee get_maintainer: allow option --mpath <directory> to read all files in <directory>
5f0baf95b1ed get_maintainer.pl: add -mpath=<path or file> for MAINTAINERS file location
31bb82c9caa9 get_maintainer: allow usage outside of kernel tree
0455c74788fd get_maintainer: improve patch recognition
882ea1d64eb3 scripts: use SPDX tag in get_maintainer and checkpatch

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2 years agolib: move rtc-lib.c to lib
Heinrich Schuchardt [Sat, 12 Jun 2021 11:20:07 +0000 (13:20 +0200)]
lib: move rtc-lib.c to lib

Function rtc_to_tm() is needed for FAT file system support even if we don't
have a real time clock. So move it from drivers/ to lib/.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2 years agotools: image-host: fix wrong return value
Ming Liu [Mon, 31 May 2021 07:04:51 +0000 (09:04 +0200)]
tools: image-host: fix wrong return value

The return value '-ENOSPC' of fit_set_timestamp function does not match
the caller fit_image_write_sig's expection which is '-FDT_ERR_NOSPACE'.

Fix it by not calling fit_set_timestamp, but call fdt_setprop instead.

This fixes a following mkimage error:
| Can't write signature for 'signature@1' signature node in
| 'conf@imx6ull-colibri-wifi-eval-v3.dtb' conf node: <unknown error>
| mkimage Can't add hashes to FIT blob: -1

Signed-off-by: Ming Liu <liu.ming50@gmail.com>
Tested-by: Igor Opaniuk <igor.opaniuk@foundries.io>
2 years agotools/fitimage: add missing linebreak for some messages
Sven Roederer [Tue, 25 May 2021 21:15:27 +0000 (23:15 +0200)]
tools/fitimage: add missing linebreak for some messages

Add a linebreak to two messages and fix punctuation.

Signed-off-by: Sven Roederer <devel-sven@geroedel.de>
2 years agofixdep: remove leftover handling of IS_BUILTIN/IS_MODULE
Rasmus Villemoes [Thu, 20 May 2021 10:32:17 +0000 (12:32 +0200)]
fixdep: remove leftover handling of IS_BUILTIN/IS_MODULE

I removed CONFIG_IS_BUILTIN and CONFIG_IS_MODULE in commit
7d78a4547d ("linux/kconfig.h: remove unused helper macros"), but
fixdep.c still looks for those. It's harmless, but also pointless and
possibly confusing to a future reader.

Fixes: 7d78a4547d ("linux/kconfig.h: remove unused helper macros")
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2 years agomkimage: allow -l to work on block devices on Linux
Yann Dirson [Tue, 18 May 2021 08:59:04 +0000 (10:59 +0200)]
mkimage: allow -l to work on block devices on Linux

When "mkimage -l" was run on a block device it would fail with
erroneous message, because fstat reports a size of zero for those:

 mkimage: Bad size: "/dev/sdb4" is not valid image

This patch identifies the "is a block device" case and reports it as
such, and if it knows how to determine the size of a block device on
the current OS, proceeds.

As shown in
http://www.mit.edu/afs.new/sipb/user/tytso/e2fsprogs/lib/blkid/getsize.c
this is no portable task, and I only handled the case of a modern
Linux kernel, which is what I can test.

Signed-off-by: Yann Dirson <yann@blade-group.com>
2 years agoMerge branch '2021-07-14-platform-updates'
Tom Rini [Wed, 14 Jul 2021 20:48:23 +0000 (16:48 -0400)]
Merge branch '2021-07-14-platform-updates'

- Assorted platform updates

2 years agousb: musb-new: Add glue driver for ST-Ericsson Ux500
Stephan Gerhold [Thu, 8 Jul 2021 18:33:50 +0000 (20:33 +0200)]
usb: musb-new: Add glue driver for ST-Ericsson Ux500

The ST-Ericsson DB8500 SoC contains a MUSB OTG controller which
supports both host and gadget mode. For some reason there is
nothing special about it - add a simple glue driver for Ux500
that literally just sets up MUSB together with a generic PHY.
There are no SoC-specific registers etc needed to make USB work.

The new Ux500 glue driver is only tested to work with DM_USB
and DM_USB_GADGET. Both host and gadget mode work fine on
the u8500 "stemmy" board that is already present in U-Boot.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
2 years agophy: Add driver for ST-Ericsson AB8500 USB PHY
Stephan Gerhold [Thu, 8 Jul 2021 18:33:49 +0000 (20:33 +0200)]
phy: Add driver for ST-Ericsson AB8500 USB PHY

The AB8500 PMIC contains an USB PHY that needs to be set up in
device or host mode to make USB work properly. Add a simple driver
for the generic PHY uclass that allows enabling it.

The if (CONFIG_IS_ENABLED(USB_MUSB_HOST)) might be a bit strange.
The USB PHY must be configured in either host or device mode and
somehow the USB PHY driver must be made aware of the mode.

Actually, the MUSB driver used together with this PHY does not
support dynamic selection of host/device mode in U-Boot at the moment.
Therefore, one very simple approach that works fine is to select
the mode to configure at compile time. When the MUSB driver is
configured in host mode the PHY is configured in host mode, and
similarly when the MUSB driver is configured in device/gadget mode.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2 years agopower: pmic: Add driver for ST-Ericsson AB8500 via PRCMU
Stephan Gerhold [Thu, 8 Jul 2021 18:33:48 +0000 (20:33 +0200)]
power: pmic: Add driver for ST-Ericsson AB8500 via PRCMU

All devices based on ST-Ericsson Ux500 use a PMIC similar to AB8500
(Analog Baseband). There is AB8500, AB8505, AB9540 and AB8540
although in practice only AB8500 and AB8505 are relevant since the
platforms with AB9540 and AB8540 were cancelled and never used in
production.

In general, the AB8500 PMIC uses I2C as control interface, where the
different register banks are represented as separate I2C devices.
However, in practice AB8500 is always connected to a special I2C bus
on the DB8500 SoC that is controlled by the power/reset/clock
management unit (PRCMU) firmware.

Add a simple driver that allows reading/writing registers of the
AB8500 PMIC. The driver directly accesses registers from the PRCMU
parent device (represented by syscon in U-Boot). Abstracting it
further (e.g. with the i2c uclass) would not provide any advantage
because the PRCMU I2C bus is always just connected to AB8500 and
vice-versa.

The ab8500.h header is mostly taken as-is from Linux (with some
minor adjustments) to allow using similar code in both Linux and
U-Boot.

Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
2 years agoboard: stemmy: Copy atags for booting downstream/vendor kernel
Stephan Gerhold [Wed, 7 Jul 2021 10:58:55 +0000 (12:58 +0200)]
board: stemmy: Copy atags for booting downstream/vendor kernel

The U-Boot "stemmy" board is mainly intended to simplify booting
mainline Linux on various smartphones from Samsung based on ST-Ericsson
Ux500. While the mainline kernel is working great, there are still some
features missing there. In particular, it is currently not possible to
charge the battery when using the mainline kernel.

This means that it is still necessary to boot the downstream/vendor
kernel from Samsung sometimes to charge the device. That kernel is
ancient, still uses board files + ATAGS instead of device trees and
relies on a strange very long kernel command line hardcoded in the
Samsung bootloader.

Actually, since mainline is booted with device trees there is a very
simple way to make the old downstream kernel work as well: We can
simply take most of the ATAGS passed to U-Boot from the Samsung
bootloader and copy them as-is when booting a kernel without device
tree. That way the long command line and other needed ATAGS are copied
as-is without having to bother with them.

The only exception is the ATAG_INITRD - since the initrd is loaded
by U-Boot, the atag for that should be generated in U-Boot so it points
to the correct address. All other ATAGS are copied as-is and not
generated in U-Boot.

Also use the chance and provide a serial# for U-Boot by parsing the
ATAG_SERIAL that is also passed by the Samsung bootloader.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
2 years agoboard: stemmy: Parse atags to get available memory
Stephan Gerhold [Wed, 7 Jul 2021 10:58:54 +0000 (12:58 +0200)]
board: stemmy: Parse atags to get available memory

At the moment the "stemmy" board attempts to detect the RAM size with
a simple memory test (get_ram_size()). Unfortunately, this does not work
correctly for devices with 768 MiB RAM (e.g. Samsung Galaxy Ace 2
(GT-I8160), "codina"). Reading/writing memory after the 768 MiB RAM
succeeds but actually overwrites some earlier parts of the memory.

For U-Boot this does not result in any major problems, but on Linux
this will eventually lead to strange crashes because of the memory
corruption.

Since the "stemmy" U-Boot port is designed to be chainloaded from
the original Samsung bootloader, the most reliable way to get the
available amount of RAM is to look at the ATAGS passed by the Samsung
bootloader. Fortunately, the header used to generate ATAGS in U-Boot
(asm/setup.h) can also be easily used to parse them.

Also clarify and simplify stemmy.h a bit to make it more clear where
some of the magic values in there are actually coming from.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
2 years agoARM: dts: uniphier: Add support for Akebi96
Kunihiko Hayashi [Tue, 6 Jul 2021 10:01:11 +0000 (19:01 +0900)]
ARM: dts: uniphier: Add support for Akebi96

Add the device tree for Akebi96. Akebi96 is a 96boards certified
development board based on UniPhier LD20.
( https://www.96boards.org/product/akebi96/ )

Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
2 years agoconfigs: uniphier: Enable CONFIG_SYS_PCI_64BIT
Kunihiko Hayashi [Tue, 6 Jul 2021 10:01:10 +0000 (19:01 +0900)]
configs: uniphier: Enable CONFIG_SYS_PCI_64BIT

Enable CONFIG_SYS_PCI_64BIT to allow 64bit access to PCI space.

Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
2 years agopci: uniphier: Add UniPhier PCIe controller driver
Kunihiko Hayashi [Tue, 6 Jul 2021 10:01:09 +0000 (19:01 +0900)]
pci: uniphier: Add UniPhier PCIe controller driver

Add PCIe driver for UniPhier SoCs. This PCIe controller is based on
Synopsys DesignWare Core IP.

This version doesn't apply common DW functions because supported
controller doesn't have unroll version of iATU.

Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
2 years agophy: socionext: Add UniPhier PCIe PHY driver
Kunihiko Hayashi [Tue, 6 Jul 2021 10:01:08 +0000 (19:01 +0900)]
phy: socionext: Add UniPhier PCIe PHY driver

Add PCIe PHY driver support for Pro5, LD20 and PXs3 SoCs.

Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
2 years agoreset: uniphier: Add PCIe reset entry
Kunihiko Hayashi [Tue, 6 Jul 2021 10:01:07 +0000 (19:01 +0900)]
reset: uniphier: Add PCIe reset entry

Add reset control for PCIe controller on each SoC.

Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
2 years agoclk: uniphier: Add PCIe clock entry
Kunihiko Hayashi [Tue, 6 Jul 2021 10:01:06 +0000 (19:01 +0900)]
clk: uniphier: Add PCIe clock entry

Add clock control for PCIe controller on each SoC.

Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
2 years agoMAINTAINERS, git-mailrc: socfpga: Change co-maintainer to Tien Fong Chee
Ley Foon Tan [Tue, 6 Jul 2021 02:20:27 +0000 (10:20 +0800)]
MAINTAINERS, git-mailrc: socfpga: Change co-maintainer to Tien Fong Chee

I'm no longer work in Intel, change Intel SoCFPGA co-maintainer to
Tien Fong Chee.

Signed-off-by: Ley Foon Tan <lftan.linux@gmail.com>
Acked-by: Marek Vasut <marex@denx.de>
2 years agoarm: mach-snapdragon: pinctrl: Place pin_name in .data section
Stephan Gerhold [Mon, 5 Jul 2021 12:18:47 +0000 (14:18 +0200)]
arm: mach-snapdragon: pinctrl: Place pin_name in .data section

According to arch/arm/lib/crt0_64.S, the BSS section is "UNAVAILABLE"
and uninitialized before relocation. Also, it overlaps with the
appended DTB before relocation, so writing data into a variable
in the BSS section might corrupt the appended DTB.

Unfortunately, pinctrl-apq8016.c and pinctrl-apq8096.c do place the
"pin_name" variable in the BSS section (since it's uninitialized).
It's also used before relocation, when setting up the pinctrl for
the serial driver.

On DB410c this causes "GPIO_5" to be written into some part of an
appended DTB, e.g.:

80111820edfe0dd0 9f100000 38000000 c00e0000    ...........8....
8011183028000000 11000000 10000000 00000000    ...(............
801118404f495047 8800355f 00000000 00000000    GPIO_5..........
8011185000000000 00000000 01000000 00000000    ................
8011186003000000 04000000 00000000 02000000    ................
8011187003000000 04000000 0f000000 02000000    ................
8011188003000000 2d000000 1b000000 6c617551    .......-....Qual
801118906d6d6f63 63655420 6c6f6e68 6569676f    comm Technologie

Depending on the part of the DTB that is corrupted this might not
cause any problems, but it can also result in strange reboots
without any serial output.

Fortunately, in practice this does not cause issues on DB410c yet
because board_fdt_blob_setup() in dragonboard410c.c currently
overrides the appended DTB with the one passed by the previous
bootloader (LK) (which does not get corrupted).

DB820c does not have board_fdt_blob_setup() so I would expect it to
be affected by this problem. Perhaps everyone was just fortunate to
not compile an U-Boot configuration where the pin_name corrupts an
important part of the DTB.

Make sure "pin_name" is explicitly placed in the .data section
instead of .bss to fix this.

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agoboard-info: Call sysinfo_detect() before sysinfo_get_str()
Marek Vasut [Sun, 4 Jul 2021 19:32:05 +0000 (21:32 +0200)]
board-info: Call sysinfo_detect() before sysinfo_get_str()

The sysinfo_get_str() implementation checks whether the sysinfo was even
detected. In U-Boot proper, sysinfo_detect() is not called anywhere but
on one specific board. Call sysinfo_detect() before sysinfo_get_str() to
make sure the sysinfo is detected and sysinfo_get_str() returns valid
value instead of -EPERM.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoboard-info: Use sysinfo_get()
Marek Vasut [Sun, 4 Jul 2021 19:32:04 +0000 (21:32 +0200)]
board-info: Use sysinfo_get()

Replace uclass_first_device_err(UCLASS_SYSINFO, &dev) with sysinfo_get(&dev).
The board_info code may use sysinfo to print board information, so use the
sysinfo functions consistently. The sysinfo_get() is internally implemented
as return uclass_first_device_err(UCLASS_SYSINFO, &dev) anyway, so there is
no functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agomisc: i2c_eeprom: Add atmel,24c01 to the list
Marek Vasut [Sun, 4 Jul 2021 19:31:18 +0000 (21:31 +0200)]
misc: i2c_eeprom: Add atmel,24c01 to the list

Linux kernel binding is using atmel,24c01 compatible string. On the
other hand there is atmel,24c01a which is not listed in the kernel.
Add compatible string without "a" suffix to be compatible with Linux
kernel binding.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Heiko Schocher <hs@denx.de>
Cc: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
2 years agotimer: nomadik-mtu: Use dev_read_addr_ptr()
Stephan Gerhold [Fri, 2 Jul 2021 16:00:13 +0000 (18:00 +0200)]
timer: nomadik-mtu: Use dev_read_addr_ptr()

Simplify the code a bit by using dev_read_addr_ptr() instead of
dev_read_addr(). This avoids having to cast explicitly to the
struct nomadik_mtu_regs.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
2 years agogpio: Add driver for Nomadik GPIO
Stephan Gerhold [Fri, 2 Jul 2021 15:06:18 +0000 (17:06 +0200)]
gpio: Add driver for Nomadik GPIO

Nomadik GPIO is a fairly simple GPIO module used in the ST-Ericsson
Ux500 SoCs (and some older Nomadik SoCs). It uses registers where
each GPIO is represented as a single bit, plus "set" and "clear"
registers that allow updating the state without having to read the
existing state.

The driver implements support for it for use together with DM_GPIO
and the existing ste-dbx5x0.dtsi device tree.

Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
2 years agogpio: Drop long unused DB8500 GPIO driver
Stephan Gerhold [Fri, 2 Jul 2021 15:06:17 +0000 (17:06 +0200)]
gpio: Drop long unused DB8500 GPIO driver

The original U-Boot port for the ST-Ericsson U8500 SoC was dropped
in commit 68282f55b846 ("arm: Remove unused ST-Ericsson u8500 arch").
Most of the drivers related to the old port were removed, but the
db8500_gpio.c driver was forgotten for some reason. There is no way
to select it and it does not compile anymore because of missing
headers, so let's just remove it.

The new port for U8500 introduced in commit 689088f9dae8
("arm: Add support for ST-Ericsson U8500 SoC") fully embraces the
new Driver Model and device trees where possible, so this is
preparation to add a new, simplified GPIO driver based on DM_GPIO.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
2 years agoboard: armltd: Remove bootargs from Total Compute configuration
Anders Dellien [Tue, 15 Jun 2021 10:28:48 +0000 (11:28 +0100)]
board: armltd: Remove bootargs from Total Compute configuration

This information will be maintained in the device tree instead.

Signed-off-by: Anders Dellien <anders.dellien@arm.com>
2 years agoMerge tag 'efi-2021-10-rc1' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Tue, 13 Jul 2021 13:42:19 +0000 (09:42 -0400)]
Merge tag 'efi-2021-10-rc1' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2021-10-rc1

Documentation

* fix typo in signature.txt

UEFI

* provide file attributes in EFI_FILE_PROTOCOL.Read()
* various capsule update fixes

2 years agoefi_loader: Fix to set bootdev_root correctly if bootdev found
Masami Hiramatsu [Mon, 12 Jul 2021 09:05:17 +0000 (18:05 +0900)]
efi_loader: Fix to set bootdev_root correctly if bootdev found

Fix find_boot_device() to set bootdev_root if it finds the
bootdev from BootNext. Currently it sets the bootdev_root only
when it finds bootdev from BootOrder.

Fixes: c74cd8bd08d1 ("efi_loader: capsule: add capsule_on_disk support")
Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
Accked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2 years agoefi_loader: set CapsuleLast after each capsule
Heinrich Schuchardt [Sat, 10 Jul 2021 09:14:13 +0000 (11:14 +0200)]
efi_loader: set CapsuleLast after each capsule

If multiple capsules are applied, the FMP drivers for the individual
capsules can expect the value of CapsuleLast to be accurate. Hence
CapsuleLast must be updated after each capsule.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2 years agoefi_loader: missing EFI_CALL() in set_capsule_result
Heinrich Schuchardt [Sat, 10 Jul 2021 09:10:26 +0000 (11:10 +0200)]
efi_loader: missing EFI_CALL() in set_capsule_result

efi_set_variable() should be called with EFI_CALL(). Use
efi_set_variable_int() instead.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2 years agoefi_loader: rework messages for capsule updates
Heinrich Schuchardt [Sat, 10 Jul 2021 09:03:27 +0000 (11:03 +0200)]
efi_loader: rework messages for capsule updates

* Use log category LOGC_EFI. This allows to remove 'EFI:' prefixes in
  messages.
* Rephrase some of the messages.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2 years agoefi_loader: provide file attributes in EFI_FILE_PROTOCOL.Read()
Heinrich Schuchardt [Sat, 15 May 2021 20:41:26 +0000 (22:41 +0200)]
efi_loader: provide file attributes in EFI_FILE_PROTOCOL.Read()

When reading a directory using EFI_FILE_PROTOCOL.Read() provide file
attributes and timestamps.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2 years agolib: remove superfluous #ifdefs from date.c
Heinrich Schuchardt [Mon, 14 Jun 2021 16:47:09 +0000 (18:47 +0200)]
lib: remove superfluous #ifdefs from date.c

We should avoid #ifdef in C modules. Unused functions are eliminated by the
linker.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2 years agofs: fat: add file attributes to struct fs_dirent
Heinrich Schuchardt [Sat, 15 May 2021 20:06:16 +0000 (22:06 +0200)]
fs: fat: add file attributes to struct fs_dirent

When reading a directory in the UEFI file system we have to return file
attributes and timestamps. Copy this data to the directory entry structure.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2 years agodoc: fix typo in signature.txt
Thomas Perrot [Fri, 2 Jul 2021 09:32:37 +0000 (11:32 +0200)]
doc: fix typo in signature.txt

Fix value fields in signature nodes.

Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2 years agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxi
Tom Rini [Sat, 10 Jul 2021 01:08:52 +0000 (21:08 -0400)]
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxi

Aside from the usual fixes and updates one visible change is the
MMC update, which fixes some lingering bugs and gives a decent speed
increase on some boards (9->19 MB/s on H6, 21->43 MB/s on A64 eMMC).
I am keeping an watchful eye on bug reports here, to spot any correctness
regressions.
Another change is finally the enablement of the first USB host port on
many boards without micro-USB (data) sockets, like the Pine64 family.
That doubles the number of usable USB ports from 1 to 2 on those boards.

Some smaller fixes, 4GB DRAM support (on the H616) and a new board (ZeroPi)
conclude this first round of changes.

Compile-tested for all 157 sunxi boards, boot-tested on Pine H64,
Pine64-LTS, OrangePi Zero 2 and BananaPi M2 Berry.

Summary:
- DT update for H3/H5/H6
- Enable first USB port on boards without micro-USB
- ZeroPi board support
- 4GB DRAM support for H616 boards
- MMC fixes and speed improvement
- some fixes

2 years agommc: sunxi: Use mmc_of_parse()
Andre Przywara [Wed, 21 Apr 2021 08:33:04 +0000 (09:33 +0100)]
mmc: sunxi: Use mmc_of_parse()

At the moment the Allwinner MMC driver parses the bus-width and
non-removable DT properties itself, in the probe() routine.

There is actually a generic function provided by the MMC framework doing
this job, also it parses more generic properties like broken-cd and
advanced transfer modes.

Drop our own code and call mmc_of_parse() instead, to get all new
features for free.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2 years agommc: sunxi: Increase MMIO FIFO read performance
Andre Przywara [Wed, 5 May 2021 10:33:40 +0000 (11:33 +0100)]
mmc: sunxi: Increase MMIO FIFO read performance

To avoid the complexity of DMA operations (with chained descriptors), we
use repeated MMIO reads and writes to the SD_FIFO_REG, which allows us
to drain or fill the MMC data buffer FIFO very easily.

However those MMIO accesses are somewhat costly, so this limits our MMC
performance, to between 17 and 22 MB/s, but down to 9.5 MB/s on the H6
(partly due to the lower AHB1 frequency).

As it turns out we read the FIFO status register after *every* word we
read or write, which effectively doubles the number of MMIO accesses,
thus effectively more than halving our performance.

To avoid this overhead, we can make use of the FIFO level bits, which are
in the very same FIFO status registers.
So for a read request, we now can collect as many words as the FIFO
level originally indicated, and only then need to update the status
register.

We don't know for sure the size of the FIFO (and it seems to differ
across SoCs anyway), so writing is more fragile, which is why we still
use the old method for that. If we find a minimum FIFO size available on
all SoCs, we could use that, in a later optimisation.

This patch increases the eMMC read speed on a Pine64-LTS from about
22MB/s to 44 MB/s. SD card reads don't gain that much, but with 23 MB/s
we now reach the practical limit for 3.3V SD cards.
On the H6 we double our transfer speed, from 9.5 MB/s to 19.7 MB/s.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 years agommc: sunxi: Cleanup and fix self-calibration code
Andre Przywara [Wed, 5 May 2021 09:06:24 +0000 (10:06 +0100)]
mmc: sunxi: Cleanup and fix self-calibration code

Newer SoCs have a self calibration feature, which avoids us writing hard
coded phase delay values into the controller.

Consolidate the code by avoiding unnecessary #ifdefs, and also enabling
the feature for all those newer SoCs.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 years agommc: sunxi: Enable "new timing mode" on all new SoCs
Andre Przywara [Wed, 5 May 2021 09:04:41 +0000 (10:04 +0100)]
mmc: sunxi: Enable "new timing mode" on all new SoCs

All SoCs since the Allwinner A64 (H5, H6, R40, H616) feature the so
called "new timing mode", so enable this in Kconfig for those SoCs.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 years agommc: sunxi: Cleanup "new timing mode" selection
Andre Przywara [Wed, 5 May 2021 08:57:47 +0000 (09:57 +0100)]
mmc: sunxi: Cleanup "new timing mode" selection

Among the SoCs using the "new timing mode", only the A83T needs to
explicitly switch to that mode.

By just defining the symbol for that one odd A83T bit to 0 for any other
SoCs, we can always OR that in, and save the confusing nested #ifdefs.

Clean up the also confusing new_mode setting on the way.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2 years agommc: sunxi: Fix MMC clock parent selection
Andre Przywara [Wed, 5 May 2021 08:57:47 +0000 (09:57 +0100)]
mmc: sunxi: Fix MMC clock parent selection

Most Allwinner SoCs which use the so called "new timing mode" in their
MMC controllers actually use the double-rate PLL6/PERIPH0 clock as their
parent input clock. This is interestingly enough compensated by a hidden
"by 2" post-divider in the mod clock, so the divider and actual output
rate stay the same.

Even though for the H6 and H616 (but only for them!) we use the doubled
input clock for the divider computation, we never accounted for the
implicit post-divider, so the clock was only half the speed on those SoCs.
This didn't really matter so far, as our slow MMIO routine limits the
transfer speed anyway, but we will fix this soon.

Clean up the code around that selection, to always use the normal PLL6
(PERIPH0(1x)) clock as an input. As the rate and divider are the same,
that makes no difference.
Explain the hardware differences in a comment.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 years agommc: sunxi: Fix warnings with CONFIG_PHYS_64BIT
Andre Przywara [Thu, 29 Apr 2021 08:31:58 +0000 (09:31 +0100)]
mmc: sunxi: Fix warnings with CONFIG_PHYS_64BIT

When enabling PHYS_64BIT on 32-bit platforms, we get two warnings about
pointer casts in sunxi_mmc.c. Those are related to MMIO addresses, which
are always below 1GB on all Allwinner SoCs, so there is no problem with
anything having more than 32 bits.

Add the proper casts to make it compile cleanly.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2 years agommc: sunxi: Avoid #ifdefs in delay and width setup
Andre Przywara [Fri, 18 Dec 2020 22:02:11 +0000 (22:02 +0000)]
mmc: sunxi: Avoid #ifdefs in delay and width setup

The delay and bus-width setup are slightly different across the
Allwinner SoC generations, and we covered this so far with some
preprocessor conditionals.

Use the more readable IS_ENABLE() instead.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2 years agosunxi: H616: Enable full 4GB of DRAM
Andre Przywara [Wed, 28 Apr 2021 20:29:55 +0000 (21:29 +0100)]
sunxi: H616: Enable full 4GB of DRAM

The H616 is our first supported Allwinner SoC which goes beyond the 4GB
address space "barrier", by having more than 32 address bits.

Lift the preliminary 3GB DRAM limit for the H616, and update the page
table setup on the way, to actually map that last GB as well.

As not all devices are actually capable of dealing with more than 32
bits (the DMA in the EMAC for instance), we also limit U-Boot's own
DRAM usage to 4GB on the way.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 years agosunxi: board: Add H616 MMC2 pins
Andre Przywara [Sun, 25 Apr 2021 23:38:04 +0000 (00:38 +0100)]
sunxi: board: Add H616 MMC2 pins

We hardcode the pinctrl setting for the MMC controllers in boards.c,
since we need them also in the SPL, where there is no DT yet.

Add the respective setting for the H616 SoC, to enable eMMC on boards
with this SoC as well.
Also to make diagnosing this problem easier, print a warning if a board
tries to setup MMC2 pins without a respective SoC setting being defined.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jagan Teki <jagan at amarulasolutions.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec at siol.net>
2 years agosunxi: h3: Add initial ZeroPi support
Yu-Tung Chang [Sat, 19 Jun 2021 08:16:45 +0000 (16:16 +0800)]
sunxi: h3: Add initial ZeroPi support

ZeroPi is a new board of high performance with low cost
designed by FriendlyElec., using the Allwinner H3 SOC.

ZeroPi features
- Allwinner H3, Quad-core Cortex-A7@1.2GHz
- 256MB/512MB DDR3 RAM
- microsd slot
- 10/100/1000Mbps Ethernet
- Debug Serial Port
- DC 5V/2A power-supply

Signed-off-by: Yu-Tung Chang <mtwget@gmail.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 years agoconfigs: OrangePi PC2: Update defaults
Jernej Skrabec [Mon, 7 Jun 2021 17:42:45 +0000 (19:42 +0200)]
configs: OrangePi PC2: Update defaults

OrangePi PC2 board has DRAM with ODT, so enable it.
H5 SoC is also connected to voltage regulator. It's default value is
reasonable at reset, but might be too low when rebooting with a lower
voltage programmed. In order to avoid instability, enable driver for it
and set it to appropriate voltage.

Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Tested-by: Andre Przywara <andre.przywara@arm.com>
[Andre: remove original ZQ value change, adjust commit message]
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 years agosunxi: clock: H6/H616: Fix PLL clock factor encodings
Andre Przywara [Wed, 5 May 2021 12:53:05 +0000 (13:53 +0100)]
sunxi: clock: H6/H616: Fix PLL clock factor encodings

Most clock factors and dividers in the H6 PLLs use a "+1 encoding",
which we were missing on two occasions.

This fixes the MMC clock setup on the H6, which could be slightly off due
to the wrong parent frequency:
mmc 2 set mod-clk req 52000000 parent 1176000000 n 2 m 12 rate 49000000

Also the CPU frequency (PLL1) was a tad too high before.

For PLL5 (DRAM) we already accounted for this +1, but in the DRAM code
itself, not in the bit field macro. Move this there to be aligned with
what the other SoCs and other PLLs do.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
2 years agophy: sun4i-usb: Fix PHY0 routing and passby configuration for MUSB
Paul Kocialkowski [Thu, 14 Mar 2019 10:38:00 +0000 (10:38 +0000)]
phy: sun4i-usb: Fix PHY0 routing and passby configuration for MUSB

Recent Allwinner platforms (starting with the H3) only use the MUSB
controller for peripheral mode and use HCI for host mode. As a result,
extra steps need to be taken to properly route USB signals to one or
the other. More precisely, the following is required:
* Routing the pins to either HCI/MUSB (controlled by PHY);
* Enabling USB PHY passby in HCI mode (controlled by PMU).

The current code will enable passby for each PHY and reroute PHY0 to
MUSB, which is inconsistent and results in broken USB peripheral support.

Passby on PHY0 must only be enabled when we want to use HCI. Since
host/device mode detection is not available from the PHY code and
because U-Boot does not support changing the mode dynamically anyway,
we can just mux the controller to MUSB if it is enabled and mux it to
HCI otherwise.

This fixes USB peripheral support for platforms with PHY0 dual-route,
especially H3/H5 and V3s.

Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 years agoarm: dts: sunxi: h3: Update DT files
Andre Przywara [Tue, 25 May 2021 00:20:25 +0000 (01:20 +0100)]
arm: dts: sunxi: h3: Update DT files

Update the H3 DT files from the Linux 5.12 release.

The changes update some boards, and don't affect U-Boot, but fix Gigabit
Ethernet when this DT is passed on to the Linux kernel.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 years agoarm: dts: sunxi: h5: Update DT files
Andre Przywara [Tue, 25 May 2021 00:20:25 +0000 (01:20 +0100)]
arm: dts: sunxi: h5: Update DT files

Update the H5 DT files from the Linux 5.12 release.

The changes don't affect U-Boot at all, but fix Gigabit Ethernet when
this DT is passed on to the Linux kernel. It also introduces DVFS.

This also updates the shared sunxi-h3-h5.dtsi, but that only adds nodes
that are of no concern to U-Boot.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 years agoarm: dts: sunxi: h6: Update DT files
Andre Przywara [Tue, 25 May 2021 00:20:25 +0000 (01:20 +0100)]
arm: dts: sunxi: h6: Update DT files

Update the H6 DT files from the Linux 5.12 release.

The changes are minimal (many LED node renames), but also help to enable
USB port 0 in U-Boot (later), enable the RSB device (not yet used in
U-Boot), and also introduce an MMC frequency limit.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 years agoMerge branch '2021-07-09-arm-updates'
Tom Rini [Fri, 9 Jul 2021 18:05:11 +0000 (14:05 -0400)]
Merge branch '2021-07-09-arm-updates'

- Assorted ARM platform updates

2 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Fri, 9 Jul 2021 18:04:56 +0000 (14:04 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-marvell

- Support higher baudrates on Armada 3720 UART (Pali & Marek)
- OcteonTX: do not require cavium BDK node to be present (Tim)

2 years agoarm: armv8: Fix warning about redeclaring global functions as weak
Tom Rini [Tue, 29 Jun 2021 23:33:04 +0000 (19:33 -0400)]
arm: armv8: Fix warning about redeclaring global functions as weak

As seen with clang-12:
warning: __asm_invalidate_l3_dcache changed binding to STB_WEAK

As we indeed use ENTRY and then declare the function weak manually.  Use
the WEAK declarative from <linux/linkage.h> instead.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoarm: bootm: Disable LMB reservation for command line and board info on arm64
Marek Vasut [Sat, 29 May 2021 11:34:32 +0000 (13:34 +0200)]
arm: bootm: Disable LMB reservation for command line and board info on arm64

On arm64, board info is not applicable and kernel command line patched into
the DT, so the LMB reservation here makes no sense anymore. On legacy arm32,
this might still be necessary on systems which do not use DT or use legacy
ATAGS. Disable this LMB reservation on arm64.

This also permits Linux DT to specify reserved memory node at address close
to the end of DRAM bank, i.e. overlaping with U-Boot location. Since after
boot, U-Boot will be no more, this is OK.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Hai Pham <hai.pham.ud@renesas.com>
Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Cc: Stephen Warren <swarren@nvidia.com>
Cc: Tom Rini <trini@konsulko.com>
2 years agoarch: cache: cp15: Add mmu_set_region_dcache_behaviour() when SYS_DCACHE_OFF is enable
Patrice Chotard [Wed, 24 Feb 2021 12:48:42 +0000 (13:48 +0100)]
arch: cache: cp15: Add mmu_set_region_dcache_behaviour() when SYS_DCACHE_OFF is enable

Fix following compilation issue when SYS_DCACHE_OFF is enable:
drivers/misc/scmi_agent.c:128: undefined reference to `mmu_set_region_dcache_behaviour'

when SYS_DCACHE_OFF is enable, mmu_set_region_dcache_behaviour() must be
defined.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2 years agoarmv8: Handle EL2 Host mode
Mark Kettenis [Wed, 10 Feb 2021 19:14:55 +0000 (20:14 +0100)]
armv8: Handle EL2 Host mode

On implementations that support VHE, the layout of the CPTR_EL2
register depends on whether HCR_EL2.E2H is set.  If the bit is
set, CPTR_EL2 uses the same layout as CPACR_EL1 and can in fact
be accessed through that register.  In that case, jump to the
EL1 code to enable access to the FP/SIMD registers.  This allows
U-Boot to run on systems that pass control to U-Boot in EL2 with
EL2 Host mode enabled such as machines using Apple's M1 SoC.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Acked-by: Marc Zyngier <maz@kernel.org>
2 years agoocteontx: do not require cavium BDK node to be present
Tim Harvey [Thu, 17 Jun 2021 23:31:07 +0000 (16:31 -0700)]
octeontx: do not require cavium BDK node to be present

The cavium,bdk node is a non-standard dt node used by the BDK and
therefore it is removed from the dt before booting Linux. Do not
require this node to exist as it won't for standard dt's.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoarm: mvebu: a37xx: Enable more baudrates
Pali Rohár [Tue, 25 May 2021 17:42:42 +0000 (19:42 +0200)]
arm: mvebu: a37xx: Enable more baudrates

Extend CONFIG_SYS_BAUDRATE_TABLE and include all standard baudrates and
also nonstandard up to the 6 MBaud. U-Boot's A3720 UART driver can use
baudrates from 300 Baud to 6 MBaud.

This changes all A3720 boards, since all of them include either
mvebu_armada-37xx.h or turris_mox.h config file.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoserial: a37xx: Switch to XTAL clock when booting Linux kernel
Pali Rohár [Tue, 25 May 2021 17:42:41 +0000 (19:42 +0200)]
serial: a37xx: Switch to XTAL clock when booting Linux kernel

Unfortunately the UART driver in current Linux for Armada 3700 expects
UART's parent clock to be XTAL and calculats baudrate divisor according
to XTAL clock. Therefore we must switch back to XTAL clock before
booting kernel.

Implement .remove method for this driver with DM_FLAG_OS_PREPARE flag
set.

If current baudrate is unsuitable for XTAL clock then we do not change
anything. This can only happen if the user either configured unsupported
settings or knows what they are doing and has kernel patches which allow
usage of non-XTAL parent clock.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoserial: a37xx: Use TBG as parent clock
Pali Rohár [Tue, 25 May 2021 17:42:40 +0000 (19:42 +0200)]
serial: a37xx: Use TBG as parent clock

Using TBG clock as parent clock for UART allows us using higher
baudrates than 230400.

Turris MOX with external FT232RL USB-UART works fine up to 3 MBaud
(which is maximum for this USB-UART controller), while EspressoBIN with
integrated pl2303 USB-UART also works fine up to 6 MBaud.

Slower baudrates with TBG as a parent clock can be achieved by
increasing TBG dividers and oversampling divider. When using the slowest
TBG clock, minimal working baudrate is 300.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoclk: armada-37xx: Set DM_FLAG_PRE_RELOC
Marek Behún [Tue, 25 May 2021 17:42:39 +0000 (19:42 +0200)]
clk: armada-37xx: Set DM_FLAG_PRE_RELOC

Setting DM_FLAG_PRE_RELOC for Armada 3720 clock drivers (TBG and
peripheral clocks) makes it possible for serial driver to retrieve clock
rates via clk API.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoserial: a37xx: Fix parent clock rate value and divider calculation
Pali Rohár [Tue, 25 May 2021 17:42:38 +0000 (19:42 +0200)]
serial: a37xx: Fix parent clock rate value and divider calculation

UART parent clock is by default the platform's xtal clock, which is
25 MHz.

The value defined in the driver, though, is 25.8048 MHz. This is a hack
for the suboptimal divisor calculation
  Divisor = UART clock / (16 * baudrate)
which does not use rounding division, resulting in a suboptimal value
for divisor if the correct parent clock rate was used.

Change the code for divisor calculation to round to closest value, i.e.
  Divisor = Round(UART clock / (16 * baudrate))
and change the parent clock rate value to that returned by
get_ref_clk().

This makes A3720 UART stable at standard UART baudrates between 1800 and
230400.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoconfigs: Resync with savedefconfig
Tom Rini [Thu, 8 Jul 2021 11:54:35 +0000 (07:54 -0400)]
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoAzure: Remove "spear" jobs
Tom Rini [Thu, 8 Jul 2021 11:50:08 +0000 (07:50 -0400)]
Azure: Remove "spear" jobs

With the spear family of platforms gone, remove references to them from
the build jobs.

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoRevert "arm: Remove nsa310s board"
Tom Rini [Thu, 8 Jul 2021 02:55:41 +0000 (22:55 -0400)]
Revert "arm: Remove nsa310s board"

While this platform has not yet been converted, there is active efforts
to do so.  Keep the platform for now.

This reverts commit aa697e6904ba1b3144a46ec642d4695e7c0cdc3e.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoMerge branch '2021-07-07-remove-non-migrated-platforms'
Tom Rini [Thu, 8 Jul 2021 02:50:41 +0000 (22:50 -0400)]
Merge branch '2021-07-07-remove-non-migrated-platforms'

- Remove a large number of platforms that did not migrate to DM_PCI or
  DM_USB by 2 years past the migration deadline and do not have a
  migration imminent.

2 years agousb: Add correct depends for CMD_USB_MASS_STORAGE
Tom Rini [Sat, 22 May 2021 12:47:16 +0000 (08:47 -0400)]
usb: Add correct depends for CMD_USB_MASS_STORAGE

We cannot build this without USB_GADGET_DOWNLOAD support enabled, add
the appropriate depends line.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agosniper: Add build guards around MUSB support code
Tom Rini [Sat, 22 May 2021 12:47:15 +0000 (08:47 -0400)]
sniper: Add build guards around MUSB support code

If MUSB support is disabled, these parts of the code will fail to build.

Cc: Paul Kocialkowski <contact@paulk.fr>
Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoarm: Remove spear600 boards and the rest of SPEAr support
Tom Rini [Sat, 22 May 2021 12:47:14 +0000 (08:47 -0400)]
arm: Remove spear600 boards and the rest of SPEAr support

These boards have not been converted to CONFIG_DM_USB by the deadline
and is also missing conversion to CONFIG_DM.  Remove them.  As this is
the last of the SPEAr platforms, so remove the rest of the remaining
support as well.

Cc: Vipin Kumar <vipin.kumar@st.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoarm: Remove spear320 boards
Tom Rini [Sat, 22 May 2021 12:47:13 +0000 (08:47 -0400)]
arm: Remove spear320 boards

These boards have not been converted to CONFIG_DM_USB by the deadline
and is also missing conversion to CONFIG_DM.  Remove them.  As this is
also the last SPEAR3XX platform, remove that symbol as well.

Cc: Vipin Kumar <vipin.kumar@st.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoarm: Remove spear310 boards
Tom Rini [Sat, 22 May 2021 12:47:12 +0000 (08:47 -0400)]
arm: Remove spear310 boards

These boards have not been converted to CONFIG_DM_USB by the deadline
and is also missing conversion to CONFIG_DM.  Remove them.

Cc: Vipin Kumar <vipin.kumar@st.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoarm: Remove spear300 boards
Tom Rini [Sat, 22 May 2021 12:47:11 +0000 (08:47 -0400)]
arm: Remove spear300 boards

These boards have not been converted to CONFIG_DM_USB by the deadline
and is also missing conversion to CONFIG_DM.  Remove them.

Cc: Vipin Kumar <vipin.kumar@st.com>
Signed-off-by: Tom Rini <trini@konsulko.com>