]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
3 years agoarm/dts: k3-j7200-r5-common: Hook buck1_reg to vtm supply
Gowtham Tammana [Wed, 14 Jul 2021 20:52:59 +0000 (15:52 -0500)]
arm/dts: k3-j7200-r5-common: Hook buck1_reg to vtm supply

Hook buck1_reg to vtm avs supply.

Signed-off-by: Gowtham Tammana <g-tammana@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Link: https://lore.kernel.org/r/20210714205300.17424-5-g-tammana@ti.com
3 years agoarm/dts: k3-j7200-r5-common: Add VTM node
Gowtham Tammana [Wed, 14 Jul 2021 20:52:58 +0000 (15:52 -0500)]
arm/dts: k3-j7200-r5-common: Add VTM node

Add voltage and thermal management (VTM) node. The efuse values for the
OPPs are stored under the VTM, and is needed for AVS class 0 support.

Signed-off-by: Gowtham Tammana <g-tammana@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Link: https://lore.kernel.org/r/20210714205300.17424-4-g-tammana@ti.com
3 years agoarm/dts: k3-j7200-r5-common: Add pmic lp876441 node
Gowtham Tammana [Wed, 14 Jul 2021 20:52:57 +0000 (15:52 -0500)]
arm/dts: k3-j7200-r5-common: Add pmic lp876441 node

Add pmic lp876411 node needed for CPU AVS support.

Signed-off-by: Gowtham Tammana <g-tammana@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Link: https://lore.kernel.org/r/20210714205300.17424-3-g-tammana@ti.com
3 years agopower: pmic: tps65941: Add compatible for LP876441
Gowtham Tammana [Wed, 14 Jul 2021 20:52:56 +0000 (15:52 -0500)]
power: pmic: tps65941: Add compatible for LP876441

TI J7200 EVM has lp876441 pmic that is similar to tps65941. Add support
for same with existing driver with new compatible.

Signed-off-by: Gowtham Tammana <g-tammana@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Link: https://lore.kernel.org/r/20210714205300.17424-2-g-tammana@ti.com
3 years agoconfigs: am65x_evm: Switch envboot out for distro_bootcmd
Tom Rini [Tue, 13 Jul 2021 14:11:39 +0000 (10:11 -0400)]
configs: am65x_evm: Switch envboot out for distro_bootcmd

Swap out the TI-centric "envboot" logic for the generic distro_bootcmd
logic for the bootcmd we run before trying to do something more complex
involving additional firmware, etc.

Cc: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Link: https://lore.kernel.org/r/20210713141139.15183-1-trini@konsulko.com
3 years agoarm: omap4: Disable USB_TTY and related options
Tom Rini [Thu, 8 Jul 2021 01:43:48 +0000 (21:43 -0400)]
arm: omap4: Disable USB_TTY and related options

The usbtty functionality is not currently used on these two platforms,
disable it.

Cc: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Link: https://lore.kernel.org/r/20210708014348.4010-1-trini@konsulko.com
3 years agoconfigs: j721e_evm: Switch envboot out for distro_bootcmd
Tom Rini [Thu, 1 Jul 2021 14:27:43 +0000 (10:27 -0400)]
configs: j721e_evm: Switch envboot out for distro_bootcmd

Swap out the TI-centric "envboot" logic for the generic distro_bootcmd
logic for the bootcmd we run before trying to do something more complex
involving additional firmware, etc.

Cc: Lokesh Vutla <lokeshvutla@ti.com> (maintainer:J721E BOARD)
Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Link: https://lore.kernel.org/r/20210701142743.26190-1-trini@konsulko.com
3 years agoti: omap5: Switch to generic distro boot for non-Android cases
Tom Rini [Thu, 1 Jul 2021 13:26:12 +0000 (09:26 -0400)]
ti: omap5: Switch to generic distro boot for non-Android cases

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.  Note that if we do not find anything
here we will continue to try and Android methods and will start by
trying fastboot.

Cc: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Link: https://lore.kernel.org/r/20210701132612.7559-3-trini@konsulko.com
3 years agoarm: ti: environment: Move <environment/ti/boot.h> in to <configs/ti_omap5_common.h>
Tom Rini [Thu, 1 Jul 2021 13:26:11 +0000 (09:26 -0400)]
arm: ti: environment: Move <environment/ti/boot.h> in to <configs/ti_omap5_common.h>

