platform/kernel/u-boot.git
5 years agoarm: mvebu: turris_mox: Change SERDES map depending on module topology
Marek Behún [Mon, 17 Dec 2018 15:10:02 +0000 (16:10 +0100)]
arm: mvebu: turris_mox: Change SERDES map depending on module topology

When SFP module is connected directly to CPU module we want the SGMII
lane speed at 1.25 Gbps.

This is a temporary solution till there is a comphy driver in the kernel
capable of changing SGMII speed at runtime.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
Signed-off-by: Stefan Roese <sr@denx.de>
5 years agoarm: mvebu: turris_mox: Cosmetic restructurization
Marek Behún [Mon, 17 Dec 2018 15:10:01 +0000 (16:10 +0100)]
arm: mvebu: turris_mox: Cosmetic restructurization

Restructure the board initialization source.
Remove the module_topology environment variable since it won't be
needed.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
Signed-off-by: Stefan Roese <sr@denx.de>
5 years agoARM: mvebu: sync Armada-38x dts with Linux 4.20
Chris Packham [Mon, 10 Dec 2018 07:07:51 +0000 (20:07 +1300)]
ARM: mvebu: sync Armada-38x dts with Linux 4.20

Sync the Armada-38x device tree files with Linux 4.20-rc5. The changes
not taken are new compatible strings for the uart and nand flash
controller. The nand binding is best updated if/when the mtd/nand
infrastructure is updated.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Signed-off-by: Stefan Roese <sr@denx.de>
5 years agompc83xx: Add support for -msingle-pic-base
Joakim Tjernlund [Wed, 28 Nov 2018 09:59:55 +0000 (10:59 +0100)]
mpc83xx: Add support for -msingle-pic-base

-msingle-pic-base is a new gcc(from 4.6) option for ppc and
it reduces the size of my u-boot with about 4 KB.
While at it, add -fno-jump-tables too to save a
few more bytes.

Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
Reviewed-by: Mario Six <mario.six@gdsys.cc>
Tested-by: Mario Six <mario.six@gdsys.cc> (on MPC8308)
5 years agoKconfig: Migrate BOUNCE_BUFFER
Philipp Tomsich [Fri, 30 Nov 2018 21:13:25 +0000 (22:13 +0100)]
Kconfig: Migrate BOUNCE_BUFFER

The bounce buffer is used by a few drivers (most of the MMC drivers)
to overcome limitations in their respective DMA implementation.

This moves the configuration to Kconfig and makes it user-selectable
(even though it will be a required feature to make those drivers
work): the expected usage is for drivers depending on this to 'select'
it unconditionally from their respective Kconfig (see follow-up
patches).

This commit includes a full migration using moveconfig.py to ensure
that each commit compiles.  To ensure bisectability we update
dependencies of various drivers to now select BOUNCE_BUFFER when needed.

[trini: Squash all patches to ensure bisectability]
Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Otavio Salvador <otavio@ossystems.com.br> [dw_mmc portion]
Reviewed-by: Fabio Estevam <festevam@gmail.com> [mxsmmc portion]
Reviewed-by: Simon Glass <sjg@chromium.org> [tegra portion]
5 years agoconfigs: Resync with savedefconfig
Tom Rini [Sat, 19 Jan 2019 14:39:42 +0000 (09:39 -0500)]
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
5 years agoMerge tag 'fsl-qoriq-for-v2019.04-rc1' of git://git.denx.de/u-boot-fsl-qoriq
Tom Rini [Sat, 19 Jan 2019 04:11:51 +0000 (23:11 -0500)]
Merge tag 'fsl-qoriq-for-v2019.04-rc1' of git://git.denx.de/u-boot-fsl-qoriq

Add TFA boot flow for more boards

Add TFA boot defconfig for ls1088a and ls2088a.
Add dts fixup for PCIe endpoint and root complex.

5 years agoMerge branch '2019-01-18-master-imports'
Tom Rini [Fri, 18 Jan 2019 18:40:41 +0000 (13:40 -0500)]
Merge branch '2019-01-18-master-imports'

- Bugfix for SPI environment optimization
- Spelling fixes
- Remove some defconfigs per various maintainers
- Minor db410, bananapi r2 fixes
- Bump QEMU to v3.1.0 for most platforms

5 years agoenv: sf: fix environment in SPI NOR
Heiko Schocher [Fri, 18 Jan 2019 09:45:56 +0000 (10:45 +0100)]
env: sf: fix environment in SPI NOR

commit 9a9d66f5eff0 ("env: add spi_flash_read_env function")

breaks Environment functionality, as it reads only
until 2 \0 are found, but fills the buffer with 0x0
instead 0xff which leads in an incorrect crc sum.

Fix: init the read buffer with 0xff instead 0x00

Signed-off-by: Heiko Schocher <hs@denx.de>
5 years agoarm: dts: am335x-pdu001: Sync with Linux 5.0-rc2
Felix Brack [Thu, 17 Jan 2019 10:51:09 +0000 (11:51 +0100)]
arm: dts: am335x-pdu001: Sync with Linux 5.0-rc2

This patch synchronizes the PDU001 board DTS file with the one used by
Linux 5.0-rc2.
Signed-off-by: Felix Brack <fb@ltec.ch>
5 years agoconfigs: Remove am335x_boneblack_defconfig
Faiz Abbas [Thu, 17 Jan 2019 10:14:06 +0000 (15:44 +0530)]
configs: Remove am335x_boneblack_defconfig

The am335x_evm_defconfig supports all am335x_boneblack variants. Remove
the redundant am335x_boneblack_defconfig.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
5 years agoarm: am335x-pdu001: Remove SPI support
Felix Brack [Thu, 17 Jan 2019 09:40:42 +0000 (10:40 +0100)]
arm: am335x-pdu001: Remove SPI support

