project/bcm63xx/u-boot.git
5 years agoefi_loader: error code in UninstallProtocolInterface()
Heinrich Schuchardt [Fri, 10 May 2019 18:06:48 +0000 (20:06 +0200)]
efi_loader: error code in UninstallProtocolInterface()

According to the UEFI specification UninstallProtocolInteface() has to
return EFI_NOT_FOUND if the interface is not found.

Correct the return value.

Cf. UEFI SCT II spec (2017), 3.3.2 UninstallProtocolInterface(), 5.1.3.2.4

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_loader: superfluous check in efi_remove_protocol()
Heinrich Schuchardt [Fri, 10 May 2019 17:55:53 +0000 (19:55 +0200)]
efi_loader: superfluous check in efi_remove_protocol()

efi_search_protocol() already checks that the GUID matches. Don't check
a second time.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_loader: LocateDevicePath() incorrect parameter check
Heinrich Schuchardt [Fri, 10 May 2019 17:21:41 +0000 (19:21 +0200)]
efi_loader: LocateDevicePath() incorrect parameter check

A parameter check in LocateDevicePath() does not match the requirements of
the UEFI spec.

If device is NULL, only return EFI_INVALID_PARAMETER if a matching handle
is found.

Cf. UEFI SCT II specification (2017)3.3.7 LocateDevicePath(), 5.1.3.7.3

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_loader: fix typo in efi_locate_handle() comment
Heinrich Schuchardt [Fri, 10 May 2019 17:03:49 +0000 (19:03 +0200)]
efi_loader: fix typo in efi_locate_handle() comment

%s/not buffer/no buffer/

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_loader: make device path to text protocol customizable
Heinrich Schuchardt [Sat, 11 May 2019 07:53:33 +0000 (09:53 +0200)]
efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_loader: make Unicode collation protocol customizable
Heinrich Schuchardt [Wed, 8 May 2019 21:24:26 +0000 (23:24 +0200)]
efi_loader: make Unicode collation protocol customizable

The Unicode collation protocol is not needed for EBBR compliance. So let's
make it a customizable option.

The Unicode capitalization table is only needed by this protocol. So let it
depend on the Unicode collation protocol.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_loader: reword the EFI_LOADER config option
Heinrich Schuchardt [Sat, 11 May 2019 08:27:58 +0000 (10:27 +0200)]
efi_loader: reword the EFI_LOADER config option

No need to mention U-Boot in brief description.
Fix several typos, mention iPXE.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_loader: format Kconfig
Heinrich Schuchardt [Wed, 8 May 2019 21:17:38 +0000 (23:17 +0200)]
efi_loader: format Kconfig

Use if/endif for dependencies to give structure to the configuration menu.

Sort important settings to the top.

Abbreviate the short description of EFI_LOADER_HII.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_loader: observe CONFIG_EFI_LOADER_HII
Heinrich Schuchardt [Wed, 8 May 2019 19:42:36 +0000 (21:42 +0200)]
efi_loader: observe CONFIG_EFI_LOADER_HII

If EFI_LOADER_HII is not set, do not unnecessarily compile files for HII
protocols.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoMAINTAINERS: assign include/charset.h
Heinrich Schuchardt [Wed, 8 May 2019 17:41:35 +0000 (19:41 +0200)]
MAINTAINERS: assign include/charset.h

Assign include/charset.h to EFI PAYLOAD.

The functions defined in this include are used by the UEFI sub-system.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agolib: charset: correct utf8_utf16_strnlen() description
Heinrich Schuchardt [Wed, 8 May 2019 17:34:48 +0000 (19:34 +0200)]
lib: charset: correct utf8_utf16_strnlen() description

Correct the description of utf8_utf16_strnlen() and utf8_utf16_strlen() to
reflect that they return u16 count and not byte count.

For these functions and utf16_utf8_strnlen() describe the handling of
invalid code sequences.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoMerge branch '2019-05-10-master-imports'
Tom Rini [Fri, 10 May 2019 15:08:48 +0000 (11:08 -0400)]
Merge branch '2019-05-10-master-imports'

- Correct CONFIG_CRC32 related options in Kconfig
- CONFIG_GPIO select's DM_GPIO, drop CONFIG_GPIO from whitelist.txt

5 years agoRemove whitelist entry for CONFIG_CRC32
Chris Packham [Sat, 13 Apr 2019 09:13:59 +0000 (21:13 +1200)]
Remove whitelist entry for CONFIG_CRC32

There are no longer any references to this in the code so this can be
removed.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
5 years agoRemove #define CONFIG_CRC32
Chris Packham [Sat, 13 Apr 2019 09:13:58 +0000 (21:13 +1200)]
Remove #define CONFIG_CRC32

There is no check for CONFIG_CRC32 so the #define in image.h does
nothing. Remove it.

Reported-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefano Babic <sbabic@denx.de>
Reviewed-by: Heiko Schocher <hs@denx.de>
5 years agomtd: ubi: Remove select for non existent option
Chris Packham [Sat, 13 Apr 2019 09:13:57 +0000 (21:13 +1200)]
mtd: ubi: Remove select for non existent option

There is no 'config CRC32' remove the select that was attempting to use
it.

Reported-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
5 years agocmd: ubifs: Remove select for non-existent option
Chris Packham [Sat, 13 Apr 2019 09:13:56 +0000 (21:13 +1200)]
cmd: ubifs: Remove select for non-existent option

There is no 'config CRC32', remove the select that was attempting to use
it.

Reported-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
5 years agoRemove whitelist entry for CONFIG_GPIO
Chris Packham [Sat, 13 Apr 2019 08:35:24 +0000 (20:35 +1200)]
Remove whitelist entry for CONFIG_GPIO

CONFIG_GPIO does not exist. There is one hit for it in tegra_gpio.c but
it is a variable name.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agosysreset: select DM_GPIO instead of GPIO
Chris Packham [Sat, 13 Apr 2019 08:35:23 +0000 (20:35 +1200)]
sysreset: select DM_GPIO instead of GPIO

CONFIG_GPIO does not exist. sysreset_gpio.c uses the DM gpio APIs so the
correct option to select is DM_GPIO.

Reported-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agoMerge branch '2019-05-09-master-imports'
Tom Rini [Fri, 10 May 2019 11:07:49 +0000 (07:07 -0400)]
Merge branch '2019-05-09-master-imports'

- Minor fixes (ata memory leak, implement feedback on ohci-da8xx
  changes, avb test fix, mmc test fix, spelling fixes, make FIT really
  optional, fit-dtb blob cleanups, TI K3 workflow improvements, bootz
  can boot barebox on 32bit ARM).

5 years agoremoteproc: k3_system_controller: Increase rx timeout
Lokesh Vutla [Thu, 2 May 2019 10:05:52 +0000 (15:35 +0530)]
remoteproc: k3_system_controller: Increase rx timeout

There is one case where 400ms is not sufficient for loading the
system firmware:
- System firmware is not signed with rsa degenerate key.
- ROM loading the sysfw directly from SPI flash which is in memory
  mapped mode.

The above scenario is definitely not desired in production use cases
as it effects boot time. But still keeping this support as this is
a valid boot scenario.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
5 years agoarm: k3: config.mk: Use k3_gen_x509_cert.sh to generate boot images
Lokesh Vutla [Thu, 2 May 2019 10:05:51 +0000 (15:35 +0530)]
arm: k3: config.mk: Use k3_gen_x509_cert.sh to generate boot images

