oweals/u-boot.git
4 years agofs: fat: get_contents() always returns -1 for errors
Heinrich Schuchardt [Thu, 12 Sep 2019 17:19:30 +0000 (19:19 +0200)]
fs: fat: get_contents() always returns -1 for errors

If out of memory, return -1 and not -ENOMEM from get_contents().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agofs: fat: treat invalid FAT clusters as errors
Heinrich Schuchardt [Thu, 12 Sep 2019 17:19:29 +0000 (19:19 +0200)]
fs: fat: treat invalid FAT clusters as errors

When hitting an invalid FAT cluster while reading a file always print an
error message and return an error code.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agosandbox: Remove sandbox_noblk build
Tom Rini [Fri, 11 Oct 2019 20:28:47 +0000 (16:28 -0400)]
sandbox: Remove sandbox_noblk build

At this point, all drivers that do not use CONFIG_BLK are past their
migration deadlines, so remove this config as it's no longer helpful and
hinders enhancing block drivers.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agospl: Introduce SPL_DM_SPI Kconfig define
Lukasz Majewski [Mon, 9 Sep 2019 10:06:46 +0000 (12:06 +0200)]
spl: Introduce SPL_DM_SPI Kconfig define

This define indicates if DM_SPI shall be supported in SPL. This allows
proper operation of DM converted SPI drivers in SPL, which use
#if !CONFIG_IS_ENABLED(DM_SPI) to also support not yet DM/DTS converted
boards.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
4 years agoarm64: print instructions leading to exception
Heinrich Schuchardt [Thu, 12 Sep 2019 17:09:26 +0000 (19:09 +0200)]
arm64: print instructions leading to exception

If an exception occurs in a loaded image and the relocation offset is
unknown, it is helpful to know the instructions pointed to by the
program counter. This patch adds the missing output.

A possible output is:
    Code: 910c4021 aa1303e0 f9400662 d63f0040 (e7f7defb)

The parentheses indicate the instruction causing the exception.

The output can be disassembled using scripts/decodecode:

echo 'Code: 90000360 9100b800 94002782 17ffff8f (e7f7defb)' | \
  ARCH=arm64 scripts/decodecode

Code: 90000360 9100b800 94002782 17ffff8f (e7f7defb)
All code
========
   0:   90000360    adrp    x0, 0x6c000
   4:   9100b800    add     x0, x0, #0x2e
   8:   94002782    bl      0x9e10
   c:   17ffff8f    b       0xfffffffffffffe48
  10:*  e7f7defb    .inst   0xe7f7defb ; undefined <-- trapping instruction

Code starting with the faulting instruction
===========================================
   0:   e7f7defb    .inst   0xe7f7defb ; undefined

We already have implemented the same for armv7.

For testing command 'exception undefined' can be used.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agocmd: avoid decimal conversion
T Karthik Reddy [Wed, 11 Sep 2019 13:39:53 +0000 (15:39 +0200)]
cmd: avoid decimal conversion

This patch uses auto instead of decimal in simple_strtoul().

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoARM: asm/io.h: remove redundant #if !defined(readb) block
Rasmus Villemoes [Tue, 10 Sep 2019 08:51:54 +0000 (08:51 +0000)]
ARM: asm/io.h: remove redundant #if !defined(readb) block

readb is unconditionally defined earlier in io.h, so there's no point
checking whether it's undefined.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
4 years agoARM: asm/io.h: kill off confusing #ifdef __mem_pci block
Rasmus Villemoes [Tue, 10 Sep 2019 08:51:53 +0000 (08:51 +0000)]
ARM: asm/io.h: kill off confusing #ifdef __mem_pci block

No ARM board seems to define __mem_pci - and if it did, one would get tons of

  ./arch/arm/include/asm/io.h:307:0: warning: "readl" redefined

warnings, because readl and friends are unconditionally defined
earlier in io.h. Moreover, the redefinitions lack the memory barriers
that the first definitions have. So I'm guessing this is practically
dead code.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
4 years agospl: mmc: Add option to set eMMC HW boot partition
Mans Rullgard [Tue, 3 Sep 2019 14:16:50 +0000 (16:16 +0200)]
spl: mmc: Add option to set eMMC HW boot partition

This change allows setting pre-defined eMMC boot partition for SPL eMMC
booting. It is necessary in the case when one wants to boot (through falcon
boot) from eMMC after loading SPL from other memory (like SPI-NOR).

Signed-off-by: Mans Rullgard <mans@mansr.com>
[lukma: Edit the commit message]
Signed-off-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Andreas Dannenberg <dannenberg@ti.com>
4 years agospl: mmc: Fix indentation in spl_mmc.c file
Mans Rullgard [Tue, 3 Sep 2019 14:17:17 +0000 (16:17 +0200)]
spl: mmc: Fix indentation in spl_mmc.c file

This fixes a wrongly indented block of code.

Signed-off-by: Mans Rullgard <mans@mansr.com>
[lukma: Make the commit message more verbose]
Signed-off-by: Lukasz Majewski <lukma@denx.de>
4 years agoregulator: fixed: Modify enable-active-high behavior
Patrice Chotard [Mon, 26 Aug 2019 11:50:31 +0000 (13:50 +0200)]
regulator: fixed: Modify enable-active-high behavior

Regulator should not be enabled at probe time if regulator-boot-on
property is not in the dt node.

"enable-active-high" property is only used to indicate the GPIO
polarity.

See kernel documentation :
 - Documentation/devicetree/bindings/regulator/fixed-regulator.yaml
 - Documentation/devicetree/bindings/regulator/gpio-regulator.yaml

Signed-off-by: Christophe Kerello <christophe.kerello@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoata: ahci: Don't forget to clear upper address regs.
Oleksandr Rybalko [Thu, 22 Aug 2019 10:26:56 +0000 (12:26 +0200)]
ata: ahci: Don't forget to clear upper address regs.