On this board SPI is only used to configure the SoC driving the LC TFT
display which is not used in U-Boot. Hence remove SPI support.

Signed-off-by: Felix Brack <fb@ltec.ch>
5 years agocmd: mtd: fix compilation warning for help when SYS_LONGHELP=n
Quentin Schulz [Thu, 17 Jan 2019 09:18:47 +0000 (10:18 +0100)]
cmd: mtd: fix compilation warning for help when SYS_LONGHELP=n

cmd/mtd.c:447:13: warning: ‘mtd_help_text’ defined but not used [-Wunused-variable]
static char mtd_help_text[] =
            ^~~~~~~~~~~~~

When SYS_LONGHELP is not defined. After looking at how other commands
work, we should surround the whole help text (even its declaration) with
an #ifdef CONFIG_SYS_LONGHELP, since it's compiled out when calling
_CMD_HELP[1] on the help text variable argument to U_BOOT_CMD.

[1] https://elixir.bootlin.com/u-boot/latest/source/include/command.h#L181

Signed-off-by: Quentin Schulz <quentin.schulz@bootlin.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
5 years agotravis: Switch QEMU to 3.1.0 version
Michal Simek [Wed, 16 Jan 2019 14:18:44 +0000 (15:18 +0100)]
travis: Switch QEMU to 3.1.0 version

Vexpress ca15_tc2 is failing with 3.1.0 because of QEMU issue.
When this patch is applied
https://patchwork.kernel.org/patch/10754401/
Vexpress can be also turn to newer QEMU version.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
5 years agotravis: Setup QEMU_VERSION as variable
Michal Simek [Wed, 16 Jan 2019 14:18:43 +0000 (15:18 +0100)]
travis: Setup QEMU_VERSION as variable

This change enables setting up specific Qemu version or sha1 for new
targets which are added after (current) v3.0.0 version.
This changes is preparation step for adding new Xilinx Versal Virt
platform which was merge after v3.0.0.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
5 years agotravis: Break up the NXP Layerscape jobs more
Tom Rini [Wed, 16 Jan 2019 12:19:26 +0000 (07:19 -0500)]
travis: Break up the NXP Layerscape jobs more

The single job for all Layerscape 10xx platforms is close to, and
sometimes exceeds the time limit for a single job configuration.  Break
this down into jobs for LS101x, LS104x and LS108x instead.  While in
here, in the name portion of these jobs, refer to them as NXP for ARM
and not Freescale as they've been NXP for quite some time.

Signed-off-by: Tom Rini <trini@konsulko.com>
5 years agousb: host: Drop [e-o]hci-sunxi drivers
Jagan Teki [Tue, 10 Jul 2018 17:59:36 +0000 (23:29 +0530)]
usb: host: Drop [e-o]hci-sunxi drivers

Now Allwinner platform is all set to use Generic USB
controller drivers, so remove the legacy sunxi drivers.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
5 years agosunxi: usb: Switch to Generic host controllers
Jagan Teki [Sat, 22 Dec 2018 12:48:10 +0000 (18:18 +0530)]
sunxi: usb: Switch to Generic host controllers

Onc of key blocker for using USB Generic host controller
drivers in Allwinner are CLK and RESET drivers, now these
available for USB usage.

So switch sunxi USB use EHCI and OHCI Generic controllers.

Enabling USB is wisely a board choise, So Enable USB_OHCI_HCD
where it already have USB_EHCI_HCD

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
5 years agomusb-new: sunxi: Use CLK and RESET support
Jagan Teki [Mon, 31 Dec 2018 11:35:40 +0000 (17:05 +0530)]
musb-new: sunxi: Use CLK and RESET support

Now clock and reset drivers are available for respective
SoC's so use clk and reset ops on musb driver.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Reviewed-by: Marek Vasut <marex@denx.de>
5 years agoreset: Add reset valid
Jagan Teki [Mon, 6 Aug 2018 13:25:06 +0000 (18:55 +0530)]
reset: Add reset valid

Add reset_valid to check whether given reset is valid
or not.

Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
5 years agophy: sun4i-usb: Use CLK and RESET support
Jagan Teki [Mon, 6 Aug 2018 06:46:39 +0000 (12:16 +0530)]
phy: sun4i-usb: Use CLK and RESET support

Now clock and reset drivers are available for respective
SoC's so use clk and reset ops on phy driver.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Reviewed-by: Marek Vasut <marex@denx.de>
5 years agoarm: sunxi: Enable CLK, RESET
Jagan Teki [Fri, 11 Jan 2019 11:10:20 +0000 (16:40 +0530)]
arm: sunxi: Enable CLK, RESET

CLK and DM_RESET drivers are now available for all of
the Allwinner platforms, so enable them in arch/arm/Kconfig

Enabling CLK will select DM_RESET by default.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
5 years agosunxi: A64: Update sun50i-a64-ccu.h
Jagan Teki [Sat, 29 Dec 2018 18:29:08 +0000 (23:59 +0530)]
sunxi: A64: Update sun50i-a64-ccu.h

Update sun50i-a64-ccu.h from the Linux sunxi/dt64-for-4.20 tree:
commit 679294497be31596e1c9c61507746d72b6b05f26
Author: Rodrigo Exterckötter Tjäder <rodrigo@tjader.xyz>
Date:   Wed Sep 26 19:48:24 2018 +0000
    arm64: dts: allwinner: a64: a64-olinuxino: set the PHY TX delay

This should be a part of previous sync patch from
commit 1b39a1834ed182bbd8036a5cd74a9ea111fa4691
Author: Andre Przywara <andre.przywara@arm.com>
Date:   Mon Oct 29 00:56:47 2018 +0000

    sunxi: A64: Update .dts/.dtsi files

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
5 years agoclk: sunxi: Add Allwinner A80 CLK driver
Jagan Teki [Fri, 11 Jan 2019 10:11:46 +0000 (15:41 +0530)]
clk: sunxi: Add Allwinner A80 CLK driver

