oweals/u-boot.git
6 years agotools/mrvl_uart.sh: Fix minicom baudrate
Andreas Färber [Sat, 20 Jan 2018 12:07:09 +0000 (13:07 +0100)]
tools/mrvl_uart.sh: Fix minicom baudrate

minicom doesn't inherit the baudrate from stty but uses its own
defaults, such as for example 57600, whereas we expect 115200 here.
Explicitly tell minicom which baudrate to use.

Fixes: eee4835d22 ("tools: Add Marvell recovery image download script")
Cc: Konstantin Porotchkin <kostap@marvell.com>
Cc: Stefan Roese <sr@denx.de>
Cc: Igal Liberman <igall@marvell.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Konstantin Porotchkin <kostap@marvell.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Signed-off-by: Stefan Roese <sr@denx.de>
6 years agoMerge tag 'signed-efi-next' of git://github.com/agraf/u-boot
Tom Rini [Sun, 28 Jan 2018 23:26:00 +0000 (18:26 -0500)]
Merge tag 'signed-efi-next' of git://github.com/agraf/u-boot

Patch queue for efi - 2018-01-28

This is the second part of patches for 2018.03-rc1, fixing
a few minor issues and adding a readme file for iSCSI booting.

6 years agoefi_loader: add a README.iscsi describing booting via iSCSI
Heinrich Schuchardt [Sun, 28 Jan 2018 14:26:02 +0000 (15:26 +0100)]
efi_loader: add a README.iscsi describing booting via iSCSI

The appended README explains how U-Boot and iPXE can be used
to boot a diskless system from an iSCSI SAN.

The maintainer for README.efi and README.iscsi is set.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
[agraf: s/Adress/Address/]
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: consistently use %pD to print device paths
Heinrich Schuchardt [Fri, 26 Jan 2018 06:20:54 +0000 (07:20 +0100)]
efi_loader: consistently use %pD to print device paths

Now that we have %pD support in vsprintf we should avoid separate
logic for printing device paths in other places.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: do not install NULL as device path
Heinrich Schuchardt [Fri, 26 Jan 2018 05:50:54 +0000 (06:50 +0100)]
efi_loader: do not install NULL as device path

In an image is loaded from memory we do not have a device path.
Do not install NULL as device path in this case.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agovsprintf.c: correct printing of a NULL device path
Heinrich Schuchardt [Fri, 26 Jan 2018 05:30:30 +0000 (06:30 +0100)]
vsprintf.c: correct printing of a NULL device path

When printing '%pD' with a value of NULL we want to output
'<NULL>'. But this requires copying to buf. Leave this
to string16.

A unit test is supplied which relies on EFI support in the sandbox.