This include file is only used by ti_omap5_common.h.  Further, the move
is towards using the generic distro boot framework and not this set of
macros.  Start by moving all of the contents in directly to where they
are used.

Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Link: https://lore.kernel.org/r/20210701132612.7559-2-trini@konsulko.com
3 years agoti: am43xx_evm: Switch to DISTRO_BOOT only
Tom Rini [Thu, 1 Jul 2021 13:26:10 +0000 (09:26 -0400)]
ti: am43xx_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/20210701132612.7559-1-trini@konsulko.com
3 years agoconfigs: am3517_evm: Fix boot hang
Adam Ford [Sat, 26 Jun 2021 13:42:58 +0000 (08:42 -0500)]
configs: am3517_evm: Fix boot hang

SPL is really tight on space, so decrease a little memory that we
allocate in order to fix boot hang.

Signed-off-by: Adam Ford <aford173@gmail.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Derald D. Woods <woods.technical@gmail.com>
Link: https://lore.kernel.org/r/20210626134258.601331-1-aford173@gmail.com
3 years agoarm: omap3: Make secure_unlock_mem() static
Adam Ford [Fri, 25 Jun 2021 19:23:08 +0000 (14:23 -0500)]
arm: omap3: Make secure_unlock_mem() static

secure_unlock_mem() is only used in one file, so make it static
in that file.

Signed-off-by: Adam Ford <aford173@gmail.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Link: https://lore.kernel.org/r/20210625192308.277136-4-aford173@gmail.com
3 years agoarm: omap3: Make secureworld_exit() static
Adam Ford [Fri, 25 Jun 2021 19:23:07 +0000 (14:23 -0500)]
arm: omap3: Make secureworld_exit() static

secureworld_exit() is only used in one file, so make it static
to that file and remove it from sys_proto.h. This
may help with some further optimization in the future.

Signed-off-by: Adam Ford <aford173@gmail.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Link: https://lore.kernel.org/r/20210625192308.277136-3-aford173@gmail.com
3 years agoarm: omap3: Make try_unlock_memory() static
Adam Ford [Fri, 25 Jun 2021 19:23:06 +0000 (14:23 -0500)]
arm: omap3: Make try_unlock_memory() static

try_unlock_memory() is only used in one file, so make it static
in that file,remove it from the sys_proto header file, and relocate
it into the #ifdef section that call it. This will make it only built
under the conditions when it is called, and it may help with some
further optimization in the future.

Signed-off-by: Adam Ford <aford173@gmail.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Link: https://lore.kernel.org/r/20210625192308.277136-2-aford173@gmail.com
3 years agoconfigs: omap3x_logic: Fix boot hang by reducing SYS_MALLOC_F_LEN
Adam Ford [Fri, 25 Jun 2021 18:57:17 +0000 (13:57 -0500)]
configs: omap3x_logic: Fix boot hang by reducing SYS_MALLOC_F_LEN

The AM3517 uses SYS_MALLOC_F_LEN of size 0x3000, but the rest of
the OMAP3 boards from LogicPD / BeaconEmbedded use 0x4000, but
they don't boot SPL.

Reduce the malloc size to restore booting.

Signed-off-by: Adam Ford <aford173@gmail.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Link: https://lore.kernel.org/r/20210625185717.243211-1-aford173@gmail.com
3 years agoarm: mach-k3: am642_init: Add missing ddr guard
Gowtham Tammana [Thu, 24 Jun 2021 17:16:14 +0000 (12:16 -0500)]
arm: mach-k3: am642_init: Add missing ddr guard

The `struct udevice *` reference is needed for either of the
K3_LOAD_SYSFW, K3_AM64_DDRSS config guards. Adding the missing
K3_AM64_DDRSS guard.

Signed-off-by: Gowtham Tammana <g-tammana@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Link: https://lore.kernel.org/r/20210624171614.14244-1-g-tammana@ti.com
3 years agoconfigs: am65x_evm_a53: Enable PRUSS remoteproc
Lokesh Vutla [Tue, 22 Jun 2021 06:34:31 +0000 (12:04 +0530)]
configs: am65x_evm_a53: Enable PRUSS remoteproc

Enable PRUSS remoteproc driver for AM65

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Link: https://lore.kernel.org/r/20210622063431.3151-6-lokeshvutla@ti.com
3 years agoarm: dts: ti: k3-am65-main: Add ICSSG nodes
Lokesh Vutla [Tue, 22 Jun 2021 06:34:30 +0000 (12:04 +0530)]
arm: dts: ti: k3-am65-main: Add ICSSG nodes

Add the DT nodes for the ICSSG0, ICSSG1 and ICSSG2 processor subsystems
that are present on the K3 AM65x SoCs. The three ICSSGs are identical
to each other for the most part, with the ICSSG2 supporting slightly
enhanced features for supporting SGMII PRU Ethernet. Each ICSSG instance
is represented by a PRUSS subsystem node. These nodes are enabled by
default.