In 32bits mode upper bits need to be set to 0, otherwise controller will
try to DMA into not existing memory and stops with error.

Tested-by: Frank Wunderlich <frank-w@public-files.de>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Signed-off-by: Oleksandr Rybalko <ray@ddteam.net>
4 years agoahci-pci: ASM1061 report wrong class, but support AHCI.
Oleksandr Rybalko [Thu, 22 Aug 2019 10:26:55 +0000 (12:26 +0200)]
ahci-pci: ASM1061 report wrong class, but support AHCI.

Tested-by: Frank Wunderlich <frank-w@public-files.de>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Signed-off-by: Oleksandr Rybalko <ray@ddteam.net>
4 years agodt-bindings: phy: add a document for MediaTek tphy
Ryder Lee [Thu, 22 Aug 2019 10:26:54 +0000 (12:26 +0200)]
dt-bindings: phy: add a document for MediaTek tphy

This adds a document for tphy which supports physical layer
functionality for a number of controllers on MediaTek SoCs,
such as, USB2.0, USB3.0, PCIe, and SATA.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
4 years agodt-bindings: pcie: add a document for MT7623 PCIe controller
Ryder Lee [Thu, 22 Aug 2019 10:26:53 +0000 (12:26 +0200)]
dt-bindings: pcie: add a document for MT7623 PCIe controller

This adds a document for MT7623 PCIe controller.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
4 years agoarm: dts: split mtk-reset.h into per-chip header
Ryder Lee [Thu, 22 Aug 2019 10:26:52 +0000 (12:26 +0200)]
arm: dts: split mtk-reset.h into per-chip header

This follows the linux header rules to avoid conflict bitfields.

Tested-by: Frank Wunderlich <frank-w@public-files.de>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
4 years agoarm: dts: add PCIe controller for MT7623 SoC
Ryder Lee [Thu, 22 Aug 2019 10:26:51 +0000 (12:26 +0200)]
arm: dts: add PCIe controller for MT7623 SoC

This adds PCIe and its PHY nodes for MT7623.

Tested-by: Frank Wunderlich <frank-w@public-files.de>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
4 years agophy: mediatek: add MediaTek T-PHY support for PCIe
Ryder Lee [Thu, 22 Aug 2019 10:26:50 +0000 (12:26 +0200)]
phy: mediatek: add MediaTek T-PHY support for PCIe

The driver provides PHY for USB2, USB3.0, PCIe and SATA, and now
we just enable PCIe. As for the other functionalities will be
added gradually in upcoming days.

This is adapted from the Linux version.

Tested-by: Frank Wunderlich <frank-w@public-files.de>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
4 years agopci: mediatek: add PCIe controller support for MT7623
Ryder Lee [Thu, 22 Aug 2019 10:26:49 +0000 (12:26 +0200)]
pci: mediatek: add PCIe controller support for MT7623

This adds PCIe controller support for MT7623.
This is adapted from the Linux version.

Tested-by: Frank Wunderlich <frank-w@public-files.de>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
4 years agospl: add a generic function board_init_f
Philippe Reynes [Thu, 19 Sep 2019 14:18:39 +0000 (16:18 +0200)]
spl: add a generic function board_init_f

This commit add a generic function board_init_f that
only initialize some device (for example serial). It
avoid to define a board function only to launch the
serial configuration.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
4 years agobcm968580xref: enable spi-nor support
Philippe Reynes [Wed, 14 Aug 2019 13:18:41 +0000 (15:18 +0200)]
bcm968580xref: enable spi-nor support

This commit enable the support of the spi-nor for the
broadcom reference board bcm968580xref.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Kursad Oney <kursad.oney@broadcom.com>
4 years agodt: bcm968580xref: add a spi-nor device
Philippe Reynes [Wed, 14 Aug 2019 13:18:40 +0000 (15:18 +0200)]
dt: bcm968580xref: add a spi-nor device

This commit add a spi-nor device in the bcm96850xref device tree.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Kursad Oney <kursad.oney@broadcom.com>
4 years agodt: bcm6858: add hsspi controller
Philippe Reynes [Wed, 14 Aug 2019 13:18:39 +0000 (15:18 +0200)]
dt: bcm6858: add hsspi controller

This commit add a hsspi controller in the bcm6858 device tree.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Kursad Oney <kursad.oney@broadcom.com>
4 years agoconfigs: Add hsspi/spi support to bcm963158.
Kursad Oney [Wed, 14 Aug 2019 13:18:38 +0000 (15:18 +0200)]
configs: Add hsspi/spi support to bcm963158.

This commit enable the support of the spi-nor for the
broadcom reference board bcm963158.

Signed-off-by: Kursad Oney <kursad.oney@broadcom.com>
Reviewed-by: Philippe Reynes <philippe.reynes@softathome.com>
4 years agodt: bcm963158: add a spi-nor device
Kursad Oney [Wed, 14 Aug 2019 13:18:37 +0000 (15:18 +0200)]
dt: bcm963158: add a spi-nor device

This change adds a spi nor flash device to the bcm963158 board.

Signed-off-by: Kursad Oney <kursad.oney@broadcom.com>
Reviewed-by: Philippe Reynes <philippe.reynes@softathome.com>
4 years agodt: bcm63158: Add hsspi controller
Kursad Oney [Wed, 14 Aug 2019 13:18:36 +0000 (15:18 +0200)]
dt: bcm63158: Add hsspi controller

This change adds the hsspi controller to the 63158 dtsi.

Signed-off-by: Kursad Oney <kursad.oney@broadcom.com>
Reviewed-by: Philippe Reynes <philippe.reynes@softathome.com>
4 years agospi: bcm63xx_hsspi: Continue init when using no reset and fixed-clock.
Kursad Oney [Wed, 14 Aug 2019 13:18:35 +0000 (15:18 +0200)]
spi: bcm63xx_hsspi: Continue init when using no reset and fixed-clock.