The development for EFI support in the sandbox is currently in branch
u-boot-dm/efi-working. The branch lacks commit 6ea8b580f06b ("efi_loader:
correct DeviceNodeToText for media types"). Ater rebasing the aforementioned
branch on U-Boot v2018.01 and adding 256060e4257a2 and this patch the test
is executed successfully.

Fixes: 256060e4257a2 (vsprintf.c: add EFI device path printing)
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: Call Exit() on return from payload in StartImage()
Alexander Graf [Thu, 25 Jan 2018 23:47:53 +0000 (00:47 +0100)]
efi_loader: Call Exit() on return from payload in StartImage()

When a UEFI payload just returns instead of calling the Exit() callback,
we handle that in efi_do_enter() and call Exit on its behalf, so that
the loaded_image->exit_status value is correct.

We were missing that logic in StartImage(). Call it there too.

Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: fix comments in indent_string()
Heinrich Schuchardt [Wed, 24 Jan 2018 18:21:36 +0000 (19:21 +0100)]
efi_loader: fix comments in indent_string()

Provide a better description for indent_string.
Fix a typo.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: catch misspelled bootefi subcommand
Heinrich Schuchardt [Wed, 24 Jan 2018 19:33:54 +0000 (20:33 +0100)]
efi_loader: catch misspelled bootefi subcommand

If 'bootefi hello' or 'bootefi selftest' can be executed depends on the
configuration.

If an invalid non-numeric 1st argument is passed to bootefi, e.g.
'bootefi hola', this string is converted to 0 and U-Boot jumps to
this typically invalid address.

With the patch the online help is shown instead.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoefi_loader: Always use EFIAPI instead of asmlinkage
Alexander Graf [Tue, 23 Jan 2018 23:18:08 +0000 (00:18 +0100)]
efi_loader: Always use EFIAPI instead of asmlinkage

EFI calls are usually defined as asmlinkage. That means we pass all parameters
to functions via the stack x86_32.

On x86_64 however, we need to also stick to the MS ABI calling conventions,
which the EFIAPI define conveniently handles for us. Most EFI functions were
also marked with EFIAPI, except for the entry call.

So this patch adjusts all entry calls to use EFIAPI instead of the manual
asmlinkage attribute.

While at it, we also change the prototype of the entry point to return
efi_status_t instead of ulong, as this is the correct prototype definition.

Signed-off-by: Alexander Graf <agraf@suse.de>
---

v1 -> v2:

  - Use efi_status_t in all occurences

6 years agoefi: Conflict efi_loader with different stub bitness
Alexander Graf [Wed, 24 Jan 2018 13:54:21 +0000 (14:54 +0100)]
efi: Conflict efi_loader with different stub bitness

We have 2 users of the EFI headers: efi_loader and the EFI stub. Efi_loader
always expects that the bitness of the definitions it uses is identical to
the execution.

The EFI stub however allows to run x86_64 U-Boot on 32bit EFI and the other
way around, so it allows for different bitness of EFI definitions and U-Boot
environment.

This patch explicitly requests via Kconfig that efi_loader can only be enabled
if the bitness is identical. Because we can run efi_loader on x86_64 without
EFI stub enabled, it also ensures that this case propagates the correct ABI
constraints.

Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoMerge git://git.denx.de/u-boot-rockchip
Tom Rini [Sun, 28 Jan 2018 18:56:19 +0000 (13:56 -0500)]
Merge git://git.denx.de/u-boot-rockchip

6 years agoomap3_logic: Clean up I2C pin muxing.
Adam Ford [Thu, 25 Jan 2018 20:15:38 +0000 (14:15 -0600)]
omap3_logic: Clean up I2C pin muxing.

The SOM has external pull-up resistors, so let's turn these off.
It was helping reduce some errors when running I2C1 @ 2.6MHz.

Signed-off-by: Adam Ford <aford173@gmail.com>
6 years agospl: add option to disable SPL banner output
Anatolij Gustschin [Thu, 25 Jan 2018 17:45:22 +0000 (18:45 +0100)]
spl: add option to disable SPL banner output

Selecting this option will reduce SPL boot time by approx. 6 ms
(e. g. with 70 bytes long banner string at 115200 baud).

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Tested-by: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agobcm2835_pinctrl: Probe pre-reloc
Alexander Graf [Thu, 25 Jan 2018 11:05:56 +0000 (12:05 +0100)]
bcm2835_pinctrl: Probe pre-reloc

The serial drivers now depend on the pinctrl driver to determine whether
they are enabled. That means if a serial device wants to be used pre-reloc,
we also need the pinctrl device pre-reloc.

Adapt the pinctrl driver as well as dts overlay accordingly.

Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agobcm2835_pl011_serial: Add BCM2835 specific serial driver
Alexander Graf [Thu, 25 Jan 2018 11:05:55 +0000 (12:05 +0100)]
bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoMAINTAINERS: Take over BCM2835 maintainership
Alexander Graf [Thu, 25 Jan 2018 11:05:54 +0000 (12:05 +0100)]
MAINTAINERS: Take over BCM2835 maintainership

It seems as if I have more interest in BCM2835 support than most others,
so I'll bite the bullet and declare myself maintainer. It'd be a shame
to leave that platform orphaned.

Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agobcm2835_mu_serial: Convert to Kconfig
Alexander Graf [Thu, 25 Jan 2018 11:05:53 +0000 (12:05 +0100)]
bcm2835_mu_serial: Convert to Kconfig

Setting config options using headers is deprecated. This patch converts
the BCM2835 Mini-UART to Kconfig.

Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agopl01x: Convert CONFIG_PL01X_SERIAL to Kconfig
Alexander Graf [Thu, 25 Jan 2018 11:05:52 +0000 (12:05 +0100)]
pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl01x.

Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agopl011: Convert CONFIG_PL011_SERIAL to Kconfig
Alexander Graf [Thu, 25 Jan 2018 11:05:51 +0000 (12:05 +0100)]
pl011: Convert CONFIG_PL011_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl011.

Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agopl010: Convert CONFIG_PL010_SERIAL to Kconfig
Alexander Graf [Thu, 25 Jan 2018 11:05:50 +0000 (12:05 +0100)]
pl010: Convert CONFIG_PL010_SERIAL to Kconfig

We want to use Kconfig logic to depend on whether pl01x devices
are built in, so let's convert their inclusion selection to Kconfig.

This round goes to pl010.

Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agopl01x: Convert to dev_read
Alexander Graf [Thu, 25 Jan 2018 11:05:49 +0000 (12:05 +0100)]
pl01x: Convert to dev_read

The fdtdec API is deprecated, convert the pl010 and pl011 devices to
use the dev_read API instead.

Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoserial_bcm283x_mu: Fail loading if not muxed
Alexander Graf [Thu, 25 Jan 2018 11:05:48 +0000 (12:05 +0100)]
serial_bcm283x_mu: Fail loading if not muxed

The bcm283x mini-uart is only really usable as U-Boot serial output
when it is muxed to the UART pins of the RPi pin header.

So fail probing in case it is not muxed correctly, as in that case
firmware did not initialize it properly either.

Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoserial_bcm283x_mu: Always skip init
Alexander Graf [Thu, 25 Jan 2018 11:05:47 +0000 (12:05 +0100)]
serial_bcm283x_mu: Always skip init

The serial initialization doesn't always quite work for me, so let's
always skip it for now. We know that firmware on the RPi initializes
us properly already.

Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoserial_bcm283x_mu: Convert to dev_read
Alexander Graf [Thu, 25 Jan 2018 11:05:46 +0000 (12:05 +0100)]
serial_bcm283x_mu: Convert to dev_read

The fdtdec API got deprecated in favor of dev_read calls.
Use those instead.

Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agorpi: Determine PL011/Mini-UART availability at runtime
Alexander Graf [Thu, 25 Jan 2018 11:05:45 +0000 (12:05 +0100)]
rpi: Determine PL011/Mini-UART availability at runtime

Firmware on the Raspberry Pi family of devices can dynamically configure either
the PL011, Mini-UART or no device at all to be routed to the user accessible
UART pins.

That means we need to always include both drivers, because we can never be sure
which of the two serial devices firmware actually chooses to use.

Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoserial: bcm283x_mu: Remove support for post-init disabling
Alexander Graf [Thu, 25 Jan 2018 11:05:44 +0000 (12:05 +0100)]
serial: bcm283x_mu: Remove support for post-init disabling

We are switching to a model where a serial device doesn't even get probed when
it's not muxed properly, so we don't need device specific disabling
functionality anymore.

Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agorpi: Remove runtime disabling support for serial
Alexander Graf [Thu, 25 Jan 2018 11:05:43 +0000 (12:05 +0100)]
rpi: Remove runtime disabling support for serial

We are switching to a model where our board file can directly fail probing
of serial devices when they're not usable, so remove the current runtime
hack we have.

Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoserial: Use next serial device if probing fails
Alexander Graf [Thu, 25 Jan 2018 11:05:42 +0000 (12:05 +0100)]
serial: Use next serial device if probing fails

Currently our serial device search chokes on the fact that the serial
probe function could fail. If it does, instead of searching for the next
usable serial device, it just quits.

This patch changes the fallback logic so that even when a serial device
was not probed correctly, we just try the next ones until we find one that
works.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agoam33xx: board: Call spl_early_init() to support sdram_init()
Faiz Abbas [Wed, 24 Jan 2018 09:14:49 +0000 (14:44 +0530)]
am33xx: board: Call spl_early_init() to support sdram_init()

With driver model enabled in SPL, sdram_init() requires device tree
and malloc to be initialized.
Therefore call spl_early_init() in early_system_init().

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
6 years agoarm: add support for PDU001
Felix Brack [Tue, 23 Jan 2018 17:27:22 +0000 (18:27 +0100)]
arm: add support for PDU001

This patch adds support for the PDU001 board.

Signed-off-by: Felix Brack <fb@ltec.ch>
Reviewed-by: Tom Rini <trini@konsulko.com>
6 years agommc: Add bcm2835 sdhost controller
Alexander Graf [Tue, 23 Jan 2018 17:05:22 +0000 (18:05 +0100)]
mmc: Add bcm2835 sdhost controller

The BCM2835 family of SoCs has 2 different SD controllers: One based on
the SDHCI spec and a custom, home-grown one.

This patch implements a driver for the latter based on the Linux driver.
This is needed so that we can make use of device trees that assume driver
presence of both SD controllers.

Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agobcm283x: Add pinctrl driver
Alexander Graf [Tue, 23 Jan 2018 17:05:21 +0000 (18:05 +0100)]
bcm283x: Add pinctrl driver

The bcm283x family of SoCs have a GPIO controller that also acts as
pinctrl controller.

This patch introduces a new pinctrl driver that can actually properly mux
devices into their device tree defined pin states and is now the primary
owner of the gpio device. The previous GPIO driver gets moved into a
subdevice of the pinctrl driver, bound to the same OF node.

That way whenever a device asks for pinctrl support, it gets it
automatically from the pinctrl driver and GPIO support is still available
in the normal command line phase.

Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agopowerpc: Drop CONFIG_WALNUT and other related dead code
Tuomas Tynkkynen [Sun, 21 Jan 2018 16:16:42 +0000 (18:16 +0200)]
powerpc: Drop CONFIG_WALNUT and other related dead code

CONFIG_WALNUT was dropped in June 2017 in:
commit 98f705c9cefdfd ("powerpc: remove 4xx support")

While at it, the related CONFIG_MACH_SPECIFIC and the have_of
and _machine variables are unused as well, so drop them too.

Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>
6 years agolibfdt: migrate include/libfdt_env.h to a wrapper
Masahiro Yamada [Sun, 21 Jan 2018 10:19:18 +0000 (19:19 +0900)]
libfdt: migrate include/libfdt_env.h to a wrapper

libfdt_env.h is supposed to provide system-dependent defines.

scripts/dtc/libfdt/libfdt_env.h from upstream DTC is suitable
for user-space, so we should use this for USE_HOSTCC case.

For compiling U-Boot, we need to override such system-dependent
defines, so use <linux/libfdt_env.h> imported from Linux.

<libfdt.h> selects a proper one.  Maybe, we should split header
inclusion completely, but I do not want too many patches at one.

I can rip off the include/libfdt_env.h from HOST_EXTRACFLAGS.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agolibfdt: migrate libfdt.h to a wrapper + U-Boot own code
Masahiro Yamada [Sun, 21 Jan 2018 10:19:17 +0000 (19:19 +0900)]
libfdt: migrate libfdt.h to a wrapper + U-Boot own code

There is tons of code duplication between lib/libfdt/libfdt.h and
scripts/dtc/libfdt/libfdt.h.  Evacuate the U-Boot own code to
include/libfdt.h and remove lib/libfdt/libfdt.h.

For host tools, <libfdt.h> should include scripts/dtc/libfdt/libfdt.h,
which is already suitable for user-space.

For compiling U-Boot, <linux/libfdt.h> should be included because we
need a different libfdt_env.h .

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
6 years agolibfdt: move working_fdt and FDT_RAMDISK_OVERHEAD to include/libfdt.h
Masahiro Yamada [Sun, 21 Jan 2018 10:19:16 +0000 (19:19 +0900)]
libfdt: move working_fdt and FDT_RAMDISK_OVERHEAD to include/libfdt.h

libfdt_env.h exists to contain system-dependent defines:

  - typedef of fdt*_t
  - fdt*_to_cpu(), cpu_to_fdt*

working_fdt and FDT_RAMDISK_OVERHEAD are unrelated to the environment,
so they must get out of this header.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agotools: include necessary headers explicitly
Masahiro Yamada [Sun, 21 Jan 2018 10:19:15 +0000 (19:19 +0900)]
tools: include necessary headers explicitly

Several host-tools use "bool" type without including <stdbool.h>.
This relies on the crappy header inclusion chain.

tools/Makefile has the following line:

  HOST_EXTRACFLAGS += -include $(srctree)/include/libfdt_env.h \

All host-tools are forced to include libfdt_env.h even if they are
totally unrelated to FDT.  Then, <stdbool.h> is indirectly included
as follows:

     include/libfdt_env.h
  -> include/linux/types.h
  -> <stdbool.h>

I am fixing this horrible crap.  In advance, I need to add necessary
include directives explicitly.  tools/fdtgrep.c needs more; <fctl.h>
for open() and <errno.h> for errno.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agolibfdt: fix <linux/libfdt.h>
Masahiro Yamada [Sun, 21 Jan 2018 10:19:14 +0000 (19:19 +0900)]
libfdt: fix <linux/libfdt.h>

I do not remember why, but this is apparently a file-copy mistake.
The file name is libfdt.h, but its content is that of libfdt_env.h

Re-import it from upstream Linux.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agolibfdt: migrate fdt_rw.c to a wrapper of scripts/dtc/libfdt/fdt_rw.c
Masahiro Yamada [Sun, 21 Jan 2018 10:19:13 +0000 (19:19 +0900)]
libfdt: migrate fdt_rw.c to a wrapper of scripts/dtc/libfdt/fdt_rw.c

The only difference between scripts/dtc/libfdt/fdt_rw.c and
lib/libfdt/fdt_rw.c is fdt_remove_unused_strings().

It is only used by fdtgrep, so we do not need to compile it for U-Boot
image.  Move it to tools/libfdt/fdw_rw.c so that lib/libfdt/fdt_rw.c
can be a wrapper of scripts/dtc/libfdt/fdt_rw.c.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agohost-tools: use python2 explicitly for shebang
Masahiro Yamada [Sun, 21 Jan 2018 09:34:57 +0000 (18:34 +0900)]
host-tools: use python2 explicitly for shebang

All of these host tools are apparently written for Python2,
not Python3.

Use 'python2' in the shebang line according to PEP 394
(https://www.python.org/dev/peps/pep-0394/).

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agoARM: omap3: evm: Fix distro bootcmd UBIFS and MMC support
Derald D. Woods [Sun, 21 Jan 2018 03:16:14 +0000 (21:16 -0600)]
ARM: omap3: evm: Fix distro bootcmd UBIFS and MMC support

The omap3_evm board does not boot when commit:
    a47ca2cf67 ("ARM: omap3: evm: Add kernel image loading from UBIFS and EXT4")
is applied after commit:
    3dde8f2037 ("Merge git://git.denx.de/u-boot-mmc")

This commit reduces the CONFIG_EXTRA_ENV_SETTINGS size and better
leverages the existing distro bootcmd infrastructure.

- Use updated UBIFS support from config_distro_bootcmd.h
- Use LEGACY_MMC naming found in am335x_evm.h and ti_omap4_common.h
- Remove extra environment content that is no longer needed

[MMC(0:1)/extlinux/extlinux.conf]
---8<-------------------------------------------------------------------
default omap3-evm-mmc-fat
label omap3-evm-mmc-fat
kernel /zImage
fdt /omap3-evm.dtb
append console=ttyO0,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait
---8<-------------------------------------------------------------------

[MMC(0:2)/boot/extlinux/extlinux.conf]
---8<-------------------------------------------------------------------
default omap3-evm-mmc-ext4
label omap3-evm-mmc-ext4
kernel /boot/zImage
fdt /boot/omap3-evm.dtb
append console=ttyO0,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait
---8<-------------------------------------------------------------------

[NAND(ubi0:rootfs)/boot/extlinux/extlinux.conf]
---8<-------------------------------------------------------------------
default omap3-evm-nand-ubifs
label omap3-evm-nand-ubifs
kernel /boot/zImage
fdt /boot/omap3-evm.dtb
append console=ttyO0,115200n8 root=ubi0:rootfs rw ubi.mtd=rootfs noinitrd rootfstype=ubifs rootwait
---8<-------------------------------------------------------------------

Fixes: a47ca2cf67 ("ARM: omap3: evm: Add kernel image loading from UBIFS and EXT4")
Signed-off-by: Derald D. Woods <woods.technical@gmail.com>
6 years agodistro bootcmd: Allow board defined UBI partition and volume names
Derald D. Woods [Sun, 21 Jan 2018 03:16:13 +0000 (21:16 -0600)]
distro bootcmd: Allow board defined UBI partition and volume names

This commit allows overriding the default assumption that the boot UBI
MTD partition is named 'UBI' and the UBI volume is 'boot'. A board
desiring to use a legacy or alternative NAND layout can now define the
following two extra environment variables:

bootubipart=<some_ubi_partition_name>
bootubivol=<some_ubi_volume_name>

EXAMPLE:

[include/configs/some_board.h]
---8<-------------------------------------------------------------------
[...]
#include <config_distro_defaults.h>

#define MEM_LAYOUT_ENV_SETTINGS \
DEFAULT_LINUX_BOOT_ENV

#define BOOT_TARGET_DEVICES(func) \
func(UBIFS, ubifs, 0)

#include <config_distro_bootcmd.h>
[...]
#define CONFIG_EXTRA_ENV_SETTINGS \
MEM_LAYOUT_ENV_SETTINGS \
"bootubivol=rootfs\0" \
"bootubipart=rootfs\0" \
BOOTENV
[...]
---8<-------------------------------------------------------------------

Signed-off-by: Derald D. Woods <woods.technical@gmail.com>
6 years agospl: use different BOARD_INIT MACRO for spl and tpl
Kever Yang [Sat, 20 Jan 2018 10:00:26 +0000 (18:00 +0800)]
spl: use different BOARD_INIT MACRO for spl and tpl

SPL and TPL may not always need spl_board_init() at the same time.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agofs: btrfs: Fix unaligned memory accesses
Alberto Sánchez Molero [Sat, 20 Jan 2018 07:17:57 +0000 (09:17 +0200)]
fs: btrfs: Fix unaligned memory accesses

Loading files stored with lzo compression from a btrfs filesystem was
producing unaligned memory accesses, which were causing a data abort
and a reset on an Orange Pi Zero.

The change in hash.c is not triggered by any error but follows the
same pattern. Please confirm.

Fixed according to doc/README.unaligned-memory-access.txt

Signed-off-by: Alberto Sánchez Molero <alsamolero@gmail.com>
Tested-by: Robert Nelson <robertcnelson@gmail.com>
6 years agospl: atf: pass NULL for bl32_ep pc
Kever Yang [Wed, 17 Jan 2018 03:05:38 +0000 (11:05 +0800)]
spl: atf: pass NULL for bl32_ep pc

ATF use bl32_ep_info->pc to decide if thre is an available bl32,
let's mark it as NULL first.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agorockchip: rk3036: enable rockusb support on rk3036 based device
Eddie Cai [Wed, 17 Jan 2018 01:51:41 +0000 (09:51 +0800)]
rockchip: rk3036: enable rockusb support on rk3036 based device

Rockchip Rockusb driver already merged. So we enable rockusb
support on rk3036 based device.

Signed-off-by: Eddie Cai <eddie.cai.linux@gmail.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agorockchip: dts: rk3128: update pwm-cell for pwm0
Kever Yang [Tue, 16 Jan 2018 08:08:18 +0000 (16:08 +0800)]
rockchip: dts: rk3128: update pwm-cell for pwm0

The backlight pwm-cell is 3.

This remove the warning in buildman:
arch/arm/dts/rk3126-evb.dtb: Warning (pwms_property): Property 'pwms', cell 3 is not a phandle reference in /backlight
arch/arm/dts/rk3126-evb.dtb: Warning (pwms_property): Missing property '#pwm-cells' in node /sram@10080400 or bad phandle (referred from /backlight:pwms[3])

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agorockchip: clk: guard set_parent implementations against OF_PLATDATA
Philipp Tomsich [Thu, 25 Jan 2018 14:27:10 +0000 (15:27 +0100)]
rockchip: clk: guard set_parent implementations against OF_PLATDATA

The set_parent implementations do not make sense when OF_PLATDATA is
enabled.  We guard these against OF_PLATDATA and don't populate the
set_parent-op when this is the case.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agoclk: rockchip: clk_rk3368: Implement "assign-clock-parent"
David Wu [Sat, 13 Jan 2018 06:07:04 +0000 (14:07 +0800)]
clk: rockchip: clk_rk3368: Implement "assign-clock-parent"

Implement the setting parent for gmac clock, and add internal
pll div set for mac clk.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agoclk: rockchip: clk_rk3288: Implement "assign-clock-parent" and "assign-clock-rate"
David Wu [Sat, 13 Jan 2018 06:06:33 +0000 (14:06 +0800)]
clk: rockchip: clk_rk3288: Implement "assign-clock-parent" and "assign-clock-rate"

The RK3288 CRU-node assigns rates to a number of clocks that are not
implemented in the RK3288 clock-driver (but which have been
sufficiently initialised from rkclk_init()): for these clocks, we
implement the gmac clock set parent, but simply ignore the
others' set_rate() operation and return 0 to signal success.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agoARM: dts: rk3288: Remove unused LCDC clock assigned
David Wu [Sat, 13 Jan 2018 06:06:16 +0000 (14:06 +0800)]
ARM: dts: rk3288: Remove unused LCDC clock assigned

The LCDC assigned rate is 0, it will make boot error,
error log:"pll_para_config: the frequency can not be
 0 Hz". Remove them, and the lcdc driver will do the
correct clock rate setting.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agoconfig: evb-rk3229: Enable rk gmac configs
David Wu [Sat, 13 Jan 2018 06:05:51 +0000 (14:05 +0800)]
config: evb-rk3229: Enable rk gmac configs

Add gmac config support for rk3229 evb.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agonet: gmac_rockchip: Add support for the RK3228 GMAC
David Wu [Sat, 13 Jan 2018 06:05:30 +0000 (14:05 +0800)]
net: gmac_rockchip: Add support for the RK3228 GMAC

The GMAC in the RK3228 once again is identical to the incarnation in
the RK3288 and the RK3399, except for where some of the configuration
and control registers are located in the GRF.

This adds the RK3368-specific logic necessary to reuse this driver.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agoclk: rockchip: Add rk322x gamc clock support
David Wu [Sat, 13 Jan 2018 06:05:12 +0000 (14:05 +0800)]
clk: rockchip: Add rk322x gamc clock support

Assuming mac_clk is fed by an external clock, set clk_rmii_src
clock select control register from IO for rgmii interface.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agorockchip: pinctrl: Add rk322x gmac pinctrl support
David Wu [Sat, 13 Jan 2018 06:04:51 +0000 (14:04 +0800)]
rockchip: pinctrl: Add rk322x gmac pinctrl support

Set gmac pins iomux and rgmii tx pins to 12ma drive-strength,
clean others to 2ma.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agorockchip: pinctrl: rk322x: Move the iomux definitions into pinctrl-driver
David Wu [Sat, 13 Jan 2018 06:04:26 +0000 (14:04 +0800)]
rockchip: pinctrl: rk322x: Move the iomux definitions into pinctrl-driver

Clean the iomux definitions at grf_rk322x.h, and move them into
pinctrl-driver for resolving the compiling error of redefinition.
After that, define the uart2 iomux at rk322x-board file.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agorockchip: dts: rk3328-evb: Enable gmac2io for rk3328-evb
David Wu [Sat, 13 Jan 2018 06:04:11 +0000 (14:04 +0800)]
rockchip: dts: rk3328-evb: Enable gmac2io for rk3328-evb

Add rk3328-evb gmac support.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agorockchip: dts: rk3328: Add gmac2io support
David Wu [Sat, 13 Jan 2018 06:03:56 +0000 (14:03 +0800)]
rockchip: dts: rk3328: Add gmac2io support

Add basic dts configuration for rk3328 gmac2io.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agorockchip: configs: Enable GMAC configs for evb-rk3328
David Wu [Sat, 13 Jan 2018 06:03:23 +0000 (14:03 +0800)]
rockchip: configs: Enable GMAC configs for evb-rk3328

Enable GMAC configs for evb-rk3328

Signed-off-by: David Wu <david.wu@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agonet: gmac_rockchip: Add rk3328 gmac support
David Wu [Sat, 13 Jan 2018 06:03:04 +0000 (14:03 +0800)]
net: gmac_rockchip: Add rk3328 gmac support

The GMAC2IO in the RK3328 once again is identical to the incarnation in
the RK3288 and the RK3399, except for where some of the configuration
and control registers are located in the GRF.

This adds the RK3328-specific logic necessary to reuse this driver.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agoclk: rockchip: Add rk3328 gamc clock support
David Wu [Sat, 13 Jan 2018 06:02:36 +0000 (14:02 +0800)]
clk: rockchip: Add rk3328 gamc clock support

The rk3328 soc has two gmac controllers, one is gmac2io,
the other is gmac2phy. We use the gmac2io rgmii interface
for 1000M phy here.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agorockchip: pinctrl: Add rk3328 gmac pinctrl support
David Wu [Sat, 13 Jan 2018 06:02:07 +0000 (14:02 +0800)]
rockchip: pinctrl: Add rk3328 gmac pinctrl support

Need to set gmac m1 pins iomux, gmac m0 tx pins, select bit2
and bit10 at com iomux register. After that, set rgmii m1 tx
pins to 12ma drive-strength, and clean others to 2ma.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agorockchip: pinctrl: rk3328: Move the iomux definitions into pinctrl-driver
David Wu [Sat, 13 Jan 2018 06:01:45 +0000 (14:01 +0800)]
rockchip: pinctrl: rk3328: Move the iomux definitions into pinctrl-driver

Clean the iomux definitions at grf_rk3328.h, and move them into
pinctrl-driver for resolving the compiling error of redefinition.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agonet: gmac_rockchip: Add support for the RV1108 GMAC
David Wu [Sat, 13 Jan 2018 06:01:12 +0000 (14:01 +0800)]
net: gmac_rockchip: Add support for the RV1108 GMAC

The rv1108 GMAC only support rmii interface, so need to add the
set_rmii() ops. Use the phy current interface to set rmii or
rgmii ops. At the same time, need to set the mac clock rate of
rmii with 50M, the clock rate of rgmii with 125M.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agorockchip: pinctrl: rv1108: Move the iomux definitions into pinctrl-driver
David Wu [Sat, 13 Jan 2018 05:53:57 +0000 (13:53 +0800)]
rockchip: pinctrl: rv1108: Move the iomux definitions into pinctrl-driver

If we include both the rk3288_grf.h and rv1108_grf.h, it will cause the
conflicts of redefinition. Clean the iomux definitions at grf_rv1108.h,
and move them into pinctrl-driver.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agorockchip: grf_rv1108.h: Fix the grf offsets
David Wu [Sat, 13 Jan 2018 05:53:56 +0000 (13:53 +0800)]
rockchip: grf_rv1108.h: Fix the grf offsets

The last 4 grf registers offset of rv1108 are wrong, fix them
for correct usage.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agorockchip: configs: Enable CONFIG_NET_RANDOM_ETHADDR for rk3288-evb
David Wu [Sat, 13 Jan 2018 05:53:55 +0000 (13:53 +0800)]
rockchip: configs: Enable CONFIG_NET_RANDOM_ETHADDR for rk3288-evb

If the Ethernet address is not set, the network can't work,
enable the random address config for default use.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agorockchip: dts: rk3399-evb: Change the tx/rx delay value for transmission quality
David Wu [Sat, 13 Jan 2018 05:53:54 +0000 (13:53 +0800)]
rockchip: dts: rk3399-evb: Change the tx/rx delay value for transmission quality

Give the mac controller the correct tx-delay and rx-delay value
for the rgmii mode transmission. If they are not matched, there
would be Ethernet packets lost, the net feature may not work.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
6 years agorockchip: clk: rk3399: accept all assigned-clocks from the 'cru'-node
Philipp Tomsich [Mon, 8 Jan 2018 13:00:27 +0000 (14:00 +0100)]
rockchip: clk: rk3399: accept all assigned-clocks from the 'cru'-node

The RK3399 CRU-node assigns rates to a number of clocks that are not
implemented in the RK3399 clock-driver (but which have been
sufficiently initialised from rkclk_init()): for these clocks, we
simply ignore the set_rate() operation and return 0 to signal success.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Tested-by: David Wu <david.wu@rock-chips.com>
Series-changes: 2
- Fixed David's email address.

6 years agoclk: implement clk_set_defaults()
Philipp Tomsich [Mon, 8 Jan 2018 12:59:18 +0000 (13:59 +0100)]
clk: implement clk_set_defaults()

Linux uses the properties 'assigned-clocks', 'assigned-clock-parents'
and 'assigned-clock-rates' to configure the clock subsystem for use
with various peripheral nodes.

This implements clk_set_defaults() and hooks it up with the general
device probibin in drivers/core/device.c: when a new device is probed,
clk_set_defaults() will be called for it and will process the
properties mentioned above.

Note that this functionality is designed to fail gracefully (i.e. if a
clock-driver does not implement set_parent(), we simply accept this
and ignore the error) as not to break existing board-support.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Tested-by: David Wu <david.wu@rock-chips.com>
Series-changes: 2
- Fixed David's email address.

Series-version: 2

Cover-letter:
clk: support assigned-clock, assigned-clock-parents, assigned-clock-rates

For various peripherals on Rockchip SoCs (e.g. for the Ethernet GMAC),
the parent-clock needs to be set via the DTS.  This adds the required
plumbing and implements the GMAC case for the RK3399.
END

6 years agorockchip: clk: rk3399: implement set_parent() operation
Philipp Tomsich [Mon, 8 Jan 2018 12:11:01 +0000 (13:11 +0100)]
rockchip: clk: rk3399: implement set_parent() operation

This implements the (newly added) set_parent() operation for the
RK3399 with a focus on allowing the RGMII clock parent to be
configured via the assigned-clock-parents property of the GMAC node.

This implementation supports only the GMAC (in fact only the RGMII
clock parent) and allows to set this clock's parent either to the
internal SCLK_GMAC or to an external clock input (identifiable by it
providing a 'clock-output-name' of "gmac_clkin").

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Tested-by: David Wu <david.wu@rock-chips.com>
Series-changes: 2
- Fixed David's email address.

6 years agoclk: refactor clk_get_by_index() into clk_get_by_indexed_prop()
Philipp Tomsich [Mon, 8 Jan 2018 10:18:18 +0000 (11:18 +0100)]
clk: refactor clk_get_by_index() into clk_get_by_indexed_prop()

The logic in clk_get_by_index() may be useful for other properties
than 'clocks': e.g. 'assigned-clocks' and 'assigned-clock-parents'
follows the same model.

This commit refactors clk_get_by_index() by introducing an internal
function clk_get_by_indexed_prop() that allows to specify the name
of the property to process.  The original clk_get_by_index() call
is simply directed through this helper function with the property
name fixed to "clocks".

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Tested-by: David Wu <david.wu@rock-chips.com>
Series-changes: 2
- Fixed David's email address.

6 years agoclk: add clk_set_parent()
Philipp Tomsich [Mon, 8 Jan 2018 10:15:08 +0000 (11:15 +0100)]
clk: add clk_set_parent()

Clocks may support multiple parents: this change introduces an
optional operation on the clk-uclass to set a clock's parent.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Tested-by: David Wu <david.wu@rock-chips.com>
Series-changes: 2
- Fixed David's email address.

6 years agoclk: clk_stm32f: Fix PLLSAICFGR_PLLSAIP_4 divider value
Patrice Chotard [Fri, 19 Jan 2018 17:02:40 +0000 (18:02 +0100)]
clk: clk_stm32f: Fix PLLSAICFGR_PLLSAIP_4 divider value

PLLSAIP divider uses 2 bits (bits 16 and 17) into RCC_PLLSAICFGR
register, available combination are :
  00: PLLSAIP = 2
  01: PLLSAIP = 4
  10: PLLSAIP = 6
  11: PLLSAIP = 8

Previously, the divider value was incorrectly set to 6.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
6 years agoARM: AM43XX: Call hw_data_init() again after relocation to update *ctrl
Faiz Abbas [Fri, 19 Jan 2018 10:02:48 +0000 (15:32 +0530)]
ARM: AM43XX: Call hw_data_init() again after relocation to update *ctrl

hw_data_init() is called before relocation to initialise hardware data.
Since ctrl is initialized to OMAP_SRAM_SCRATCH_SYS_CTRL in
arch/arm/mach-omap2/am33xx/hw_data.c, the pointer *ctrl will not be
updated during relocation and will hold a stale value.

Therefore call hw_data_init() again after relocation to
reinitialize *ctrl.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
6 years agoconfigs: Replace CONFIG_ISW_ENTRY_ADDR with CONFIG_SYS_TEXT_BASE
Faiz Abbas [Fri, 19 Jan 2018 10:02:47 +0000 (15:32 +0530)]
configs: Replace CONFIG_ISW_ENTRY_ADDR with CONFIG_SYS_TEXT_BASE

Since 7e0ed13 ("Convert ARCH_OMAP2PLUS boards' CONFIG_SYS_TEXT_BASE to
Kconfig"), a default SYS_TEXT_BASE was set for all ARCH_OMAP2PLUS devices.
CONFIG_ISW_ENTRY_ADDR is used to set SYS_TEXT_BASE in qspi boot.

Simplify this by directly assigning SYS_TEXT_BASE in the defconfig.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
6 years agotools: remove unused ret
Jelle van der Waa [Thu, 18 Jan 2018 19:19:43 +0000 (20:19 +0100)]
tools: remove unused ret

Remove unused ret from fw_env_flush.

Signed-off-by: Jelle van der Waa <jelle@vdwaa.nl>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agoclk: clk_stm32f: Move SYSCFG clock setup into configure_clocks()
Patrice Chotard [Thu, 18 Jan 2018 13:10:05 +0000 (14:10 +0100)]
clk: clk_stm32f: Move SYSCFG clock setup into configure_clocks()

Move SYSCFG clock setup into configure_clocks() instead of calling
clock_setup() from board file.

As this clock is only needed in case of ethernet enabled and as
both stm32f4 and stm32f7 are using the Designware ethernet IP,
we use CONFIG_ETH_DESIGNWARE to only enable this clock if needed.

Move the RMII setup from board_early_init_f() to board_init()
to insure that RMII bit is set only when clock driver is initialized.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
6 years agoclk: clk_stm32f: Remove STMMAC clock setup
Patrice Chotard [Thu, 18 Jan 2018 13:10:04 +0000 (14:10 +0100)]
clk: clk_stm32f: Remove STMMAC clock setup

Thanks to 'commit ba1f96672522 ("net: designware: add clock support")'
we don't need anymore to setup the STMMAC clock in board.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>
6 years agoARM: dts: stm32: Add STMMAC clocks for stm32f746
Patrice Chotard [Thu, 18 Jan 2018 13:10:03 +0000 (14:10 +0100)]
ARM: dts: stm32: Add STMMAC clocks for stm32f746

Add ETHMAC, ETHMACRX and ETHMACTX clocks for STMMAC.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas Manocha <vikas.manocha@st.com>
6 years agoatomic-long: Fix warnings on arm64
Bradley Bolen [Sat, 27 Jan 2018 03:11:04 +0000 (22:11 -0500)]
atomic-long: Fix warnings on arm64

Several inline functions in this file reference undefined functions in
U-Boot.  For example:

atomic-long.h:73:9: warning: implicit declaration of function
'atomic64_sub_and_test'
atomic-long.h:80:9: warning: implicit declaration of function
'atomic64_dec_and_test'
atomic-long.h:87:9: warning: implicit declaration of function
'atomic64_inc_and_test'

Handle this the same as the 32 bit build by wrapping these functions in
a __UBOOT__ check.

Signed-off-by: Bradley Bolen <bradleybolen@gmail.com>
6 years agoARM: dts: stm32: add stm32429-eval-u-boot dts file
Patrice Chotard [Thu, 18 Jan 2018 12:39:34 +0000 (13:39 +0100)]
ARM: dts: stm32: add stm32429-eval-u-boot dts file

   _ Add gpio compatible and aliases for stm32f469
   _ Add FMC sdram node
   _ Add "u-boot,dm-pre-reloc" for rcc, fmc, fixed-clock, pinctrl,
     pwrcfg and gpio nodes.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
6 years agoARM: dts: stm32: Add STM32F429 Evaluation board support
Patrice Chotard [Thu, 18 Jan 2018 12:39:33 +0000 (13:39 +0100)]
ARM: dts: stm32: Add STM32F429 Evaluation board support

This DT file comes from kernel v4.15, this board offers :

   _ STM32F429NIH6 microcontroller
   _ 4.3” color TFT LCD with resistive touchscreen (480 x 272 pixels)
   _ Six 5 V power supply options:
        Power jack
        ST-LINK/V2 USB connector
        User USB HS connector
        User USB FS1 connector
        User USB FS2 connector
        Daughterboard
   _ SAI Audio DAC, stereo audio jack which supports headset with
     microphone
   _ Stereo digital microphone, audio terminal connector used to connect
     external speakers
   _ 2 GBytes (or more) SDIO interface MicroSD card
   _ RF EEPROM on I2 C compatible serial interface
   _ RS-232 communication
   _ IrDA transceiver
   _ JTAG/SWD and ETM trace debug support, ST-LINK/V2 embedded
   _ IEEE-802.3-2002 compliant Ethernet connector
   _ Camera module
   _ 8M x 32-bit SDRAM, 1M x 16-bit SRAM and 8M x 16-bit NOR Flash
   _ Joystick with 4-directional control and selector
   _ Reset, Wakeup and Tamper buttons
   _ 4 color user LEDs
   _ Extension connectors & memory connectors for daughterboard or
     wrapping board
   _ USB OTG HS and FS with Micro-AB connectors
   _ RTC with backup battery
   _ CAN2.0A/B compliant connection
   _ Potentiometer
   _ Motor control connector

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
6 years agoboard: stm32: Add stm32f429-evaluation board support
Patrice Chotard [Thu, 18 Jan 2018 12:39:32 +0000 (13:39 +0100)]
board: stm32: Add stm32f429-evaluation board support

Add stm32f429-evaluation board support.
For more information, please visit:
http://www.st.com/en/evaluation-tools/stm32429i-eval.html

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
6 years agoconfigs: stm32f: Remove STM32_HSE_HZ for all STM32F series
Patrice Chotard [Thu, 18 Jan 2018 12:39:31 +0000 (13:39 +0100)]
configs: stm32f: Remove STM32_HSE_HZ for all STM32F series

As clk_stm32f driver is able to retrieve HSE frequency from DT,
CONFIG_STM32_HSE_HZ becomes useless.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
6 years agoclk: stm32: retrieve external oscillator frequency from DT
Patrice Chotard [Thu, 18 Jan 2018 12:39:30 +0000 (13:39 +0100)]
clk: stm32: retrieve external oscillator frequency from DT

All current STM32F4 supported boards uses a 8MHz external oscillator.
All current STM32F7 supported boards uses a 25MHz external oscillator.

In order to introduce the new stm32f429-evaluation board which uses a
25MHz external oscillator without creating a dedicated struct
stm32_clk_info for this board, retrieve the external oscillator
frequency from DT and set pll_m accordingly to obtain 1MHz for the VCO.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
6 years agoARM: dts: stm32: add "u-boot, dm-pre-reloc" for clk_hse in stm32f7-u-boot
Patrice Chotard [Thu, 18 Jan 2018 12:39:29 +0000 (13:39 +0100)]
ARM: dts: stm32: add "u-boot, dm-pre-reloc" for clk_hse in stm32f7-u-boot

In order to retrieve the clk_hse fixed clock phandle in clk_stm32f driver,
add "u-boot,dm-pre-reloc" property in Uboot specific DT file.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
6 years agoarm: bootm-fdt.c: fix compiler warning
Heiko Schocher [Wed, 17 Jan 2018 06:00:37 +0000 (07:00 +0100)]
arm: bootm-fdt.c: fix compiler warning

compiling U-Boot with bosch_mpcxxxxd_sd_defconfig
drops warning:

arch/arm/lib/bootm-fdt.c: In function ‘arch_fixup_fdt’:
arch/arm/lib/bootm-fdt.c:37:6: warning: unused variable ‘ret’ [-Wunused-variable]
  int ret = 0;
      ^~~

Fix it.

Signed-off-by: Heiko Schocher <hs@denx.de>
6 years agoarm: mach-omap2: Pass args to secure ROM in SRAM in SPL
Andrew F. Davis [Tue, 16 Jan 2018 20:25:48 +0000 (14:25 -0600)]
arm: mach-omap2: Pass args to secure ROM in SRAM in SPL

When in early SPL we make some secure ROM calls that can effect
DRAM, due to this it is more stable to store the args for these
calls in SRAM, but uninitialized and zero'd globals are placed
in BSS, located in DRAM. Force our args into the data section
which is in SRAM during SPL.

Signed-off-by: Andrew F. Davis <afd@ti.com>
6 years agocommon: board_r: Fix style violations
Mario Six [Mon, 15 Jan 2018 10:10:30 +0000 (11:10 +0100)]
common: board_r: Fix style violations

Fix some style violations in the board_r file.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Mario Six <mario.six@gdsys.cc>
6 years agocommon: board_f: Fix style violations
Mario Six [Mon, 15 Jan 2018 10:10:02 +0000 (11:10 +0100)]
common: board_f: Fix style violations

Fix some style violations in the board_f file.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Mario Six <mario.six@gdsys.cc>
6 years agoserial: ns16550: Fix style violation
Mario Six [Mon, 15 Jan 2018 10:09:49 +0000 (11:09 +0100)]
serial: ns16550: Fix style violation

Clarify the computation precedence in two ternary operator
constructions.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Mario Six <mario.six@gdsys.cc>
6 years agoinclude: dm: Fix 'devioe'/'devuce' typos
Mario Six [Mon, 15 Jan 2018 10:09:36 +0000 (11:09 +0100)]
include: dm: Fix 'devioe'/'devuce' typos

There are some typos in the documentation of some functions in read.h;
fix those.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agogpio: mpc8xxx: Make live-tree compatible
Mario Six [Mon, 15 Jan 2018 10:07:50 +0000 (11:07 +0100)]
gpio: mpc8xxx: Make live-tree compatible

Make the MPC8xxx GPIO driver compatible with a live device tree.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
6 years agogpio: mpc8xxx: Make compatible with more SoCs
Mario Six [Mon, 15 Jan 2018 10:07:49 +0000 (11:07 +0100)]
gpio: mpc8xxx: Make compatible with more SoCs

Finally, make the mpc8xxx driver capable of handling more GPIO devices;
this entails adding a special case for the MPC5121 SoC, and adding a set
of new compatible strings.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
6 years agogpio: mpc8xxx: Rename Kconfig option, structures, and functions
Mario Six [Mon, 15 Jan 2018 10:07:48 +0000 (11:07 +0100)]
gpio: mpc8xxx: Rename Kconfig option, structures, and functions

Rename the Kconfig option, structures (and their members), as well as
functions of the mpc85xx driver to include mpc8xxx to reflect the more
generic usage.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
6 years agogpio: mpc85xx: Rename driver file to mpc8xxx
Mario Six [Mon, 15 Jan 2018 10:07:47 +0000 (11:07 +0100)]
gpio: mpc85xx: Rename driver file to mpc8xxx

In preparation to making the MPC85xx GPIO driver useable for a broader
range of SoCs, rename the driver file.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
6 years agogpio: mpc85xx_gpio: Fix style violations
Mario Six [Mon, 15 Jan 2018 10:07:46 +0000 (11:07 +0100)]
gpio: mpc85xx_gpio: Fix style violations

Fix some style violations in the MPC85XX GPIO driver.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
6 years agogpio: pca953x_gpio: Make live-tree compatible
Mario Six [Mon, 15 Jan 2018 10:07:45 +0000 (11:07 +0100)]
gpio: pca953x_gpio: Make live-tree compatible

Make the pca953x_gpio driver compatible with a live device tree.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Mario Six <mario.six@gdsys.cc>