Add initial clock driver for Allwinner A80.

- Implement UART bus clocks via ccu_clk_gate table for
  A80, so it can accessed in common clk enable and disable
  functions from clk_sunxi.c
- Implement UART bus resets via ccu_reset table for A80,
  so it can accessed in common reset deassert and assert
  functions from reset-sunxi.c

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
5 years agoARM: dts: sun8i: Update A80 dts(i) from Linux-v4.18-rc3
Jagan Teki [Fri, 11 Jan 2019 10:52:57 +0000 (16:22 +0530)]
ARM: dts: sun8i: Update A80 dts(i) from Linux-v4.18-rc3

Update all A80 devicetree dtsi and dtsi files from
Linux-v4.18-rc3 with below commits.

arch/arm/boot/dts/sun9i-a80*:

commit 190e3138f9577885691540dca59c2f07540bde04
Merge: cafc87023b0d a7affb13b271
Author: Arnd Bergmann <arnd@arndb.de>
Date:   Tue Mar 27 14:58:00 2018 +0200

    Merge tag 'sunxi-h3-h5-for-4.17' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into next/dt

include/dt-bindings/*/sun9i-a80-*:

commit 783ab76ae553abc23f80ef7511052d055697531b
Author: Chen-Yu Tsai <wens@csie.org>
Date:   Sat Jan 28 20:22:36 2017 +0800

    clk: sunxi-ng: Add A80 Display Engine CCU

Note: sun9i-a80-cx-a99.dts is updated only uart0, since the same
dts is not available in Linux.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
5 years agoclk: sunxi: Add Allwinner H6 CLK driver
Jagan Teki [Mon, 31 Dec 2018 10:05:01 +0000 (15:35 +0530)]
clk: sunxi: Add Allwinner H6 CLK driver

Add initial clock driver for Allwinner H6.

- Implement UART bus clocks via ccu_clk_gate table for
  H6, so it can accessed in common clk enable and disable
  functions from clk_sunxi.c
- Implement UART bus resets via ccu_reset table for H6,
  so it can accessed in common reset deassert and assert
  functions from reset-sunxi.c

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
5 years agoclk: sunxi: Implement UART resets
Jagan Teki [Sun, 30 Dec 2018 16:07:31 +0000 (21:37 +0530)]
clk: sunxi: Implement UART resets

Implement UART resets for all relevant Allwinner SoC
clock drivers via ccu reset table.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
5 years agoclk: sunxi: Implement UART clocks
Jagan Teki [Sun, 30 Dec 2018 15:59:24 +0000 (21:29 +0530)]
clk: sunxi: Implement UART clocks

Implement UART clocks for all Allwinner SoC
clock drivers via ccu clock gate table.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
5 years agoclk: sunxi: Add Allwinner V3S CLK driver
Jagan Teki [Sun, 5 Aug 2018 09:01:54 +0000 (14:31 +0530)]
clk: sunxi: Add Allwinner V3S CLK driver

Add initial clock driver for Allwinner V3S.

- Implement USB bus and USB clocks via ccu_clk_gate table
  for V3S, so it can accessed in common clk enable and disable
  functions from clk_sunxi.c
- Implement USB bus and USB resets via ccu_reset table
  for V3S, so it can accessed in common reset deassert
  and assert functions from reset-sunxi.c

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
5 years agoclk: sunxi: Add Allwinner R40 CLK driver
Jagan Teki [Sun, 5 Aug 2018 05:46:33 +0000 (11:16 +0530)]
clk: sunxi: Add Allwinner R40 CLK driver

Add initial clock driver for Allwinner R40.

- Implement USB bus and USB clocks via ccu_clk_gate
  for R40, so it can accessed in common clk enable
  and disable functions from clk_sunxi.c
- Implement USB bus and USB resets via ccu_reset table
  for R40, so it can accessed in common reset deassert
  and assert functions from reset-sunxi.c

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
5 years agoclk: sunxi: Add Allwinner A83T CLK driver
Jagan Teki [Thu, 2 Aug 2018 18:03:55 +0000 (23:33 +0530)]
clk: sunxi: Add Allwinner A83T CLK driver

Add initial clock driver for Allwinner A83T.

- Implement USB bus and USB clocks via ccu_clk_gate table
  for A83T, so it can accessed in common clk enable and
  disable functions from clk_sunxi.c
- Implement USB bus and USB resets via ccu_reset table
  for A83T, so it can accessed in common reset deassert
  and assert functions from reset-sunxi.c

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
5 years agoclk: sunxi: Add Allwinner A23/A33 CLK driver
Jagan Teki [Thu, 2 Aug 2018 17:55:03 +0000 (23:25 +0530)]
clk: sunxi: Add Allwinner A23/A33 CLK driver

Add initial clock driver for Allwinner A23/A33.

- Implement USB bus and USB clocks via ccu_clk_gate table
  for A23/A33, so it can accessed in common clk enable and
  disable functions from clk_sunxi.c
- Implement USB bus and USB resets via ccu_reset table
  for A23/A33, so it can accessed in common reset deassert
  and assert functions from reset-sunxi.c

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
5 years agoclk: sunxi: Add Allwinner A31 CLK driver
Jagan Teki [Thu, 2 Aug 2018 17:45:34 +0000 (23:15 +0530)]
clk: sunxi: Add Allwinner A31 CLK driver

Add initial clock driver for Allwinner A31.

- Implement USB ahb1 and USB clocks via ccu_clk_gate table
  for A31, so it can accessed in common clk enable and disable
  functions from clk_sunxi.c
- Implement USB ahb1 and USB resets via ccu_reset table
  for A31, so it can accessed in common reset deassert
  and assert functions from reset-sunxi.c

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
5 years agoclk: sunxi: Add Allwinner A10s/A13 CLK driver
Jagan Teki [Thu, 2 Aug 2018 14:24:26 +0000 (19:54 +0530)]
clk: sunxi: Add Allwinner A10s/A13 CLK driver

Add initial clock driver for Allwinner A10s/A13.

- Implement USB ahb and USB clocks via ccu_clk_gate table
  for A10s/A13, so it can accessed in common clk enable and
  disable functions from clk_sunxi.c
- Implement USB resets via ccu_reset table for A10s/A13,
  so it can accessed in common reset deassert and assert
  functions from reset-sunxi.c

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
5 years agoclk: sunxi: Add Allwinner A10/A20 CLK driver
Jagan Teki [Thu, 2 Aug 2018 11:22:37 +0000 (16:52 +0530)]
clk: sunxi: Add Allwinner A10/A20 CLK driver

Add initial clock driver for Allwinner A10/A20.

- Implement USB ahb and USB clocks via ccu_clk_gate table
  for A10/A20, so it can accessed in common clk enable and
  disable functions from clk_sunxi.c
- Implement USB resets via ccu_reset table for A10/A20,
  so it can accessed in common reset deassert and assert
  functions from reset-sunxi.c

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
5 years agoclk: sunxi: Add Allwinner H3/H5 CLK driver
Jagan Teki [Thu, 2 Aug 2018 10:13:02 +0000 (15:43 +0530)]
clk: sunxi: Add Allwinner H3/H5 CLK driver

Add initial clock driver for Allwinner H3/H5.

- Implement USB bus and USB clocks via ccu_clk_gate table for
  H3/H5, so it can accessed in common clk enable and disable
  functions from clk_sunxi.c
- Implement USB bus and USB resets via ccu_reset table for
  H3/H5, so it can accessed in common reset deassert and assert
  functions from reset-sunxi.c

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
5 years agoreset: Add Allwinner RESET driver
Jagan Teki [Fri, 18 Jan 2019 16:48:13 +0000 (22:18 +0530)]
reset: Add Allwinner RESET driver

Add common reset driver for all Allwinner SoC's.

Since CLK and RESET share common DT compatible, it is CLK driver
job is to bind the reset driver. So add CLK bind call on respective
SoC driver by passing ccu map descriptor so-that reset deassert,
deassert operations held based on ccu reset table defined from
CLK driver.

Select DM_RESET via CLK_SUNXI, this make hidden section of RESET
since CLK and RESET share common DT compatible and code.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
5 years agoclk: Add Allwinner A64 CLK driver
Jagan Teki [Sat, 22 Dec 2018 16:02:49 +0000 (21:32 +0530)]
clk: Add Allwinner A64 CLK driver

Add initial clock driver for Allwinner A64.

Implement USB clock enable and disable functions for
OHCI, EHCI, OTG and USBPHY gate and clock registers
via ccu clk gate table.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
5 years agoboard: sun50i-h5: Add Emlid Neutis N5 support
Aleksandr Aleksandrov [Fri, 5 Oct 2018 12:55:59 +0000 (15:55 +0300)]
board: sun50i-h5: Add Emlid Neutis N5 support

Emlid Neutis N5 is a SoM based on Allwinner H5, has a WiFi & BT
module, DDR3 RAM and eMMC.

- add neutis-devboard target to dtb makefile
- add dtsi file for Neutis N5 needs
- add config file for Neutis N5 Dev board

Signed-off-by: Aleksandr Aleksandrov <aleksandr.aleksandrov@emlid.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
[jagan: update proper commit head]
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
5 years agosunxi: board: Add i2c initialization for sun50i
Stefan Mavrodiev [Tue, 8 Jan 2019 10:04:30 +0000 (12:04 +0200)]
sunxi: board: Add i2c initialization for sun50i

To use TWI0/1/2 the user can select CONFIG_I2C#_ENABLE.
However even the controller is enabled, the mux for the pins
are not set.

This patch follows the existing mux method. Since the pads are
different, separate check is added for each i2c.

Tested with A64-SOM204 board.

Signed-off-by: Stefan Mavrodiev <stefan@olimex.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
5 years agoconfigs: Remove am43xx_evm_ethboot_defconfig
Vignesh R [Wed, 16 Jan 2019 09:24:36 +0000 (14:54 +0530)]
configs: Remove am43xx_evm_ethboot_defconfig

am43xx_evm_ethboot_defconfig is not being actively used and has not been
moved to DM or DT. Also, ethboot cannot be tested on AM43xx EVM as such
due EVM limitations. Therefore delete it.

Signed-off-by: Vignesh R <vigneshr@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
5 years agoconfigs: Remove unused am335x_evm defconfigs
Vignesh R [Wed, 16 Jan 2019 09:08:04 +0000 (14:38 +0530)]
configs: Remove unused am335x_evm defconfigs

These defconfigs don't seem be actively used any more, and have not been
moved to adapt DM or DT. Therefore delete them.

Signed-off-by: Vignesh R <vigneshr@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
5 years agoconfigs: am335x_evm: Enable DM_SPI and DM_SPI_FLASH
Vignesh R [Wed, 16 Jan 2019 06:46:11 +0000 (12:16 +0530)]
configs: am335x_evm: Enable DM_SPI and DM_SPI_FLASH

Enable DM_SPI and DM_SPI_FLASH for actively used defconfigs for
am335x_evm.

Signed-off-by: Vignesh R <vigneshr@ti.com>
5 years agoadding saveenv-command for bananapi r2
Frank Wunderlich [Tue, 15 Jan 2019 17:49:06 +0000 (18:49 +0100)]
adding saveenv-command for bananapi r2

bananapi r2 can be booted from sd-card and emmc
saving the environment have to choose the storage
from which the device has booted

also the offset is set to 1MB to make sure env is written
to block "user data area" between uboot and first partition

https://www.fw-web.de/dokuwiki/lib/exe/fetch.php?cache=&media=bpi-r2:boot-structure.png

Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
5 years agomkimage: fixup CONFIG_FIT_EXTERNAL_OFFSET
Patrick Wildt [Tue, 15 Jan 2019 15:34:19 +0000 (16:34 +0100)]
mkimage: fixup CONFIG_FIT_EXTERNAL_OFFSET

The last parameter is expected to be the imagefile.  Since -E is a
flag having the output name before -p will make mkimage ignore the
external offset option.

Signed-off-by: Patrick Wildt <patrick@blueri.se>
5 years agolib: Kconfig: spelling fixes
Chris Packham [Sun, 13 Jan 2019 09:13:28 +0000 (22:13 +1300)]
lib: Kconfig: spelling fixes

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agovideo: Kconfig: spelling fixes
Chris Packham [Sun, 13 Jan 2019 09:13:27 +0000 (22:13 +1300)]
video: Kconfig: spelling fixes

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
5 years agopinctrl: Kconfig: spelling fixes
Chris Packham [Sun, 13 Jan 2019 09:13:26 +0000 (22:13 +1300)]
pinctrl: Kconfig: spelling fixes

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agoi2c: Kconfig: spelling fixes
Chris Packham [Sun, 13 Jan 2019 09:13:25 +0000 (22:13 +1300)]
i2c: Kconfig: spelling fixes

Signed-off-by: Chris Packham <judge.packham@gmail.com>
5 years agodrivers: Kconfig: spelling fixes
Chris Packham [Sun, 13 Jan 2019 09:13:24 +0000 (22:13 +1300)]
drivers: Kconfig: spelling fixes

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agowork_92105: Kconfig: spelling fixes
Chris Packham [Sun, 13 Jan 2019 09:13:23 +0000 (22:13 +1300)]
work_92105: Kconfig: spelling fixes

Signed-off-by: Chris Packham <judge.packham@gmail.com>
5 years agox86: Kconfig: spelling fixes
Chris Packham [Sun, 13 Jan 2019 09:13:22 +0000 (22:13 +1300)]
x86: Kconfig: spelling fixes

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agoarm: Kconfig: spelling fixes
Chris Packham [Sun, 13 Jan 2019 09:13:21 +0000 (22:13 +1300)]
arm: Kconfig: spelling fixes

Signed-off-by: Chris Packham <judge.packham@gmail.com>
5 years agocommon: spl: Kconfig: spelling fixes
Chris Packham [Sun, 13 Jan 2019 09:13:20 +0000 (22:13 +1300)]
common: spl: Kconfig: spelling fixes

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agoKconfig: fix spelling
Chris Packham [Sun, 13 Jan 2019 09:13:19 +0000 (22:13 +1300)]
Kconfig: fix spelling

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agodisk: efi: GUIDs should be const
Heinrich Schuchardt [Sat, 12 Jan 2019 10:25:25 +0000 (11:25 +0100)]
disk: efi: GUIDs should be const

Make system_guid const.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agomach-snapdragon: db410: pinctrl: fix pin count
Ramon Fried [Sat, 12 Jan 2019 09:48:28 +0000 (11:48 +0200)]
mach-snapdragon: db410: pinctrl: fix pin count

Pin count in APQ8016 was wrong, fix that.

Fixes: ad97051b7ff6 ("mach-snapdragon: Introduce pinctrl driver")
Signed-off-by: Ramon Fried <ramon.fried@gmail.com>
5 years agodts: db410: fix indentation
Ramon Fried [Sat, 12 Jan 2019 09:48:27 +0000 (11:48 +0200)]
dts: db410: fix indentation

Signed-off-by: Ramon Fried <ramon.fried@gmail.com>
5 years agoMerge tag 'mips-pull-2019-11-16' of git://git.denx.de/u-boot-mips
Tom Rini [Fri, 18 Jan 2019 00:12:55 +0000 (19:12 -0500)]
Merge tag 'mips-pull-2019-11-16' of git://git.denx.de/u-boot-mips

- MIPS: mscc: various enhancements for Luton and Ocelot platforms
- MIPS: mscc: added support for Jaguar2 platform
- MIPS: optimised SPL linker script
- MIPS: bcm6368: fix restart flow issues
- MIPS: fixed CONFIG_OF_EMBED warnings for all MIPS boards
- MIPS: mt7688: small fixes and enhancements
- mmc: compile-out write support if disabled

5 years agoMerge branch '2019-01-16-master-imports'
Tom Rini [Thu, 17 Jan 2019 22:42:03 +0000 (17:42 -0500)]
Merge branch '2019-01-16-master-imports'

- Fixes for CVE-2018-18440 and CVE-2018-18439
- Patch to allow disabling unneeded NAND ECC layouts
- Optimize SPI flash env read process

5 years agoarmv8: ls2088ardb: Update MAINTAINERS
York Sun [Wed, 16 Jan 2019 15:49:25 +0000 (15:49 +0000)]
armv8: ls2088ardb: Update MAINTAINERS

Signed-off-by: York Sun <york.sun@nxp.com>
CC: Rajesh Bhagat <rajesh.bhagat@nxp.com>
5 years agoarmv8: ls1088ardb: Update MAINTAINERS
York Sun [Wed, 16 Jan 2019 15:49:19 +0000 (15:49 +0000)]
armv8: ls1088ardb: Update MAINTAINERS

Signed-off-by: York Sun <york.sun@nxp.com>
CC: Rajesh Bhagat <rajesh.bhagat@nxp.com>
5 years agoarmv7: dts: ls1021a: Remove aliases property name warning
Rajesh Bhagat [Sat, 5 Jan 2019 08:06:14 +0000 (08:06 +0000)]
armv7: dts: ls1021a: Remove aliases property name warning

Remove aliases property name warning while compilation:
Warning (alias_paths): /aliases: aliases property name must
include only lowercase and '-'

Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
5 years agopci: layerscape: Add the dts fixup for EP and RC
Xiaowei Bao [Fri, 26 Oct 2018 01:56:26 +0000 (09:56 +0800)]
pci: layerscape: Add the dts fixup for EP and RC

Add the dts fixup when PCI controller work diffferent mode.

Signed-off-by: Xiaowei Bao <xiaowei.bao@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
5 years agopci: layerscape: Do not scan when PEX work in EP mode
Xiaowei Bao [Fri, 26 Oct 2018 01:56:25 +0000 (09:56 +0800)]
pci: layerscape: Do not scan when PEX work in EP mode

Don't scan the bus when the PEX work in EP mode.

Signed-off-by: Xiaowei Bao <xiaowei.bao@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
5 years agopci: layerscape: Modify the EP and RC mode judge method
Xiaowei Bao [Fri, 26 Oct 2018 01:56:24 +0000 (09:56 +0800)]
pci: layerscape: Modify the EP and RC mode judge method

Modify the RC and EP mode judge method, save the mode as a variable,
the variable will be used by other function.

Signed-off-by: Xiaowei Bao <xiaowei.bao@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
5 years agols1046aqds: Bypass xfi port fixup for KR mode
Florinel Iordache [Mon, 10 Dec 2018 09:27:31 +0000 (09:27 +0000)]
ls1046aqds: Bypass xfi port fixup for KR mode

u-boot makes a fixup for LS1046AQDS board to setup the properties
'fixed-link' and 'phy-connection-type' to 'xgmii' but in case of
backplane mode this fixup is not correct because it causes the KR link
to fail and so it must be bypassed in order to keep the link in KR
mode as it is defined in DTS.

Signed-off-by: Florinel Iordache <florinel.iordache@nxp.com>
[YS: Fix compiling warning]
Reviewed-by: York Sun <york.sun@nxp.com>
5 years agoarmv8: fsl-layerscape: properly configure qdma ICID
Laurentiu Tudor [Wed, 12 Dec 2018 11:45:51 +0000 (13:45 +0200)]
armv8: fsl-layerscape: properly configure qdma ICID

The ICIDs for the qdma device are not configured through SCFG but
through some registers found in the actual device register block.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
5 years agommc: fsl_esdhc: make get_cd work well in dm_mmc_ops
Yinbo Zhu [Fri, 14 Dec 2018 10:02:53 +0000 (18:02 +0800)]
mmc: fsl_esdhc: make get_cd work well in dm_mmc_ops

This patch is to make get_cd work well when DM_MMC enabled

Signed-off-by: Yinbo Zhu <yinbo.zhu@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
5 years agofsl-layerscape: dpaa: fix fsl-mc status in fdt with bootefi
Mian Yousaf Kaukab [Tue, 18 Dec 2018 13:01:17 +0000 (14:01 +0100)]
fsl-layerscape: dpaa: fix fsl-mc status in fdt with bootefi

fsl-mc lazyapply command applies dpl from efi_exit_boot_services().
Status of fsl-mc node in working fdt is updated at this stage.
However, an efi application like grub may already have copied the fdt.
So the updates to fdt done at efi_exit_boot_services() may not be
visible to the OS. Fix it by updating fdt earlier if fsl-mc lazyapply
command is used.

Fixes: b7b8410a8f (ls2080: Exit dpaa only right before exiting U-Boot)
Signed-off-by: Mian Yousaf Kaukab <ykaukab@suse.de>
Reviewed-by: York Sun <york.sun@nxp.com>
5 years agoarmv8: ls1043a: correct the PCIe INTx fixup
Hou Zhiqiang [Thu, 20 Dec 2018 06:31:21 +0000 (06:31 +0000)]
armv8: ls1043a: correct the PCIe INTx fixup

On LS1043A rev1.0 there are 4 interrupt pins for INTx, and on
rev1.1 there is only 1 for INTx, so the current fixup is inverse
of the fact.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
5 years agoarmv8: ls1043a: add SVR definitions for 23x23 package silicon
Hou Zhiqiang [Thu, 20 Dec 2018 06:31:17 +0000 (06:31 +0000)]
armv8: ls1043a: add SVR definitions for 23x23 package silicon

LS1043A/LS1023A 23x23 package silicon has different SVR:VAR_PER.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
5 years agoconfigs: update TFABOOT defconfigs for SD boot support
Rajesh Bhagat [Sat, 12 Jan 2019 07:31:01 +0000 (07:31 +0000)]
configs: update TFABOOT defconfigs for SD boot support

update TFABOOT defconfig for SD boot on below NXP chasis2
and chasis3 platforms:

ls1043a, ls1046a, ls1088a and ls2088a.

Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
5 years agoenv: fix allow to build multiple environments
Rajesh Bhagat [Sat, 12 Jan 2019 07:30:51 +0000 (07:30 +0000)]
env: fix allow to build multiple environments

Patch fixes build error when enabling CONFIG_ENV_IS_IN_SPI_FLAS
and CONFIG_ENV_IS_IN_MMC at the same time mentioned issue in
below link:

Refer: https://lists.denx.de/pipermail/u-boot/2018-February/319565.html

build error when enabling CONFIG_ENV_IS_IN_SPI_FLASH and
CONFIG_ENV_IS_IN_MMC at the same time.

Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
5 years agoarmv8: ls2088aqds: Add TFABOOT support
Rajesh Bhagat [Thu, 27 Dec 2018 04:38:01 +0000 (04:38 +0000)]
armv8: ls2088aqds: Add TFABOOT support

TFABOOT support includes:
 - ls2088aqds_tfa_defconfig to be loaded by trusted firmware
 - environment address and size changes for TFABOOT

Signed-off-by: Pankit Garg <pankit.garg@nxp.com>
Signed-off-by: Ruchika Gupta <ruchika.gupta@nxp.com>
Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
5 years agoarmv8: ls2088ardb: Add TFABOOT support
Rajesh Bhagat [Thu, 27 Dec 2018 04:37:59 +0000 (04:37 +0000)]
armv8: ls2088ardb: Add TFABOOT support

TFABOOT support includes:
  - ls2088ardb_tfa_defconfig to be loaded by trusted firmware
  - environment address and size changes for TFABOOT
  - define BOOTCOMMAND for TFABOOT
  - remove EL3 specific erratas for TFABOOT

Signed-off-by: Pankit Garg <pankit.garg@nxp.com>
Signed-off-by: Ruchika Gupta <ruchika.gupta@nxp.com>
Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
5 years agoarmv8: ls1088aqds: Add TFABOOT support
Pankit Garg [Thu, 27 Dec 2018 04:37:57 +0000 (04:37 +0000)]
armv8: ls1088aqds: Add TFABOOT support

TFABOOT support includes:
 - ls1088aqds_tfa_defconfig to be loaded by trusted firmware
 - environment address and size changes for TFABOOT
 - MC address changes for TFABOOT
 - define BOOTCOMMAND for TFABOOT
 - ifc chip select changes for TFABOOT

Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com>
Signed-off-by: Pankit Garg <pankit.garg@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
5 years agoarmv8: ls1088ardb: Add TFABOOT support
Pankit Garg [Thu, 27 Dec 2018 04:37:55 +0000 (04:37 +0000)]
armv8: ls1088ardb: Add TFABOOT support

TFABOOT support includes:
- ls1088ardb_tfa_defconfig to be loaded by trusted firmware
- environment address and size changes for TFABOOT
- MC address changes for TFABOOT
- define BOOTCOMMAND for TFABOOT
- ifc chip select changes for TFABOOT

Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com>
Signed-off-by: Pankit Garg <pankit.garg@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
5 years agols1043a: add support for nand-boot cmd for TFA
Pankit Garg [Thu, 27 Dec 2018 04:37:53 +0000 (04:37 +0000)]
ls1043a: add support for nand-boot cmd for TFA

Signed-off-by: Pankit Garg <pankit.garg@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
5 years agodrivers: ifc: restore the legacy flow for IFC config
Rajesh Bhagat [Thu, 27 Dec 2018 04:37:51 +0000 (04:37 +0000)]
drivers: ifc: restore the legacy flow for IFC config

Restore the legacy flow along with TFABOOT flow for
IFC configuration.

Signed-off-by: Pankit Garg <pankit.garg@nxp.com>
Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
5 years agoarmv8: fsl-layerscape: fixes for TFABOOT framework
Rajesh Bhagat [Thu, 27 Dec 2018 04:37:49 +0000 (04:37 +0000)]
armv8: fsl-layerscape: fixes for TFABOOT framework

Fixes for TFABOOT framework
- update eMMC bootsrc to SD_MMC
- Increase buffer size for mcinitcmd from 256 to 512
- Fix mcinitcmd and bootcmd for Secure Boot

Signed-off-by: Pankit Garg <pankit.garg@nxp.com>
Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
5 years agoarm: bootm: fix sp detection at end of address range
Simon Goldschmidt [Mon, 14 Jan 2019 21:38:23 +0000 (22:38 +0100)]
arm: bootm: fix sp detection at end of address range

This fixes  'arch_lmb_reserve()' for ARM that tries to detect in which
DRAM bank 'sp' is in.

This code failed if a bank was at the end of physical address range
(i.e. size + length overflowed to 0).

To fix this, calculate 'bank_end' as 'size + length - 1' so that such
banks end at 0xffffffff, not 0.

Fixes: 15751403b6 ("ARM: bootm: don't assume sp is in DRAM bank 0")
Reported-by: Frank Wunderlich <frank-w@public-files.de>
Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
5 years agotftp: prevent overwriting reserved memory
Simon Goldschmidt [Mon, 14 Jan 2019 21:38:22 +0000 (22:38 +0100)]
tftp: prevent overwriting reserved memory

This fixes CVE-2018-18439 ("insufficient boundary checks in network
image boot") by using lmb to check for a valid range to store
received blocks.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
[trini: Always build lib/lmb.o on LMB and lib/fdtdec.o on OF_LIBFDT]
Signed-off-by: Tom Rini <trini@konsulko.com>
5 years agolmb: remove unused extern declaration
Simon Goldschmidt [Mon, 14 Jan 2019 21:38:21 +0000 (22:38 +0100)]
lmb: remove unused extern declaration

lmb.h includes an extern declaration of "struct lmb lmb;" which
is not used anywhere, so remove it.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
5 years agobootm: use new common function lmb_init_and_reserve
Simon Goldschmidt [Mon, 14 Jan 2019 21:38:20 +0000 (22:38 +0100)]
bootm: use new common function lmb_init_and_reserve

This reduces duplicate code only.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agofs: prevent overwriting reserved memory
Simon Goldschmidt [Mon, 14 Jan 2019 21:38:19 +0000 (22:38 +0100)]
fs: prevent overwriting reserved memory

This fixes CVE-2018-18440 ("insufficient boundary checks in filesystem
image load") by using lmb to check the load size of a file against
reserved memory addresses.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agolib: lmb: extend lmb for checks at load time
Simon Goldschmidt [Mon, 14 Jan 2019 21:38:18 +0000 (22:38 +0100)]
lib: lmb: extend lmb for checks at load time

This adds two new functions, lmb_alloc_addr and
lmb_get_unreserved_size.

lmb_alloc_addr behaves like lmb_alloc, but it tries to allocate a
pre-specified address range. Unlike lmb_reserve, this address range
must be inside one of the memory ranges that has been set up with
lmb_add.

lmb_get_unreserved_size returns the number of bytes that can be
used up to the next reserved region or the end of valid ram. This
can be 0 if the address passed is reserved.

Added test for these new functions.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
5 years agofdt: parse "reserved-memory" for memory reservation
Simon Goldschmidt [Mon, 14 Jan 2019 21:38:17 +0000 (22:38 +0100)]
fdt: parse "reserved-memory" for memory reservation

boot_fdt_add_mem_rsv_regions() adds reserved memory sections to an lmb
struct. Currently, it only parses regions described by /memreserve/
entries.

Extend this to the more commonly used scheme of the "reserved-memory"
node.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agolib: lmb: reserving overlapping regions should fail
Simon Goldschmidt [Mon, 14 Jan 2019 21:38:16 +0000 (22:38 +0100)]
lib: lmb: reserving overlapping regions should fail

lmb_add_region handles overlapping regions wrong: instead of merging
or rejecting to add a new reserved region that overlaps an existing
one, it just adds the new region.

Since internally the same function is used for lmb_alloc, change
lmb_add_region to reject overlapping regions.

Also, to keep reserved memory correct after 'free', reserved entries
created by allocating memory must not set their size to a multiple
of alignment but to the original size. This ensures the reserved
region is completely removed when the caller calls 'lmb_free', as
this one takes the same size as passed to 'lmb_alloc' etc.

Add test to assert this.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
5 years agolmb: fix allocation at end of address range
Simon Goldschmidt [Mon, 14 Jan 2019 21:38:15 +0000 (22:38 +0100)]
lmb: fix allocation at end of address range

The lmb code fails if base + size of RAM overflows to zero.

Fix this by calculating end as 'base + size - 1' instead of 'base + size'
where appropriate.

Added tests to assert this is fixed.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
5 years agotest: add test for lib/lmb.c
Simon Goldschmidt [Mon, 14 Jan 2019 21:38:14 +0000 (22:38 +0100)]
test: add test for lib/lmb.c

Add basic tests for the lmb memory allocation code used to reserve and
allocate memory during boot.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agoenv: add spi_flash_read_env function
Horatiu Vultur [Tue, 11 Dec 2018 09:13:56 +0000 (10:13 +0100)]
env: add spi_flash_read_env function

The spi_flash_read_env function is a wrapper over spi_flash_read, which
enables the env to read multiple flash page size from flash until '\0\0'
is read or the end of env partition is reached. Instead of reading the
entire env size. When it reads '\0\0', it stops reading further the env
and assumes that the rest of env is '\0'.

This is an optimization for large environments that contain few bytes
environment variables. In this case it doesn't need to read the entire
environment and only few pages.

Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
5 years agomtd: nand: raw: allow to disable unneeded ECC layouts
Stefan Agner [Thu, 6 Dec 2018 13:57:09 +0000 (14:57 +0100)]
mtd: nand: raw: allow to disable unneeded ECC layouts

Each ECC layout consumes about 2984 bytes in the .data section. Allow
to disable the default ECC layouts if a driver is known to provide its
own ECC layout.

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
5 years agomips: mt7688: gardena-smart-gateway: Enable green power LED on startup
Stefan Roese [Tue, 15 Jan 2019 12:54:26 +0000 (13:54 +0100)]
mips: mt7688: gardena-smart-gateway: Enable green power LED on startup

Set the correct power-up state (default-state) of the green power LED.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
5 years agomips: mt7688: gardena-smart-gateway: Update mtdparts/mtdids for Kernel 4.19
Stefan Roese [Tue, 15 Jan 2019 12:54:25 +0000 (13:54 +0100)]
mips: mt7688: gardena-smart-gateway: Update mtdparts/mtdids for Kernel 4.19

With the new SPI NOR framework in v4.19, we need to adapt the MTD parts
so that the kernel cmdline parameter "mtdparts=" uses the correct naming
for the devices.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
5 years agoMIPS: bmips: switch to CONFIG_OF_SEPARATE
Daniel Schwierzeck [Sat, 12 Jan 2019 19:52:21 +0000 (20:52 +0100)]
MIPS: bmips: switch to CONFIG_OF_SEPARATE

Fix the Kconfig warning to not use CONFIG_OF_EMBED in defconfigs.

Based on https://patchwork.ozlabs.org/patch/1019791/

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
5 years agoMIPS: xilfpga: switch to CONFIG_OF_SEPARATE
Daniel Schwierzeck [Sat, 12 Jan 2019 19:52:20 +0000 (20:52 +0100)]
MIPS: xilfpga: switch to CONFIG_OF_SEPARATE

Fix the Kconfig warning to not use CONFIG_OF_EMBED in defconfigs.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
5 years agoMIPS: pic32mzdask: switch to CONFIG_OF_SEPARATE
Daniel Schwierzeck [Sat, 12 Jan 2019 19:52:19 +0000 (20:52 +0100)]
MIPS: pic32mzdask: switch to CONFIG_OF_SEPARATE

Fix the Kconfig warning to not use CONFIG_OF_EMBED in defconfigs.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
5 years agoMIPS: malta: switch to CONFIG_OF_SEPARATE
Daniel Schwierzeck [Sat, 12 Jan 2019 19:52:18 +0000 (20:52 +0100)]
MIPS: malta: switch to CONFIG_OF_SEPARATE

Fix the Kconfig warning to not use CONFIG_OF_EMBED in defconfigs.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
5 years agoMIPS: boston: switch to CONFIG_OF_SEPARATE
Daniel Schwierzeck [Sat, 12 Jan 2019 19:52:17 +0000 (20:52 +0100)]
MIPS: boston: switch to CONFIG_OF_SEPARATE

Fix the Kconfig warning to not use CONFIG_OF_EMBED in defconfigs.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>