Instead of overlading makefile, use the k3_gen_x509_cert.sh script
to generate boot images.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
5 years agotools: k3_get_x509 cert: Add a script to generate x509 certificate for K3 devices
Lokesh Vutla [Thu, 2 May 2019 10:05:50 +0000 (15:35 +0530)]
tools: k3_get_x509 cert: Add a script to generate x509 certificate for K3 devices

TI's K3 boot architecture mandates a x509 certificate for every boot image.
While signing the image K3 ROM allows for two types of keys based on which
the boot image gets loaded in different ways:
- Degenerate RSA keys: This generates a signature which is equal to the digest.
       When ROM sees this, it does a DMA for copying the images,
       which significantly improves the boot time.
- Any other key: Does a memcpy to load the image. This is introduced as a
 fallback for DMA copy.

Add a script for generating boot images with the above options. Default
generates image using rsa degenerate key in order to improve boot time.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
5 years agoSet time and umask on fit-dtb.blob to ensure reproducibile builds.
Vagrant Cascadian [Thu, 2 May 2019 18:14:12 +0000 (11:14 -0700)]
Set time and umask on fit-dtb.blob to ensure reproducibile builds.

Support for compressed fit-dtb.blob was added in:

  commit 95f4bbd581cf ("lib: fdt: Allow LZO and GZIP DT compression in
  U-Boot")

When building compressed (lzop, gzip) fit-dtb.blob images, the
compression tool may embed the time or umask in the image.

Work around this by manually setting the time of the source file using
SOURCE_DATE_EPOCH and a hard-coded 0600 umask.

With gzip, this could be accomplished by using -n/--no-name, but lzop
has no current workaround:

  https://bugs.debian.org/896520

This is essentially the same fix applied to multi-dtb fit SPL images in:

  commit 8664ab7debab ("Set time and umask on multi-dtb fit images to
  ensure reproducibile builds.")

Signed-off-by: Vagrant Cascadian <vagrant@reproducible-builds.org>
5 years agoRemove fit-dtb.blob* in clean target.
Vagrant Cascadian [Thu, 2 May 2019 18:14:11 +0000 (11:14 -0700)]
Remove fit-dtb.blob* in clean target.

Support for compressed fit-dtb.blob was added in:

  commit 95f4bbd581cf ("lib: fdt: Allow LZO and GZIP DT compression in
  U-Boot")

Adjust Makefile to also clean compressed blobs.

Signed-off-by: Vagrant Cascadian <vagrant@reproducible-builds.org>
5 years agoAdd fit-dtb.blob* to .gitignore.
Vagrant Cascadian [Thu, 2 May 2019 18:14:10 +0000 (11:14 -0700)]
Add fit-dtb.blob* to .gitignore.

Support for compressed fit-dtb.blob was added in:

  commit 95f4bbd581cf ("lib: fdt: Allow LZO and GZIP DT compression in
  U-Boot")

Adjust .gitignore to also exclude compressed blobs.

Signed-off-by: Vagrant Cascadian <vagrant@reproducible-builds.org>
5 years agoarm: zimage: add barebox image magic number
Christoph Fritz [Fri, 3 May 2019 11:19:49 +0000 (13:19 +0200)]
arm: zimage: add barebox image magic number

For chainboot configurations or test environments, this patch allows
booting barebox images by using command bootz.

Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com>
5 years agotest/py: don't use mmc_rd config for other mmc tests
Stephen Warren [Tue, 16 Apr 2019 22:04:49 +0000 (16:04 -0600)]
test/py: don't use mmc_rd config for other mmc tests

Fix test_mmc_dev(), test_mmc_rescan(), test_mmc_info() not to use the
same configuration data that test_mmc_rd() does. Doing so causes the
following issues:

* The new code uncondtionally expects certain keys to exist in the
configuration data. These keys do not exist in existing configuration
data since they were not previously required, and there was no
notification re: a requirement to add these new keys. This causes test
failures due to thrown exceptions when accessing the non-existent keys.

* The new tests logically operate on different objects. test_mmc_rd()
operates on ranges of sectors on an MMC device (which may be the entire
set of sectors of a device, or a part of a device), whereas all the new
tests operate solely on entire devices. These are separate things, and
it's entirely likely that the user will wish to runs the two types of
tests on different sets of data; see the example configuration data that
this commit adds. Ideally, the new tests would have been added to a
separate Python file, since they aren' closely related to the existing
tests.

FIXME: Marek, can you please replace the "???" in this patch with some
reasonable looking data? Thanks.

Cc: Marek Vasut <marek.vasut@gmail.com>
Fixes: 4ffec8cdf512 ("test/py: mmc: Add 'mmc info' test")
Fixes: ce4b2cafa79c ("test/py: mmc: Add 'mmc rescan' test")
Fixes: 86dfd152c917 ("test/py: mmc: Add 'mmc dev' test")
Signed-off-by: Stephen Warren <swarren@nvidia.com>
5 years agofdt_shrink_to_minimum: do not mark fdt space reserved unconditionally
Simon Goldschmidt [Fri, 3 May 2019 19:19:03 +0000 (21:19 +0200)]
fdt_shrink_to_minimum: do not mark fdt space reserved unconditionally

This function merely relocates the fdt blob, so don't let it alter
it by adding reservations that didn't exist before.

Instead, if the memory used for the fdt blob has been reserved
before calling this function, ensure the relocated memory is
marked as reserved instead.

Reported-by: Keerthy <j-keerthy@ti.com>
Reported-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
5 years agoMake FIT support really optional
Fabrice Fontaine [Fri, 3 May 2019 20:37:05 +0000 (22:37 +0200)]
Make FIT support really optional

Due to some mistakes in the source code, it was not possible to really
turn FIT support off. This commit fixes the problem by means of the
following changes:

- Enclose "bootm_host_load_image" and "bootm_host_load_images" between
  checks for CONFIG_FIT_SIGNATURE, in common/bootm.c.

- Enclose the declaration of "bootm_host_load_images" between checks for
  CONFIG_FIT_SIGNATURE, in common/bootm.h.

- Condition the compilation and linking of fit_common.o fit_image.o
  image-host.o common/image-fit.o to CONFIG_FIT=y, in tools/Makefile.

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
[fabio: adapt for 2016.07]
Signed-off-by: Fabio Estevam <festevam@gmail.com>
[Ricardo: fix conditional compilation and linking of the files mentioned above
for 2016.07]
Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com>
[Jörg: adapt for 2019.01]
Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
[Retrieved from:
https://git.buildroot.net/buildroot/tree/package/uboot-tools/0003-Make-FIT-support-really-optional.patch]
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
5 years agoFix spelling of available.
Vagrant Cascadian [Fri, 3 May 2019 22:28:37 +0000 (14:28 -0800)]
Fix spelling of available.

Signed-off-by: Vagrant Cascadian <vagrant@debian.org>
5 years agoenv: spi: Fix incorrect entry description
Marek Vasut [Sat, 4 May 2019 17:10:05 +0000 (19:10 +0200)]
env: spi: Fix incorrect entry description

Fix the max frequency entry description, it's incorrect.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Chris Brandt <chris.brandt@renesas.com>
Cc: Jagan Teki <jagan@amarulasolutions.com>
Cc: Tom Rini <trini@konsulko.com>
5 years agotest/py: avb: fix test_avb_persistent_values fail
Igor Opaniuk [Mon, 6 May 2019 09:07:31 +0000 (12:07 +0300)]
test/py: avb: fix test_avb_persistent_values fail

Fix test_avb_persistent_values() pytest, which was failing because of
wrong size value provided from tee sandbox driver.

Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Igor Opaniuk <igor.opaniuk@gmail.com>
5 years agoata: ahci: fix memory leak
Christian Gmeiner [Mon, 6 May 2019 13:18:54 +0000 (15:18 +0200)]
ata: ahci: fix memory leak

malloc(..) and memalign(..) are both allocating memory and as a result
we leak the memory allocated with malloc(..).

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agousb: ohci: ohci-da8xx: Cleanup Error handling and fix flags
Adam Ford [Tue, 7 May 2019 11:57:39 +0000 (06:57 -0500)]
usb: ohci: ohci-da8xx: Cleanup Error handling and fix flags

Per feedback from Marek, he suggested better handling and
to enable DM_FLAG_OS_PREPARE, this patch re-orders some of
the error checking, and errors returns the error code right
away and also sets DM_FLAG_OS_PREPARE.

Signed-off-by: Adam Ford <aford173@gmail.com>
5 years agodm: MIGRATION: Add migration plan for WDT (DM watchdog support)
Stefan Roese [Thu, 9 May 2019 08:16:20 +0000 (10:16 +0200)]
dm: MIGRATION: Add migration plan for WDT (DM watchdog support)

As much of the watchdog system has been migrated to DM now, formalize a
deadline for migration.

Please note that the old CONFIG_HW_WATCHDOG macro should be removed
completely at some point.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
5 years agoMerge tag 'rockchip-for-v2019.07-rc1' of git://git.denx.de/u-boot-rockchip
Tom Rini [Thu, 9 May 2019 11:12:51 +0000 (07:12 -0400)]
Merge tag 'rockchip-for-v2019.07-rc1' of git://git.denx.de/u-boot-rockchip

Improvements and new features:
- split more rockchip pinctrl_core feature into per SoC
- enable TPL for evb-rk3399 board
- enable TPL/SPL for evb-px5 board
- enable TPL and OP-TEE support for evb-rk3229
- update fix in arm common assembly start code for rockchip header file
- update default SPL_FIT_GENERATOR for rockchip
- rk3399 boards update to use '-u-boot.dtsi'
- add new rk3399 boards: Nanopi M4, Nanopc T4
- enable sound for chromebook_minnie

5 years agoMerge git://git.denx.de/u-boot-marvell
Tom Rini [Thu, 9 May 2019 11:12:25 +0000 (07:12 -0400)]
Merge git://git.denx.de/u-boot-marvell

- DM updates for multiple MVEBU boards (Stefan)
- Add CRS305-1G-4S board (Luka)
- Enable MMC in SPL on clearfog (Baruch)

5 years agoMerge git://git.denx.de/u-boot-riscv
Tom Rini [Thu, 9 May 2019 11:11:52 +0000 (07:11 -0400)]
Merge git://git.denx.de/u-boot-riscv

- Correct SYS_TEXT_BASE for qemu.
- Support booti.
- Increase SYSBOOTM_LEN for Fedora/RISCV kernel.
- Support SMP booting from flash.

5 years agoMerge tag 'u-boot-amlogic-20190509' of git://git.denx.de/u-boot-amlogic
Tom Rini [Thu, 9 May 2019 11:11:39 +0000 (07:11 -0400)]
Merge tag 'u-boot-amlogic-20190509' of git://git.denx.de/u-boot-amlogic

- Add USB PHY drivers for Amlogic G12A
- Add USB Complex Glue driver for Amlogic G12A
- Add USB Gadget support for Amlogic G12A

5 years agodoc: rockchip: Add global doc for rk3399 build/flash
Jagan Teki [Wed, 8 May 2019 05:41:51 +0000 (11:11 +0530)]
doc: rockchip: Add global doc for rk3399 build/flash

Since rockchip have an individual doc/README.rockchip, it would
be better to update the same instead of maintaining it separately
in board files.

So, add the documentation for rk3399
- procedure to build for Rockchip miniloader and
  U-Boot SPL options
- procedure to boot from SD for Rockchip miniloader and
  U-Boot SPL options
- procedure to build ATF, PMU M0 firmware for puma boards
- add boot logs of each option, so-that it would help for future
  boards porting

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
5 years agorockchip: rk3399: Add Nanopc T4 board support
Jagan Teki [Wed, 8 May 2019 05:41:47 +0000 (11:11 +0530)]
rockchip: rk3399: Add Nanopc T4 board support

Add initial support for Nanopc T4 board.

Specification
- Rockchip RK3399
- Dual-Channel 4GB LPDDR3-1866
- SD card slot
- 16GB eMMC
- RTL8211E 1Gbps
- AP6356S WiFI/BT
- HDMI In/Out, DP, MIPI DSI/CSI, eDP
- USB 3.0, 2.0
- USB Type C power and data
- GPIO expansion ports
- DC 12V/2A

Commit details of rk3399-nanopc-t4.dts sync from Linux 5.1-rc2:
"arm64: dts: rockchip: Add NanoPC-T4 IR receiver"
(sha1: 95658e21b1707ad7844f873db2fdaa295109a5a3)

Tested-by: Daniel Gröber <dxld@darkboxed.org>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
5 years agorockchip: rk3399: Add Nanopi M4 board support
Jagan Teki [Wed, 8 May 2019 05:41:46 +0000 (11:11 +0530)]
rockchip: rk3399: Add Nanopi M4 board support

Add initial support for Nanopi M4 board.

Specification
- Rockchip RK3399
- Dual-Channel 4GB LPDDR3-1866
- SD card slot
- eMMC socket
- RTL8211E 1Gbps
- AP6356S WiFI/BT
- HDMI In/Out, DP, MIPI DSI/CSI
- USB 3.0 x4
- USB Type C power and data
- GPIO1, GPIO2 expansion ports
- DC5V/3A

Commit details of rk3399-nanopi-m4.dts sync from Linux 5.1-rc2:
"arm64: dts: rockchip: Refine nanopi4 differences"
(sha1: c62ffaf5026d0b7633e62b2cea8450b5543c349a)

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
5 years agorockchip: dts: rk3399: nanopi4: Use CD pin as RK_FUNC_1
Jagan Teki [Wed, 8 May 2019 05:41:45 +0000 (11:11 +0530)]
rockchip: dts: rk3399: nanopi4: Use CD pin as RK_FUNC_1

Attaching GPIO functionality to SDMMC0_DET pin (which
does in Linux base dts) make dwmmc driver "fail to detect
the card".

  Card did not respond to voltage select!

It may be because the existing driver can't support gpio
card detection. So, change the pinctrl functionality from
RK_FUNC_GPIO to RK_FUNC_1 like other rk3399 dts does via
sdmmc_cd pin.

Cc: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
5 years agoRISCV: image: Add booti support
Atish Patra [Tue, 7 May 2019 00:49:39 +0000 (17:49 -0700)]
RISCV: image: Add booti support

This patch adds booti support for RISC-V Linux kernel. The existing
bootm method will also continue to work as it is.

It depends on the following kernel patch which adds the header to the
flat Image. Gzip compressed Image (Image.gz) support is not enabled with
this patch.

https://patchwork.kernel.org/patch/10925543/

Tested on HiFive Unleashed and QEMU.

Signed-off-by: Atish Patra <atish.patra@wdc.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Karsten Merker <merker@debian.org>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
5 years agoriscv: configs: AE350 will use CONFIG_OF_SEPARATE when boots from flash
Rick Chen [Tue, 30 Apr 2019 05:49:37 +0000 (13:49 +0800)]
riscv: configs: AE350 will use CONFIG_OF_SEPARATE when boots from flash

When AE350 boots from flash, use CONFIG_OF_SEPARATE instead of
CONFIG_OF_BOARD.

Also remove unused code about prior_stage_fdt_address.
And modify CONFIG_SYS_FDT_BASE as flash address.

Signed-off-by: Rick Chen <rick@andestech.com>
Cc: Greentime Hu <greentime@andestech.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
5 years agoriscv: configs: AE350 will use CONFIG_OF_PRIOR_STAGE when boots from ram
Rick Chen [Tue, 30 Apr 2019 05:49:36 +0000 (13:49 +0800)]
riscv: configs: AE350 will use CONFIG_OF_PRIOR_STAGE when boots from ram

When AE350 boots from ram, use CONFIG_OF_PRIOR_STAGE instead
of CONFIG_OF_BOARD.

Signed-off-by: Rick Chen <rick@andestech.com>
Cc: Greentime Hu <greentime@andestech.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
5 years agoriscv: prior_stage_fdt_address should only be used when OF_PRIOR_STAGE is enabled
Rick Chen [Tue, 30 Apr 2019 05:49:35 +0000 (13:49 +0800)]
riscv: prior_stage_fdt_address should only be used when OF_PRIOR_STAGE is enabled

This patch will fix prior_stage_fdt_address write failure problem, when
AE350 boots from flash.

When AE350 boots from flash, prior_stage_fdt_address will be flash
address, we shall avoid it to be written.

Signed-off-by: Rick Chen <rick@andestech.com>
Cc: Greentime Hu <greentime@andestech.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
5 years agoriscv: configs: Support AE350 SMP booting from flash flow
Rick Chen [Thu, 9 May 2019 02:20:19 +0000 (10:20 +0800)]
riscv: configs: Support AE350 SMP booting from flash flow

Add two defconfigs to support AE350 SMP booting from flash.

Signed-off-by: Rick Chen <rick@andestech.com>
Cc: Greentime Hu <greentime@andestech.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
5 years agoriscv: Introduce CONFIG_XIP to support booting from flash
Rick Chen [Tue, 30 Apr 2019 05:49:33 +0000 (13:49 +0800)]
riscv: Introduce CONFIG_XIP to support booting from flash

When U-Boot boots from flash, during the boot process,
hart_lottery and available_harts_lock variable addresses
point to flash which is not writable. This causes boot
failures on AE350. Introduce a config option CONFIG_XIP
to support such configuration.

Signed-off-by: Rick Chen <rick@andestech.com>
Cc: Greentime Hu <greentime@andestech.com>
Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agoriscv: qemu: Use correct SYS_TEXT_BASE for S-mode on 32bit system
Anup Patel [Thu, 11 Apr 2019 06:52:12 +0000 (06:52 +0000)]
riscv: qemu: Use correct SYS_TEXT_BASE for S-mode on 32bit system

For 32bit system, the OpenSBI (or BBL) will jump to 0x80400000 address
in S-mode whereas for 64bit system it will jump to 0x80200000 address
in S-mode.

Currently, the S-mode U-Boot sets SYS_TEXT_BASE to 0x80200000 for both
32bit and 64bit system. This breaks S-mode U-Boot for 32bit system.

This patch sets different SYS_TEXT_BASE for 32bit and 64bit system so
that S-mode U-Boot works fine for both.

Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Tested-by: Karsten Merker <merker@debian.org>
5 years agoriscv: qemu-riscv.h: define CONFIG_PREBOOT (enables extlinux)
David Abdurachmanov [Tue, 9 Apr 2019 10:42:47 +0000 (12:42 +0200)]
riscv: qemu-riscv.h: define CONFIG_PREBOOT (enables extlinux)

- Set fdt_addr variable, which is needed for extlinux to find FDT.
  Otherwise booting kernel using extlinux results in missing FDT.

- Also run fdt addr with FDT address so that fdt commands would
  work out of the box in U-Boot prompt.

This is successfully used by Fedora/RISCV with 5.1-rc3+ kernel using
OpenSBI -> U-Boot (S-mode) [extlinux] -> Kernel setup.

Signed-off-by: David Abdurachmanov <david.abdurachmanov@gmail.com>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agoriscv: set CONFIG_SYS_BOOTM_LEN to SZ_64M
David Abdurachmanov [Tue, 9 Apr 2019 10:42:46 +0000 (12:42 +0200)]
riscv: set CONFIG_SYS_BOOTM_LEN to SZ_64M

After updating Fedora/RISCV kernel to 5.1-rc3+ the size increased above
the current threshold. Looking into HiKey, Dragonboards, etc. seems that
SZ_64M is a popular option.

This sucessfully boots Fedora/RISCV with 5.1-rc3+ kernel on QEMU 4.0 (master)
with OpenSBI -> U-Boot (S-mode) [extlinux] -> Kernel setup.

Signed-off-by: David Abdurachmanov <david.abdurachmanov@gmail.com>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agomach-meson: g12a: add DWC2 peripheral mode support
Neil Armstrong [Tue, 19 Feb 2019 13:21:04 +0000 (14:21 +0100)]
mach-meson: g12a: add DWC2 peripheral mode support

Adds support for Amlogic G12A USB Device mode.

The DWC2 Controller behind the Glue can be connected to an OTG
capable PHY. The Glue setups the PHY mode.

This patch implements Device mode support by adding a board_usb_init/cleanup
setting up the DWC2 controller and switch the OTG capable port to Device
before starting the DWC2 controller in Device mode.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
5 years agophy: meson: add Amlogic G12A USB2 and USB3+PCIE PHY drivers
Neil Armstrong [Tue, 19 Feb 2019 14:17:29 +0000 (15:17 +0100)]
phy: meson: add Amlogic G12A USB2 and USB3+PCIE PHY drivers

This adds support for the USB PHYs found in the Amlogic G12A SoC Family.

The USB2 PHY supports Host and/or Peripheral mode, depending on it's position.
The first PHY is only used as Host, but the second supports Dual modes
defined by the USB Control Glue HW in front of the USB Controllers.

The second driver supports USB3 Host mode or PCIE 2.0 mode, depending on
the layout of the board.
Selection is done by the #phy-cells, making the mode static and exclusive.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
5 years agousb: dwc3: Add Meson G12A USB Glue
Neil Armstrong [Tue, 19 Feb 2019 12:42:01 +0000 (13:42 +0100)]
usb: dwc3: Add Meson G12A USB Glue

Adds support for Amlogic G12A USB Control Glue HW.

The Amlogic G12A SoC Family embeds 2 USB Controllers :
- a DWC3 IP configured as Host for USB2 and USB3
- a DWC2 IP configured as Peripheral USB2 Only

A glue connects these both controllers to 2 USB2 PHYs, and optionnally
to an USB3+PCIE Combo PHY shared with the PCIE controller.

The Glue configures the UTMI 8bit interfaces for the USB2 PHYs, including
routing of the OTG PHY between the DWC3 and DWC2 controllers, and
setups the on-chip OTG mode selection for this PHY.

This driver sets the OTG capable port as Host mode by default,
the switch to Device mode is to be done in a separate patch.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Marek Vasut <marex@denx.de>
5 years agoarm: mvebu: clearfog: add MMC to SPL DT
Baruch Siach [Wed, 8 May 2019 14:47:32 +0000 (17:47 +0300)]
arm: mvebu: clearfog: add MMC to SPL DT

This allows SPL to load the main U-Boot image from MMC once DM_MMC is
enabled.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Stefan Roese <sr@denx.de>
Signed-off-by: Stefan Roese <sr@denx.de>
5 years agoarm: mvebu: Add CRS305-1G-4S board
Luka Kovacic [Tue, 7 May 2019 17:35:55 +0000 (19:35 +0200)]
arm: mvebu: Add CRS305-1G-4S board

CRS305-1G-4S has a switch chip with an integrated CPU (98DX3236) and
like some of the other similar boards requires bin_hdr.
bin_hdr (DDR3 init stage) is currently retrieved from the stock
bootloader and compiled into the kwb image.

Adds support for U-Boot, enable UART, SPI, Winbond SPI flash chip
support and writing env to SPI flash.

Signed-off-by: Luka Kovacic <me@lukakovacic.xyz>
Reviewed-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Signed-off-by: Stefan Roese <sr@denx.de>
5 years agoarm: mvebu: db-88f6820-gp: Enable BLK and DM support
Stefan Roese [Fri, 3 May 2019 06:42:19 +0000 (08:42 +0200)]
arm: mvebu: db-88f6820-gp: Enable BLK and DM support

This patch enables CONFIG_BLK and some DM enabled drivers on
db-88f6820-gp to remove these compile warnings:

===================== WARNING ======================
This board does not use CONFIG_DM_MMC. Please update
the board to use CONFIG_DM_MMC before the v2019.04 release.
Failure to update by the deadline may result in board removal.
See doc/driver-model/MIGRATION.txt for more info.
====================================================
===================== WARNING ======================
This board does not use CONFIG_DM_USB. Please update
the board to use CONFIG_DM_USB before the v2019.07 release.
Failure to update by the deadline may result in board removal.
See doc/driver-model/MIGRATION.txt for more info.
====================================================
===================== WARNING ======================
This board does use CONFIG_LIBATA but has CONFIG_AHCI not
enabled. Please update the storage controller driver to use
CONFIG_AHCI before the v2019.07 release.
Failure to update by the deadline may result in board removal.
See doc/driver-model/MIGRATION.txt for more info.
====================================================

Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Chris Packham <judge.packham@gmail.com>
5 years agoarm: mvebu: db-88f6720: Enable CONFIG_BLK
Stefan Roese [Fri, 3 May 2019 06:42:18 +0000 (08:42 +0200)]
arm: mvebu: db-88f6720: Enable CONFIG_BLK

This patch enables CONFIG_BLK to remove this compile warning:

===================== WARNING ======================
This board does not use CONFIG_DM_USB. Please update
the board to use CONFIG_DM_USB before the v2019.07 release.
Failure to update by the deadline may result in board removal.
See doc/driver-model/MIGRATION.txt for more info.
====================================================

Signed-off-by: Stefan Roese <sr@denx.de>
5 years agoarm: mvebu: clearfog: Enable BLK and DM support
Stefan Roese [Fri, 3 May 2019 06:42:17 +0000 (08:42 +0200)]
arm: mvebu: clearfog: Enable BLK and DM support

This patch enables CONFIG_BLK and some DM enabled drivers on clearfog
to remove these compile warnings:

===================== WARNING ======================
This board does not use CONFIG_DM_MMC. Please update
the board to use CONFIG_DM_MMC before the v2019.04 release.
Failure to update by the deadline may result in board removal.
See doc/driver-model/MIGRATION.txt for more info.
====================================================
===================== WARNING ======================
This board does not use CONFIG_DM_USB. Please update
the board to use CONFIG_DM_USB before the v2019.07 release.
Failure to update by the deadline may result in board removal.
See doc/driver-model/MIGRATION.txt for more info.
====================================================
===================== WARNING ======================
This board does use CONFIG_LIBATA but has CONFIG_AHCI not
enabled. Please update the storage controller driver to use
CONFIG_AHCI before the v2019.07 release.
Failure to update by the deadline may result in board removal.
See doc/driver-model/MIGRATION.txt for more info.
====================================================

Signed-off-by: Stefan Roese <sr@denx.de>
5 years agoMerge branch 'master' of git://git.denx.de/u-boot-net
Tom Rini [Thu, 9 May 2019 02:46:31 +0000 (22:46 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-net

- Various PHY fixes / enhancements.
- TI K2G fixes

5 years agonet: phy: micrel: Find Micrel PHY node correctly
James Byrne [Mon, 4 Mar 2019 17:40:34 +0000 (17:40 +0000)]
net: phy: micrel: Find Micrel PHY node correctly

In some of the device trees that specify skew values for KSZ90x1 PHYs
the values are stored (incorrectly) in the MAC node, whereas in others
it is in an 'ethernet-phy' subnode. Previously the code would fail to
find and program these skew values, so this commit changes it to look
for an "ethernet-phy" subnode first, and revert to looking in the MAC
node if there isn't one.

The device trees affected (where the skew values are in a subnode) are
imx6qdl-icore-rqs.dtsi, r8a77970-eagle.dts, r8a77990-ebisu.dts,
r8a77995-draak.dts, salvator-common.dtsi, sama5d3xcm.dtsi,
sama5d3xcm_cmp.dtsi, socfpga_cyclone5_vining_fpga.dts,
socfpga_stratix10_socdk.dts and ulcb.dtsi. Before this change the skew
values in these device trees would be ignored.

The device trees where the skew values are in the MAC node are
socfpga_arria10_socdk.dtsi, socfpga_arria5_socdk.dts,
socfpga_cyclone5_de0_nano_soc.dts, socfpga_cyclone5_de10_nano.dts,
socfpga_cyclone5_de1_soc.dts, socfpga_cyclone5_is1.dts,
socfpga_cyclone5_socdk.dts, socfpga_cyclone5_sockit.dts. These should be
unaffected by this change.

The changes were tested on a sama5d3xcm.

Signed-off-by: James Byrne <james.byrne@origamienergy.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agonet: phy: micrel: Use correct skew values on KSZ9021
James Byrne [Mon, 4 Mar 2019 17:40:33 +0000 (17:40 +0000)]
net: phy: micrel: Use correct skew values on KSZ9021

Commit ff7bd212cb8a ("net: phy: micrel: fix divisor value for KSZ9031
phy skew") fixed the skew value divisor for the KSZ9031, but left the
code using the same divisor for the KSZ9021, which is incorrect.

The preceding commit c16e69f702b1 ("net: phy: micrel: add documentation
for Micrel KSZ90x1 binding") added the DTS documentation for the
KSZ90x1, changing it from the equivalent file in the Linux kernel to
correctly state that for this part the skew value is set in 120ps steps,
whereas the Linux documentation and driver continue to this day to use
the incorrect value of 200 that came from the original KSZ9021 datasheet
before it was corrected in revision 1.2 (Feb 2014).

This commit sorts out the resulting confusion in a consistent way by
making the following changes:

- Update the documentation to be clear about what the skew values mean,
in the same was as for the KSZ9031.

- Update the Micrel PHY driver to select the appropriate divisor for
both parts.

- Adjust all the device trees that state skew values for KSZ9021 PHYs to
use values based on 120ps steps instead of 200ps steps. This will result
in the same values being programmed into the skew registers as the
equivalent device trees in the Linux kernel do, where it incorrectly
uses 200ps steps (since that's where all these device trees were copied
from).

Signed-off-by: James Byrne <james.byrne@origamienergy.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agonet: phy: aquantia: Set only autoneg on in register 4.c441
Valentin-catalin Neacsu [Wed, 13 Feb 2019 09:14:53 +0000 (09:14 +0000)]
net: phy: aquantia: Set only autoneg on in register 4.c441

For AQR405 in register 4.c441 bit 15 was override with 0. This caused the
phy to not negotiate at 2.5GB rate with mac. To avoid
this override it needed first to know the previous value of reg 4.c441
and set only bit 3.

Signed-off-by: Valentin Catalin Neacsu <valentin-catalin.neacsu@nxp.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agonet: phy: Fix return value check phy_probe
Siva Durga Prasad Paladugu [Mon, 4 Mar 2019 15:02:11 +0000 (16:02 +0100)]
net: phy: Fix return value check phy_probe

Don't ignore return value of phy_probe() call as
the probe may fail and it needs to be reported.

Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agonet: phy: Reloc next and prev pointers inside phy_drivers
Siva Durga Prasad Paladugu [Mon, 4 Mar 2019 15:01:30 +0000 (16:01 +0100)]
net: phy: Reloc next and prev pointers inside phy_drivers

This patch relocates the pointers inside phy_drivers incase
of manual reloc. Without this reloc, these points to invalid
pre relocation address and hence causes exception or hang.

Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agoARM: k2g-ice: Add pinmux support for rgmii interface
Murali Karicheri [Mon, 25 Feb 2019 20:27:34 +0000 (15:27 -0500)]
ARM: k2g-ice: Add pinmux support for rgmii interface

This add pinmux configuration for rgmii interface so that network
driver can be supported on K2G ICE boards. The pinmux configurations
for this are generated using the pinmux tool at
https://dev.ti.com/pinmux/app.html#/default

As this required some BUFFER_CLASS definitions, same is re-used
from the linux defnitions in include/dt-bindings/pinctrl/keystone.h

Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agoARM: k2g-gp-evm: update to rgmii pinmux configuration
Murali Karicheri [Mon, 25 Feb 2019 20:27:33 +0000 (15:27 -0500)]
ARM: k2g-gp-evm: update to rgmii pinmux configuration

This patch updates pinmux configuration for K2G GP EVM based on
data generated by the pinmux tool at
https://dev.ti.com/pinmux/app.html#/default

Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agodrivers: net: ldpaa_eth: fix resource leak
Pankaj Bansal [Fri, 8 Feb 2019 08:46:11 +0000 (08:46 +0000)]
drivers: net: ldpaa_eth: fix resource leak

if an error occurs in ldpaa_eth_init, need to free all resources
before returning the error.

Threfore, free net_dev before returning from ldpaa_eth_init.

Signed-off-by: Pankaj Bansal <pankaj.bansal@nxp.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agoMerge branch 'master' of git://git.denx.de/u-boot-sunxi
Tom Rini [Wed, 8 May 2019 20:21:43 +0000 (16:21 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-sunxi

- H6 Beelink GS1 board (Clément)
- Olimex A64-Teres-I board (Jonas)
- sunxi build fix for CONFIG_CMD_PXE|DHCP (Ondrej)
- Change include order (Jagan)
- EPHY clock changes (Jagan)
- EMAC enablement on Cubietruck Plus, BPI-M3 (Chen-Yu Tsai)

5 years agosunxi: Enable EMAC on the Bananapi M3
Chen-Yu Tsai [Fri, 3 May 2019 02:27:41 +0000 (10:27 +0800)]
sunxi: Enable EMAC on the Bananapi M3

The Bananapi M3 has an RTL8211E PHY connected to the EMAC using
RGMII. The PHY is powered by DCDC1 through SW @ 3.3V.

The board is designed to use 3.3V with RGMII, instead of the standard
reduced voltage of 2.5V we see everywhere. DLDO3, which provides the
I/O voltages, is raised to match.

This patch enables the EMAC and Realtek PHY drivers in the defconfig.
The device tree file already has the EMAC enabled.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
5 years agosunxi: Enable EMAC on the Cubietruck Plus
Chen-Yu Tsai [Fri, 3 May 2019 02:27:40 +0000 (10:27 +0800)]
sunxi: Enable EMAC on the Cubietruck Plus

The Cubietruck Plus has an RTL8211E PHY connected to the EMAC using
RGMII. The PHY is powered by DLDO4 @ 3.3V, while the I/O pins are
powered by DLDO3 @ 2.5V.

This patch enables the EMAC and Realtek PHY drivers in the defconfig.
The device tree file already has the EMAC enabled.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
5 years agosun50i: a64: Add Olimex A64-Teres-I board initial support
Jonas Smedegaard [Sat, 20 Apr 2019 10:24:16 +0000 (18:24 +0800)]
sun50i: a64: Add Olimex A64-Teres-I board initial support

Olimex A64-Teres-I board is a mainboard (the only one so far)
for Olimex Teres-I DIY laptop kit.

Key features:
- Allwinner A64 Cortex-A53
- Mali-400MP2 GPU
- AXP803 PMIC
- 2GB DDR3 RAM
- MicroSD Slot
- 16GB eMMC Flash
- eDP LCD display
- HDMI
- USB Host
- Battery management
- 5V DC power supply
- Certified Open Source Hardware (OSHW)

Works:
- i2C
- MMC/SD
- PWM backlight

Known broken:
- Internal keyboard (seems to be because the keyboard firmware loads a
bootloader first, and then disconnects bootloader and connect real
keyboard). External ones connected to the USB port work fine.

This patch enables support for the A64-Teres-I board to u-boot,
including enabling screen backlight (lacking from Linux device-tree).

Linux commit details about the sun50i-a64-teres-i.dts sync:
"arm64: dts: allwinner: a64: Rename uart0_pins_a label to uart0_pb_pins"
(sha1: d91ebb95b96c8840932dc3a10c9f243712555467)

Cosmetic warnings regarding whitespace and placement of SPDX notice for
dts file was ignored.

config and .dtsi file are adapted from pinebook files.

Tested-by: Jonas Smedegaard <dr@jones.dk>
Signed-off-by: Jonas Smedegaard <dr@jones.dk>
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
[jagan: move board entry in MAINTAINERS file at proper position]
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
5 years agonet: sun8i_emac: Add EPHY CLK and RESET support
Jagan Teki [Wed, 27 Feb 2019 18:57:00 +0000 (00:27 +0530)]
net: sun8i_emac: Add EPHY CLK and RESET support

Add EPHY CLK and RESET support for sun8i_emac driver to
enable EPHY TX clock and EPHY reset pins via CLK and RESET
framework.

Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Lothar Felten <lothar.felten@gmail.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agotest/dm: reset: Add reset_get_by_index[_nodev] test
Jagan Teki [Wed, 27 Feb 2019 18:56:56 +0000 (00:26 +0530)]
test/dm: reset: Add reset_get_by_index[_nodev] test

Add sample dm reset test for reset_get_by_index and
reset_get_by_index_nodev functionality code.

Cc: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agoreset: Get the RESET by index without device
Jagan Teki [Wed, 27 Feb 2019 18:56:55 +0000 (00:26 +0530)]
reset: Get the RESET by index without device

Getting a RESET by index with device is not straight forward
for some use-cases like handling clock operations for child
node in parent driver. So we need to process the child node
in parent probe via ofnode and process RESET operation for child
without udevice but with ofnode.

So add reset_get_by_index_nodev() and move the common code
in reset_get_by_index_tail() to use for reset_get_by_index()

Cc: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agotest/dm: clk: Add clk_get_by_index[_nodev] test
Jagan Teki [Tue, 5 Mar 2019 14:12:44 +0000 (19:42 +0530)]
test/dm: clk: Add clk_get_by_index[_nodev] test

Add sample dm clk test for clk_get_by_index and
clk_get_by_index_nodev functionality code.

Cc: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agoclk: Use clk_get_by_index_tail()
Jagan Teki [Wed, 27 Feb 2019 18:56:53 +0000 (00:26 +0530)]
clk: Use clk_get_by_index_tail()

clk_get_by_index_tail() now handle common clk get by index
code so use it from clk_get_by_indexed_prop().

Cc: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
5 years agoclk: Get the CLK by index without device
Jagan Teki [Wed, 27 Feb 2019 18:56:52 +0000 (00:26 +0530)]
clk: Get the CLK by index without device

Getting a CLK by index with device is not straight forward
for some use-cases like handling clock operations for child
node in parent driver. So we need to process the child node
in parent probe via ofnode and process CLK operation for child
without udevice but with ofnode.

So add clk_get_by_index_nodev() and move the common code
in clk_get_by_index_tail() to use for clk_get_by_index()

Cc: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agoserial: sifive: Change include order
Jagan Teki [Wed, 8 May 2019 14:26:16 +0000 (19:56 +0530)]
serial: sifive: Change include order

Like clk_get_by_index, there is requirement for
clk_get_by_index_nodev. In this case to make common
code functionalities for dev and nodev, clk_get_by_index
is trying to get the index of clock by passing ofnode
instead of actual dev like current gpio uclass does.

In these scenarios with current order of include files
the serial_sifive driver is unable to find CONFIG_ENV_SIZE.

In file included from arch/riscv/include/asm/u-boot.h:23:0,
                 from include/dm/of.h:10,
                 from include/dm/ofnode.h:12,
                 from include/clk.h:11,
                 from drivers/serial/serial_sifive.c:6:
include/environment.h:145:19: error: 'CONFIG_ENV_SIZE'
undeclared here (not in a function); did you mean 'CONFIG_CMD_XIMG'?
 #define ENV_SIZE (CONFIG_ENV_SIZE - ENV_HEADER_SIZE)

So, fix consists of changing the order of include files
in serial_sifive.c to include first common.h file.

Cc: Anup Patel <Anup.Patel@wdc.com>
Cc: Rick Chen <rick@andestech.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
5 years agoclk: sifive: fu540-prci: Change include order
Jagan Teki [Wed, 8 May 2019 14:22:18 +0000 (19:52 +0530)]
clk: sifive: fu540-prci: Change include order

Like clk_get_by_index, there is requirement for
clk_get_by_index_nodev. In this case to make common
code functionalities for dev and nodev, clk_get_by_index
is trying to get the index of clock by passing ofnode
instead of actual dev like current gpio uclass does.

In these scenarios with current order of include files
the fu540-prci driver is unable to find CONFIG_ENV_SIZE.

In file included from arch/riscv/include/asm/u-boot.h:23:0,
                 from include/dm/of.h:10,
                 from include/dm/ofnode.h:12,
                 from include/clk.h:11,
                 from include/clk-uclass.h:13,
                 from drivers/clk/sifive/fu540-prci.c:32:
include/environment.h:145:19: error: 'CONFIG_ENV_SIZE'
undeclared here (not in a function); did you mean 'CONFIG_CMD_XIMG'?
 #define ENV_SIZE (CONFIG_ENV_SIZE - ENV_HEADER_SIZE)

So, fix consists of changing the order of include files
in fu540-prci.c to include first common.h file.

Cc: Anup Patel <Anup.Patel@wdc.com>
Cc: Rick Chen <rick@andestech.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
5 years agospi: atcspi200: Change include order
Jagan Teki [Wed, 8 May 2019 14:12:16 +0000 (19:42 +0530)]
spi: atcspi200: Change include order

Like clk_get_by_index, there is requirement for
clk_get_by_index_nodev. In this case to make common
code functionalities for dev and nodev, clk_get_by_index
is trying to get the index of clock by passing ofnode
instead of actual dev like current gpio uclass does.

In these scenarios with current order of include files
the atcspi200_spi driver is unable to find CONFIG_ENV_SIZE.

In file included from arch/nds32/include/asm/u-boot.h:24,
                 from include/dm/of.h:10,
                 from include/dm/ofnode.h:12,
                 from include/clk.h:11,
                 from drivers/spi/atcspi200_spi.c:9:
include/environment.h:145:19: error: 'CONFIG_ENV_SIZE'
undeclared here (not in a function); did you mean 'CONFIG_CMD_XIMG'?
 #define ENV_SIZE (CONFIG_ENV_SIZE - ENV_HEADER_SIZE)

So, fix consists of changing the order of include files
in atcspi200_spi.c to include first common.h file.

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
5 years agoMerge git://git.denx.de/u-boot-x86
Tom Rini [Wed, 8 May 2019 13:20:19 +0000 (09:20 -0400)]
Merge git://git.denx.de/u-boot-x86

- Allow x86 boards to use TPL, SPL and U-Boot proper
- Update sysreset x86 driver to utilize ACPI registers to do power off
- Add a new chromebook_samus_tpl board for TPL support
- Several minor changes in binman tool

5 years agoMerge tag 'efi-2019-07-rc2-2' of git://git.denx.de/u-boot-efi
Tom Rini [Wed, 8 May 2019 13:20:04 +0000 (09:20 -0400)]
Merge tag 'efi-2019-07-rc2-2' of git://git.denx.de/u-boot-efi

Pull request for UEFI sub-system for v2019.07-rc2 (2)

Fix a bunch of errors in the UEFI sub-system:

* implement missing UnloadImage(),
* implement missing RegisterProtocolNotify(),
* unload images in Exit(),
* parameter checks.

Provide a unit test for UnloadImage().
Remove a redundant function for unit tests.
Clean up the UEFI sub-system initialization

5 years agorockchip: dts: rk3399: Sync rk3399-nanopi4.dtsi from Linux
Jagan Teki [Wed, 8 May 2019 05:41:44 +0000 (11:11 +0530)]
rockchip: dts: rk3399: Sync rk3399-nanopi4.dtsi from Linux

Sync rk3399-nanopi4.dtsi from Linux 5.1-rc2 tag.

Linux commit details about the rk3399-nanopi4.dtsi sync:
"arm64: dts: rockchip: Add nanopi4 bluetooth"
(sha1: 3e2f0bb72be36aa6c14ee7f11ac4dd8014801030)

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
5 years agoarm: rockchip: rk3399: Move common configs in Kconfig
Jagan Teki [Wed, 8 May 2019 05:41:43 +0000 (11:11 +0530)]
arm: rockchip: rk3399: Move common configs in Kconfig

Few SPL and U-Boot proper configs are common to all rk3399 target
defconfigs, move them and select it from platform kconfig.

Moved configs:
-  SPL_ATF
-  SPL_ATF_NO_PLATFORM_PARAM if SPL_ATF
-  SPL_LOAD_FIT
-  SPL_CLK if SPL
-  SPL_PINCTRL if SPL
-  SPL_RAM if SPL
-  SPL_REGMAP if SPL
-  SPL_SYSCON if SPL
-  CLK
-  FIT
-  PINCTRL
-  RAM
-  REGMAP
-  SYSCON
-  DM_PMIC
-  DM_REGULATOR_FIXED

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
5 years agoKconfig: Add default SPL_FIT_GENERATOR for rockchip
Jagan Teki [Wed, 8 May 2019 05:41:42 +0000 (11:11 +0530)]
Kconfig: Add default SPL_FIT_GENERATOR for rockchip

Add default SPL_FIT_GENERATOR py script for rockchip platforms if
specific target enabled SPL_LOAD_FIT.

So, this would help get rid of explicitly mentioning the default
SPL FIT generator in defconfigs. however some targets, like puma_rk3399
still require their own FIT generator so in those cases the default will
override with defconfig defined generator.

Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
5 years agorockchip: dts: rk3399: Sync pwm2_pin_pull_down from Linux 5.1-rc2
Jagan Teki [Wed, 8 May 2019 05:41:41 +0000 (11:11 +0530)]
rockchip: dts: rk3399: Sync pwm2_pin_pull_down from Linux 5.1-rc2

To make successful build with dts(i) files syncing from Linux 5.1-rc2
the rk3399.dtsi would require pwm2_pin_pull_down.

So, sync the pwm2_pin_pull_down node from Linux 5.1-rc2.  Since this
node is strictly not part of any commit alone, I have mentioned
Linux 5.1-rc2 tag for future reference of where would this sync
coming from.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
5 years agorockchip: rk3399: orangepi: Add SPL_TEXT_BASE
Jagan Teki [Tue, 7 May 2019 18:24:40 +0000 (23:54 +0530)]
rockchip: rk3399: orangepi: Add SPL_TEXT_BASE

CONFIG_SPL_TEXT_BASE was available in configs/rk3399_common.h
when the OrangePI rk3399 board supported during first
version patch.

But, later below change which move this config into Kconfig and
same has been merged in mainline tree.
"configs: move CONFIG_SPL_TEXT_BASE to Kconfig"
(sha1: f89d6133eef2e068f9c33853b6584d7fcbfa9d2e)

Unfortunately, the maintainer applied the initial version patch,
instead of looking for next version changes.

Fix it by adding SPL_TEXT_BASE in orangepi-rk3399 defconfig.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
5 years agoarm64: rockchip: dts: rk3399: Use rk3399-u-boot.dtsi
Jagan Teki [Tue, 7 May 2019 18:21:52 +0000 (23:51 +0530)]
arm64: rockchip: dts: rk3399: Use rk3399-u-boot.dtsi

Now we have
- board specific -u-boot.dtsi files for board specific u-boot
  dts changes.
- soc specific rk3399-u-boot.dtsi for soc specific u-boot
  dts changes.

So, include the rk3399-u-boot-dtsi on respective board -u-boot.dtsi
and drop the properties which are globally available in rk3399-u-boot.dtsi

Right now rk3399-u-boot.dtsi has sdmmc, spi1 u-boot,dm-pre-reloc
property and more properties and nodes can be move further based
on the requirements.

This would fix, the -u-boot.dtsi inclusion for evb, firefly, puma
boards that was accidentally merged on below commit.
"rockchip: dts: rk3399: Create initial rk3399-u-boot.dtsi"
(sha1: e05b4a4fa84b65a0c8873e8f34721741fe2bc09d)

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
5 years agorockchip: dts: rk3399-u-boot: Add u-boot, dm-pre-reloc for spi1
Jagan Teki [Tue, 7 May 2019 18:21:51 +0000 (23:51 +0530)]
rockchip: dts: rk3399-u-boot: Add u-boot, dm-pre-reloc for spi1

Add u-boot,dm-pre-reloc property for spi1, so-that the
subsequent rk3399 boards which boot from SPI.

This help to separate the u-boot specific properties away
from base dts files so-that the Linux sync become easy and
meaningful.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
5 years agoarm64: rockchip: dts: rk3399: Add board -u-boot.dtsi files
Jagan Teki [Tue, 7 May 2019 18:21:50 +0000 (23:51 +0530)]
arm64: rockchip: dts: rk3399: Add board -u-boot.dtsi files

Devicetree files in RK3399 platform is synced from Linux, like other
platforms does. Apart from these u-boot in rk3399 would also require
some u-boot specific node like dmc.

dmc node has big chunk of DDR timing parameters which are specific
to specific board, and maintained with rk3399-sdram*.dtsi.

So, create board specific -u-boot.dtsi files and move these sdram dtsi
files accordingly. This would help of maintain u-boot specific changes
separately without touching Linux dts(i) files which indeed easy for
syncing from Linux between releases.

These board specific -u-boot.dtsi can be extendible to add more u-boot
specific nodes or properties in future.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
5 years agodts: Makefile: Build rockchip dtbs based on SoC types
Jagan Teki [Tue, 7 May 2019 18:21:49 +0000 (23:51 +0530)]
dts: Makefile: Build rockchip dtbs based on SoC types

- Sometimes u-boot specific dtsi files are included
  automatically which would build for entire rockchip SoC,
  even-though the respective dtsi should used it for specific
  family of rockchip SoC.
- Sometimes u-boot specific dts nodes or properties can use
  config macros from respective rockchip family include/configs
  files, example CONFIG_SPL_PAD_TO.

So, it's better to compile the dtbs based on the respective
rockchip family types rather than rockchip itself to avoid
compilation issues.

This patch organize the existing dtb's based on the rockchip
family types.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
5 years agopinctrl: rockchip: Also move common set_schmitter func into per Soc file
David Wu [Tue, 16 Apr 2019 13:58:13 +0000 (21:58 +0800)]
pinctrl: rockchip: Also move common set_schmitter func into per Soc file

Only some Soc need Schmitter feature, so move the
implementation into their own files.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
5 years agopinctrl: rockchip: Clean the unused type and label
David Wu [Tue, 16 Apr 2019 13:57:54 +0000 (21:57 +0800)]
pinctrl: rockchip: Clean the unused type and label

As the mux/pull/drive feature implement at own file,
the type and label are not necessary.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
5 years agopinctrl: rockchip: Special treatment for RK3288 gpio0 pins' pull
David Wu [Tue, 16 Apr 2019 13:57:28 +0000 (21:57 +0800)]
pinctrl: rockchip: Special treatment for RK3288 gpio0 pins' pull

RK3288 pmu_gpio0 pull setting have no higher 16 writing corresponding
bits, need to read before write the register.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
5 years agopinctrl: rockchip: Split the common set_pull() func into per Soc
David Wu [Tue, 16 Apr 2019 13:57:05 +0000 (21:57 +0800)]
pinctrl: rockchip: Split the common set_pull() func into per Soc

As the common set_mux func(), implement the feature at the own file
for each Soc.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
5 years agopinctrl: rockchip: Special treatment for RK3288 gpio0 pins' drive strength
David Wu [Tue, 16 Apr 2019 13:56:34 +0000 (21:56 +0800)]
pinctrl: rockchip: Special treatment for RK3288 gpio0 pins' drive strength

RK3288 pmu_gpio0 drive strength setting have no higher 16 writing
corresponding bits, need to read before write the register.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
5 years agopinctrl: rockchip: Split the common set_drive() func into per Soc
David Wu [Tue, 16 Apr 2019 13:55:26 +0000 (21:55 +0800)]
pinctrl: rockchip: Split the common set_drive() func into per Soc

As the common set_mux func(), implement the feature at the own file
for each Soc.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
5 years agopinctrl: rockchip: Special treatment for RK3288 gpio0 pins' iomux
David Wu [Tue, 16 Apr 2019 13:50:56 +0000 (21:50 +0800)]
pinctrl: rockchip: Special treatment for RK3288 gpio0 pins' iomux

RK3288 pmu_gpio0 iomux setting have no higher 16 writing corresponding
bits, need to read before write the register.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>