oweals/u-boot.git
5 years agoMAINTAINERS: Add git custodians for ARM STM STM32MP entry
Patrice Chotard [Thu, 20 Jun 2019 13:35:28 +0000 (15:35 +0200)]
MAINTAINERS: Add git custodians for ARM STM STM32MP entry

Add git custodians for STMicroelectronics STM32MP entry.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
5 years agostm32mp1: add SPI flash support in SPL
Patrick Delaunay [Thu, 11 Jul 2019 09:25:54 +0000 (11:25 +0200)]
stm32mp1: add SPI flash support in SPL

Allow boot from NOR with basic boot.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agostm32mp1: Add UBIFS boot capability
Patrick Delaunay [Fri, 21 Jun 2019 13:39:55 +0000 (15:39 +0200)]
stm32mp1: Add UBIFS boot capability

Add support for boot from NAND in generic ditribution command.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agostm32mp1: activate OF_BOARD_SETUP and FDT_FIXUP_PARTITIONS
Patrick Delaunay [Tue, 2 Jul 2019 11:26:07 +0000 (13:26 +0200)]
stm32mp1: activate OF_BOARD_SETUP and FDT_FIXUP_PARTITIONS

Update kernel MTD partition in device tree with U-Boot information.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agostm32mp1: add configuration op-tee
Patrick Delaunay [Tue, 2 Jul 2019 11:26:06 +0000 (13:26 +0200)]
stm32mp1: add configuration op-tee

Add support of Trusted boot chain with OP-TEE
- reserved 32MB at the end of the DDR for OP-TEE

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agostm32mp1: reorder some CONFIG in stm32mp1.h
Patrick Delaunay [Tue, 2 Jul 2019 11:26:05 +0000 (13:26 +0200)]
stm32mp1: reorder some CONFIG in stm32mp1.h

Change config not directly linked to CONFIG_DISTRO_DEFAULTS.
Allow to deactivate CONFIG_SYS_MTDPARTS_RUNTIME when
CONFIG_MTDPARTS_DEFAULT is defined in defconfig.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agopmic: stpmic1: add support for SYSRESET_POWER_OFF
Patrick Delaunay [Mon, 20 May 2019 07:47:07 +0000 (09:47 +0200)]
pmic: stpmic1: add support for SYSRESET_POWER_OFF