The Broadcom ARM implementations do not yet have a clock framework so
one can use a fixed clock as the root clock of the hsspi block. The
fixed clock does not have an "enable" routine, since it's always
enabled. So when we hit this issue, getting an ENOSYS return, do not
bail but continue initialization.

Similarly the block might already have been out of reset, say, when
we are booting from a SPI device. So if the reset signal is not configured
in the device tree, do not bail out and instead skip deasserting the reset.

Signed-off-by: Kursad Oney <kursad.oney@broadcom.com>
Reviewed-by: Philippe Reynes <philippe.reynes@softathome.com>
4 years agospi: bcm63xx_hsspi: switch to raw I/O functions.
Kursad Oney [Wed, 14 Aug 2019 13:18:34 +0000 (15:18 +0200)]
spi: bcm63xx_hsspi: switch to raw I/O functions.

Make the driver compatible with both big and little endian SOCs.
Replace big-endian calls with their raw equivalents, expect for
writing the command to FIFO. That still has to be in big-endian
format.

Signed-off-by: Kursad Oney <kursad.oney@broadcom.com>
Reviewed-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
4 years agowaitbit: Add the generic wait_for_bit macros for 16 and 32 bits.
Kursad Oney [Wed, 14 Aug 2019 13:18:33 +0000 (15:18 +0200)]
waitbit: Add the generic wait_for_bit macros for 16 and 32 bits.

wait_for_bit_le32 and wait_for_bit_le16 use the raw I/O functions
which would default to big-endian on BE systems. Create the generic
equivalents to use the native endianness.

Signed-off-by: Kursad Oney <kursad.oney@broadcom.com>
Reviewed-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
4 years agospi: hsspi: allow to be used on bcm6858 and bcm63158
Kursad Oney [Wed, 14 Aug 2019 13:18:32 +0000 (15:18 +0200)]
spi: hsspi: allow to be used on bcm6858 and bcm63158

This IP exists in both MIPS and ARM cores, so we also
allow to use this driver on bcm6858 and bcm63158.

Signed-off-by: Kursad Oney <kursad.oney@broadcom.com>
Reviewed-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
4 years agoMerge tag 'xilinx-for-v2020.01' of https://gitlab.denx.de/u-boot/custodians/u-boot...
Tom Rini [Wed, 9 Oct 2019 20:22:03 +0000 (16:22 -0400)]
Merge tag 'xilinx-for-v2020.01' of https://gitlab.denx.de/u-boot/custodians/u-boot-microblaze

Xilinx/FPGA changes for v2020.01

FPGA:
- Enable fpga loading on Versal
- Minor fix

Microblaze:
- Fix LMB configurations to support initrds
- Some other cleanups

Zynq:
- Minor config/dt changes
- Add distro boot support for usb1 and mmc1
- Remove Xilinx private boot commands and use only distro boot

ZynqMP:
- Kconfig cleanups, defconfig updates
- Update some dt files
- Add firmware driver for talking to PMUFW
- Extend distro boot support for jtag
- Add new IDs
- Add system controller configurations
- Convert code to talk firmware via mailbox or SMCs

Versal:
- Add board_late_init()
- Add run time DT memory setup
- Add DFU support
- Extend distro boot support for jtag and dfu
- Add clock driver
- Tune mini configurations

Xilinx:
- Improve documentation (boot scripts, dt binding)
- Enable run time initrd_high calculation
- Define default SYS_PROMPT
- Add zynq/zynqmp virtual defconfig

Drivers:
- Add Xilinx mailbox driver for talking to firmware
- Clean zynq_gem for Versal
- Move ZYNQ_HISPD_BROKEN to Kconfig
- Wire genphy_init() in phy.c
- Add Xilinx gii2rgmii bridge
- Cleanup zynq_sdhci
- dwc3 fix
- zynq_gpio fix
- axi_emac fix

Others:
- apalis-tk1 - clean config file

4 years agotravis: Move keystone 3 (k3) boards into the k2 job
Tom Rini [Wed, 9 Oct 2019 15:02:21 +0000 (11:02 -0400)]
travis: Move keystone 3 (k3) boards into the k2 job

Build the keystone 3 platforms with the keystone 2 platforms, in order
to get back more room in the "catch-all" build jobs.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agotravis: Split bcm SoCs into their own build job
Tom Rini [Wed, 9 Oct 2019 15:01:06 +0000 (11:01 -0400)]
travis: Split bcm SoCs into their own build job

As both "catch-all" ARM jobs are nearing their time limit, move all of
the bcm SoC boards into a single job.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoMerge tag 'u-boot-imx-20191009' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
Tom Rini [Wed, 9 Oct 2019 13:35:43 +0000 (09:35 -0400)]
Merge tag 'u-boot-imx-20191009' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

u-boot-imx-20191009
-------------------

Travis : https://travis-ci.org/sbabic/u-boot-imx/builds/595148532

- MX6UL / ULZ
- Toradex board
- Allow to set OCRAM for MX6Q/D
- MX7ULP
- MX8: (container image, imx8mq_mek), SCU API
- fix several board booting from SD/EMMC (cubox-i for example)
- pico boards

