]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
6 years agoarm: spring: fix alias of mmc correctly
Minkyu Kang [Fri, 27 Jul 2018 07:59:24 +0000 (16:59 +0900)]
arm: spring: fix alias of mmc correctly

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
6 years agoarm: exynos5: fix warning of dts
Minkyu Kang [Fri, 27 Jul 2018 07:57:55 +0000 (16:57 +0900)]
arm: exynos5: fix warning of dts

remove this warning: avoid_unnecessary_addr_size

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
6 years agoarm: exynos4: fix warning of dts
Minkyu Kang [Fri, 27 Jul 2018 07:54:04 +0000 (16:54 +0900)]
arm: exynos4: fix warning of dts

remove this warning: avoid_unnecessary_addr_size

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
6 years agoARM: Odroid XU3: Modify exynos dw_mmc driver to support Odroid XU3 in DM MMC
Lukasz Majewski [Wed, 1 Aug 2018 12:49:00 +0000 (14:49 +0200)]
ARM: Odroid XU3: Modify exynos dw_mmc driver to support Odroid XU3 in DM MMC

This commit enables support for Exynos Designware MMC driver based on DM.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Tested-by: Anand Moon <linux.amoon@gmail.com>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
6 years agoARM: Odroid XU3: Fix the dwmci_exynos *priv data assignment for DM_MMC (sdr_timing)
Lukasz Majewski [Wed, 1 Aug 2018 12:48:59 +0000 (14:48 +0200)]
ARM: Odroid XU3: Fix the dwmci_exynos *priv data assignment for DM_MMC (sdr_timing)

By convention for DM_MMC the host->priv is used to store struct udevice
*dev pointer.

Unfortunately, the legacy Exynos DW MMC code uses this field to
store pointer to dwmci_exynos_priv_data struct
Hence, we do need to get data in other way - namely by using container_of
when host pointer is present.
In this way the sdr_timing data is properly accessed.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Tested-by: Anand Moon <linux.amoon@gmail.com>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
6 years agoARM: Odroid XU3: MAINTAINERS: Add a co-maintainer for OdroidXU3
Lukasz Majewski [Wed, 1 Aug 2018 12:48:58 +0000 (14:48 +0200)]
ARM: Odroid XU3: MAINTAINERS: Add a co-maintainer for OdroidXU3

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Tested-by: Anand Moon <linux.amoon@gmail.com>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
6 years agoARM: Odroid XU3: Adjust BOOT_TARGET_DEVICES to allow booting from SD card (mmc2)
Lukasz Majewski [Wed, 1 Aug 2018 12:48:57 +0000 (14:48 +0200)]
ARM: Odroid XU3: Adjust BOOT_TARGET_DEVICES to allow booting from SD card (mmc2)

This change is necessary to allow booting the Odroid XU3 from SD card
after enabling the DM_MMC support.

After this change the SD card mmc IP block is correctly enumerated as mmc2
(and not as mmc1 as in the legacy code).

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Tested-by: Anand Moon <linux.amoon@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
6 years agoARM: Odroid XU3: Fix autoboot.cmd to use ${mmcbootdev} instead of hardcoded 0
Lukasz Majewski [Wed, 1 Aug 2018 12:48:56 +0000 (14:48 +0200)]
ARM: Odroid XU3: Fix autoboot.cmd to use ${mmcbootdev} instead of hardcoded 0

This commit adjusts the autoboot.cmd file to use ${mmcbootdev} instead of
hardcoded value 0.

This is necessary to allow booting this board from the SD card.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Tested-by: Anand Moon <linux.amoon@gmail.com>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
6 years agoARM: Odroid XU3: Enable driver model support for MMC (DM_MMC)
Lukasz Majewski [Wed, 1 Aug 2018 12:48:55 +0000 (14:48 +0200)]
ARM: Odroid XU3: Enable driver model support for MMC (DM_MMC)

This commit enables support for DW_MMC running with driver model.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Tested-by: Anand Moon <linux.amoon@gmail.com>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
6 years agoARM: Odroid XU3: config: Disable SDHCI support in the Odroid XU3
Lukasz Majewski [Wed, 1 Aug 2018 12:48:54 +0000 (14:48 +0200)]
ARM: Odroid XU3: config: Disable SDHCI support in the Odroid XU3

The Exynos5422 is solely using DW MMC IP block to support eMMC/SD devices,
hence the SDHCI code doesn't need to be compiled it.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Tested-by: Anand Moon <linux.amoon@gmail.com>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
6 years agoARM: dw_mmc: Exclude dwmci Exynos priv_data allocation from exynos_dwmci_get_config()
Lukasz Majewski [Wed, 1 Aug 2018 12:48:53 +0000 (14:48 +0200)]
ARM: dw_mmc: Exclude dwmci Exynos priv_data allocation from exynos_dwmci_get_config()

This commit prevents memory leak when this function is used with DM_MMC
as the struct dwmci_exynos_priv_data is already allocated by DM.

It is necessary for NON DM aware devices to allocate this struct first.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Tested-by: Anand Moon <linux.amoon@gmail.com>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
6 years agoarm: odroid: Inherit default value for bootdelay from distro_bootcmd.
Vagrant Cascadian [Wed, 25 Jul 2018 03:18:35 +0000 (11:18 +0800)]
arm: odroid: Inherit default value for bootdelay from distro_bootcmd.

The default value with distro_bootcmd is 2 seconds, which is
reasonably fast, and provides a consistent experience across platforms
supporting distro_bootcmd.

The current bootdelay value of 0 seconds is a bit challenging to
interrupt when desired.

Acked-by: Lukasz Majewski <lukma@denx.de>
Signed-off-by: Vagrant Cascadian <vagrant@debian.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
6 years agoarm: odroid: Enable distro_bootcmd support.
Vagrant Cascadian [Wed, 25 Jul 2018 03:18:34 +0000 (11:18 +0800)]
arm: odroid: Enable distro_bootcmd support.

Enable distro_bootcmd for a standardized boot process across multiple
platforms.

Acked-by: Lukasz Majewski <lukma@denx.de>
Signed-off-by: Vagrant Cascadian <vagrant@debian.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
6 years agoarm: odroid: Increase default env size in preparation for distro_bootcmd.
Vagrant Cascadian [Wed, 25 Jul 2018 03:18:33 +0000 (11:18 +0800)]
arm: odroid: Increase default env size in preparation for distro_bootcmd.

Adding distro_bootcmd support bumps the default environment size over
4500. Increase to SZ_16K to allow for room to grow in the future.