DT nodes are fetch from Linux 5.13 Kernel.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Link: https://lore.kernel.org/r/20210622063431.3151-5-lokeshvutla@ti.com
3 years agoarm: dts: k3-am654-base-board: Add r5 specific u-boot dtsi
Lokesh Vutla [Tue, 22 Jun 2021 06:34:29 +0000 (12:04 +0530)]
arm: dts: k3-am654-base-board: Add r5 specific u-boot dtsi

So far all the u-boot specific properties for both r5 and a53 are
placed in k3-am654-base-board-u-boot.dtsi. But there are few a53
nodes that should be updated but doesn't belong to r5. So create a
separate r5 specific u-boot dtsi.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Link: https://lore.kernel.org/r/20210622063431.3151-4-lokeshvutla@ti.com
3 years agoremoteproc: pru: Add support for various PRU cores on K3 AM65x SoCs
Keerthy [Tue, 22 Jun 2021 06:34:28 +0000 (12:04 +0530)]
remoteproc: pru: Add support for various PRU cores on K3 AM65x SoCs

The K3 AM65x family of SoCs have the next generation of the PRU-ICSS
processor subsystem, commonly referred to as ICSSG. Each ICSSG processor
subsystem on AM65x SR1.0 contains two primary PRU cores and two new
auxiliary PRU cores called RTUs. The AM65x SR2.0 SoCs have a revised
ICSSG IP that is based off the subsequent IP revision used on J721E
SoCs. This IP instance has two new custom auxiliary PRU cores called
Transmit PRUs (Tx_PRUs) in addition to the existing PRUs and RTUs.

Each RTU and Tx_PRU cores have their own dedicated IRAM (smaller than
a PRU), Control and debug feature sets, but is different in terms of
sub-modules integrated around it and does not have the full capabilities
associated with a PRU core. The RTU core is typically used to aid a
PRU core in accelerating data transfers, while the Tx_PRU cores is
normally used to control the TX L2 FIFO if enabled in Ethernet
applications. Both can also be used to run independent applications.
The RTU and Tx_PRU cores though share the same Data RAMs as the PRU
cores, so the memories have to be partitioned carefully between different
applications. The new cores also support a new sub-module called Task
Manager to support two different context thread executions.
The driver currently supports the AM65xx SoC

Signed-off-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Link: https://lore.kernel.org/r/20210622063431.3151-3-lokeshvutla@ti.com
3 years agosoc: ti: pruss: Add a platform driver for PRUSS in TI SoCs
Keerthy [Tue, 22 Jun 2021 06:34:27 +0000 (12:04 +0530)]
soc: ti: pruss: Add a platform driver for PRUSS in TI SoCs

The Programmable Real-Time Unit - Industrial Communication
Subsystem (PRU-ICSS) is present of various TI SoCs such as
AM335x or AM437x or the AM654x family. Each SoC can have
one or more PRUSS instances that may or may not be identical.

The PRUSS consists of dual 32-bit RISC cores called the
Programmable Real-Time Units (PRUs), some shared, data and
instruction memories, some internal peripheral modules, and
an interrupt controller. The programmable nature of the PRUs
provide flexibility to implement custom peripheral interfaces,
fast real-time responses, or specialized data handling.

Add support for pruss driver. Currently am654x family
is supported.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Link: https://lore.kernel.org/r/20210622063431.3151-2-lokeshvutla@ti.com
3 years agoarm: dts: k3-am64-main: Reserve OCMRAM for DMSC-lite and secure proxy communication
Aswath Govindraju [Wed, 16 Jun 2021 16:38:21 +0000 (22:08 +0530)]
arm: dts: k3-am64-main: Reserve OCMRAM for DMSC-lite and secure proxy communication

The final 128KB in SRAM is reserved by default for DMSC-lite code and
secure proxy communication buffer. The memory region used for DMSC-lite
code can be optionally freed up by secure firmware API[1]. However, the
buffer for secure proxy communication is not configurable. This default
hardware configuration is unique for AM64.

Therefore, indicate the area reserved for DMSC-lite code and secure proxy
communication buffer in the oc_sram device tree node.

[1] - http://downloads.ti.com/tisci/esd/latest/6_topic_user_guides/security_handover.html#triggering-security-handover

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Acked-by: Suman Anna <s-anna@ti.com>
Link: https://lore.kernel.org/r/20210616163821.20457-3-a-govindraju@ti.com
3 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
3 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
3 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
3 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
3 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

3 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
3 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
3 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
3 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
3 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
3 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
3 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
3 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
3 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
3 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
3 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
3 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
3 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
3 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
3 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
3 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

3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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

3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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

3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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

3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>