Adds support for SYSRESET_POWER_OFF = PMIC power off used by command
power off and introduced by commit 751fed426f87 ("sysreset: Add a way
to find the last reset").
The driver use SYSRESET_POWER for the PMIC-level power cycle, with restart.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agoARM: dts: stm32mp1: sync device tree with v5.2-rc4
Patrick Delaunay [Thu, 11 Jul 2019 09:15:28 +0000 (11:15 +0200)]
ARM: dts: stm32mp1: sync device tree with v5.2-rc4

Synchronize device tree with v5.2-rc4 label and
update the associated u-boot dtsi.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Tested-by: Pierre-Jean Texier <pjtexier@koncepto.io>
5 years agostm32mp1: force boot_net_usb_start
Patrick Delaunay [Fri, 5 Jul 2019 15:20:22 +0000 (17:20 +0200)]
stm32mp1: force boot_net_usb_start

Prevent USB enumeration and avoid unnecessary delay in bootcmd_pxe
as Ethernet device is not attached to USB.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agostm32mp1: add check for presence of environment in boot device
Patrick Delaunay [Fri, 5 Jul 2019 15:20:21 +0000 (17:20 +0200)]
stm32mp1: add check for presence of environment in boot device

For boot from flash, check presence of default environment to force
save env.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Tested-by: Pierre-Jean Texier <pjtexier@koncepto.io>
5 years agostm32mp1: configs: Add CONFIG_OF_SPL_REMOVE_PROPS
Patrick Delaunay [Fri, 5 Jul 2019 15:20:20 +0000 (17:20 +0200)]
stm32mp1: configs: Add CONFIG_OF_SPL_REMOVE_PROPS

Removes unused device tree property in SPL
to reduce the SPL size by 1kB

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agostm32mp1: cosmetic: remove unnecessary include
Patrick Delaunay [Fri, 5 Jul 2019 15:20:19 +0000 (17:20 +0200)]
stm32mp1: cosmetic: remove unnecessary include

Remove post.h include as it is used in spl.c

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agostm32mp1: update README
Patrick Delaunay [Fri, 5 Jul 2019 15:20:18 +0000 (17:20 +0200)]
stm32mp1: update README

Add latest information and correct some information.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agostm32mp1: key: add stm32key command
Patrick Delaunay [Fri, 5 Jul 2019 15:20:17 +0000 (17:20 +0200)]
stm32mp1: key: add stm32key command

Add dedicated command to register in fuse a public hash
key provided by keygen tool.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agostm32mp1: add stboard command
Patrick Delaunay [Fri, 5 Jul 2019 15:20:16 +0000 (17:20 +0200)]
stm32mp1: add stboard command

Allow to update board identification in OTP 59.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agostm32mp1: update device tree with ETZPC status
Patrick Delaunay [Fri, 5 Jul 2019 15:20:15 +0000 (17:20 +0200)]
stm32mp1: update device tree with ETZPC status

U-Boot should disable nodes in device tree if needed according
ETZPC status in ft_system_setup().

ETZPC itself use an array on addresses to do the match between the status
bits and the node.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agostm32mp1: update package information in device tree
Patrick Delaunay [Fri, 5 Jul 2019 15:20:14 +0000 (17:20 +0200)]
stm32mp1: update package information in device tree

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agostm32mp1: export get_cpu_package function
Patrick Delaunay [Fri, 5 Jul 2019 15:20:13 +0000 (17:20 +0200)]
stm32mp1: export get_cpu_package function

Prepare update of package information update
in Linux device tree.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agodt-bindings: pinctrl: stm32: add new entry for package information
Patrick Delaunay [Fri, 5 Jul 2019 15:20:12 +0000 (17:20 +0200)]
dt-bindings: pinctrl: stm32: add new entry for package information

Add "st,package" entry. Possibles values are:
-STM32MP_PKG_AA for LFBGA448 (18*18) package
-STM32MP_PKG_AB for LFBGA354 (16*16) package
-STM32MP_PKG_AC for TFBGA361 (12*12) package
-STM32MP_PKG_AD for TFBGA257 (10*10) package

see Linux commit 966d9b928f626a54a0c27c0fdae1e3dfe9bab416
for v5.2-rc1

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agostm32mp1: syscon: remove stgen
Patrick Delaunay [Fri, 5 Jul 2019 15:20:11 +0000 (17:20 +0200)]
stm32mp1: syscon: remove stgen

Reduce difference with kernel Linux device tree.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agostm32mp1: syscon: remove etzpc support
Patrick Delaunay [Fri, 5 Jul 2019 15:20:10 +0000 (17:20 +0200)]
stm32mp1: syscon: remove etzpc support

Support for ETZPC is removed as this device is not present
in Linux kernel device tree.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agostm32mp1: call regulators_enable_boot_on in board_init
Patrick Delaunay [Fri, 5 Jul 2019 15:20:09 +0000 (17:20 +0200)]
stm32mp1: call regulators_enable_boot_on in board_init

U-Boot activates regulators by reading the "regulator-boot-on"
property in DT; it is requested by M4 early Boot feature.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agostm32mp1: deactivate WATCHDOG in defconfig
Patrick Delaunay [Fri, 5 Jul 2019 15:20:08 +0000 (17:20 +0200)]
stm32mp1: deactivate WATCHDOG in defconfig

Deactivate WATCHDOG by default in u-boot to avoid issue to boot kernel
and rootfs without the needed daemon to reload it.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Tested-by: Pierre-Jean Texier <pjtexier@koncepto.io>
5 years agosysreset: syscon: add support for power off
Patrick Delaunay [Mon, 20 May 2019 08:58:39 +0000 (10:58 +0200)]
sysreset: syscon: add support for power off

The new type sysreset 'POWER_OFF', introduced by
commit 751fed426f87 ("sysreset: Add a way to find the last reset")
is only supported for "syscon-poweroff" compatible.

For details see Linux binding:
./Documentation/devicetree/bindings/power/reset/syscon-poweroff.txt

This patch removes the support of POWER_OFF for "syscon-reboot"
and keeps only the COLD reset (for command reset support)
and it introduces the compatible "syscon-poweroff"
for the POWER_OFF case.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agostm32mp1: move CONFIG_ENV in Kconfig
Patrick Delaunay [Fri, 14 Jun 2019 11:05:59 +0000 (13:05 +0200)]
stm32mp1: move CONFIG_ENV in Kconfig

Move 2 ENV configuration flags in board Kconfig
- CONFIG_ENV_SECT_SIZE
- CONFIG_ENV_OFFSET

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agoARM: dts: stm32: Add ipcc mailbox support on stm32mp1
Fabien Dessenne [Tue, 14 May 2019 09:20:37 +0000 (11:20 +0200)]
ARM: dts: stm32: Add ipcc mailbox support on stm32mp1

Add IPCC mailbox support on stm32mp157 eval and disco boards.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
5 years agoconfigs: stm32mp15: enable IPCC mailbox
Fabien Dessenne [Tue, 14 May 2019 09:20:36 +0000 (11:20 +0200)]
configs: stm32mp15: enable IPCC mailbox

Activate the ipcc mailbox for stm32mp15 configs.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
5 years agoMAINTAINERS: Add stm32 mailbox IPPC driver
Fabien Dessenne [Tue, 14 May 2019 09:20:35 +0000 (11:20 +0200)]
MAINTAINERS: Add stm32 mailbox IPPC driver

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
5 years agomailbox: introduce stm32-ipcc driver
Fabien Dessenne [Tue, 14 May 2019 09:20:34 +0000 (11:20 +0200)]
mailbox: introduce stm32-ipcc driver

On STM32 family, the IPCC peripheral allows the communication
between 2 processors offering doorbells mechanism.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
5 years agoMerge branch '2019-07-11-master-imports'
Tom Rini [Thu, 11 Jul 2019 22:03:52 +0000 (18:03 -0400)]
Merge branch '2019-07-11-master-imports'

- spear platform improvements
- Android BCB support
- Cadence PCIe endpoint driver

5 years agogpio: pca953x: Add TI TCA9539 compatible string
Marek Vasut [Sat, 25 May 2019 20:52:20 +0000 (22:52 +0200)]
gpio: pca953x: Add TI TCA9539 compatible string

Add TI TCA9539 compatible string for yet another I2C GPIO expander.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Mario Six <mario.six@gdsys.cc>
Cc: Peng Fan <van.freenix@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
5 years agoarm: mach-omap2: am33xx: Init pinmux before clock
Marek Vasut [Sat, 25 May 2019 20:40:35 +0000 (22:40 +0200)]
arm: mach-omap2: am33xx: Init pinmux before clock

The board_early_init_f() inits clock before initing pinmux. However,
the clock configuration code might need to adjust PMIC settings of a
PMIC on I2C bus (e.g. board/ti/am335x/board.c does that). If the I2C
bus pin muxing is not configured before attempting to communicate
with the PMIC, the communication will silently fail and the prcm_init()
may configure fast enough CPU clock that the default voltage provided
by the PMIC would be insufficient and the platform would become
unstable.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Jean-Jacques Hiblot <jjhiblot@ti.com>
Cc: Tom Rini <trini@konsulko.com>
5 years agodoc: relocate/rename Android README and add BCB overview
Eugeniu Rosca [Thu, 23 May 2019 15:32:23 +0000 (17:32 +0200)]
doc: relocate/rename Android README and add BCB overview

Rename:
 - doc/{README.avb2 => android/avb2.txt}
 - doc/{README.android-fastboot => android/fastboot.txt}

Add a new file documenting the 'bcb' command:
 - doc/android/bcb.txt

The new directory structure has been reviewed by Simon in
https://patchwork.ozlabs.org/patch/1101107/#2176031 .

Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agocmd: Add 'bcb' command to read/modify/write BCB fields
Eugeniu Rosca [Thu, 23 May 2019 15:32:22 +0000 (17:32 +0200)]
cmd: Add 'bcb' command to read/modify/write BCB fields

'Bootloader Control Block' (BCB) is a well established term/acronym in
the Android namespace which refers to a location in a dedicated raw
(i.e. FS-unaware) flash (e.g. eMMC) partition, usually called "misc",
which is used as media for exchanging messages between Android userspace
(particularly recovery [1]) and an Android-capable bootloader.

On higher level, this allows implementing a subset of Android Bootloader
Requirements [2], amongst which is the Android-specific bootloader
flow [3]. Regardless how the latter is implemented in U-Boot ([3] being
the most memorable example), reading/writing/dumping the BCB fields in
the development process from inside the U-Boot is a convenient feature.
Hence, make it available to the users.

Some usage examples of the new command recorded on R-Car H3ULCB-KF
('>>>' is an overlay on top of the original console output):

=> bcb
bcb - Load/set/clear/test/dump/store Android BCB fields

Usage:
bcb load  <dev> <part>       - load  BCB from mmc <dev>:<part>
bcb set   <field> <val>      - set   BCB <field> to <val>
bcb clear [<field>]          - clear BCB <field> or all fields
bcb test  <field> <op> <val> - test  BCB <field> against <val>
bcb dump  <field>            - dump  BCB <field>
bcb store                    - store BCB back to mmc

Legend:
<dev>   - MMC device index containing the BCB partition
<part>  - MMC partition index or name containing the BCB
<field> - one of {command,status,recovery,stage,reserved}
<op>    - the binary operator used in 'bcb test':
          '=' returns true if <val> matches the string stored in <field>
          '~' returns true if <val> matches a subset of <field>'s string
<val>   - string/text provided as input to bcb {set,test}
          NOTE: any ':' character in <val> will be replaced by line feed
          during 'bcb set' and used as separator by upper layers

=> bcb dump command
Error: Please, load BCB first!
 >>> Users must specify mmc device and partition before any other call

=> bcb load 1 misc
=> bcb load 1 1
 >>> The two calls are equivalent (assuming "misc" has index 1)

=> bcb dump command
00000000: 62 6f 6f 74 6f 6e 63 65 2d 73 68 65 6c 6c 00 72    bootonce-shell.r
00000010: 79 00 72 00 00 00 00 00 00 00 00 00 00 00 00 00    y.r.............
 >>> The output is in binary/string format for convenience
 >>> The output size matches the size of inspected BCB field
 >>> (32 bytes in case of 'command')

=> bcb test command = bootonce-shell && echo true
true
=> bcb test command = bootonce-shell- && echo true
=> bcb test command = bootonce-shel && echo true
 >>> The '=' operator returns 'true' on perfect match

=> bcb test command ~ bootonce-shel && echo true
true
=> bcb test command ~ bootonce-shell && echo true
true
 >>> The '~' operator returns 'true' on substring match

=> bcb set command recovery
=> bcb dump command
00000000: 72 65 63 6f 76 65 72 79 00 73 68 65 6c 6c 00 72    recovery.shell.r
00000010: 79 00 72 00 00 00 00 00 00 00 00 00 00 00 00 00    y.r.............
 >>> The new value is NULL-terminated and stored in the BCB field

=> bcb set recovery "msg1:msg2:msg3"
=> bcb dump recovery
00000040: 6d 73 67 31 0a 6d 73 67 32 0a 6d 73 67 33 00 00    msg1.msg2.msg3..
00000050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00000060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
 >>> --- snip ---
 >>> Every ':' is replaced by line-feed '\n' (0xA). The latter is used
 >>> as separator between individual commands by Android userspace

=> bcb store
 >>> Flush/store the BCB structure to MMC

[1] https://android.googlesource.com/platform/bootable/recovery
[2] https://source.android.com/devices/bootloader
[3] https://patchwork.ozlabs.org/patch/746835/
    ("[U-Boot,5/6] Initial support for the Android Bootloader flow")

Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
5 years agoinclude: android_bootloader_message.h: Minimize the diff to AOSP
Eugeniu Rosca [Thu, 23 May 2019 15:32:21 +0000 (17:32 +0200)]
include: android_bootloader_message.h: Minimize the diff to AOSP

Perform the following updates:
 - Relocate the commit id from the file to the description of U-Boot
   commit. The AOSP commit is c784ce50e8c10eaf70e1f97e24e8324aef45faf5.
   This is done to avoid stale references in the file itself. The
   reasoning is in https://patchwork.ozlabs.org/patch/1098056/#2170209.
 - Minimize the diff to AOSP, to decrease the effort of the next AOSP
   backports. The background can be found in:
   https://patchwork.ozlabs.org/patch/1080394/#2168454.
 - Guard the static_assert() calls by #ifndef __UBOOT__ ... #endif,
   to avoid compilation failures of files including the header.

Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agoSPL: Default to disabling legacy image support when using FIT
Tom Rini [Thu, 23 May 2019 11:14:08 +0000 (07:14 -0400)]
SPL: Default to disabling legacy image support when using FIT

When we have a FIT image being used by SPL by default that means the
most common case is that we'll never run into a legacy image.  Disable
legacy image support by default in that case to reclaim space.

Signed-off-by: Tom Rini <trini@konsulko.com>
5 years agoconfigs: Rename CONFIG_IMAGE_FORMAT_LEGACY to CONFIG_LEGACY_IMAGE_FORMAT
Tom Rini [Thu, 23 May 2019 11:14:07 +0000 (07:14 -0400)]
configs: Rename CONFIG_IMAGE_FORMAT_LEGACY to CONFIG_LEGACY_IMAGE_FORMAT

The name CONFIG_LEGACY_IMAGE_FORMAT reads slightly better along with
allowing us to avoid a rather nasty Kbuild/Kconfig issue down the line
with CONFIG_IS_ENABLED(IMAGE_FORMAT_LEGACY).  In a few places outside of
cmd/ switch to using CONFIG_IS_ENABLED() to test what is set.

Signed-off-by: Tom Rini <trini@konsulko.com>
5 years agotpm: wait for valid status
Roman Kapl [Thu, 16 May 2019 16:32:48 +0000 (18:32 +0200)]
tpm: wait for valid status

The TPM specification says that the EXPECT_DATA bit is not valid until
the VALID bit is set. Wait for that bit to be set. Fixes problems with
Ifineon SPI TPM.

Signed-off-by: Roman Kapl <rka@sysgo.com>
5 years agoarm: spear: Return to BootROM if failing to boot from the main device
Miquel Raynal [Tue, 7 May 2019 12:18:54 +0000 (14:18 +0200)]
arm: spear: Return to BootROM if failing to boot from the main device

Overload the weak function board_boot_order() so that besides choosing
the main boot device, we can fallback on USB boot by returning in the
BootROM, eg. if the NOR flash is empty while it was the primary boot
medium.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Stefan Roese <sr@denx.de>
5 years agoarm: spear: Do not link the _main branch
Miquel Raynal [Tue, 7 May 2019 12:18:53 +0000 (14:18 +0200)]
arm: spear: Do not link the _main branch

The _main call is not supposed to return at all: don't link the
branch.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Stefan Roese <sr@denx.de>
5 years agoarm: spear: Support returning to BootROM
Miquel Raynal [Tue, 7 May 2019 12:18:52 +0000 (14:18 +0200)]
arm: spear: Support returning to BootROM

Implement the weak board_return_to_bootrom() function so that when
enabling the spl_bootrom.c driver, one can make use of usbboot on
spear platforms. All necessary information to return to the BootROM
are stored in the BootROM's stack. The SPL stack pointer is reset so
we save the BootROM's stack pointer into the SPL .data section.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Stefan Roese <sr@denx.de>
5 years agoarm: spear: Simplify start.S organization
Miquel Raynal [Tue, 7 May 2019 12:18:51 +0000 (14:18 +0200)]
arm: spear: Simplify start.S organization

There is no reason to do the few spear-related initialization, in a
different procedure than 'reset'. Spare one branching and get a linear
code flow by removing this indirection.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Stefan Roese <sr@denx.de>
5 years agoarm: spear: Reference the link register with LR instead of R14
Miquel Raynal [Tue, 7 May 2019 12:18:50 +0000 (14:18 +0200)]
arm: spear: Reference the link register with LR instead of R14

The link register is stored in R14. ARM assembly code allows to use
the 'lr' name to reference it instead of 'r14' which is not very
meaningful. Do the substitution to ease the reading.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Stefan Roese <sr@denx.de>
5 years agoarm: spear: Use PUSH/POP mnemonics when relevant
Miquel Raynal [Tue, 7 May 2019 12:18:49 +0000 (14:18 +0200)]
arm: spear: Use PUSH/POP mnemonics when relevant

Quoting ARM "RealView Compilation Tools Assembler Guide v4.0":

        PUSH and POP are synonyms for STMDB and LDM (or LDMIA), with
        the base register sp (r13), and the adjusted address written
        back to the base register.
PUSH and POP are the preferred mnemonic in these cases.

Let's follow this recommandation to ease the reading and substitute
LDMIA/STMDB operations with PUSH/POP mnemonics.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Stefan Roese <sr@denx.de>
5 years agoarm: spear: Purely cosmetic changes in start.S
Miquel Raynal [Tue, 7 May 2019 12:18:48 +0000 (14:18 +0200)]
arm: spear: Purely cosmetic changes in start.S

Before cleaning a bit further the spear/start.S file, apply a few
cosmetic changes: capital letters, comment indentation and small
rewriting.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Stefan Roese <sr@denx.de>
5 years agoarm: spear: Fix the main comment in start.S
Miquel Raynal [Tue, 7 May 2019 12:18:47 +0000 (14:18 +0200)]
arm: spear: Fix the main comment in start.S

This comment describes the board state at the moment where we enter
the SPL. The description is entirely wrong; re-write it to fit the
reality.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Stefan Roese <sr@denx.de>
5 years agoarm: spear: Drop false comment
Miquel Raynal [Tue, 7 May 2019 12:18:46 +0000 (14:18 +0200)]
arm: spear: Drop false comment

SPL BSS lies in SRAM and is actually initialized to 0 by the SPL in
arch/arm/lib/crt0.S:_main(), which is called by cpu_init_crit.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Stefan Roese <sr@denx.de>
5 years agoarm: spear: Call the SPL 'SPL', not 'Xloader'
Miquel Raynal [Tue, 7 May 2019 12:18:45 +0000 (14:18 +0200)]
arm: spear: Call the SPL 'SPL', not 'Xloader'

Rename Xloader as SPL in comments.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Stefan Roese <sr@denx.de>
5 years agoarm: spear: Drop useless board_init_r call
Miquel Raynal [Tue, 7 May 2019 12:18:44 +0000 (14:18 +0200)]
arm: spear: Drop useless board_init_r call

It is clearly stated that board_init_f should *not* call
board_init_r. Indeed, board_init_f should return. The code will
continue through arch/arm/lib/crt0.S which will do more setup before
calling board_init_r.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Stefan Roese <sr@denx.de>
5 years agospl: Fix typo in kernel doc
Miquel Raynal [Tue, 7 May 2019 12:18:43 +0000 (14:18 +0200)]
spl: Fix typo in kernel doc

Fix a tiny typo in boot_from_devices() kernel doc.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Stefan Roese <sr@denx.de>
5 years agotest: pci_ep: add basic pci_ep tests
Ramon Fried [Sat, 27 Apr 2019 08:15:24 +0000 (11:15 +0300)]
test: pci_ep: add basic pci_ep tests

Add basic PCI endpoint sandbox testing.

Signed-off-by: Ramon Fried <ramon.fried@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agopci_ep: add pci endpoint sandbox driver
Ramon Fried [Sat, 27 Apr 2019 08:15:23 +0000 (11:15 +0300)]
pci_ep: add pci endpoint sandbox driver

Add a dummy PCI endpoint for sandbox.
Supporting only a single function, it allows setting
and reading header configuration.

Signed-off-by: Ramon Fried <ramon.fried@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agopci_ep: add Cadence PCIe endpoint driver
Ramon Fried [Sat, 27 Apr 2019 08:15:22 +0000 (11:15 +0300)]
pci_ep: add Cadence PCIe endpoint driver

Add Cadence PCIe endpoint driver supporting configuration
of header, bars and MSI for device.

Signed-off-by: Ramon Fried <ramon.fried@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agodrivers: pci_ep: Introduce UCLASS_PCI_EP uclass
Ramon Fried [Sat, 27 Apr 2019 08:15:21 +0000 (11:15 +0300)]
drivers: pci_ep: Introduce UCLASS_PCI_EP uclass

Introduce new UCLASS_PCI_EP class for handling PCI endpoint
devices, allowing to set various attributes of the PCI endpoint
device, such as:
* configuration space header
* BAR definitions
* outband memory mapping
* start/stop PCI link

Signed-off-by: Ramon Fried <ramon.fried@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-i2c
Tom Rini [Wed, 10 Jul 2019 17:51:53 +0000 (13:51 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-i2c

5 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-ubi
Tom Rini [Wed, 10 Jul 2019 14:40:14 +0000 (10:40 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-ubi

[trini: Migrate sama5d27_som1_ek_qspiflash/sama5d2_xplained_qspiflash
        for CONFIG_ENV_SECT_SIZE]
Signed-off-by: Tom Rini <trini@konsulko.com>
5 years agoMerge tag 'u-boot-atmel-2019.10-a' of https://gitlab.denx.de/u-boot/custodians/u...
Tom Rini [Tue, 9 Jul 2019 12:16:50 +0000 (08:16 -0400)]
Merge tag 'u-boot-atmel-2019.10-a' of https://gitlab.denx.de/u-boot/custodians/u-boot-atmel

First set of u-boot-atmel features and fixes for 2019.10 cycle

This includes the Atmel QSPI driver and support for the at91 boards.
This is the port of the driver from Linux, mostly done by Tudor Ambarus.

5 years agortc: pcf2127: Fixed bug with rtc settings and getting error time
Chuanhua Han [Mon, 8 Jul 2019 03:45:25 +0000 (11:45 +0800)]
rtc: pcf2127: Fixed bug with rtc settings and getting error time

The previous pcf2127 RTC chip could not read and set the correct time.
When reading the data of internal registers, the read address was the
value of register plus 1. This is because this chip requires the host
to send a stop signal after setting the register address and before
reading the register data.

This patch sets the register address using dm_i2c_write and reads
the register data using the original dm_i2c_xfer in order to generate
a stop signal after the register address is set, and fixes the bug of
the original read and write time.

Signed-off-by: Biwen Li <biwen.li@nxp.com>
Signed-off-by: Chuanhua Han <chuanhua.han@nxp.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Heiko Schocher <hs@denx.de>
5 years agoconfigs: sama5d2_xplained: add support QSPI flash boot
Eugen Hristev [Tue, 18 Jun 2019 08:52:11 +0000 (08:52 +0000)]
configs: sama5d2_xplained: add support QSPI flash boot

The spi-nor flash resides on spi bus 1. Update the CONFIG_ENV_SPI_CS
and CONFIG_BOOTCOMMAND accordingly.

Based on original work by Wenyou Yang.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
[tudor.ambarus@microchip.com: amend the commit message.]
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
5 years agoconfigs: sama5d27_som1_ek: qspi: use common memory layout
Tudor Ambarus [Tue, 18 Jun 2019 08:52:09 +0000 (08:52 +0000)]
configs: sama5d27_som1_ek: qspi: use common memory layout

Use the qspi memory layout defined in at91-sama5_common - it aligns
with the 8 Mbyte flash (sst26vf064b-104i/sn) available in sama5d27_som1_ek.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
5 years agoconfigs: sama5d27_som1_ek: add qspiflash_defconfig
Tudor Ambarus [Tue, 18 Jun 2019 08:52:06 +0000 (08:52 +0000)]
configs: sama5d27_som1_ek: add qspiflash_defconfig

Add the default config file of QSPI media. The config is based on
sama5d27_som1_ek_mmc_defconfig.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
5 years agoconfigs: sama5d2_xplained: add qspiflash_defconfig
Tudor Ambarus [Tue, 18 Jun 2019 08:52:03 +0000 (08:52 +0000)]
configs: sama5d2_xplained: add qspiflash_defconfig

Add the default config file of QSPI media. The config is based on
sama5d2_xplained_mmc_defconfig.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
5 years agoARM: at91: sama5: add common environment for QSPI
Cyrille Pitchen [Tue, 18 Jun 2019 08:52:01 +0000 (08:52 +0000)]
ARM: at91: sama5: add common environment for QSPI

Use the same memory layout as we use for the NAND boot on the other boards.

QSPI flashes are present on the following boards:
sama5d2_xplained RevB:  32 Mbyte flash (mx25l3273fm2i-08g)
sama5d2_xplained RevC:   8 Mbyte flash (sst26vf064b-104i/sn)
sama5d27_som1_ek:        8 Mbyte flash (sst26vf064b-104i/sn)
sama5d2_ptc_ek:          8 Mbyte flash (sst26vf064b-104i/sn)

The 8 Mbyte limit is enough to cope with the memory layout used in the NAND
boot. rootfs exceeds the 8 Mbyte limit and will stay in eMMC in the
sama5d2_xplained case. The final scope is to use a single memory layout for
all boot medias.

Signed-off-by: Cyrille Pitchen <cyrille.pitchen@microchip.com>
[tudor.ambarus@microchip.com: change memory layout, add commit message]
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
5 years agoARM: dts: at91: sama5d2_xplained: fix QSPI0 node
Cyrille Pitchen [Tue, 18 Jun 2019 08:51:58 +0000 (08:51 +0000)]
ARM: dts: at91: sama5d2_xplained: fix QSPI0 node

Fix the following:
- use "jedec,spi-nor" binding, we use jedec compatible flashes
- set bus width to 4, we use quad capable flashes
- differentiate bewteen data and clk and cs pins
- drop partions as we don't use them in u-boot.

Signed-off-by: Cyrille Pitchen <cyrille.pitchen@microchip.com>
[tudor.ambarus@microchip.com: use "jedec,spi-nor", edit commit message]
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
5 years agoconfigs: sama5d27_som1_ek: enable qspi controller and flashes
Tudor Ambarus [Tue, 18 Jun 2019 08:51:55 +0000 (08:51 +0000)]
configs: sama5d27_som1_ek: enable qspi controller and flashes

We use a sst spi-nor flash memory on sama5d27_som1_ek. Select
the others for testing purposes.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
5 years agoconfigs: sama5d2_xplained: enable qspi controller and flashes
Tudor Ambarus [Tue, 18 Jun 2019 08:51:53 +0000 (08:51 +0000)]
configs: sama5d2_xplained: enable qspi controller and flashes

We have a macronix spi-nor flash on sama5d2_xplained RevB and
a sst spi-nor flash on RevC. Select the rest for testing purposes.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
5 years agospi: Add Atmel QuadSPI driver
Tudor Ambarus [Tue, 18 Jun 2019 08:51:50 +0000 (08:51 +0000)]
spi: Add Atmel QuadSPI driver

Backport the driver from linux v5.1-rc5 and adapt it for u-boot.
Tested on sama5d2_xplained Rev B with mx25l25635e spi-nor flash.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
5 years agoxilinx_xiic: Fix transfer initialisation
Melin Tomas [Fri, 28 Jun 2019 12:08:40 +0000 (12:08 +0000)]
xilinx_xiic: Fix transfer initialisation

Prior to starting a new transfer, conditionally wait for bus to not
be busy.

Reinitialise controller as otherwise operation is not stable.
For reference, see linux kernel
commit 9656eeebf3f1 ("i2c: Revert i2c: xiic: Do not reset controller before every transfer")

hs: Fixed DOS line endings
    added missing '\n'
    Fixed git commit description style

Signed-off-by: Tomas Melin <tomas.melin@vaisala.com>
5 years agoxilinx_xiic: Fix fill tx fifo loop
Melin Tomas [Fri, 28 Jun 2019 12:08:31 +0000 (12:08 +0000)]
xilinx_xiic: Fix fill tx fifo loop

Comparison should be against the actual message length, not loop index.

len is used for stopping while loop, pos is position in message.
stop should be sent when entire message is sent, not when
len and pos meet.

hs: fixed DOS line endings

Signed-off-by: Tomas Melin <tomas.melin@vaisala.com>
5 years agoi2c: designware: Get clock rate from clock DM
Ley Foon Tan [Wed, 12 Jun 2019 01:48:04 +0000 (09:48 +0800)]
i2c: designware: Get clock rate from clock DM

Get clock rate from clock DM if CONFIG_CLK is enabled.
Otherwise, uses IC_CLK define.

Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
Acked-by: Marek Vasut <marex@denx.de>
5 years agoi2c: designware_i2c: Restore enable state after set speed
Jun Chen [Wed, 5 Jun 2019 07:23:16 +0000 (15:23 +0800)]
i2c: designware_i2c: Restore enable state after set speed

Before calling __dw_i2c_set_bus_speed(),
the I2C could already be set as ether enable or disable,
we should restore the original setting instead of enable i2c anyway.

This patch fix a bug happened in init function:
    __dw_i2c_init(){
            /* Disable i2c */
            ...
            __dw_i2c_set_bus_speed(i2c_base, NULL, speed);
            writel(slaveaddr, &i2c_base->ic_sar);
            /* Enable i2c */
    }
In this case, enable i2c inside __dw_i2c_set_bus_speed() function
will cause ic_sar write fail.

Signed-off-by: Jun Chen <ptchentw@gmail.com>
5 years agoubispl: introduce separate CONFIG_UBI_SPL_SILENCE_MSG
Markus Klotzbuecher [Wed, 15 May 2019 13:16:00 +0000 (15:16 +0200)]
ubispl: introduce separate CONFIG_UBI_SPL_SILENCE_MSG

This allows to silence ubi and ubispl individually.

Signed-off-by: Markus Klotzbuecher <markus.klotzbuecher@kistler.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Cc: Kyungmin Park <kmpark@infradead.org>
5 years agoubispl: add support for loading volumes by name
Hamish Guthrie [Wed, 15 May 2019 13:15:59 +0000 (15:15 +0200)]
ubispl: add support for loading volumes by name

The motivation is to use the UBI atomic volume rename functionality to
allow double copy software updates on UBI. To that end the SPL is
configured to always load the same volume name (e.g. "u-boot"),
whereas a software updater always installs into the secondary volume
"u-boot_r". After successful installation, these two volume names are
switched.

This extension is protected by #ifdefs as it will somewhat slow down
loading of volumes by id. This is because the code needs to disable
the optimization of ignoring all volume ids which are not
to-be-loaded, since these can only be resolved after attaching.

This adds two vtbl related functions from Linux, which are taken from
the same kernel version as the current main U-Boot UBI code (Linux 4.2
64291f7db5bd8).

Signed-off-by: Hamish Guthrie <hamish.guthrie@kistler.com>
Signed-off-by: Markus Klotzbuecher <markus.klotzbuecher@kistler.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Cc: Kyungmin Park <kmpark@infradead.org>
5 years agoconfigs: migrate ubispl boards to KConfig
Markus Klotzbuecher [Wed, 15 May 2019 13:15:58 +0000 (15:15 +0200)]
configs: migrate ubispl boards to KConfig

Migrate the ubispl configuration for the omap3_igep00x0 and
am335x_igep003x boards to KConfig. Both boards were built with
SOURCE_DATE_EPOCH=0 and found to be equal before and after.

Signed-off-by: Markus Klotzbuecher <markus.klotzbuecher@kistler.com>
Cc: Heiko Schocher <hs@denx.de>
Cc: Kyungmin Park <kmpark@infradead.org>
Cc: Javier Martínez Canillas <javier@dowhile0.org>
Cc: Enric Balletbo i Serra <eballetbo@gmail.com>
Acked-by: Enric Balletbo i Serra <eballetbo@gmail.com>
5 years agoubispl: migrate configuration to Kconfig
Markus Klotzbuecher [Wed, 15 May 2019 13:15:57 +0000 (15:15 +0200)]
ubispl: migrate configuration to Kconfig

Move the ubispl configuration to KConfig and drop them from the
whitelist.

Signed-off-by: Markus Klotzbuecher <markus.klotzbuecher@kistler.com>
Cc: Heiko Schocher <hs@denx.de>
Cc: Kyungmin Park <kmpark@infradead.org>
Cc: Javier Martínez Canillas <javier@dowhile0.org>
Cc: Enric Balletbo i Serra <eballetbo@gmail.com>
5 years agoubi: fix UBI_SILENCE_MSG
Markus Klotzbuecher [Wed, 15 May 2019 13:15:56 +0000 (15:15 +0200)]
ubi: fix UBI_SILENCE_MSG

 - drop CONFIG_ prefix from kconfig entry
 - fix small compilation issue with CONFIG_UBI_SILENCE_MSG

Signed-off-by: Markus Klotzbuecher <markus.klotzbuecher@kistler.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Cc: Kyungmin Park <kmpark@infradead.org>
5 years agoenv: ubi: support configurable VID offset
Hamish Guthrie [Wed, 15 May 2019 13:15:55 +0000 (15:15 +0200)]
env: ubi: support configurable VID offset

Introduce KConfig CONFIG_ENV_UBI_VID_OFFSET to allow providing custom
VID header offsets for the environment on UBI.

Signed-off-by: Hamish Guthrie <hamish.guthrie@kistler.com>
Signed-off-by: Markus Klotzbuecher <markus.klotzbuecher@kistler.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Cc: Kyungmin Park <kmpark@infradead.org>
5 years agoat91, omap2plus: configs: migrate CONFIG_ENV_ to defconfigs
Markus Klotzbuecher [Wed, 15 May 2019 13:15:54 +0000 (15:15 +0200)]
at91, omap2plus: configs: migrate CONFIG_ENV_ to defconfigs

Enable the extended ENV options for AT91 and OMAP2PLUS in order to be
able to use CONFIG_ENV_UBI_* on these architectures.

As this change also makes the configs ENV_SIZE, ENV_SECT_SIZE,
ENV_OFFSET visible to AT91 and OMAP2PLUS, migrate users of these to
KConfig.

This migration was run using an extended moveconfig.py which evaluates
expressions such as "(512 << 10)". See patch ("moveconfig: expand
simple expressions").

All modified boards were built with SOURCE_DATE_EPOCH=0 before and
after the change and successfully confirmed that the identical binary
is generated (the only exception was igep00x0, which does not define
CONFIG_ENV_IS_IN_UBI in the original board header. Once that is
defined, the test passes too).

hs: rebased patch to:
  68b90e57bc: "configs: tinker-rk3288 disable CONFIG_SPL_I2C_SUPPORT"

Signed-off-by: Markus Klotzbuecher <markus.klotzbuecher@kistler.com>
Cc: Heiko Schocher <hs@denx.de>
Cc: Eugen Hristev <eugen.hristev@microchip.com>
Cc: Tom Rini <trini@konsulko.com>
5 years agoenv: ubi: KConfig: add CONFIG_ENV_UBI_VOLUME_REDUND
Markus Klotzbuecher [Wed, 15 May 2019 13:15:53 +0000 (15:15 +0200)]
env: ubi: KConfig: add CONFIG_ENV_UBI_VOLUME_REDUND

Introduce the KConfig option CONFIG_ENV_UBI_VOLUME_REDUND for defining
the name of the UBI volume used to store the redundant environment.

Signed-off-by: Markus Klotzbuecher <markus.klotzbuecher@kistler.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Cc: Kyungmin Park <kmpark@infradead.org>
hs: get rid of stm32mp1* build errors

5 years agomoveconfig: expand simple expressions
Markus Klotzbuecher [Wed, 15 May 2019 13:15:52 +0000 (15:15 +0200)]
moveconfig: expand simple expressions

Add support for expanding simple expressions and sizes such as
"(4 * 1024)", "(512 << 10)" or "(SZ_256K)".

This can help to significantly reduce the number of "suspicious"
moves, such as

 'CONFIG_ENV_SIZE="(64 << 10)"' was removed by savedefconfig.

If the expansion fails, it falls back to the original string.

Signed-off-by: Markus Klotzbuecher <markus.klotzbuecher@kistler.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Heiko Schocher <hs@denx.de>
5 years agoMerge tag 'efi-2019-10-rc1' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Mon, 8 Jul 2019 20:02:51 +0000 (16:02 -0400)]
Merge tag 'efi-2019-10-rc1' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi

Pull request for UEFI sub-system for v2019.10-rc1

Fix a possible overflow for GUID partition tables.

For some runtime services we only have implementations valid at boottime.
So we replace them when leaving boottime. Move this from
SetVirtualAddressMap() to ExitBootServices() as SetVirtualAddressMap() is
not called by all operating systems. Adjust the Python tests accordingly.

Bump the supported UEFI specification version to 2.8.

5 years agoMerge tag 'u-boot-amlogic-20190704' of https://gitlab.denx.de/u-boot/custodians/u...
Tom Rini [Mon, 8 Jul 2019 20:02:19 +0000 (16:02 -0400)]
Merge tag 'u-boot-amlogic-20190704' of https://gitlab.denx.de/u-boot/custodians/u-boot-amlogic

- fix khadas-vim README
- add support for unique generated MAC adresses from SoC serial,
  limited to Amlogic GXL/GXM boards for now

5 years agoMerge tag 'mmc-6-23' of https://github.com/MrVan/u-boot
Tom Rini [Mon, 8 Jul 2019 19:49:50 +0000 (15:49 -0400)]
Merge tag 'mmc-6-23' of https://github.com/MrVan/u-boot

- Pull in the series to split fsl_esdhc for i.MX/non-i.MX cleanly

5 years agoPrepare v2019.07 v2019.07
Tom Rini [Mon, 8 Jul 2019 19:23:28 +0000 (15:23 -0400)]
Prepare v2019.07

Signed-off-by: Tom Rini <trini@konsulko.com>
5 years agoMerge tag 'mips-fixes-for-2019.07' of https://gitlab.denx.de/u-boot/custodians/u...
Tom Rini [Mon, 8 Jul 2019 11:29:33 +0000 (07:29 -0400)]
Merge tag 'mips-fixes-for-2019.07' of https://gitlab.denx.de/u-boot/custodians/u-boot-mips

- mtmips: network stability fixes for gardena-smart-gateway

5 years agoarm: mediatek: remove arch_misc_init
Weijie Gao [Thu, 16 May 2019 09:19:50 +0000 (17:19 +0800)]
arm: mediatek: remove arch_misc_init

The watchdog of mediatek chips is enabled by bootrom before u-boot is
running. Previously we choose to enable the wdt driver only to disable the
watchdog hardware.

Now wdt service is enabled by default. The function arch_misc_init which is
only used to disable wdt is no longer needed.

Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
5 years agoboard_r: move initr_watchdog to be called after initr_serial
Weijie Gao [Thu, 16 May 2019 09:19:13 +0000 (17:19 +0800)]
board_r: move initr_watchdog to be called after initr_serial

The initr_watchdog is currently placed before initr_serial. The
initr_watchdog calls printf and printf finally calls ops->putc of a serial
driver.

However, gd->cur_serial_dev points to a udevice allocated in board_f. The
gd->cur_serial_dev->driver->ops->putc points the the code region before
relocation.

Some serial drivers call WATCHDOG_RESET() in ops->putc. When DM is enabled
for watchdog, watchdog_reset() is called. watchdog_reset() calls get_timer
to get current timer.

On some platforms the timer driver is also a DM driver. initr_watchdog is
placed right after initr_dm, which means the timer driver hasn't been
initialized. So dm_timer_init() is called. To create a new udevice, calloc
is called.

However start from ops->putc, u-boot execution flow is redirected into the
memory region before relocation (board_f). In board_f, dlmalloc hasn't
been initialized. The call to calloc will fail, and this will cause DM to
print out an error message, and it will call printf again, causing
recursive error outputs.

This patch places initr_watchdog after initr_serial to solve this issue.

Cc: Stefan Roese <sr@denx.de>
Reviewed-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Tested-by: Frank Wunderlich <frank-w@public-files.de>
Tested-by: Suniel Mahesh <sunil.m@techveda.org>
5 years agoMerge tag 'dm-pull-7jul19' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm
Tom Rini [Sun, 7 Jul 2019 20:17:56 +0000 (16:17 -0400)]
Merge tag 'dm-pull-7jul19' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm

Fix booting for wandboard

5 years agoMerge tag 'video-for-2019.07' of https://gitlab.denx.de/u-boot/custodians/u-boot...
Tom Rini [Sun, 7 Jul 2019 20:17:13 +0000 (16:17 -0400)]
Merge tag 'video-for-2019.07' of https://gitlab.denx.de/u-boot/custodians/u-boot-video

- fix pwm backlight

5 years agoimx6: wandboard: allow booting from MMC 2
Heinrich Schuchardt [Sun, 23 Jun 2019 07:49:43 +0000 (09:49 +0200)]
imx6: wandboard: allow booting from MMC 2

One of the SD-CARD slots on the Wandboard Quad B1 is MMC 2. Enable it as a
boot device.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
5 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-usb
Tom Rini [Sun, 7 Jul 2019 11:06:03 +0000 (07:06 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-usb

- DWC and i.MX6 fixes

5 years agoMerge tag 'rockchip-for-v2019.07-rc5-3' of https://gitlab.denx.de/u-boot/custodians...
Tom Rini [Sun, 7 Jul 2019 11:05:47 +0000 (07:05 -0400)]
Merge tag 'rockchip-for-v2019.07-rc5-3' of https://gitlab.denx.de/u-boot/custodians/u-boot-rockchip

5 years agovideo: backlight: fix pwm inversion
Marc Dietrich [Tue, 2 Jul 2019 20:08:33 +0000 (22:08 +0200)]
video: backlight: fix pwm inversion

set_pwm() will always fail with -ENOSYS if pwm_ops set_invert() is
not implemented, leaving the backlight dark. Fix this by returning
no error if set_invert() is not implemented and no polarity change
is requested.

Fixes: 57e7775413 ("video: backlight: Parse PWM polarity cell")
Signed-off-by: Marc Dietrich <marvin24@gmx.de>
5 years agoefi_loader: detach runtime in ExitBootServices()
Heinrich Schuchardt [Fri, 5 Jul 2019 15:42:16 +0000 (17:42 +0200)]
efi_loader: detach runtime in ExitBootServices()

Linux can be called with a command line parameter efi=novamap, cf.
commit 4e46c2a95621 ("efi/arm/arm64: Allow SetVirtualAddressMap() to be
omitted"). In this case SetVirtualAddressMap() is not called after
ExitBootServices().

OpenBSD 32bit does not call SetVirtualAddressMap() either.

Runtime services must be set to an implementation supported at runtime
in ExitBootServices().

Reported-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Suggested-by: Alexander Graf <agraf@csgraf.de>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_loader: simplify detaching
Heinrich Schuchardt [Fri, 5 Jul 2019 16:12:21 +0000 (18:12 +0200)]
efi_loader: simplify detaching

We do not need any array typed detach list. Let's simply update the
pointers directly.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_loader: decision on EFI_RT_SUPPORTED_RESET_SYSTEM
Heinrich Schuchardt [Fri, 5 Jul 2019 16:12:16 +0000 (18:12 +0200)]
efi_loader: decision on EFI_RT_SUPPORTED_RESET_SYSTEM

Move the logic determining which board supports reset at runtime to Kconfig.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agotest/py: not all boards support UEFI runtime reset
Heinrich Schuchardt [Fri, 5 Jul 2019 16:16:51 +0000 (18:16 +0200)]
test/py: not all boards support UEFI runtime reset

As not all boards support resets at runtime do not test for it in the
Python tests.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_loader: bump UEFI specification number to 2.8
Heinrich Schuchardt [Fri, 28 Jun 2019 17:31:55 +0000 (19:31 +0200)]
efi_loader: bump UEFI specification number to 2.8

We are implementing UEFI variable RuntimeServicesSupported and set the
unimplemented runtime functions return EFI_UNSUPPORTED as described in UEFI
specification 2.8. So let's also advertise this specification version in
our system table.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Alexander Graf <agraf@csgraf.de>
5 years agoefi_loader: split off detaching SetVirtualAddress()
Heinrich Schuchardt [Sat, 29 Jun 2019 01:32:52 +0000 (03:32 +0200)]
efi_loader: split off detaching SetVirtualAddress()

The runtime services SetVirtualAddress() and ConvertPointer() become
unavailable after SetVirtualAddress(). Other runtime services become
unavailable after ExitBootServices.

Move the update of SetVirtualAddress() and ConvertPointer() to
efi_relocate_runtime_table().

Use functions with the correct signature when detaching.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_selftest: test variable services at runtime
Heinrich Schuchardt [Thu, 20 Jun 2019 14:18:48 +0000 (16:18 +0200)]
efi_selftest: test variable services at runtime

Provide a unit test for the variable services at runtime.

Currently we expect EFI_UNSUPPORTED to be returned as the runtime
implementation is still missing.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>