Acked-by: Lukasz Majewski <lukma@denx.de>
Signed-off-by: Vagrant Cascadian <vagrant@debian.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
6 years agoarm: odroid: Use standard environment variable names kernel_addr_r, ramdisk_addr_r...
Vagrant Cascadian [Wed, 25 Jul 2018 03:18:32 +0000 (11:18 +0800)]
arm: odroid: Use standard environment variable names kernel_addr_r, ramdisk_addr_r and fdt_addr_r.

Replace non-standard variable names kerneladdr, initrdaddr and fdtaddr
with kernel_addr_r, ramdisk_addr_r and fdt_addr_r, as documented in
u-boot README.

Acked-by: Lukasz Majewski <lukma@denx.de>
Signed-off-by: Vagrant Cascadian <vagrant@debian.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
6 years agosnow: set fdtfile
Guillaume GARDET [Thu, 14 Jun 2018 20:34:10 +0000 (22:34 +0200)]
snow: set fdtfile

Needed to boot with EFI distro boot.

Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Cc: Akshay Saraswat <akshay.s@samsung.com>
Cc: Tom Rini <trini@konsulko.com>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
6 years agotegra: Indicate that binman makes all three output files
Simon Glass [Sat, 21 Jul 2018 01:49:27 +0000 (19:49 -0600)]
tegra: Indicate that binman makes all three output files

Use GNU make pattern rules to indicate that a single run of binman
produces all three Tegra output files. The avoids make running binman
three times (perhaps in parallel) and those instances inteferring with
each other.

See http://patchwork.ozlabs.org/patch/944611/ for the bug report.

Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Stephen Warren <swarren@nvidia.com>
6 years agoMAINTAINERS: Mark NAND as Orphaned
Tom Rini [Thu, 26 Jul 2018 16:02:03 +0000 (12:02 -0400)]
MAINTAINERS: Mark NAND as Orphaned

Scott is no longer maintaining the NAND subsystem, mark as orphaned for
now.

Acked-by: Scott Wood <oss@buserror.net>
Signed-off-by: Tom Rini <trini@konsulko.com>
6 years agocmd/ubi.c: Fix format warning
Tom Rini [Thu, 26 Jul 2018 15:17:24 +0000 (11:17 -0400)]
cmd/ubi.c: Fix format warning

On 64bit platforms we would otherwise see:
../cmd/ubi.c: In function 'ubi_volume_read':
../cmd/ubi.c:359:16: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'size_t {aka long unsigned int}' [-Wformat=]