[trini: display5 merged manually]
Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Tue, 8 Oct 2019 22:45:49 +0000 (18:45 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-marvell

- Move WATCHDOG_TIMEOUT_MSECS to Kconfig (Heiko)

4 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-x86
Tom Rini [Tue, 8 Oct 2019 22:45:26 +0000 (18:45 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-x86

- Rename existing FSP code to fsp1
- Add fsp2 directory in preparation to support FSP 2.0
- Various x86 platform codes update
- Various bug fixes and updates in dm core, sandbox and spl

4 years agoMerge tag 'u-boot-atmel-2020.01-a' of https://gitlab.denx.de/u-boot/custodians/u...
Tom Rini [Tue, 8 Oct 2019 22:43:56 +0000 (18:43 -0400)]
Merge tag 'u-boot-atmel-2020.01-a' of https://gitlab.denx.de/u-boot/custodians/u-boot-atmel

First set of u-boot-atmel features and fixes for 2020.01 cycle

The feature set includes support for two new boards from Microchip AT91:
The sama5d27_wlsom1_ek , an evaluation kit which includes the SAMA5D2
SOC packaged in a 256 MB LPDDR2 SIP, on a SOM including wireless, which
is placed on evaluation kit with sd-card, ethernet, LCD, Camera sensor,
QSPI, etc
The sam9x60ek, an evaluation kit for the new SoC based on ARM926j , the
SAM9X60 . The evaluation kit includes NAND flash, QSPI, Ethernet, Audio,
Camera sensor connector, etc.
The full support for sam9x60ek will come at a later time. There are
still missing bits regarding the clock support and power management
controller.

4 years agoMerge tag 'efi-2020-01-rc1' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Tue, 8 Oct 2019 22:43:37 +0000 (18:43 -0400)]
Merge tag 'efi-2020-01-rc1' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi

Pull request for UEFI sub-system for efi-2020-01-rc1

The major corrections in this pull request are:

Fixes for the SetVariable() boot service.
Device path node for NVMe drives.
Disable CONFIG_CMD_NVEDIT by default.

4 years agoMerge branch '2019-10-08-master-imports'
Tom Rini [Tue, 8 Oct 2019 22:37:19 +0000 (18:37 -0400)]
Merge branch '2019-10-08-master-imports'

- Python3 conversion of genboardscfg.py
- Resync Kconfiglib.py
- Switch to running CI on Ubuntu "bionic" to facilitate Python 3.6 being
  the minimum we use and test.

4 years agotravis.yml: Switch to bionic for the host distribution
Tom Rini [Tue, 8 Oct 2019 12:39:26 +0000 (08:39 -0400)]
travis.yml: Switch to bionic for the host distribution

To match what we're doing in GitLab, move to 'bionic' for these builds
as well.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agogitlab-ci: Switch to Ubuntu 18.04 image
Tom Rini [Fri, 4 Oct 2019 16:12:54 +0000 (12:12 -0400)]
gitlab-ci: Switch to Ubuntu 18.04 image

In order to run all filesystem tests we need to have newer ext4 tools,
move up to Ubuntu 18.04 'bionic' for our base.  We need to change
slightly how we invoke the provided grub-mkimage.  This will also make
future python3 work easier.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agogitlab-ci: Have buildman use /tmp for output
Tom Rini [Fri, 4 Oct 2019 16:12:53 +0000 (12:12 -0400)]
gitlab-ci: Have buildman use /tmp for output

When running as another user we might not be able to use '..' for
certain directories and this is the default for buildman.  Specify an
output directory instead.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agobuildman: Perform tests in a temporary directory
Tom Rini [Mon, 7 Oct 2019 21:17:36 +0000 (17:17 -0400)]
buildman: Perform tests in a temporary directory

We may not always be able to write to the default output directory so
have a temporary directory for our output be created.

Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Stephen Warren <swarren@wwwdotorg.org>
Suggested-by: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoARM: imx6q_logic: Fix MMC2 booting
Adam Ford [Tue, 8 Oct 2019 13:01:12 +0000 (08:01 -0500)]
ARM: imx6q_logic: Fix MMC2 booting

With the reverting of a previous change to spl_boot_device,
this board needs a new solution to determining if we're booting
from MMC1 or MMC2.

This patch creates board_boot_order function which overrides the
standard, and returns not only MMC1, or MMC2, but also can fall
back to NAND or the serial downloader should other boot options
fail.

Signed-off-by: Adam Ford <aford173@gmail.com>
4 years agoRevert "spl: imx6: Let spl_boot_device return USDHC1 or USDHC2"
Adam Ford [Tue, 8 Oct 2019 12:56:44 +0000 (07:56 -0500)]
Revert "spl: imx6: Let spl_boot_device return USDHC1 or USDHC2"

Apologies to everyone whose board I broke by attempting to return
MMC1 or MMC2. I misunderstood how the MMC indexing worked.

This reverts commit 14d319b1856b86e593e01abd0a1e3c2d63b52a8a.

Signed-off-by: Adam Ford <aford173@gmail.com>
4 years agoRevert "imx: mmc_env: update runtime SD/MMC boot env device"
Stefano Babic [Tue, 8 Oct 2019 09:01:53 +0000 (11:01 +0200)]
Revert "imx: mmc_env: update runtime SD/MMC boot env device"

This reverts commit 34f2feb92db6146831bafa696b7b46785c9f6b10.

Signed-off-by: Stefano Babic <sbabic@denx.de>
4 years agoconfigs: sheevaplug disable EFI_UNICODE_CAPITALIZATION
Heinrich Schuchardt [Sun, 6 Oct 2019 13:37:51 +0000 (15:37 +0200)]
configs: sheevaplug disable EFI_UNICODE_CAPITALIZATION

With upcoming patches u-boot.kwb gets too large.

Save 3740 bytes in u-boot.kwb by disabling Unicode support in the UEFI
sub-system.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agopico-imx7d: Remove dead code for dm_video
Joris Offouga [Mon, 23 Sep 2019 12:54:41 +0000 (14:54 +0200)]
pico-imx7d: Remove dead code for dm_video

Since convert dm_video, unused code introduced, so remove this

Signed-off-by: Joris Offouga <offougajoris@gmail.com>
Reviewed-by: Otavio Salvador <otavio@ossystems.com.br>
4 years agopico-imx7d: fix splash logo drawing
Joris Offouga [Mon, 23 Sep 2019 12:54:40 +0000 (14:54 +0200)]
pico-imx7d: fix splash logo drawing

Signed-off-by: Joris Offouga <offougajoris@gmail.com>
Reviewed-by: Otavio Salvador <otavio@ossystems.com.br>
4 years agoimx: replace CONFIG_SECURE_BOOT with CONFIG_IMX_HAB
Stefano Babic [Fri, 20 Sep 2019 06:47:53 +0000 (08:47 +0200)]
imx: replace CONFIG_SECURE_BOOT with CONFIG_IMX_HAB

CONFIG_SECURE_BOOT is too generic and forbids to use it for cross
architecture purposes. If Secure Boot is required for imx, this means to
enable and use the HAB processor in the soc.

Signed-off-by: Stefano Babic <sbabic@denx.de>
4 years agopinctrl: nxp: DM_FLAG_PRE_RELOC by default
Igor Opaniuk [Wed, 24 Jul 2019 15:09:57 +0000 (18:09 +0300)]
pinctrl: nxp: DM_FLAG_PRE_RELOC by default

For NXP SoCs we have to set pinmux configuration ASAP (ideally
before relocation) to get serial console working. Without this we miss
almost the half of output (U-boot version, CPU defails, Reset cause,
DRAM details etc.).

To achieve this we need to force appropriate pinctrl drivers to get
probed before relocation.

Fixes: cd69e8ef9b ("colibri-imx6ull: migrate pinctrl and regulators to dtb/dm")
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
4 years agoconfigs: move CONFIG_SPL_TEXT_BASE to Kconfig
Parthiban Nallathambi [Mon, 16 Sep 2019 15:21:50 +0000 (17:21 +0200)]
configs: move CONFIG_SPL_TEXT_BASE to Kconfig

CONFIG_SPL_TEXT_BASE is moved to common/spl/Kconfig, update
pcl063_ull defconfig.

Signed-off-by: Parthiban Nallathambi <pn@denx.de>
4 years agoimx: variscite: Fix regression of SPL and U-boot booting
Saravanan Sekar [Sun, 4 Aug 2019 17:36:42 +0000 (19:36 +0200)]
imx: variscite: Fix regression of SPL and U-boot booting

1. Commit 3a7c45f6a772 ("simple-bus: add DM_FLAG_PRE_RELOC flag to
simple-bus driver") causes some i.MX boards that were converted
to DM, such as warp7, to fail to boot.

As explained by Lukas Auer:

"With the patch, U-Boot probes the drivers for devices under simple-bus
device tree nodes in the pre-relocation device model. The default value
of CONFIG_SYS_MALLOC_F_LEN (0x4000) leaves U-Boot with not enough memory to
do this, causing it to hang."

Fix this problem by providing a convenient default value for
CONFIG_SYS_MALLOC_F_LEN.

2. CONFIG_SPL_TEXT_BASE was moved to Kconfig, so added in defconfig
"configs: move CONFIG_SPL_TEXT_BASE to Kconfig"
(sha1: f89d6133eef2e068f9c33853b6584d7fcbfa9d2e)

Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
4 years agoARM: imx6q_logic: Enable DM_SERIAL
Adam Ford [Wed, 7 Aug 2019 17:05:59 +0000 (12:05 -0500)]
ARM: imx6q_logic: Enable DM_SERIAL

In order to call preloader_console_init from board_init_f when
DM_SERIAL is enabled, it neesd to call spl_early_init() to get early access
to DM and device tree.

This patch calls spl_early_init just before preloader_console_init()
and enables DM_SERIAL and SPL_DM_SERIAL.

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
4 years agoARM: imx6qlogic: Cleanup board_init_f
Adam Ford [Wed, 7 Aug 2019 17:05:58 +0000 (12:05 -0500)]
ARM: imx6qlogic: Cleanup board_init_f

Per the workflow found in crt0.S, we don't need to clear BSS in
board_init_f nor do we need to call board_init_r since that will be
done for us from main when we return from board_init_f.

This patch removes the unneeded function calls from board_init_f.

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
4 years agomx6ulevk: Include SDP boot instructions in README
Breno Matheus Lima [Thu, 18 Jul 2019 20:44:31 +0000 (20:44 +0000)]
mx6ulevk: Include SDP boot instructions in README

Add instructions on how to boot mx6ul_14x14_evk_defconfig target
using the Serial Download Protocol.

Add examples from uuu and imx_usb_loader tools.

Signed-off-by: Breno Lima <breno.lima@nxp.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
4 years agoddr: imx8m: Fix the ddr init hang on imx8mq
Jacky Bai [Thu, 8 Aug 2019 09:59:11 +0000 (09:59 +0000)]
ddr: imx8m: Fix the ddr init hang on imx8mq

On, i.MX8MQ, the PLL config must be done when ddrmix
isolation is released. So move the dram pll init after
iso config done. For other i.MX8M SOC, either init pll
before or after isolation is ok.

Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agodriver: ddr: Refine the ddr init driver on imx8m
Jacky Bai [Thu, 8 Aug 2019 09:59:08 +0000 (09:59 +0000)]
driver: ddr: Refine the ddr init driver on imx8m

Refine the ddr init driver to make it more reusable for different
DDR type(LPDDR4, DDR4 & DDR3L). So we can reduce some redundant
code.

Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agoimx8mq: Update the ddrc QoS setting for B1 chip
Bai Ping [Thu, 8 Aug 2019 09:59:05 +0000 (09:59 +0000)]
imx8mq: Update the ddrc QoS setting for B1 chip

Update the ddrc Qos setting for B1 to align with B0's setting.
Correct the initial clock for dram_pll. This setting will be
overwrite before ddr phy training. Although there is no impact
on the dram init, we still need to correct it to eliminate
confusion.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
Tested-by: Robby Cai <robby.cai@nxp.com>
4 years agoddr: imx8m: Fix ddr4 driver build issue
Ye Li [Thu, 8 Aug 2019 09:59:02 +0000 (09:59 +0000)]
ddr: imx8m: Fix ddr4 driver build issue

Since the parameter of dram_pll_init is changed, update to use new.
Also remove non-existed header file.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agospi: fsl_qspi: Add support for QSPI on iMX7ULP
Ye Li [Wed, 14 Aug 2019 11:31:40 +0000 (11:31 +0000)]
spi: fsl_qspi: Add support for QSPI on iMX7ULP

Add the compatible string and driver data for iMX7ULP platform

Signed-off-by: Ye Li <ye.li@nxp.com>
4 years agospi: fsl_qspi: Update to use driver data
Ye Li [Wed, 14 Aug 2019 11:31:36 +0000 (11:31 +0000)]
spi: fsl_qspi: Update to use driver data

Add the driver data for each compatible string. So we can remove the
SOC config and use driver data instead.

Signed-off-by: Ye Li <ye.li@nxp.com>
4 years agospi: fsl_qspi: Update write data size for page program LUT
Ye Li [Wed, 14 Aug 2019 11:31:31 +0000 (11:31 +0000)]
spi: fsl_qspi: Update write data size for page program LUT

The write data size can be overwritten by writing to the IDATSZ
field of IPCR register. Since the driver always updates the IDATSZ
in page program operation. Set the LUT data size to 0 to align
the codes with iMX.

Signed-off-by: Ye Li <ye.li@nxp.com>
4 years agospi: fsl_qspi: Fix DDR mode setting for latest iMX platforms
Ye Li [Wed, 14 Aug 2019 11:31:27 +0000 (11:31 +0000)]
spi: fsl_qspi: Fix DDR mode setting for latest iMX platforms

On latest iMX platforms like iMX7D/iMX6UL/iMX8MQ, the QSPI controller
is updated to have TDH field in FLSHCR register. According to reference
manual, this TDH must be set to 1 when DDR_EN is set. Otherwise, the TX
DDR delay logic won't be enabled.

Another issue in DDR mode is the MCR register will be overwritten in
every read/write/erase operation. This causes DDR_EN been cleared while
TDH=1, then no clk2x output for TX data shift and all operations will
fail.

Signed-off-by: Ye Li <ye.li@nxp.com>
4 years agoimx: nandbcb: include long help only when enabled
Parthiban Nallathambi [Fri, 23 Aug 2019 16:35:10 +0000 (18:35 +0200)]
imx: nandbcb: include long help only when enabled

conditionally include long help text when enabled

Signed-off-by: Parthiban Nallathambi <pn@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
4 years agoimx: initialize fec only when enabled
Parthiban Nallathambi [Fri, 23 Aug 2019 16:35:09 +0000 (18:35 +0200)]
imx: initialize fec only when enabled

board early initialize fec ethernet controller pinmux
only when FEC is enabled

Signed-off-by: Parthiban Nallathambi <pn@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
4 years agoimx: remove board specific boot order from spl
Parthiban Nallathambi [Fri, 23 Aug 2019 16:35:08 +0000 (18:35 +0200)]
imx: remove board specific boot order from spl

boot order was added to handle both SD and eMMC. But commit
14d319b1 introduced to handle both eMMC and SD globally.

Signed-off-by: Parthiban Nallathambi <pn@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
4 years agoimx: pcl063: add nand boot support
Parthiban Nallathambi [Fri, 23 Aug 2019 16:19:48 +0000 (18:19 +0200)]
imx: pcl063: add nand boot support

Booting from NAND needs nandbcb and nand boot device selection

Signed-off-by: Parthiban Nallathambi <pn@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
4 years agoapalis_imx6: use distroboot by default
Igor Opaniuk [Fri, 23 Aug 2019 17:00:49 +0000 (20:00 +0300)]
apalis_imx6: use distroboot by default

Use distro_bootcmd as default bootcmd instead of legacy wrappers.

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
4 years agocolibri_imx6/imx7/imx8x: use distroboot by default
Igor Opaniuk [Fri, 23 Aug 2019 17:00:48 +0000 (20:00 +0300)]
colibri_imx6/imx7/imx8x: use distroboot by default

Use distro_bootcmd as defauult bootcmd instead of legacy wrappers.

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
4 years agomisc: imx8: add more scfw api
Peng Fan [Mon, 23 Sep 2019 10:12:31 +0000 (10:12 +0000)]
misc: imx8: add more scfw api

Add more scfw api for clk/partition/seco usage
The api will be used by ccf/partition/secure boot.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agospl: nor: support loading i.MX container format file
Peng Fan [Mon, 23 Sep 2019 02:18:48 +0000 (10:18 +0800)]
spl: nor: support loading i.MX container format file

i.MX8 only support AHAB secure boot with Container format image,
we could not use FIT to support secure boot, so introduce container
support to let SPL could load container images.

Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Cc: Tien Fong Chee <tien.fong.chee@intel.com>
Cc: York Sun <york.sun@nxp.com>
Cc: Marek Vasut <marex@denx.de>
Cc: Alex Kiernan <alex.kiernan@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Cc: Kever Yang <kever.yang@rock-chips.com>
Cc: Heiko Schocher <hs@denx.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agospl: spi: support loading i.MX container format file
Peng Fan [Mon, 23 Sep 2019 02:18:47 +0000 (10:18 +0800)]
spl: spi: support loading i.MX container format file

i.MX8 only support AHAB secure boot with Container format image,
we could not use FIT to support secure boot, so introduce container
support to let SPL could load container images.

Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Cc: Tien Fong Chee <tien.fong.chee@intel.com>
Cc: York Sun <york.sun@nxp.com>
Cc: Marek Vasut <marex@denx.de>
Cc: Alex Kiernan <alex.kiernan@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Cc: Kever Yang <kever.yang@rock-chips.com>
Cc: Heiko Schocher <hs@denx.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agospl: nand: support loading i.MX container format file
Peng Fan [Mon, 23 Sep 2019 02:18:46 +0000 (10:18 +0800)]
spl: nand: support loading i.MX container format file

i.MX8 only support AHAB secure boot with Container format image,
we could not use FIT to support secure boot, so introduce container
support to let SPL could load container images.

Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Cc: Tien Fong Chee <tien.fong.chee@intel.com>
Cc: York Sun <york.sun@nxp.com>
Cc: Marek Vasut <marex@denx.de>
Cc: Alex Kiernan <alex.kiernan@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Cc: Kever Yang <kever.yang@rock-chips.com>
Cc: Heiko Schocher <hs@denx.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agoimx8: update README
Peng Fan [Mon, 23 Sep 2019 02:18:45 +0000 (10:18 +0800)]
imx8: update README

After u-boot.cnt is padded to flash.bin automatically by script,
no need to burn the image mannually, so drop the step.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agoimx8: Add support to get container image set size
Peng Fan [Mon, 23 Sep 2019 02:18:44 +0000 (10:18 +0800)]
imx8: Add support to get container image set size

To avoid hardcoded offset when adding u-boot.cnt to flash.bin, we use
flexible offset which is calculated based on the size of the container
image generated int the first stage. And pad u-boot.cnt at 1KB
alignment.

So add code to get the offset when SPL loading u-boot.cnt.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agospl: nand: Introduce spl_nand_get_uboot_raw_page
Peng Fan [Mon, 23 Sep 2019 02:18:43 +0000 (10:18 +0800)]
spl: nand: Introduce spl_nand_get_uboot_raw_page

Introduce weak spl_nand_get_uboot_raw_page, then platform could
have their own implementation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Cc: Tien Fong Chee <tien.fong.chee@intel.com>
Cc: Marek Vasut <marex@denx.de>
Cc: Andreas Dannenberg <dannenberg@ti.com>
Cc: Alex Kiernan <alex.kiernan@gmail.com>
Cc: Stefan Roese <sr@denx.de>
Cc: Patrick Delaunay <patrick.delaunay@st.com>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Michal Simek <michal.simek@xilinx.com>
4 years agospl: nor: introduce spl_nor_get_uboot_base
Peng Fan [Mon, 23 Sep 2019 02:18:42 +0000 (10:18 +0800)]
spl: nor: introduce spl_nor_get_uboot_base

Introduce weak spl_nor_get_uboot_base, then platform have their own
implementation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Cc: Tien Fong Chee <tien.fong.chee@intel.com>
Cc: Marek Vasut <marex@denx.de>
Cc: Andreas Dannenberg <dannenberg@ti.com>
Cc: Alex Kiernan <alex.kiernan@gmail.com>
Cc: Stefan Roese <sr@denx.de>
Cc: Patrick Delaunay <patrick.delaunay@st.com>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Michal Simek <michal.simek@xilinx.com>
4 years agospl: spi: introduce spl_spi_get_uboot_offs
Peng Fan [Mon, 23 Sep 2019 02:18:41 +0000 (10:18 +0800)]
spl: spi: introduce spl_spi_get_uboot_offs

Introduce a weak function spl_spi_get_uboot_offs, then
platform could have their own implementation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Cc: Tien Fong Chee <tien.fong.chee@intel.com>
Cc: Marek Vasut <marex@denx.de>
Cc: Andreas Dannenberg <dannenberg@ti.com>
Cc: Alex Kiernan <alex.kiernan@gmail.com>
Cc: Stefan Roese <sr@denx.de>
Cc: Patrick Delaunay <patrick.delaunay@st.com>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Michal Simek <michal.simek@xilinx.com>
4 years agospl: mmc: introduce spl_mmc_get_uboot_raw_sector
Peng Fan [Mon, 23 Sep 2019 02:18:40 +0000 (10:18 +0800)]
spl: mmc: introduce spl_mmc_get_uboot_raw_sector

Introduce a weak function spl_mmc_get_uboot_raw_sector, then platform
could have their own implementation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Cc: Tien Fong Chee <tien.fong.chee@intel.com>
Cc: Marek Vasut <marex@denx.de>
Cc: Andreas Dannenberg <dannenberg@ti.com>
Cc: Alex Kiernan <alex.kiernan@gmail.com>
Cc: Stefan Roese <sr@denx.de>
Cc: Patrick Delaunay <patrick.delaunay@st.com>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Michal Simek <michal.simek@xilinx.com>
4 years agoimx: Add i.MX8MM EVK board support.
Peng Fan [Tue, 27 Aug 2019 06:26:08 +0000 (06:26 +0000)]
imx: Add i.MX8MM EVK board support.

Add board and SoC dts
Add ddr training code
support SD/MMC/GPIO/PINCTRL/UART

Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agoarm: dts: add i.MX8MM pin func
Peng Fan [Tue, 27 Aug 2019 06:26:04 +0000 (06:26 +0000)]
arm: dts: add i.MX8MM pin func

Import i.MX8MM pin func from Linux Kernel,
commit <0a8ad0ffa4d8> ("Merge tag 'for-linus-5.3-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux")

Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agoarm: dts: import i.MX8MM dtsi
Peng Fan [Tue, 27 Aug 2019 06:26:01 +0000 (06:26 +0000)]
arm: dts: import i.MX8MM dtsi

Import i.MX8MM dtsi from Linux Kernel,
commit <0a8ad0ffa4d8> ("Merge tag 'for-linus-5.3-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux")

Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agoimx8m: soc: probe clock device in arch_cpu_init_dm
Peng Fan [Tue, 27 Aug 2019 06:25:58 +0000 (06:25 +0000)]
imx8m: soc: probe clock device in arch_cpu_init_dm

Because we need to get cpu freq in print_cpuinfo at very early stage,
so we need to make sure the ccm be probed.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agoimx: mmc_env: update runtime SD/MMC boot env device
Peng Fan [Tue, 27 Aug 2019 06:25:54 +0000 (06:25 +0000)]
imx: mmc_env: update runtime SD/MMC boot env device

When DM_MMC enabled, the USDHC index in U-Boot is the USDHC port.
To directly return devno, we could avoid add board specific code.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agoimx8m: add clk support for i.MX8MM
Peng Fan [Tue, 27 Aug 2019 06:25:51 +0000 (06:25 +0000)]
imx8m: add clk support for i.MX8MM

Introduce clk implementation for i.MX8MM, including pll configuration,
ccm configuration. Mostly will be done clk dm driver,
but such as DRAM part, we still use non clk dm driver, because we
have limited sram.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agoimx8m: restructure clock.h
Peng Fan [Tue, 27 Aug 2019 06:25:48 +0000 (06:25 +0000)]
imx8m: restructure clock.h

i.MX8MQ and i.MX8MM use different analog pll design, but they
share same ccm design.
Add clock_imx8mq.h for i.MX8MQ
keep common part in clock.h

Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agoimx8m: rename clock to clock_imx8mq
Peng Fan [Tue, 27 Aug 2019 06:25:44 +0000 (06:25 +0000)]
imx8m: rename clock to clock_imx8mq

i.MX8MQ and i.MX8MM has totally different pll design, so
rename clock to clock_imx8mq.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agoimx8m: restrict reset_cpu
Peng Fan [Tue, 27 Aug 2019 06:25:41 +0000 (06:25 +0000)]
imx8m: restrict reset_cpu

Make reset_cpu only visible when CONFIG_SYSRESET not defined
or CONFIG_SPL_BUILD.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agoimx8m: soc: enable SCTR clock before timer init
Peng Fan [Tue, 27 Aug 2019 06:25:37 +0000 (06:25 +0000)]
imx8m: soc: enable SCTR clock before timer init

To i.MX8MM SCTR clock is disabled by ROM, so before timer init
need to enable it.
To i.MX8MQ, it does not hurt the clock is enabled again.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agoimx8m: Configure trustzone region 0 for non-secure access
Ye Li [Tue, 27 Aug 2019 06:25:34 +0000 (06:25 +0000)]
imx8m: Configure trustzone region 0 for non-secure access

Set trustzone region 0 to allow both non-secure and secure access
when trust zone is enabled. We found USB controller fails to access
DDR if the default region 0 is secure access only.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agoimx8m: set BYPASS ID SWAP to avoid AXI bus errors
Peng Fan [Tue, 27 Aug 2019 06:25:30 +0000 (06:25 +0000)]
imx8m: set BYPASS ID SWAP to avoid AXI bus errors

set the BYPASS ID SWAP bit (GPR10 bit 1) in order for GPU not to
generated AXI bus errors with TZC380 enabled.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agoimx8m: Fix MMU table issue for OPTEE memory
Peng Fan [Tue, 27 Aug 2019 06:25:27 +0000 (06:25 +0000)]
imx8m: Fix MMU table issue for OPTEE memory

When running with OPTEE, the MMU table in u-boot does not remove the OPTEE
memory from its settings. So ARM speculative prefetch in u-boot may access
that OPTEE memory. Due to trust zone is enabled by OPTEE and that memory
is set to secure access, then the speculative prefetch will fail and cause
various memory issue in u-boot.
The fail address register and int_status register in trustzone has logged
that speculative access from u-boot.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agoimx: add i.MX8MM PE property
Peng Fan [Tue, 27 Aug 2019 06:25:23 +0000 (06:25 +0000)]
imx: add i.MX8MM PE property

i.MX8MM does not have LVTTL, it has a PE property

Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agoimx8m: add pin header for i.MX8MM
Peng Fan [Tue, 27 Aug 2019 06:25:20 +0000 (06:25 +0000)]
imx8m: add pin header for i.MX8MM

Add pin header file for i.MX8MM

To IMX8MM_PAD_NAND_WE_B_USDHC3_CLK, IOMUX_CONFIG_SION needs to be
selected.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agoimx: add get_cpu_rev support for i.MX8MM
Peng Fan [Tue, 27 Aug 2019 06:25:17 +0000 (06:25 +0000)]
imx: add get_cpu_rev support for i.MX8MM

There are several variants based on i.MX8MM, add the support in
get_cpu_rev

Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agoimx8m: update imx-regs for i.MX8MM
Peng Fan [Tue, 27 Aug 2019 06:25:14 +0000 (06:25 +0000)]
imx8m: update imx-regs for i.MX8MM

i.MX8MM has similar architecture with i.MX8MQ, but it has totally
different PLL design and register layout change.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agoimx8m: imx-regs: drop unused register definitions
Peng Fan [Tue, 27 Aug 2019 06:25:10 +0000 (06:25 +0000)]
imx8m: imx-regs: drop unused register definitions

Drop unused register definitions and structures for i.MX8MQ

Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agoimx: spl: add spl_board_boot_device for i.MX8MM
Peng Fan [Tue, 27 Aug 2019 06:25:07 +0000 (06:25 +0000)]
imx: spl: add spl_board_boot_device for i.MX8MM

Differnet board has different controller used, it is
hard to use one layout for them all.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agoimx: add i.MX8MM cpu type
Peng Fan [Tue, 27 Aug 2019 06:25:04 +0000 (06:25 +0000)]
imx: add i.MX8MM cpu type

Add i.MX8MM cpu type and related helper functions

Signed-off-by: Peng Fan <peng.fan@nxp.com>