platform/kernel/u-boot.git
5 years agoMerge tag 'u-boot-imx-20181025' of git://git.denx.de/u-boot-imx
Tom Rini [Thu, 25 Oct 2018 14:16:21 +0000 (10:16 -0400)]
Merge tag 'u-boot-imx-20181025' of git://git.denx.de/u-boot-imx

Merged imx8 architecture, fix build for imx8 + warnings

5 years agoarm: dts: imx8qxp: fix build warining
Peng Fan [Thu, 25 Oct 2018 08:36:49 +0000 (08:36 +0000)]
arm: dts: imx8qxp: fix build warining

Fix below build warning.

arch/arm/dts/fsl-imx8qxp-mek.dtb: Warning (avoid_unnecessary_addr_size):
/regulators: unnecessary #address-cells/#size-cells without "ranges"
or child "reg" property

Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agoimx: mkimage: avoid stop CI when required files not exists
Peng Fan [Thu, 25 Oct 2018 08:32:40 +0000 (08:32 +0000)]
imx: mkimage: avoid stop CI when required files not exists

Introduce a new script to check whether file exists and
use that check in Makefile to avoid break CI system.

The script return 1 when the required files not exists, return 0
when files exists. The script will ignore check to u-boot-dtb.bin,
because if there is something wrong to generate u-boot-dtb.bin,
there must be some code error.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agowarp7: MAINTAINERS: Add an entry for warp7_bl33_defconfig
Fabio Estevam [Tue, 23 Oct 2018 15:38:18 +0000 (12:38 -0300)]
warp7: MAINTAINERS: Add an entry for warp7_bl33_defconfig

Add an entry for the warp7_bl33_defconfig target.

This fixes the following warnings:

WARNING: no status info for 'warp7_bl33'
WARNING: no maintainers for 'warp7_bl33'