Fixes: 68c7025d99db ("cmd: ubi: print load size after establishing volume size")
Signed-off-by: Tom Rini <trini@konsulko.com>
6 years agoMerge branch 'master' of git://git.denx.de/u-boot-socfpga
Tom Rini [Thu, 26 Jul 2018 15:43:26 +0000 (11:43 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-socfpga

6 years agoMerge branch 'master' of git://git.denx.de/u-boot-sh
Tom Rini [Thu, 26 Jul 2018 15:43:23 +0000 (11:43 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-sh

6 years agoMakefile: Fix 'clean' target
Tom Rini [Wed, 25 Jul 2018 15:38:17 +0000 (11:38 -0400)]
Makefile: Fix 'clean' target

Now that we have removed the DocBook files we need to not try and clean
that directory.

Reported-by: ericywl <midnight2903@gmail.com>
Reported-by: Jagan Teki <jagan@amarulasolutions.com>
Fixes: 78a88f7930be ("doc: Replace DocBook with sphinx-based docs")
Signed-off-by: Tom Rini <trini@konsulko.com>
6 years agoMerge branch 'master' of git://git.denx.de/u-boot-uniphier
Tom Rini [Wed, 25 Jul 2018 02:46:50 +0000 (22:46 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-uniphier

6 years agoARM: uniphier: enable distro boot
Masahiro Yamada [Fri, 20 Jul 2018 12:47:18 +0000 (21:47 +0900)]
ARM: uniphier: enable distro boot

Switch to the distro boot for UniPhier platform.

 - Remove the environment vairalbes used to load images from raw
   block devices.

 - Keep the command to download images via tftp.  This will be
   useful to boot the kernel when no valid kernel image is ready
   yet in the file system.

 - Use root.cpio.gz instead of root.cpio.uboot because we always know
   the file size of the init ramdisk; it is loaded via either a file
   system or network.

 - Rename fit_addr_r to kernel_addr_r, which the distro command
   checks to get the load address of FIT image.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
6 years agoARM: uniphier: enable MTD partition and UBI
Masahiro Yamada [Thu, 19 Jul 2018 07:28:27 +0000 (16:28 +0900)]
ARM: uniphier: enable MTD partition and UBI

Enable "mtdparts" and "ubi" commands for uniphier_v8_defconfig to
use UBI on NAND devices.

Enable only "mtdparts" for uniphier_{v7,ld4_sld8}_defconfig because
enabling UBI would increase 170KB, which would be memory footprint
problem.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
6 years agoARM: uniphier: support fdt_fixup_mtdparts
Masahiro Yamada [Thu, 19 Jul 2018 07:28:26 +0000 (16:28 +0900)]
ARM: uniphier: support fdt_fixup_mtdparts

Propagate the "mtdparts" environment variable to the DT passed
in to OS.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
6 years agoARM: uniphier: split ft_board_setup() out to a separate file
Masahiro Yamada [Thu, 19 Jul 2018 07:28:25 +0000 (16:28 +0900)]
ARM: uniphier: split ft_board_setup() out to a separate file

Prepare to add more fdt fixup code.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
6 years agoARM: uniphier: clean-up ft_board_setup()
Masahiro Yamada [Thu, 19 Jul 2018 07:28:24 +0000 (16:28 +0900)]
ARM: uniphier: clean-up ft_board_setup()

The 'bd' is passed in ft_board_setup() as the second argument.
Replace 'gd->bd' with 'bd'.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
6 years agoboard: constify struct node_info array
Masahiro Yamada [Thu, 19 Jul 2018 07:28:23 +0000 (16:28 +0900)]
board: constify struct node_info array

Add 'const' (also 'static' in some places) to struct node_info
arrays to save memory footprint.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
6 years agofdt_support: make fdt_fixup_mtdparts() prototype more specific
Masahiro Yamada [Thu, 19 Jul 2018 07:28:22 +0000 (16:28 +0900)]
fdt_support: make fdt_fixup_mtdparts() prototype more specific

The second argument of fdt_fixup_mtdparts() is an opaque pointer,
'void *node_info', hence callers can pass any pointer.

Obviously, fdt_fixup_mtdparts() expects 'struct node_info *'
otherwise, it crashes run-time.

Change the prototype so that it is compile-time checked.

Also, add 'const' qualifier to it so that callers can constify
the struct node_info arrays.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agomtd: nand: denali: correct buffer alignment for DMA transfer
Masahiro Yamada [Thu, 19 Jul 2018 01:13:23 +0000 (10:13 +0900)]
mtd: nand: denali: correct buffer alignment for DMA transfer

The NAND framework makes sure to pass in the buffer with at least
chip->buf_align alignment.  Currently, the Denali NAND driver only
requests 16 byte alignment.  This causes unaligned cache operations
for the DMA transfer.

[Error Example]

=> nand read 81000010 0 1000

NAND read: device 0 offset 0x0, size 0x1000
CACHE: Misaligned operation at range [8100001081001010]
CACHE: Misaligned operation at range [8100001081001010]
CACHE: Misaligned operation at range [8100001081001010]
CACHE: Misaligned operation at range [8100001081001010]
 4096 bytes read: OK

Reported-by: Marek Vasut <marex@denx.de>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
6 years agokconfig: Avoid format overflow warning from GCC 8.1
Luis Araneda [Thu, 5 Jul 2018 20:55:31 +0000 (16:55 -0400)]
kconfig: Avoid format overflow warning from GCC 8.1

cherry-pick kernel commit 2ae89c7 (2018-06-05)
to avoid warnings when compiling with GCC 8.1

In file included from scripts/kconfig/zconf.tab.c:2486:
scripts/kconfig/confdata.c: In function ‘conf_write’:
scripts/kconfig/confdata.c:771:22: warning: ‘%s’ directive writing likely 7 or more bytes into a region of size between 1 and 4097 [-Wformat-overflow=]
  sprintf(newname, "%s%s", dirname, basename);
                      ^~
scripts/kconfig/confdata.c:771:19: note: assuming directive output of 7 bytes
  sprintf(newname, "%s%s", dirname, basename);
                   ^~~~~~
scripts/kconfig/confdata.c:771:2: note: ‘sprintf’ output 1 or more bytes (assuming 4104) into a destination of size 4097
  sprintf(newname, "%s%s", dirname, basename);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scripts/kconfig/confdata.c:774:23: warning: ‘.tmpconfig.’ directive writing 11 bytes into a region of size between 1 and 4097 [-Wformat-overflow=]
   sprintf(tmpname, "%s.tmpconfig.%d", dirname, (int)getpid());
                       ^~~~~~~~~~~
scripts/kconfig/confdata.c:774:3: note: ‘sprintf’ output between 13 and 4119 bytes into a destination of size 4097
   sprintf(tmpname, "%s.tmpconfig.%d", dirname, (int)getpid());
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Luis Araneda <luaraneda@gmail.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
6 years agoARM: rmobile: gen2: Enable ACTLR[0] (Enable invalidates of BTB) to facilitate CVE_201...
Marek Vasut [Sat, 30 Jun 2018 06:07:41 +0000 (08:07 +0200)]
ARM: rmobile: gen2: Enable ACTLR[0] (Enable invalidates of BTB) to facilitate CVE_2017-5715 WA in OS

Enable CVE_2017_5715 mitigation on CPU0 on R-Car H2, M2W, M2N, V2H,
which all contain Cortex-A15 cores. R-Car E2 contains only Cortex-A7
cores and is not affected. Without this enabled, Linux kernel reports:

  CPU0: Spectre v2: firmware did not set auxiliary control register IBE bit, system vulnerable

With this enabled, Linux kernel reports:

  CPU0: Spectre v2: using ICIALLU workaround

NOTE: This by itself does not enable the workaround for other CPUs
      than CPU0 and may require additional kernel patches for the
      other CPUs in SMP configurations.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nishanth Menon <nm@ti.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
6 years agoARM: dts: socfpga: Adjust NAND register layout on Arria10
Marek Vasut [Mon, 7 May 2018 20:22:26 +0000 (22:22 +0200)]
ARM: dts: socfpga: Adjust NAND register layout on Arria10

Adjust the NAND register size on Arria10 to reflect reality.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <chin.liang.see@intel.com>
Cc: Dinh Nguyen <dinguyen@kernel.org>
6 years agoARM: socfpga: Init missing security policies on A10
Marek Vasut [Thu, 12 Jul 2018 13:34:23 +0000 (15:34 +0200)]
ARM: socfpga: Init missing security policies on A10

The Arria10 requires proper configuration of the NOC firewall, otherwise
the access to certain areas of the LWHPS bridge fails in Linux. Add the
missing setup.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <chin.liang.see@intel.com>
Cc: Dinh Nguyen <dinguyen@kernel.org>
6 years agoARM: socfpga: Assure correct CPACR configuration
Marek Vasut [Thu, 12 Jul 2018 13:07:46 +0000 (15:07 +0200)]
ARM: socfpga: Assure correct CPACR configuration

Make sure the ARM CPACR register is zeroed out, this is mandatory
on Arria10.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <chin.liang.see@intel.com>
Cc: Dinh Nguyen <dinguyen@kernel.org>
6 years agoarm: socfpga: Fixes: Rename CONFIG_SPL_RESET_SUPPORT to CONFIG_SPL_DM_RESET
Ley Foon Tan [Fri, 13 Jul 2018 05:40:23 +0000 (13:40 +0800)]
arm: socfpga: Fixes: Rename CONFIG_SPL_RESET_SUPPORT to CONFIG_SPL_DM_RESET

Commit bfc6bae8fa1f2d8a9c51548767b02f1a1e0ffe52

This commit rename CONFIG_SPL_RESET_SUPPORT to CONFIG_SPL_DM_RESET. Update
with new CONFIG name and enable CONFIG_SPL_DM_RESET when CONFIG_DM_RESET is enabled.

Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
Acked-by: Marek Vasut <marex@denx.de>
6 years agomailmap: Fix broken email from fit_image.c
Michal Simek [Tue, 24 Jul 2018 10:51:37 +0000 (12:51 +0200)]
mailmap: Fix broken email from fit_image.c

The patch
"tools/mkimage: Fix DTC run command to handle file names with space"
(sha1: a6e9810495bc929b6beafb88f557cdaadf87fc83) contains comma in name
which is confusing patman. Fix it by defining Mirza's email in mailmap.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
6 years agoconfigs: am3517-evm: Setup NAND booting
Adam Ford [Sat, 21 Jul 2018 23:12:12 +0000 (18:12 -0500)]
configs: am3517-evm: Setup NAND booting

The NAND offsets for the kernel and U-Boot were missing.
This patch sets up the offsets so the AM3517-EVM can boot from NAND
when DIP switches S7:1 and S7:4 are to the OFF position

Signed-off-by: Adam Ford <aford173@gmail.com>
6 years agoARM: AM3517-EVM: Update Maintainer
Adam Ford [Sat, 21 Jul 2018 23:18:10 +0000 (18:18 -0500)]
ARM: AM3517-EVM: Update Maintainer

The previous e-mail pointing to Vaibhav Hiremath <hvaibhav@ti.com>
is bouncing and has for some time.  This updates it to myself and I
work for Logic PD the manufacturer of the AM3517-SOM and EVM

Signed-off-by: Adam Ford <aford173@gmail.com>
6 years agoconfig: remove unused CONFIG_SPL_RELOC_STACK_SIZE
Heinrich Schuchardt [Sat, 21 Jul 2018 15:08:13 +0000 (17:08 +0200)]
config: remove unused CONFIG_SPL_RELOC_STACK_SIZE

Symbol CONFIG_SPL_RELOC_STACK_SIZE is not used anywhere. So remove it.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
6 years agodoc: Move device tree bindings documentation to doc/device-tree-bindings
Breno Lima [Sat, 21 Jul 2018 00:48:10 +0000 (21:48 -0300)]
doc: Move device tree bindings documentation to doc/device-tree-bindings

Currently the U-Boot project contains 2 documentation directories:

- doc/
- Documentation/

The Documentation directory only contains device tree bindings related
content, so move the 3 files to doc/device-tree-bindings/.

Signed-off-by: Breno Lima <breno.lima@nxp.com>
6 years agomkimage: fit_image: Use macros from image.h
Michal Simek [Fri, 20 Jul 2018 10:31:02 +0000 (12:31 +0200)]
mkimage: fit_image: Use macros from image.h

There is no reason not to use macros which are already defined.
It is also much easier for grepping.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agoomap3: beagle: re-enable EFI support after the following commit removed it by mistake:
Guillaume GARDET [Wed, 18 Jul 2018 19:38:44 +0000 (21:38 +0200)]
omap3: beagle: re-enable EFI support after the following commit removed it by mistake:

commit d233ccb1d84b901f7e23e6d9b4f2c6a57198b23b
  ARM: omap3: beagle: Enable DM_SERIAL, update distro usage and NAND layout

Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Cc: Derald D. Woods <woods.technical@gmail.com>
Cc: Tom Rini <trini@konsulko.com>
6 years agospl: remove dependency to "asm/utils.h"
Paulo Zaneti [Tue, 17 Jul 2018 19:15:46 +0000 (16:15 -0300)]
spl: remove dependency to "asm/utils.h"

Header file "asm/utils.h" is not required to compile "spl_ymodem.c".
So, removing this dependency allows other architectures to use this
booting device as "asm/utils.h" is only present in "arm" architecture.

Signed-off-by: Paulo Zaneti <paulo.zaneti@datacom.ind.br>
6 years agohashtable: Fix length calculation in hexport_r
Zubair Lutfullah Kakakhel [Tue, 17 Jul 2018 18:25:38 +0000 (19:25 +0100)]
hashtable: Fix length calculation in hexport_r

The length returned by hexport_r has a few redundant characters.
This appears as NULL characters at the end so seems harmless.

Remove the surplus counts in two places

totlen += strlen(ep->key) + 2;
I'm guessing the +2 here is for = and sep char. But there is another
totlen += 2; line that does that.

size = totletn + 1;
Doesn't make sense and isn't justified with any comment.

Signed-off-by: Zubair Lutfullah Kakakhel <zubair@resin.io>
6 years agoavb2.0: use block API in AVB ops
Igor Opaniuk [Tue, 17 Jul 2018 11:33:26 +0000 (14:33 +0300)]
avb2.0: use block API in AVB ops

Use blk_dread()/blk_dwrite() in mmc_read()/mmc_write() AVB operation
implementations. This fixes compilation issues when CONFIG_BLK is
enabled.

Signed-off-by: Igor Opaniuk <igor.opaniuk@linaro.org>
Tested-by: Eugeniu Rosca <rosca.eugeniu@gmail.com>
6 years agoavb2.0: add proper dependencies
Igor Opaniuk [Tue, 17 Jul 2018 11:33:25 +0000 (14:33 +0300)]
avb2.0: add proper dependencies

1. Since libavb library alone is highly portable, introduce dedicated
Kconfig symbol for AVB bootloader-dependent operations, so it's possible
to build libavb separately. AVB bootloader-dependent operations include:
  * Helpers to process strings in order to build OS bootargs.
  * Helpers to access MMC, similar to drivers/fastboot/fb_mmc.c.
  * Helpers to alloc/init/free avb ops.
2. Add CONFIG_FASTBOOT dependency, as fastboot buffer is
re-used in partition verification operations.

Reported-by: Eugeniu Rosca <rosca.eugeniu@gmail.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@linaro.org>
Reviewed-by: Eugeniu Rosca <rosca.eugeniu@gmail.com>
Tested-by: Eugeniu Rosca <rosca.eugeniu@gmail.com>
6 years agomtdparts: fixed buffer overflow bug
Kay Potthoff [Tue, 17 Jul 2018 06:19:39 +0000 (08:19 +0200)]
mtdparts: fixed buffer overflow bug

In the case that there was no name defined for a partition the
code assumes that name_len is 22 and therefore allocates exactly
that space for a dummy name. But the function sprintf() first
resolves "0x%08llx@0x%08llx" to a string that is longer than 22
bytes. This leads to a buffer overflow. The replacement function
snprintf() limits the copied bytes to name_len and therefore
avoids the buffer overflow.

Signed-off-by: Kay Potthoff <Kay.Potthoff@microsys.de>
6 years agoboard: STiH410-B2260: Set SYS_BOOTM_LEN to 16M
Patrice Chotard [Mon, 16 Jul 2018 08:04:19 +0000 (10:04 +0200)]
board: STiH410-B2260: Set SYS_BOOTM_LEN to 16M

With recent kernel v4.18-rcx, uImage becomes bigger than 8MB.
Set SYS_BOOTM_LEN to 16MB, this fix the following error message:
"Fix Loading Kernel Image ... Image too large: increase
CONFIG_SYS_BOOTM_LEN"

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
6 years agomtd: remove stale comment in mtd_oob_ops structure
Miquel Raynal [Sat, 14 Jul 2018 12:37:19 +0000 (14:37 +0200)]
mtd: remove stale comment in mtd_oob_ops structure

A comment in the kernel doc of the mtd_oob_ops structure tells that it
is not possible to write more than one page with OOB. This was
probably true at some time in the past but today it is entirely wrong.

As one can see for instance in the nand_do_write_ops() helper available
in the NAND core, this implementation called by mtd->_write_oob()
simply loops over the pages until everything has been written.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
6 years agortc: compile date.c if DM_RTC
AKASHI Takahiro [Wed, 11 Jul 2018 09:06:06 +0000 (18:06 +0900)]
rtc: compile date.c if DM_RTC

rtc_to_tm() and rtc_mktime() are required for some RTC drivers, at least
PL031. Without this patch, we also need to enable CONFIG_CMD_DATE even if
we don't want or need this command.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
6 years agomtd: nand: add new enum for storing ECC algorithm
Rafał Miłecki [Tue, 10 Jul 2018 09:48:08 +0000 (11:48 +0200)]
mtd: nand: add new enum for storing ECC algorithm

Our nand_ecc_modes_t is already a bit abused by value NAND_ECC_SOFT_BCH.
This enum should store ECC mode only and putting algorithm details there
is a bad idea. It would result in too many values impossible to support
in a sane way.

To solve this problem let's add a new enum. We'll have to modify all
drivers to set it properly but once it's done it'll be possible to drop
NAND_ECC_SOFT_BCH. That will result in a cleaner design and more
possibilities like setting ECC algorithm for hardware ECC mode.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
[Linux commit: b0fcd8ab7b3c89b5da7fff5224d06ed73e7a33cc]
[Philippe Reynes: adapt code to u-boot]
Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
6 years agoARM: configs: omap3_logic: remove Legacy OMAP3 USB driver
Adam Ford [Fri, 13 Jul 2018 20:27:13 +0000 (15:27 -0500)]
ARM: configs: omap3_logic: remove Legacy OMAP3 USB driver

Only the MUSB driver is currently supported on the omap3_logic
boards.  The driver is using the new-musb and not the legacy
version, so this patch removes the dead code references.

Signed-off-by: Adam Ford <aford173@gmail.com>
6 years agoConvert CONFIG_DA8XX_GPIO to Kconfig
Adam Ford [Tue, 10 Jul 2018 12:01:20 +0000 (07:01 -0500)]
Convert CONFIG_DA8XX_GPIO to Kconfig

This converts the following to Kconfig:
   CONFIG_DA8XX_GPIO

Signed-off-by: Adam Ford <aford173@gmail.com>
6 years agoARM: DTS: am3517-evm-u-boot: Mark MMC1 with cd-inverted
Adam Ford [Tue, 10 Jul 2018 10:23:37 +0000 (05:23 -0500)]
ARM: DTS: am3517-evm-u-boot: Mark MMC1 with cd-inverted

In order to use the device tree for MMC, the card-detect pin
needs to be inverted.  This patch places this into the
am3517-evm-u-boot.dtsi file to keep the main DTS and DTSI files
clean and in-sync with Linux

Signed-off-by: Adam Ford <aford173@gmail.com>
6 years agoARM: dts: am3517-evm-uboot: Add reg-shift for UART
Adam Ford [Tue, 10 Jul 2018 10:04:38 +0000 (05:04 -0500)]
ARM: dts: am3517-evm-uboot: Add reg-shift for UART

With the resync of the omap3.dtsi file, the reg-shift was removed
so it breaks the UART.  Adding the reg-shift into the
am3517-evm-u-boot.dtsi keeps the reg-shift for U-Boot, but keeps
the dts/dtsi files clean from Linux.

Signed-off-by: Adam Ford <aford173@gmail.com>
6 years agodoc: Replace DocBook with sphinx-based docs
Mario Six [Tue, 10 Jul 2018 06:40:17 +0000 (08:40 +0200)]
doc: Replace DocBook with sphinx-based docs

The Linux kernel moved to sphinx-based documentation and got rid of the
DocBook based documentation quite a while ago. Hence, the DocBook
documentation for U-Boot should be converted as well.

To achieve this, import the necessary files from Linux v4.17, and
convert the current DocBook documentation (three files altogether) to
sphinx/reStructuredText.

For now, all old DocBook documentation was merged into a single
handbook, tentatively named "U-Boot Hacker Manual".

For some source files, the documentation style was changed to comply
with kernel-doc; no functional changes were applied.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
6 years agoARM: DTS: Resync Logic PD SOM-LV 37xx devkit with Linux 4.18-RC4
Adam Ford [Tue, 10 Jul 2018 01:18:44 +0000 (20:18 -0500)]
ARM: DTS: Resync Logic PD SOM-LV 37xx devkit with Linux 4.18-RC4

There have been some significant changes to the DM37 SOM-LV device
tree.  This patch re-syncs it with Linux.

Signed-off-by: Adam Ford <aford173@gmail.com>
6 years agoARM: DTS: Resync LogicPD-Torpedo-37xx-devkit with Linux 4.18-RC4
Adam Ford [Tue, 10 Jul 2018 01:18:14 +0000 (20:18 -0500)]
ARM: DTS: Resync LogicPD-Torpedo-37xx-devkit with Linux 4.18-RC4

There have been some refactoring of the DTS files for the Logic PD
DM37 Torpedo.  This patch re-sync's the DTS files with Linux

Signed-off-by: Adam Ford <aford173@gmail.com>
6 years agoARM: dts: Resync OMAP3 and omap36xx with Linux 4.18-RC4
Adam Ford [Tue, 10 Jul 2018 01:14:25 +0000 (20:14 -0500)]
ARM: dts: Resync OMAP3 and omap36xx with Linux 4.18-RC4

There have been several minor changes to the OMAP3.dtsi, so this
patch re-syncs it with Linux.  An addition include/dt-binding was
also brought with it.

Signed-off-by: Adam Ford <aford173@gmail.com>
6 years agoARM: DTS: Resync am3517-evm.dts with Linux 4.18-rc4
Adam Ford [Tue, 10 Jul 2018 00:52:48 +0000 (19:52 -0500)]
ARM: DTS: Resync am3517-evm.dts with Linux 4.18-rc4

Several changes have been made to the AM3517-evm and the underlying
am3517.dtsi file.  This patch re-sync's the DTS and DTSI files with
Linux.

Signed-off-by: Adam Ford <aford173@gmail.com>
6 years agom68k: m5253evbe: Remove this board
Tom Rini [Mon, 9 Jul 2018 14:44:51 +0000 (10:44 -0400)]
m68k: m5253evbe: Remove this board

The m5253evbe board has been marked as orphan since June of 2014 and
should have been dropped a while ago.  Do so now.

Signed-off-by: Tom Rini <trini@konsulko.com>
6 years agospi: stm32_qspi: rework mode management
Christophe Kerello [Mon, 9 Jul 2018 13:32:38 +0000 (15:32 +0200)]
spi: stm32_qspi: rework mode management

This patch solves quad read issue with Macronix/Micron spi nor.

Signed-off-by: Christophe Kerello <christophe.kerello@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
6 years agospi: stm32_qspi: assign functional operation mode in _stm32_qspi_gen_ccr
Christophe Kerello [Mon, 9 Jul 2018 13:32:37 +0000 (15:32 +0200)]
spi: stm32_qspi: assign functional operation mode in _stm32_qspi_gen_ccr

This patch assigns the functional operation mode in _stm32_qspi_gen_ccr
function.

Signed-off-by: Christophe Kerello <christophe.kerello@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
6 years agobios_emulator: remove assignment without effect
Heinrich Schuchardt [Sun, 18 Mar 2018 10:01:23 +0000 (11:01 +0100)]
bios_emulator: remove assignment without effect

Assigning a parameter which is not used afterwards has not effect.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agoMerge branch 'master' of git://git.denx.de/u-boot-imx
Tom Rini [Mon, 23 Jul 2018 14:51:13 +0000 (10:51 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-imx

trini: Update colibri-imx6ull to use Kconfig for mtdparts related
options.

Signed-off-by: Tom Rini <trini@konsulko.com>
6 years agoconfigs: imx6q_logic: Cleanup ramdiskaddr and fdtaddr
Adam Ford [Fri, 20 Jul 2018 13:25:53 +0000 (08:25 -0500)]
configs: imx6q_logic: Cleanup ramdiskaddr and fdtaddr

There are already definitions for ramdisk_addr_r and fdt_addr_r, so
having a duplicate copy called ramdiskaddr and fdtaddr is confusing.
This patch converts any references to ramdisk_addr_r and fdt_addr_r
and removes the duplicates.

Signed-off-by: Adam Ford <aford173@gmail.com>
6 years agomx25: fix the offset between the USB ports' registers
Martin Kaiser [Mon, 16 Jul 2018 20:11:57 +0000 (22:11 +0200)]
mx25: fix the offset between the USB ports' registers

The USBOH module on imx25 chips contains two USB controllers which are
called USB OTG Controller and USB Host Controller. Each one has its EHCI
root hub. The OTG Controller's EHCI registers start at offset 0, the Host
Controller's registers start at offset 0x400.

We set CONFIG_MXC_USB_PORT=0 to select the OTG Controller and 1 for the
Host Controller. Therefore, IMX_USB_PORT_OFFSET must be 0x400. Using
this setting, the Host Controller starts working on my imx25 board.

Please note that the imx25 reference manual claims that the Host
Controller's registers start at 0x200. This is not correct. The Linux
Kernel uses the correct offset 0x400 in imx25.dtsi.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
6 years agotools/imximage: get HAB information from header
Holger Dengler [Fri, 6 Jul 2018 14:10:00 +0000 (16:10 +0200)]
tools/imximage: get HAB information from header

Signing parts of a u-boot imximage for image verification in High
Assurance Boot (HAB) in a post-build process, requires some
information from the imximage header. Currently, this information is
only provided during the image build, which makes the transfer of this
information to the post-build process harder than necessary.

The i.MX HAB information (start and length) can be calculated either
by using information from the image-configuration file, or from the
information in the flash header of the imximage.
The advantage of using information from flash header is, that they are
not only available during image creation, but also available if
existing images are processed.

Example:
$ tools/mkimage -l u-boot.imx
Image Type:   Freescale IMX Boot Image
Image Ver:    2 (i.MX53/6/7 compatible)
Mode:         DCD
Data Size:    483328 Bytes = 472.00 KiB = 0.46 MiB
Load Address: 877ff420
Entry Point:  87800000
HAB Blocks:   0x877ff400 0x00000000 0x00071c00
DCD Blocks:   0x00910000 0x0000002c 0x00000208

Signed-off-by: Holger Dengler <dengler@linutronix.de>
Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
6 years agoARM: dh_imx6: enable GigaDevice, Macronix, and Winbond SPI Flash support in Kconfig
Ludwig Zenz [Fri, 6 Jul 2018 09:26:03 +0000 (11:26 +0200)]
ARM: dh_imx6: enable GigaDevice, Macronix, and Winbond SPI Flash support in Kconfig

In preparation for delivery bottlenecks, enable support for GigaDevice, Macronix, and Winbond nor flash chips.

Signed-off-by: Ludwig Zenz <lzenz@dh-electronics.de>
6 years agoimx: i.mx6q: imx6q_logic: Migrate to SPL and enable SDP
Adam Ford [Fri, 6 Jul 2018 01:58:24 +0000 (20:58 -0500)]
imx: i.mx6q: imx6q_logic: Migrate to SPL and enable SDP

Since the vast majority of i.MX6 boards are migrating to SPL,
this patch converts im6q_logic to SPL and enables the SDP for
loading SPL and u-boot.img over USB.  The Falcon mode only
supports NAND flash as of now due to limited space/RAM, but
all i.MX6D/Q SOM's from Logic PD have internal NAND from which
to boot.

Signed-off-by: Adam Ford <aford173@gmail.com>
6 years agoARM: imx6: DHCOM i.MX6 PDK: ddr init for 32bit bus and 4GBit chips
Ludwig Zenz [Thu, 5 Jul 2018 07:23:48 +0000 (09:23 +0200)]
ARM: imx6: DHCOM i.MX6 PDK: ddr init for 32bit bus and 4GBit chips

Support 1GIB + 2GIB DDR3 with 64bit bus width and 512MIB + 1GIB with 32bit bus width

Signed-off-by: Ludwig Zenz <lzenz@dh-electronics.de>
6 years agoARM: imx6: configure ddrcode pins in spl DHCOM i.MX6 PDK
Ludwig Zenz [Thu, 5 Jul 2018 07:23:47 +0000 (09:23 +0200)]
ARM: imx6: configure ddrcode pins in spl DHCOM i.MX6 PDK

Preperation for conditional DDR3 initialization based on GPIO codes.

Signed-off-by: Ludwig Zenz <lzenz@dh-electronics.de>
6 years agoRevert "ARM: imx6: Disable DDR DRAM calibration DHCOM i.MX6 PDK"
Ludwig Zenz [Thu, 5 Jul 2018 07:23:46 +0000 (09:23 +0200)]
Revert "ARM: imx6: Disable DDR DRAM calibration DHCOM i.MX6 PDK"

This reverts commit a637fe6f27fd4c19ef9f43a5f871c244581422ac.

The DDR DRAM calibration was enhanced by write leveling correction code.
It can be used with T-topology now.

Signed-off-by: Ludwig Zenz <lzenz@dh-electronics.de>
6 years agopico-imx7d: Add new pico-pi config
Otavio Salvador [Fri, 29 Jun 2018 18:19:21 +0000 (15:19 -0300)]
pico-imx7d: Add new pico-pi config

The new config skips the boot menu which asks which board is in
use. This is useful to allow direct booting of image without user
iteration.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
6 years agopico-imx7d: README: Drop old instructions about secure mode
Otavio Salvador [Fri, 29 Jun 2018 18:19:20 +0000 (15:19 -0300)]
pico-imx7d: README: Drop old instructions about secure mode

Our default config already has the secure mode supported, so the
manual step is not required anymore.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
6 years agopico-imx7d: README: Use dfu-util to flash U-Boot
Otavio Salvador [Fri, 29 Jun 2018 18:19:19 +0000 (15:19 -0300)]
pico-imx7d: README: Use dfu-util to flash U-Boot

The DFU allows a more user friendly use as the details where the
bootloader is installed are abstracted.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
6 years agopico-imx7d: Enable auxiliary code support
Otavio Salvador [Fri, 29 Jun 2018 18:19:18 +0000 (15:19 -0300)]
pico-imx7d: Enable auxiliary code support

This enables the "bootaux" command so a firmware can be loaded inside
the M4 MCU.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
6 years agopico-imx7d: Allow default fdtfile to be overridden by defconfig
Otavio Salvador [Fri, 29 Jun 2018 18:19:17 +0000 (15:19 -0300)]
pico-imx7d: Allow default fdtfile to be overridden by defconfig

This allow the addition of extra default configurations for each
baseboard, removing the boot menu when user boots for the first time.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
6 years agopico-imx7d: Do not override addrmap5
Fabio Estevam [Fri, 29 Jun 2018 18:19:16 +0000 (15:19 -0300)]
pico-imx7d: Do not override addrmap5

The addrmap5 value is the same for the 512MB and 1GB variants,
so there is no need to override it.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
6 years agopico-imx7d: Enable CONFIG_ARMV7_BOOT_SEC_DEFAULT
Fabio Estevam [Fri, 29 Jun 2018 18:19:15 +0000 (15:19 -0300)]
pico-imx7d: Enable CONFIG_ARMV7_BOOT_SEC_DEFAULT

Currently the CAAM driver fails to be probed:

caam 30900000.caam: Entropy delay = 3200
caam 30900000.caam: failed to acquire DECO 0
caam 30900000.caam: failed to instantiate RNG

CAAM needs to be initialized in secure world, so enable
CONFIG_ARMV7_BOOT_SEC_DEFAULT to allow the driver to
probe successfully.

Tested with kernel mainline version 4.17.2.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
6 years agopico-imx7d: Add Falcon mode support
Fabio Estevam [Fri, 29 Jun 2018 18:19:14 +0000 (15:19 -0300)]
pico-imx7d: Add Falcon mode support

Falcon mode boots the kernel directly from SPL, without loading
the full U-Boot.

As pico-imx7d does not have a GPIO for selecting Falcon versus
normal mode, enter in Falcon mode when the customer selects
the CONFIG_SPL_OS_BOOT option in menuconfig.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
6 years agopico-imx7d: Add bootmenu to choose the baseboard
Otavio Salvador [Fri, 29 Jun 2018 18:19:13 +0000 (15:19 -0300)]
pico-imx7d: Add bootmenu to choose the baseboard

Currently the baseboards do not offer a way to autodetect which one is
in use, so we ask the user if no value has been set.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
6 years agopico-imx7d: Add support for update SPL using DFU
Fabio Berton [Fri, 29 Jun 2018 18:19:12 +0000 (15:19 -0300)]
pico-imx7d: Add support for update SPL using DFU

Add spl entry on dfu_alt_info to be able to update U-Boot with SPL
for pico imx7d board.

Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
6 years agopico-imx7d: Add SPL support
Fabio Estevam [Fri, 29 Jun 2018 18:19:11 +0000 (15:19 -0300)]
pico-imx7d: Add SPL support

Convert pico-imx7d to SPL support.

There are two variants of pico-imx7d SOMs:
- One with 512MB of RAM
- One with 1GB of RAM

The 512MB module contains two Hynix H5TC2G63GFR-PBA.
The 1GB module contains two Hynix H5TC4G63GFR-PBA.

The RAM size is determined in runtime by reading GPIO1_12.

While at it, also add USB Serial Download mode support as it
is very helpful for loading SPL and u-boot.img via imx_usb_loader.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
6 years agopico-imx7d: Add fastboot support
Fabio Estevam [Fri, 29 Jun 2018 18:19:10 +0000 (15:19 -0300)]
pico-imx7d: Add fastboot support

fastboot tool is a convenient way to flash the eMMC, so
add support for it.

Examples of usages:

On the pico-imx7d U-Boot prompt:

=> fastboot 0

On the Linux PC connected via USB:

1. Retrieving the U-Boot version

$ sudo fastboot getvar bootloader-version -i 0x0525
bootloader-version: U-Boot 2018.07-rc1-03888-gde846f9
finished. total time: 0.000s

2. Resetting the board

$ sudo fastboot reboot -i 0x0525

(this causes the pico-imx7d to reboot)

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
6 years agopico-imx7d: Add default DFU targets
Otavio Salvador [Fri, 29 Jun 2018 18:19:09 +0000 (15:19 -0300)]
pico-imx7d: Add default DFU targets

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
6 years agopico-imx7d: Add GPT partitioning support
Otavio Salvador [Fri, 29 Jun 2018 18:19:08 +0000 (15:19 -0300)]
pico-imx7d: Add GPT partitioning support

This allow the use of:

> run setup_emmc

inside of the U-Boot prompt to do the partitioning of the disk.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
6 years agopico-imx7d: Fix common distro configuration behavior
Otavio Salvador [Fri, 29 Jun 2018 18:19:07 +0000 (15:19 -0300)]
pico-imx7d: Fix common distro configuration behavior

This sets DISTRO_CONFIG and BOOTCOMMAND, as well as add a `finduuid`
environment helper to allow it to properly work with Yocto Project and
other distributions using extlinux autogenerated configuration files.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
6 years agopico-imx7d: Convert to distro config
Fabio Estevam [Fri, 29 Jun 2018 18:19:06 +0000 (15:19 -0300)]
pico-imx7d: Convert to distro config

Instead of keeping a custom environment, use a more generic approach
by switching to disto config.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
6 years agoarm, imx6: add alternative PAD_CTL_DSE constants
Mark Jonas [Thu, 28 Jun 2018 13:56:18 +0000 (15:56 +0200)]
arm, imx6: add alternative PAD_CTL_DSE constants

Not all i.MX6 pads use the same drive strength table. So far only the
240 Ohm to 34 Ohm table was available. Because the constants used have
speaking names it can be confusing to use e.g. PAD_CTL_DSE_48ohm when
according to the reference manual 52 Ohm is the correct value. This
patch adds the 260 Ohm to 37 Ohm table.

For example, the IOMUXC_SW_PAD_CTL_PAD_SD2_CLK register (SD-card clock)
uses the added table.

Signed-off-by: Mark Jonas <mark.jonas@de.bosch.com>
Reviewed-by: Stefano Babic <sbabic@denx.de>
6 years agocolibri_imx7: improve DDR3 timing
Stefan Agner [Tue, 26 Jun 2018 09:10:52 +0000 (11:10 +0200)]
colibri_imx7: improve DDR3 timing

This makes sure that all Colibri iMX7 modules work with the
same timing. The changes are:
- Disable ODT on read (JEDEC standard JESD79-3F says in chapter
  5.2.3 ODT during Reads: "As the DDR3 SDRAM can not terminate
  and drive at the same time, RTT must be disabled at least half
  a clock cycle..." and also MX7D SABRESD is disabling it)
  This alone fixed memory issues for two Colibri iMX7 1GB modules
  which showed issues before
- Make sure tRFC(min) is at least 260ns
- Make sure tRC is >50.625ns
- tRP needs to be >13.125ns, we can lower from 18.75ns to 15ns
- tFAW is not relevant, leave at reset

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
6 years agocolibri_imx7: add compatible string used in vanilla Linux
Stefan Agner [Tue, 26 Jun 2018 09:10:51 +0000 (11:10 +0200)]
colibri_imx7: add compatible string used in vanilla Linux

Device trees from vanilla Linux do not specify a i.MX 7 specific
compatible string. Make sure to set partitions also when booting
upstream Linux.

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
6 years agomx6cuboxi: Move the default environment for all devices
Jon Nettleton [Mon, 25 Jun 2018 10:39:03 +0000 (13:39 +0300)]
mx6cuboxi: Move the default environment for all devices

Previously we had stored the environment right after the
u-boot.img on the disk.  I never liked this because with dtbs
being included and such the image could grow in size.  Instead
we move the environment to be negatively offset from the 1MB
mark.  Almost all our images start at 4MB's, and most standard
images start at 1MB, and all our storage devices are a minimum
1MB.  Therefore we can store env there for all classes of devices
and have plenty of space in case u-boot.img needs to grow.

Signed-off-by: Jon Nettleton <jon@solid-run.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
6 years agoimx: mx7: psci: implement MIGRATE_INFO_TYPE
Stefan Agner [Sun, 24 Jun 2018 19:09:58 +0000 (21:09 +0200)]
imx: mx7: psci: implement MIGRATE_INFO_TYPE

Implement MIGRATE_INFO_TYPE. This informs Linux that no migration
for the trusted operating system is necessary:
  [    0.000000] psci: Trusted OS migration not required

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
6 years agoimx: mx7: psci: support CPU0 on/off
Stefan Agner [Sun, 24 Jun 2018 19:09:57 +0000 (21:09 +0200)]
imx: mx7: psci: support CPU0 on/off

So far psci_cpu_(on|off) only worked for CPU1. Allow to control
CPU0 too. This allows to run the Linux PSCI checker successfully:
  [    2.213447] psci_checker: PSCI checker started using 2 CPUs
  [    2.219107] psci_checker: Starting hotplug tests
  [    2.223859] psci_checker: Trying to turn off and on again all CPUs
  [    2.267191] IRQ21 no longer affine to CPU0
  [    2.293266] Retrying again to check for CPU kill
  [    2.302269] CPU0 killed.
  [    2.311648] psci_checker: Trying to turn off and on again group 0 (CPUs 0-1)
  [    2.354354] IRQ21 no longer affine to CPU0
  [    2.383222] Retrying again to check for CPU kill
  [    2.392148] CPU0 killed.
  [    2.398063] psci_checker: Hotplug tests passed OK
  [    2.402910] psci_checker: Starting suspend tests (10 cycles per state)
  [    2.410019] psci_checker: cpuidle not available on CPU 0, ignoring
  [    2.416452] psci_checker: cpuidle not available on CPU 1, ignoring
  [    2.422757] psci_checker: Could not start suspend tests on any CPU
  [    2.429370] psci_checker: PSCI checker completed

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
6 years agoimx: mx7: psci: provide complete PSCI 1.0 implementation
Stefan Agner [Sun, 24 Jun 2018 19:09:56 +0000 (21:09 +0200)]
imx: mx7: psci: provide complete PSCI 1.0 implementation

PSCI 1.0 require PSCI_VERSION, PSCI_FEATURES, AFFINITY_INFO and
CPU_SUSPEND to be implemented. Commit 0ec3d98f7692 ("mx7_common:
use psci 1.0 instead of 0.1") marked the i.MX 7 implementation to
be PSCI 1.0 compliant but failed to implement those functions.
Especially the missing PSCI version callback was noticeable when
booting Linux:

  [    0.000000] psci: probing for conduit method from DT.
  [    0.000000] psci: PSCIv65535.65535 detected in firmware.
  [    0.000000] psci: Using standard PSCI v0.2 function IDs
  [    0.000000] psci: MIGRATE_INFO_TYPE not supported.
  [    0.000000] psci: SMC Calling Convention v1.0

This patch provides a minimal implementation thereof. With this
patch applied Linux detects PSCI 1.0:

  [    0.000000] psci: probing for conduit method from DT.
  [    0.000000] psci: PSCIv1.0 detected in firmware.
  [    0.000000] psci: Using standard PSCI v0.2 function IDs
  [    0.000000] psci: MIGRATE_INFO_TYPE not supported.
  [    0.000000] psci: SMC Calling Convention v1.0

Fixes: 0ec3d98f7692 ("mx7_common: use psci 1.0 instead of 0.1")
Suggested-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
6 years agoimx: mx7: psci: use C code exclusively
Stefan Agner [Sun, 24 Jun 2018 19:09:55 +0000 (21:09 +0200)]
imx: mx7: psci: use C code exclusively

There is no need for assembly in the platform specific part of
the PSCI implementation.

Note that this does not make it a complete PSCI 1.0 implementation
yet but aids to do so in upcoming patches.

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
6 years agoARM: PSCI: initialize stack pointer on secondary CPUs
Stefan Agner [Sun, 24 Jun 2018 19:09:54 +0000 (21:09 +0200)]
ARM: PSCI: initialize stack pointer on secondary CPUs

A proper stack is required to safely use C code in psci_arch_cpu_entry.

Fixes: 486daaa618e1 ("arm: psci: add a weak function psci_arch_cpu_entry")
Cc: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Patrick DELAUNAY <Patrick.delaunay@st.com>
Tested-by: Patrick DELAUNAY <Patrick.delaunay@st.com>