Reported-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
5 years agoMerge branch 'master' of git://git.denx.de/u-boot-samsung
Tom Rini [Wed, 24 Oct 2018 01:13:32 +0000 (21:13 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-samsung

5 years agotravis: Rework Freescale ARM jobs a bit
Tom Rini [Tue, 23 Oct 2018 15:58:44 +0000 (11:58 -0400)]
travis: Rework Freescale ARM jobs a bit

- Split the AArch64 LS10xx and LS20xx builds into their own jobs, and
  then exclude only ls1/ls2 from the catch-all.  This moves the S32V234
  job (and future i.MX8*) to the catch-all.
- Split spear out from arm926ejs and exclude freescale, not mx from that
  job.  The older Freescale i.MX boards are caught by the catch-all job
  for Freescale but now we build the non-Freescale older i.MX platforms.

Signed-off-by: Tom Rini <trini@konsulko.com>
5 years agoARM: Samsung: Add Exynos5422-based Odroid HC2 support
Dirk Meul [Sun, 14 Oct 2018 15:14:17 +0000 (17:14 +0200)]
ARM: Samsung: Add Exynos5422-based Odroid HC2 support

Odroid HC2 board is based on Odroid XU4 board, like the Odroid HC1.

The linux kernel does not provide a hc2 DTB so the hc1 DTB is also used
for the Odroid HC2.

Resend because MUA changed whitespace.

Signed-off-by: Dirk Meul <dirk.meul@rwth-aachen.de>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
5 years agobinman: Add a test for Intel reference code
Simon Glass [Mon, 1 Oct 2018 18:22:31 +0000 (12:22 -0600)]
binman: Add a test for Intel reference code

Unfortunately the test was not included in the original implementation.
Add one.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agoMerge git://git.denx.de/u-boot-x86
Tom Rini [Mon, 22 Oct 2018 17:56:10 +0000 (13:56 -0400)]
Merge git://git.denx.de/u-boot-x86

5 years agoserial: mxc: Add match string for i.mx6 quad/dual lite serial
Bernhard Messerklinger [Mon, 3 Sep 2018 08:17:35 +0000 (10:17 +0200)]
serial: mxc: Add match string for i.mx6 quad/dual lite serial

Signed-off-by: Bernhard Messerklinger <bernhard.messerklinger@br-automation.com>
Reviewed-by: Hannes Schmelzer <oe5hpm@oevsv.at>
Tested-by: Hannes Schmelzer <oe5hpm@oevsv.at>
5 years agoarm: ti: boot: Remove environment partition
Sam Protsenko [Thu, 18 Oct 2018 19:47:17 +0000 (22:47 +0300)]
arm: ti: boot: Remove environment partition

Remove "environment" partition and do not read it when booting Android
from eMMC. We don't use this partition anymore, so this is just an
unintentional leftover.

Earlier we were reading dtb file from "environment" partition to feed it
further to kernel. Now we are using dtb from FIT image ("boot" partition
contains boot_fit.img image), which can be seen from this command:

    bootm ${loadaddr}#${fdtfile}

where "#" character means we have FIT image in ${loadaddr} RAM address.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Acked-by: Praneeth Bajjuri <praneeth@ti.com>
5 years agowatchdog: aspeed: restore default value of reset_mask
Cédric Le Goater [Tue, 16 Oct 2018 11:57:11 +0000 (13:57 +0200)]
watchdog: aspeed: restore default value of reset_mask

This is required for the current Linux kernel to reboot. It should also
probably be fixed in Linux.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agoARM: omap3_logic: Add NOR Flash Support for SOM-LV
Adam Ford [Sun, 14 Oct 2018 20:53:17 +0000 (15:53 -0500)]
ARM: omap3_logic: Add NOR Flash Support for SOM-LV

The DM37 and OMAP35 SOM-LV SOM-LV products both support a NOR
flash part connected to CS2 in addition to the NAND part on CS0.
This patch setups the GPMC timings for the MT28 NOR Flash and
enables the CFI-Flash driver now that the CFI stuff is in Kconfig

Signed-off-by: Adam Ford <aford173@gmail.com>
5 years agoarm: udoo: Convert to distro config
Meul, Dirk [Sat, 13 Oct 2018 12:54:01 +0000 (12:54 +0000)]
arm: udoo: Convert to distro config

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

Signed-off-by: Dirk Meul <dirk.meul@rwth-aachen.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
5 years agotest: overlay: add missing include
Heinrich Schuchardt [Thu, 11 Oct 2018 00:16:46 +0000 (02:16 +0200)]
test: overlay: add missing include

Compiling the overlay unit test fails with odroid-c2_defconfig showing
errors like:

    test/overlay/cmd_ut_overlay.c:29:8:
    error: unknown type name ‘fdt32_t’

Add the missing include.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agonand: atmel: Initialize pmecc smu with correct size
Bin Meng [Mon, 8 Oct 2018 09:27:44 +0000 (02:27 -0700)]
nand: atmel: Initialize pmecc smu with correct size

Currently in pmecc_get_sigma(), the code tries to clear the memory
pointed by smu with wrong size 'sizeof(int16_t) * ARRAY_SIZE(smu)'.
Since smu is actually a pointer, not an array, so ARRAY_SIZE(smu)
does not generate correct size to be cleared.

In fact, GCC 8.1.0 reports a warning against it:

error: division 'sizeof (int16_t * {aka short int *}) / sizeof (int16_t
{aka short int})' does not compute the number of array elements
[-Werror=sizeof-pointer-div]

Fix it by using the correct size.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
5 years agoconfigs: sama5d2_ptc_ek: add default bootargs for MMC defconfig
Eugen Hristev [Mon, 8 Oct 2018 07:37:00 +0000 (10:37 +0300)]
configs: sama5d2_ptc_ek: add default bootargs for MMC defconfig

Add default bootargs for the MMC defconfig to use SD-Card as rootfs

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
5 years agoconfigs: sama5d2_ptc_ek: add default bootargs for NAND defconfig
Eugen Hristev [Mon, 8 Oct 2018 07:36:59 +0000 (10:36 +0300)]
configs: sama5d2_ptc_ek: add default bootargs for NAND defconfig

Add the default kernel bootargs according to our NAND flash demo layout:
http://www.at91.com/linux4sam/bin/view/Linux4SAM/Sama5d2PtcEKMainPage#NAND_Flash_demo_Memory_map

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
5 years agoconfigs: sama5d2_xplained: enable w1 and overlay for emmc defconfig
Eugen Hristev [Mon, 8 Oct 2018 07:20:04 +0000 (10:20 +0300)]
configs: sama5d2_xplained: enable w1 and overlay for emmc defconfig

Enable onewire support and commands, fdt overlay for the emmc defconfig.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
5 years agoconfigs: sama5d27_som1_ek: enable w1 and overlay for mmc1 defconfig
Eugen Hristev [Mon, 8 Oct 2018 07:12:56 +0000 (10:12 +0300)]
configs: sama5d27_som1_ek: enable w1 and overlay for mmc1 defconfig

Enable onewire support and commands, fdt overlay for the mmc1 defconfig.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
5 years agoconfigs: at91: sama5: enable CMD_IMI
Eugen Hristev [Mon, 8 Oct 2018 07:03:01 +0000 (10:03 +0300)]
configs: at91: sama5: enable CMD_IMI

Enable iminfo command with CONFIG_CMD_IMI

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
5 years agoconfigs: at91: sam9x5: added FIT and iminfo support
Eugen Hristev [Mon, 8 Oct 2018 06:55:19 +0000 (09:55 +0300)]
configs: at91: sam9x5: added FIT and iminfo support

Enabled FIT image support and iminfo command for FIT information.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
5 years agoboard: at91sam9x5: add environment var for cpu type
Eugen Hristev [Mon, 8 Oct 2018 06:54:27 +0000 (09:54 +0300)]
board: at91sam9x5: add environment var for cpu type

When booting and CPU is detected from cpuid, we also need an environment
variable that will be used in boot commands to load the proper devicetree.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
5 years agoARM: omap3logic: Fix MMC name
Adam Ford [Sun, 7 Oct 2018 22:47:50 +0000 (17:47 -0500)]
ARM: omap3logic: Fix MMC name

In my haste to migrate SPL to DM, I copied the wrong name.
While it really doesn't matter, I'd prefer the name to match
the board, so am335x_mmc0 is now called omap3_logic_mmc0

Signed-off-by: Adam Ford <aford173@gmail.com>
5 years agoARM: omap3logic: Specify DM serial driver as omap_serial
Adam Ford [Sun, 7 Oct 2018 22:42:42 +0000 (17:42 -0500)]
ARM: omap3logic: Specify DM serial driver as omap_serial

With the new omap_serial driver, this patch uses this instead
from the former ns16550_serial driver.  Even though the
omap_serial driver is essentially the same.

Signed-off-by: Adam Ford <aford173@gmail.com>
5 years agoARM: omap3logic: Encapsulate the MUSB functions in check for DM
Adam Ford [Sun, 7 Oct 2018 22:39:29 +0000 (17:39 -0500)]
ARM: omap3logic: Encapsulate the MUSB functions in check for DM

With the DM_USB working for USB host features, encapsulate the
USB gadget initialization in a precomiler check.  If DM is enabled,
we don't need to manually initialize the MUSB driver.

Signed-off-by: Adam Ford <aford173@gmail.com>
5 years agoARM: omap3_logic.c: Optimize DDR timings based on OMAP35 or 36/37
Adam Ford [Sun, 7 Oct 2018 14:20:45 +0000 (09:20 -0500)]
ARM: omap3_logic.c: Optimize DDR timings based on OMAP35 or 36/37

The default timings are assumming an OMAP36 / AM37 / DM37, but
the OMAP35 controller is a bit slower, so DDR may operate out of
spec when under stress.  This patch checks the processor type and
sets the DDR timings according to processor type.

Fixes: 5ad4212ce0d5 ("ARM: DTS: Add Logic PD OMAP35/DM37 SOM-LV
and OMAP35 Torpedo")

Signed-off-by: Adam Ford <aford173@gmail.com>
5 years agoARM: da850evm_direct_nor: Remove DM_I2C_COMPAT
Adam Ford [Sun, 7 Oct 2018 13:39:21 +0000 (08:39 -0500)]
ARM: da850evm_direct_nor: Remove DM_I2C_COMPAT

The da850evm does not need this enabled, so this removes a
notice that appears during compile time that says
"Please remove"

Signed-off-by: Adam Ford <aford173@gmail.com>
5 years agowarp7: configs: add bl33 defconfig
Rui Miguel Silva [Wed, 5 Sep 2018 10:56:08 +0000 (11:56 +0100)]
warp7: configs: add bl33 defconfig

Add default configuration to run u-boot as BL33 in the ARM Trusted Firmware
boot flow for AArch32 case.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Lukasz Majewski <lukma@denx.de>
Cc: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Cc: u-boot@lists.denx.de
5 years agowarp7: include: configs: set skip low level init
Rui Miguel Silva [Wed, 5 Sep 2018 10:56:07 +0000 (11:56 +0100)]
warp7: include: configs: set skip low level init

If we have defined the OPTEE ram size and not OPTEE means that we are in
the case where OPTEE is loaded already (maybe by ARM Trusted Firmware) and
that most of the low level initialization is already done and that we
may/should skip it doing them here.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: u-boot@lists.denx.de
5 years agooptee: adjust dependencies and default values for dram
Rui Miguel Silva [Wed, 5 Sep 2018 10:56:06 +0000 (11:56 +0100)]
optee: adjust dependencies and default values for dram

We may have, the not yet considered, scenario where OPTEE is loaded before
u-boot and *not* by u-boot, e.g, the boot flow using the ARM Trusted
Firmware (ATF), where in the 32bit flow is:
BootRom->ATF(BL2)->Optee(BL32)->u-boot(BL33)

In this case we need still to reserve the memory used by optee, to avoid
for example to realocate ourself to the same address at the end of DRAM.
So, we change here the dependencies on the OPTEE lib and we set the default
size and base of TZRAM to zero.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Ryan Harkin <ryan.harkin@linaro.org>
Cc: u-boot@lists.denx.de
5 years agoimx: mx7: avoid some initialization if low level is skipped
Rui Miguel Silva [Wed, 5 Sep 2018 10:56:05 +0000 (11:56 +0100)]
imx: mx7: avoid some initialization if low level is skipped

We can have the case where u-boot is launched after some other low level
enabler, like for example when u-boot runs after arm-trusted-firmware
and/or optee. So, because of that we may need to jump the initialization of
some IP blocks even because we may no longer have the permission for that.

So, if the config option to skip low level init is set disable also timer,
board and csu initialization.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: u-boot@lists.denx.de
Reviewed-by: Peng Fan <peng.fan@nxp.com>
5 years agoi2c: imx_lpi2c: fix typo and register base address format
Anatolij Gustschin [Thu, 18 Oct 2018 14:36:01 +0000 (16:36 +0200)]
i2c: imx_lpi2c: fix typo and register base address format

Output the register base address in hex notation.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Acked-by: Heiko Schocher <hs@denx.de>
5 years agoKconfig: Convert CONFIG_IMX_WATCHDOG to Kconfig
Xiaoliang Yang [Thu, 18 Oct 2018 09:14:19 +0000 (17:14 +0800)]
Kconfig: Convert CONFIG_IMX_WATCHDOG to Kconfig

Move this option to Kconfig and tidy up the config file of eight
boards which use it.

Signed-off-by: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
5 years agoboard: ge: bx50v3: fix initialization of i2c bus0
Dan Cimpoca [Mon, 15 Oct 2018 10:09:56 +0000 (12:09 +0200)]
board: ge: bx50v3: fix initialization of i2c bus0

I2C bus 0 was not initialized correctly. There is an offset between i2c
index and the structure number of pad info. So i2c bus 0 can be in an
inconsistent state.

This problem become visible on B{4,6}50v3 with the CPUC HW watchdog enabled.
Sometimes when the CPUC HW watchdog interrupted the boot process, U-Boot was
not able to read VPD from I2C/EEPROM and the system failed to boot up again,
because a device connected to that bus was stuck in data transfer state (from
previous boot attempt) and there was no method to recover (struct
mxc_i2c_bus::idle_bus_fn was not set) courtesy of incorrect initialization.

Signed-off-by: Dan Cimpoca <dan.I.cimpoca@ge.com>
Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>
5 years agoboard: ge: bx50v3: b{4,6}50v3 modeline
Ian Ray [Mon, 15 Oct 2018 07:59:45 +0000 (09:59 +0200)]
board: ge: bx50v3: b{4,6}50v3 modeline

The b{4,6}50v3 kernel framebuffer console requires a modeline otherwise
the LVDS panel shows garbage.

Signed-off-by: Ian Ray <ian.ray@ge.com>
Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>
5 years agoboard: ge: bx50v3: correct LDB clock
Ian Ray [Mon, 15 Oct 2018 07:59:44 +0000 (09:59 +0200)]
board: ge: bx50v3: correct LDB clock

Use Video PLL to provide 65MHz for all displays.

Signed-off-by: Ian Ray <ian.ray@ge.com>
Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>
5 years agoboard: ge: bx50v3: Change maintainer
Fabien Lahoudere [Mon, 15 Oct 2018 07:29:27 +0000 (09:29 +0200)]
board: ge: bx50v3: Change maintainer

While using ./scripts/get_maintainer.pl I detect that the Maintainer name
and address for bx50v3 boards are not valid.
The new maintainer for GE bx50v3 products must be Ian Ray.

Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>
5 years agodoc: imx: Improve i.MX documentation naming
Breno Matheus Lima [Wed, 10 Oct 2018 01:10:51 +0000 (01:10 +0000)]
doc: imx: Improve i.MX documentation naming

There is no need to have README in all i.MX documents name.
Remove README from i.MX docs name and add .txt file extension.

Signed-off-by: Breno Lima <breno.lima@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
5 years agodoc: imx: misc: Reorganize miscellaneous documentation
Breno Matheus Lima [Wed, 10 Oct 2018 01:10:48 +0000 (01:10 +0000)]
doc: imx: misc: Reorganize miscellaneous documentation

The Serial Download Protocol feature is availible in various
i.MX SoCs.

Move README.sdp document to imx/misc directory.

Signed-off-by: Breno Lima <breno.lima@nxp.com>
5 years agodoc: imx: hab: Reorganize High Assurance Boot documentation
Breno Matheus Lima [Wed, 10 Oct 2018 01:10:44 +0000 (01:10 +0000)]
doc: imx: hab: Reorganize High Assurance Boot documentation

The current High Assurance Boot document README.mxc_hab
include details for the following features in a single file:

- HAB Secure Boot
- HAB Encrypted Boot

Split HAB documentation in a specific directory for a cleaner
documentation structure, subsequent patches will include more
content in HAB documentation.

Signed-off-by: Breno Lima <breno.lima@nxp.com>
5 years agodoc: imx: Reorganize i.MX SoC common documentation
Breno Matheus Lima [Wed, 10 Oct 2018 01:10:40 +0000 (01:10 +0000)]
doc: imx: Reorganize i.MX SoC common documentation

The following documents describe device details according to the
i.MX family:

- README.imx25
- README.imx27
- README.imx5
- README.imx6
- README.mxs

Move all device common related document to doc/imx/common for a better
directory structure.

Signed-off-by: Breno Lima <breno.lima@nxp.com>
5 years agodoc: imx: mkimage: reorganize i.MX mkimage documentation
Breno Matheus Lima [Wed, 10 Oct 2018 01:10:35 +0000 (01:10 +0000)]
doc: imx: mkimage: reorganize i.MX mkimage documentation

The following documents describe the image type used by the mkimage
tool to generate U-Boot images for i.MX devices.

- README.imximage
- README.mxsimage

Move all mkimage related document to doc/imx/mkimage for a better
directory structure.

Signed-off-by: Breno Lima <breno.lima@nxp.com>
5 years agodoc: imx: Move SPD related info to the appropriate doc
Breno Matheus Lima [Wed, 10 Oct 2018 01:10:31 +0000 (01:10 +0000)]
doc: imx: Move SPD related info to the appropriate doc

Currently the Serial Download Protocol tools and procedure are
documented in two places:

- doc/imx/README.sdp
- doc/imx/README.imx6

It is better to consolidate all SDP related information into
README.sdp file, so move the content from README.imx6 to
README.sdp.

Signed-off-by: Breno Lima <breno.lima@nxp.com>
5 years agodoc: imx: reorganize i.MX documentation
Breno Matheus Lima [Wed, 10 Oct 2018 01:10:27 +0000 (01:10 +0000)]
doc: imx: reorganize i.MX documentation

Currently the U-Boot doc/ directory contains the following files
that are only relevant for i.MX devices:

- doc/README.imx25
- doc/README.imx27
- doc/README.imx5
- doc/README.imx6
- doc/README.imximage
- doc/README.mxc_hab
- doc/README.mxs
- doc/README.mxsimage
- doc/README.sdp

Move all content to a common i.MX folder for a better documentation
structure.

Signed-off-by: Breno Lima <breno.lima@nxp.com>
5 years agoimx: imx8qxp_mek: update to build image in U-Boot
Peng Fan [Tue, 16 Oct 2018 04:50:39 +0000 (04:50 +0000)]
imx: imx8qxp_mek: update to build image in U-Boot

Update README
Add imximage.cfg
Update defconfig to include imximage.cfg

Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agoarm: imx: include imx8image support
Peng Fan [Tue, 16 Oct 2018 04:50:35 +0000 (04:50 +0000)]
arm: imx: include imx8image support

When building i.MX8/8X board, use imx8image type.

`-e $(CONFIG_SYS_TEXT_BASE)` is not needed, but
no harm to keep it for i.MX8/8X

Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agotools: add i.MX8/8X image support
Peng Fan [Tue, 16 Oct 2018 04:50:30 +0000 (04:50 +0000)]
tools: add i.MX8/8X image support

i.MX8/8X bootable image type is container type.
The bootable image, containers a container set which supports two
container. The 1st container is for SECO firmware, the 2nd container
needs to include scfw, m4_0/1 image, ACore images per your requirement.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agoimx: add i.MX8QXP MEK board support
Peng Fan [Thu, 18 Oct 2018 12:28:37 +0000 (14:28 +0200)]
imx: add i.MX8QXP MEK board support

Add i.MX8QXP MEK board support
Enabled pinctrl/clk/power-domain/mmc/i2c/fec driver.
Added README file.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
5 years agoarm: dts: introduce dtsi for i.MX8QXP
Peng Fan [Thu, 18 Oct 2018 12:28:36 +0000 (14:28 +0200)]
arm: dts: introduce dtsi for i.MX8QXP

Introduce dtsi for i.MX8QXP, since there is other variants i.MX8DX(P),
so add them there, because i.MX8QXP includes the dtsi of them.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
5 years agommc: fsl_esdhc: add uclass clk support
Peng Fan [Thu, 18 Oct 2018 12:28:35 +0000 (14:28 +0200)]
mmc: fsl_esdhc: add uclass clk support

When CONIFG_CLK is enabled, use uclass clk api to handle
the clock.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Stefano Babic <sbabic@denx.de>
5 years agofsl_esdhc: Update usdhc driver to support i.MX8
Ye Li [Thu, 18 Oct 2018 12:28:34 +0000 (14:28 +0200)]
fsl_esdhc: Update usdhc driver to support i.MX8

Add CONFIG_ARCH_IMX8 to use the 64bits support in usdhc driver.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
5 years agoserial: lpuart: support uclass clk api
Peng Fan [Thu, 18 Oct 2018 22:26:23 +0000 (00:26 +0200)]
serial: lpuart: support uclass clk api

Modify most APIs to use udevice as the first parameter, then
it will be easy to get the clk reference by using udevice pointer.
Use uclass api to get lpuart clk when CONFIG_CLK is enabled.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoserial: lpuart: Enable RX and TX FIFO
Ye Li [Thu, 18 Oct 2018 12:28:32 +0000 (14:28 +0200)]
serial: lpuart: Enable RX and TX FIFO

Enable the RX and TX FIFO in LPUART driver to avoid the input lost
during U-Boot boot up.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoserial_lpuart: Update lpuart driver to support i.MX8
Peng Fan [Thu, 18 Oct 2018 12:28:31 +0000 (14:28 +0200)]
serial_lpuart: Update lpuart driver to support i.MX8

Add i.MX8 compatible string and cpu type support to lpuart driver,
to use little endian 32 bits configurations.

Also, according to RM, the Receive FIFO Enable (RXFE) field in LPUART
FIFO register is bit 3, so this definition should change to 0x08
(not 0x40) for i.MX8, otherwise the Receive FIFO is not disabled.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoclk: imx: add clk driver for i.MX8QXP
Peng Fan [Thu, 18 Oct 2018 12:28:30 +0000 (14:28 +0200)]
clk: imx: add clk driver for i.MX8QXP

Add clk driver for i.MX8QXP. This basic version supports clk
enable/disable/get_rate/set_rate operations for I2C, ENET,
SDHC0 and UART clocks.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agopower: Add power domain driver for i.MX8
Peng Fan [Thu, 18 Oct 2018 12:28:29 +0000 (14:28 +0200)]
power: Add power domain driver for i.MX8

Add the power domain DM driver for i.MX8, that it depends on the DTB
power domain trees to generate the power domain provider devices. Users
need to add power domain trees with property "compatible = "nxp,imx8-pd";"

When power on a PD device, the driver will power on its ancestor PD
devices in power domain tree.

When power off a PD device, the driver will check its child PD devices
first. Only if all child PD devices are off, then power off the current PD
device. Then the driver checks sibling PD devices. If sibling PD devices
are off, then it will power off parent PD device.

There is no counter maintained in this driver, but a state to hold current
on/off state. So the request and free functions are empty.

The power domain implementation in i.MX8 DTB set the "#power-domain-cells"
to 0, so there is no ID binding with each PD device. We don't use "id"
variable in struct power_domain. At the same time, we have to set of_xlate
to empty to bypass standard of_xlate in uclass driver.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agopinctrl: Add pinctrl driver for i.MX8
Peng Fan [Thu, 18 Oct 2018 12:28:28 +0000 (14:28 +0200)]
pinctrl: Add pinctrl driver for i.MX8

Add pinctrl driver for i.MX8. The pads configuration is controlled
by SCU, so need to ask SCU to configure pads through scfw API.
Add pinctrl-scu to invoke sc_pad_set to configure pads.
Add a new flag IMX8_USE_SCU to differentiate i.MX8 from other platforms
which could directly configure pads from Acore side.
Add CONFIG_PINCTRL_IMX8 as the built gate.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agogpio: mxc_gpio: add support for i.MX8
Peng Fan [Thu, 18 Oct 2018 12:28:27 +0000 (14:28 +0200)]
gpio: mxc_gpio: add support for i.MX8

Add i.MX8 support, there are 8 GPIO banks.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoimx8: add dummy clock
Peng Fan [Thu, 18 Oct 2018 12:28:26 +0000 (14:28 +0200)]
imx8: add dummy clock

This driver is mostly used to avoid build errors.
We use uclass clk driver for clk related operations.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoimx8: add iomux configuration api
Peng Fan [Thu, 18 Oct 2018 12:28:25 +0000 (14:28 +0200)]
imx8: add iomux configuration api

Add iomux configuration api.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoimx8: cpu: add uclass based CPU driver
Anatolij Gustschin [Thu, 18 Oct 2018 12:28:24 +0000 (14:28 +0200)]
imx8: cpu: add uclass based CPU driver

print_cpuinfo() in board init code requires uclass CPU driver,
add it to be able to display CPU info when CONFIG_DISPLAY_CPUINFO
option is enabled. CPU node in DT will have to include 'clocks'
and 'u-boot,dm-pre-reloc' properties for generic print_cpuinfo()
to work as expected. The driver outputs info for i.MX8QXP Rev A
and Rev B CPUs.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
5 years agoimx8: cpu: add function for reading FEC MAC from fuse
Anatolij Gustschin [Thu, 18 Oct 2018 12:28:23 +0000 (14:28 +0200)]
imx8: cpu: add function for reading FEC MAC from fuse

FEC driver requires imx_get_mac_from_fuse(). Add it in preparation
for ENETx support.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
5 years agoimx8: add arch_cpu_init arch_cpu_init_dm
Peng Fan [Thu, 18 Oct 2018 12:28:22 +0000 (14:28 +0200)]
imx8: add arch_cpu_init arch_cpu_init_dm

Add arch_cpu_init(_dm) mainly to open the channel between ACore and SCU.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoimx8: add mmu and dram related functions
Peng Fan [Thu, 18 Oct 2018 12:28:21 +0000 (14:28 +0200)]
imx8: add mmu and dram related functions

Add mmu memmap, some memory regions are reserved by M4, Arm Trusted
Firmware, so need to get memreg using SCFW API and setup the memmap.

Add dram_init, dram_init_banksize, get_effective_memsize functions,
according to the memreg.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoimx8: implement mmc_get_env_dev
Peng Fan [Thu, 18 Oct 2018 12:28:20 +0000 (14:28 +0200)]
imx8: implement mmc_get_env_dev

Implement mmc_get_env_dev for i.MX8.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoimx8: add boot device detection
Peng Fan [Thu, 18 Oct 2018 12:28:19 +0000 (14:28 +0200)]
imx8: add boot device detection

Add get_boot_device to detect boot device.
Add print_bootinfo to print the boot device info.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoimx8: add basic cpu support
Peng Fan [Thu, 18 Oct 2018 12:28:18 +0000 (14:28 +0200)]
imx8: add basic cpu support

Add basic cpu support, including cpu revision, cpu type,
cpu core detection.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoarmv8: add cpu core helper functions
Peng Fan [Thu, 18 Oct 2018 12:28:17 +0000 (14:28 +0200)]
armv8: add cpu core helper functions

Add helper functions to identify different armv8 variants.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoimx: add i.MX8 cpu type
Peng Fan [Thu, 18 Oct 2018 12:28:16 +0000 (14:28 +0200)]
imx: add i.MX8 cpu type

Add i.MX8 cpu type and is_imx8/is_imx8qxp help macros.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoimx8: pins: include i.MX8QXP pin header when CONFIG_IMX8QXP defined
Peng Fan [Thu, 18 Oct 2018 12:28:15 +0000 (14:28 +0200)]
imx8: pins: include i.MX8QXP pin header when CONFIG_IMX8QXP defined

Include i.MX8QXP pin header when CONFIG_IMX8QXP defined,
if no SoC macro defined, report error.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoimx8: add imx-regs header file
Peng Fan [Thu, 18 Oct 2018 12:28:14 +0000 (14:28 +0200)]
imx8: add imx-regs header file

Add imx-regs header file to include the register base definition

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoimx: boot_mode: Add FLEXSPI boot entry
Peng Fan [Thu, 18 Oct 2018 12:28:13 +0000 (14:28 +0200)]
imx: boot_mode: Add FLEXSPI boot entry

i.MX8 support FLEXSPI boot support. So add FLEXSPI boot entry.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agomisc: imx8: add scfw api impementation
Peng Fan [Thu, 18 Oct 2018 12:28:12 +0000 (14:28 +0200)]
misc: imx8: add scfw api impementation

Add clk/misc/pad/pm/rm scfw api implementaion for different
drivers to invoke. The low level code is using misc_call
to invoke imx8_scu driver.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agomisc: add i.MX8 misc driver
Peng Fan [Thu, 18 Oct 2018 12:28:11 +0000 (14:28 +0200)]
misc: add i.MX8 misc driver

Add i.MX8 MISC driver to handle the communication between
A35 Core and SCU.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoarm: global_data: add scu_dev for i.MX8
Peng Fan [Thu, 18 Oct 2018 12:28:10 +0000 (14:28 +0200)]
arm: global_data: add scu_dev for i.MX8

Add scu_dev for i.MX8, this will be used as a handle
to communite with SCU from A35.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoarm: build mach-imx for i.MX8
Peng Fan [Thu, 18 Oct 2018 12:28:09 +0000 (14:28 +0200)]
arm: build mach-imx for i.MX8

Build mach-imx for i.MX8

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoimx: add Kconfig entry for i.MX8QXP
Peng Fan [Thu, 18 Oct 2018 12:28:08 +0000 (14:28 +0200)]
imx: add Kconfig entry for i.MX8QXP

Add Kconfig entry for i.MX8QXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoimx8: add scfw macro definition
Peng Fan [Thu, 18 Oct 2018 12:28:07 +0000 (14:28 +0200)]
imx8: add scfw macro definition

Add SCFW macro definition.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agodt-bindings: soc: add i.MX8QXP pm and rsrc definition
Peng Fan [Thu, 18 Oct 2018 12:28:06 +0000 (14:28 +0200)]
dt-bindings: soc: add i.MX8QXP pm and rsrc definition

Add i.MX8QXP power and resource definition

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agodt-bindings: clock: dt-bindings: pinctrl: add i.MX8QXP clocks definition
Peng Fan [Thu, 18 Oct 2018 12:28:05 +0000 (14:28 +0200)]
dt-bindings: clock: dt-bindings: pinctrl: add i.MX8QXP clocks definition

Add i.MX8QXP clocks definition

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agodt-bindings: pinctrl: add i.MX8QXP pads definition
Peng Fan [Thu, 18 Oct 2018 12:28:04 +0000 (14:28 +0200)]
dt-bindings: pinctrl: add i.MX8QXP pads definition

Add i.MX8QXP pads definition

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
5 years agotravis: Add qemu-x86_64 target for test.py testing
Bin Meng [Sun, 14 Oct 2018 03:52:14 +0000 (20:52 -0700)]
travis: Add qemu-x86_64 target for test.py testing

Add qemu-x86_64 to the list of targets we use for test.py runs.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agotravis: Update to use QEMU 3.0.0 for testing
Bin Meng [Sun, 14 Oct 2018 03:52:13 +0000 (20:52 -0700)]
travis: Update to use QEMU 3.0.0 for testing

This updates travis-ci to use QEMU 3.0.0 for testing.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agotravis: Generate grub_x64.efi for qemu-x86_64
Bin Meng [Sun, 14 Oct 2018 03:52:12 +0000 (20:52 -0700)]
travis: Generate grub_x64.efi for qemu-x86_64

grub_x86.efi is for 32-bit QEMU. Generate the 64-bit one.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agox86: quark: Specify X86_TSC_TIMER_EARLY_FREQ
Bin Meng [Sun, 14 Oct 2018 03:52:11 +0000 (20:52 -0700)]
x86: quark: Specify X86_TSC_TIMER_EARLY_FREQ

Specify X86_TSC_TIMER_EARLY_FREQ for Quark SoC so that TSC as
the early timer can be supported.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agox86: tsc: Introduce config option for early timer frequency
Bin Meng [Sun, 14 Oct 2018 03:52:10 +0000 (20:52 -0700)]
x86: tsc: Introduce config option for early timer frequency

So far the TSC timer driver supports trying hardware calibration first
and using device tree as last resort for its running frequency as the
normal timer.

However when it is used as the early timer, it only supports hardware
calibration and if it fails, the driver just panics. This introduces
a new config option to specify the early timer frequency in MHz and
it should be equal to the value described in the device tree.

Without this patch, the travis-ci testing on QEMU x86_64 target fails
each time after it finishes the 'bootefi selftest' as the test.py see
an error was emitted on the console like this:

  TSC frequency is ZERO
  resetting ...
  ### ERROR ### Please RESET the board ###

It's strange that this error is consistently seen on the travis-ci
machine, but only occasionally seen on my local machine (maybe 1 out
of 10). Since QEMU x86_64 target enables BOOTSTAGE support which uses
early timer, with this fix it should work without any failure.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agox86: Fix the mystery of printch() during 64-bit boot
Bin Meng [Sun, 14 Oct 2018 03:52:09 +0000 (20:52 -0700)]
x86: Fix the mystery of printch() during 64-bit boot

At present in arch_setup_gd() it calls printch(' ') at the end which
has been a mystery for a long time as without such call the 64-bit
U-Boot just does not boot at all.

In fact this is due to the bug that board_init_f() was called with
boot_flags not being set. Hence whatever value being there in the
rdi register becomes the boot_flags if without such magic call.
With a printch(' ') call the rdi register is initialized as 0x20
and this value seems to be sane enough for the whole boot process.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agox86: put global data pointer into the .data section
Heinrich Schuchardt [Sun, 14 Oct 2018 03:52:07 +0000 (20:52 -0700)]
x86: put global data pointer into the .data section

On x86_64 the field global_data_ptr is assigned before relocation. As
sections for uninitialized global data (.bss) overlap with the relocation
sections (.rela) this destroys the relocation table and leads to spurious
errors.

Initialization forces the global_data_ptr into a section for initialized
global data (.data) which cannot overlap any .rela section.

Fixes: a160092a610f ("x86: Support global_data on x86_64")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: detect unsupported relocation types
Heinrich Schuchardt [Sun, 14 Oct 2018 03:52:06 +0000 (20:52 -0700)]
x86: detect unsupported relocation types

Currently we support only relocations of type ELF64_R_TYPE or ELF32_R_TYPE.
We should be warned if other relocation types appear in the relocation
sections.

This type of message has helped to identify code overwriting a relocation
section before relocation and incorrect parsing of relocation tables.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: qemu: enable CONFIG_SPL_DM_RTC
Heinrich Schuchardt [Sun, 14 Oct 2018 03:52:05 +0000 (20:52 -0700)]
x86: qemu: enable CONFIG_SPL_DM_RTC

Since commit 380d4f787a3f ("rtc: Allow use of RTC in SPL and TPL")
qemu-x86_64_defconfig does not boot anymore.

Fixes: 380d4f787a3f ("rtc: Allow use of RTC in SPL and TPL")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
5 years agox86: doc: Remove stale sections of 64-bit support
Bin Meng [Sun, 14 Oct 2018 03:52:04 +0000 (20:52 -0700)]
x86: doc: Remove stale sections of 64-bit support

There are some sections in current doc saying 64-bit is unsupported.
This apparently is out of date. Remove it.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agox86: doc: Mention qemu-x86_64 support
Bin Meng [Sun, 14 Oct 2018 03:52:03 +0000 (20:52 -0700)]
x86: doc: Mention qemu-x86_64 support

Currently only 32-bit U-Boot for QEMU x86 is documented. Mention
the 64-bit support.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agox86: Ensure no instruction sets of MMX/SSE are generated in 64-bit build
Bin Meng [Sun, 14 Oct 2018 03:52:02 +0000 (20:52 -0700)]
x86: Ensure no instruction sets of MMX/SSE are generated in 64-bit build

With the '-march=core2' fix, it seems that we have some luck that
the 64-bit U-Boot boots again. However if we examine the disassembly
codes there are still SSE instructions elsewhere which means passing
cpu type to GCC is not enough to prevent it from generating these
instructions. A simple test case is doing a 'bootefi selftest' from
the U-Boot shell and it leads to a reset too.

The 'bootefi selftest' reset is even seen with the image created by
the relative older GCC 5.4.0, the one shipped by Ubuntu 16.04.

The reset actually originates from undefined instruction exception
caused by these SSE instructions. To keep U-Boot as a bootloader as
simple as possible, we don't want to handle such advanced SIMD stuff.
To make sure no MMX/SSE instruction sets are generated, tell GCC not
to do this. Note AVX is out of the question as CORE2 is old enough
to support AVX yet.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agox86: Specify -march=core2 to build 64-bit U-Boot proper
Bin Meng [Sun, 14 Oct 2018 03:52:01 +0000 (20:52 -0700)]
x86: Specify -march=core2 to build 64-bit U-Boot proper

With newer kernel.org GCC (7.3.0 or 8.1.0), the u-boot.rom image
built for qemu-x86_64 target does not boot. It keeps resetting
soon after the 32-bit SPL jumps to 64-bit proper. Debugging shows
that the reset happens inside env_callback_init().

000000000113dd85 <env_callback_init>:
 113dd85:       41 54                   push   %r12
 113dd87:       55                      push   %rbp
 113dd88:       31 c0                   xor    %eax,%eax
 113dd8a:       53                      push   %rbx
 113dd8b:       0f 57 c0                xorps  %xmm0,%xmm0

Executing "xorps %xmm0,%xmm0" causes CPU to immediately reset.
However older GCC like 5.4.0 (the one shipped by Ubuntu 16.04)
does not generate such instructions that utilizes SSE for this
function - env_callback_init() and U-Boot boots without any issue.
Explicitly specifying -march=core2 for newer GCC allows U-Boot
proper to boot again. Examine assembly codes of env_callback_init
and there is no SSE instruction in that function hence U-Boot
continues to boot.

core2 seems to be the oldest arch in GCC that supports 64-bit.
Like 32-bit U-Boot build we use -march=i386 which is the most
conservative cpu type so that the image can run on any x86
processor, let's do the same for the 64-bit U-Boot build.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agox86/bootm: fix error handling in boot_prep_linux(...)
Hannes Schmelzer [Thu, 11 Oct 2018 05:44:42 +0000 (07:44 +0200)]
x86/bootm: fix error handling in boot_prep_linux(...)

Once we get a zero pointer from load_zimage(...) we must bunch out
instead of continue boot.

Signed-off-by: Hannes Schmelzer <hannes.schmelzer@br-automation.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agoEnable CONFIG_TIMER_EARLY with bootstage
Simon Glass [Sun, 2 Sep 2018 23:02:24 +0000 (17:02 -0600)]
Enable CONFIG_TIMER_EARLY with bootstage

In initr_bootstage() we call bootstage_mark_name() which ends up calling
timer_get_us(). This call happens before initr_dm(), which inits driver
model.

On x86 we set gd->timer to NULL in the transition from board_init_f()
to board_init_r(). See board_init_f_r() for this assignment. So U-Boot
knows there is no timer available in the period immediately after
relocation.

On x86 the timer_get_us() call is implemented as calls to get_ticks() and
get_tbclk(). Both of these call dm_timer_init() to set up the timer, if
gd->timer is NULL and the early timer is not available.

However dm_timer_init() cannot succeed before initr_dm() is called.

So it seems that on x86 if we want to use CONFIG_BOOTSTAGE we must enable
CONFIG_TIMER_EARLY. Update the Kconfig to handle this.

Note: On most architectures we can rely on the pre-relocation memory still
being available, so that gd->timer pointers to a valid timer device and
everything works correctly. Admittedly this is not strictly correct since
the timer device is set up by pre-relocation U-Boot, but normally this is
fine. On x86 the 'CAR' (cache-as-RAM) memory used by pre-relocation U-Boot
disappears in board_init_f_r() and any attempt to access it will hang.
This is the reason why we must mark the timer as invalid when we get to
board_init_f_r().

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agobinman: Add support for Intel reference code
Simon Glass [Sun, 2 Sep 2018 23:02:26 +0000 (17:02 -0600)]
binman: Add support for Intel reference code

Some platforms use this instead of FSP to set up the platform, including
memory. Add support for this in binman. This is needed for
chromebook_samus, for example.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agochromebook_samus: Increase pre-relocation memory
Simon Glass [Sun, 2 Sep 2018 23:02:25 +0000 (17:02 -0600)]
chromebook_samus: Increase pre-relocation memory

With bootstage now allocating pre-relocation memory the current amount
available is insufficient. Increase it a little.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agotest: Add test for PCI device without compat string and with DT node
Marek Vasut [Wed, 10 Oct 2018 19:27:09 +0000 (21:27 +0200)]
test: Add test for PCI device without compat string and with DT node

Add test which checks if a PCI device described in DT with an
entry and reg = <...> property, but without compatible string
results in a valid U-Boot PCI udevice with the udevice.node
populated with reference to this DT node. Also check if the
other PCI device without a DT node does not contain any bogus
udevice.node.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>