oweals/u-boot.git
5 years agoimx8m: add image cfg for i.MX8MM lpddr4
Peng Fan [Tue, 27 Aug 2019 06:24:50 +0000 (06:24 +0000)]
imx8m: add image cfg for i.MX8MM lpddr4

There is no HDMI on i.MX8MM, so we need to remove HDMI entry, then
we could not reuse imximage.cfg, so create a new one.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agoddr: imx8m: fix ddr firmware location when enable SPL OF
Peng Fan [Tue, 27 Aug 2019 06:24:47 +0000 (06:24 +0000)]
ddr: imx8m: fix ddr firmware location when enable SPL OF

With CONFIG_SPL_OF_CONTROL, the device tree will be padded to
end of the u-boot-spl-nodtb.bin, however we also put
the ddr firmware file to this location, so need to adapt
the code with SPL OF and align to 4 bytes to ease copy firmware.

Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Tested-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agotools: imx8m_image: align spl bin image size
Peng Fan [Tue, 27 Aug 2019 06:24:43 +0000 (06:24 +0000)]
tools: imx8m_image: align spl bin image size

The loader for the DDR firmware in drivers/ddr/imx/imx8m/helper.c uses a
4-byte-aligned address to load the firmware. In cases where OF is
enabled in SPL the dtb will be appended to the SPL binary and can result
in a binary that is not aligned correctly. If OF is not enabled in SPL,
`_end` is already aligned correctly, but this patch does not hurt.

To ensure the correct alignment we use dd to create a temporary file
u-boot-spl-pad.bin with the correct padding.

Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Tested-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agoimx: mkimage_fit_atf: Fix FIT image for correct boot order
Frieder Schrempf [Tue, 27 Aug 2019 06:24:40 +0000 (06:24 +0000)]
imx: mkimage_fit_atf: Fix FIT image for correct boot order

Fix the FIT image metadata for i.MX8 to result in the intended boot
order (SPL -> ATF -> U-Boot).

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agoKconfig: Set default BUILD_TARGET for ARCH_MX6 with SPL
Stefan Roese [Fri, 20 Sep 2019 16:09:10 +0000 (18:09 +0200)]
Kconfig: Set default BUILD_TARGET for ARCH_MX6 with SPL

Use BUILD_TARGET to automatically build "u-boot-with-spl.imx" on MX6
targets with SPL.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoARM: imx: arch/arm/mach-imx/spl_qspi.cfg
Stefan Roese [Fri, 20 Sep 2019 16:09:09 +0000 (18:09 +0200)]
ARM: imx: arch/arm/mach-imx/spl_qspi.cfg

Similar to "spl_sd.cfg", this patch introduces "spl_qspi.cfg" so that
all i.MX6 based boards can use it, when they use SPL and QSPI boot
mode.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoARM: imx: Add QSPI boot mode for i.MX6UL/ULL
Stefan Roese [Fri, 20 Sep 2019 16:09:08 +0000 (18:09 +0200)]
ARM: imx: Add QSPI boot mode for i.MX6UL/ULL

This patch adds the missing boot mode detection for QSPI boot on
i.MX6UL/ULL. Without it, booting with SPL from QSPI NOR does not work.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Stefano Babic <sbabic@denx.de>
5 years agoimx: mx6ul_14x14_evk: fix link issue
Anatolij Gustschin [Mon, 23 Sep 2019 16:05:05 +0000 (18:05 +0200)]
imx: mx6ul_14x14_evk: fix link issue

Since recent splash changes common code for splashscreen logo
should be used instead of adding duplicated code under board
directories. mx6ul_9x9_evk and mx6ul_14x14_evk configurations
used old board specific logo code and do not link, fix them.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Acked-by: Peng Fan <peng.fan@nxp.com>
5 years agoimx: Kconfig: Reduce default CONFIG_CSF_SIZE
Breno Matheus Lima [Mon, 23 Sep 2019 18:39:47 +0000 (18:39 +0000)]
imx: Kconfig: Reduce default CONFIG_CSF_SIZE

The default CSF_SIZE defined in Kconfig is too high and SPL cannot
fit into the OCRAM in certain cases.

The CSF cannot achieve 0x2000 length when using RSA 4K key which is
the largest key size supported by HABv4.

According to AN12056 "Encrypted Boot on HABv4 and CAAM Enabled Devices"
it's recommended to pad CSF binary to 0x2000 and append DEK blob to
deploy encrypted boot images.

As the maximum DEK blob size is 0x58 we can reduce CSF_SIZE to 0x2060
which should cover both CSF and DEK blob length.

Update default_image.c and image.c to align with this change and avoid
a U-Boot proper authentication failure in HAB closed devices:

Authenticate image from DDR location 0x877fffc0...
bad magic magic=0x32 length=0x6131 version=0x38
bad length magic=0x32 length=0x6131 version=0x38
bad version magic=0x32 length=0x6131 version=0x38
spl: ERROR:  image authentication fail

Fixes: 96d27fb218 (Revert "habv4: tools: Avoid hardcoded CSF size for SPL targets")

Reported-by: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: Breno Lima <breno.lima@nxp.com>
5 years agoimx: enable the reset controller on the i.MX8MQ EVK
Patrick Wildt [Thu, 3 Oct 2019 14:13:24 +0000 (16:13 +0200)]
imx: enable the reset controller on the i.MX8MQ EVK

This patch makes sure that the reset controller driver is compiled
for the i.MX8MQ EVK.

Signed-off-by: Patrick Wildt <patrick@blueri.se>
5 years agoimx: add the i.MX8M reset controller node
Patrick Wildt [Thu, 3 Oct 2019 14:12:57 +0000 (16:12 +0200)]
imx: add the i.MX8M reset controller node

This patch adds the reset controller node to the i.MX8MQ SoC
device tree.

Signed-off-by: Patrick Wildt <patrick@blueri.se>
5 years agoimx: add support for i.MX7/i.MX8MQ reset controller
Patrick Wildt [Thu, 3 Oct 2019 14:08:35 +0000 (16:08 +0200)]
imx: add support for i.MX7/i.MX8MQ reset controller

Add support for the reset controller that's used on the i.MX7D
and i.MX8MQ.  This will be needed to be able to assert the PCIe
reset pins.  Bindings taken from Linux, driver implementation
mostly taken from Linux and adjusted to U-Boot infrastructure.

Signed-off-by: Patrick Wildt <patrick@blueri.se>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
5 years agoimx: add support for i.MX8MQ power domain controller
Patrick Wildt [Thu, 3 Oct 2019 13:51:50 +0000 (15:51 +0200)]
imx: add support for i.MX8MQ power domain controller

Add support for the power domain controller that's used on the
i.MX8MQ.  This will be needed to be able to power on the PCIe
controller.  Bindings taken from Linux, driver implementation
taken from the i.MX8 power domain controller and adjusted for
the i.MX8M SoC.

Signed-off-by: Patrick Wildt <patrick@blueri.se>
5 years agoARM: dts: pcl063: add usdhc reset pin of eMMC
Parthiban Nallathambi [Thu, 26 Sep 2019 13:47:08 +0000 (15:47 +0200)]
ARM: dts: pcl063: add usdhc reset pin of eMMC

pcl063 phycore SoM with eMMC also got usdhc reset pin,
add reset pin to pinmux.

Signed-off-by: Parthiban Nallathambi <pn@denx.de>
5 years agoimx: mxs: Fix location for the elftosb tool
Fabio Estevam [Fri, 4 Oct 2019 11:05:58 +0000 (08:05 -0300)]
imx: mxs: Fix location for the elftosb tool

The Denx FTP location is no longer reachable.

Switch to the Timesys repository instead.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
5 years agomx28evk: README: Fix location for the generic mxs README
Fabio Estevam [Fri, 4 Oct 2019 11:05:57 +0000 (08:05 -0300)]
mx28evk: README: Fix location for the generic mxs README

doc/README.mxs no longer exists. It has been renamed doc/imx/common/mxs.txt,
so fix the mx28evk README accordingly.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
5 years agoimx: wandboard: convert FEC support to DM_ETH
Anatolij Gustschin [Fri, 20 Sep 2019 20:49:06 +0000 (22:49 +0200)]
imx: wandboard: convert FEC support to DM_ETH

Remove CONFIG_DM_ETH conversion warning to avoid board removal.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
5 years agospi: Add support for SPL_OF_PLATDATA to mxs_gpio.c driver
Lukasz Majewski [Thu, 5 Sep 2019 07:55:01 +0000 (09:55 +0200)]
spi: Add support for SPL_OF_PLATDATA to mxs_gpio.c driver

After this patch the mxs_gpio.c DM/DTS driver can be used at early SPL to
read states of gpio pins (and for example alter the boot flow).

It was necessary to adjust its name to 'fsl_imx_2{38}_gpio' to match
requirements for SPL_OF_PLATDATA usage.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
5 years agommc: Replace printf with debug call for timeouts in the i.MX28 mxs driver
Lukasz Majewski [Thu, 5 Sep 2019 07:55:00 +0000 (09:55 +0200)]
mmc: Replace printf with debug call for timeouts in the i.MX28 mxs driver

This change replaces printf() with debug() for the notification about
commands timeouts.

This is done on purpose (also other drivers use such approach - dw_mmc.c,
mvebu_mmc.c), as the mmc core code (mmc.c) uses timeouts to assess if one
is using sd card or eMMC device.
In such situation timeout is a some kind of a "normal" behavior and there
shall not be any output to the console.

There is no impact on boot time for boards using this driver (even in SPL)
when two extra timeouts are returned (no SD card present, only eMMC
available).

Boot time tested with grabserial:
sudo grabserial -b 115200 -d /dev/ttyUSB1 -e 30 -t -m "^U-Boot SPL*"

Signed-off-by: Lukasz Majewski <lukma@denx.de>
5 years agommc: Convert mxsmmc eMMC driver for i.MX2{38} to DM/DTS
Lukasz Majewski [Thu, 5 Sep 2019 07:54:59 +0000 (09:54 +0200)]
mmc: Convert mxsmmc eMMC driver for i.MX2{38} to DM/DTS

This patch converts the mxsmmc driver to support DM/DTS.

Moreover, it is also possible to use it in early SPL with
SPL_OF_PLATDATA enabled.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
5 years agospi: Add support for SPL_OF_PLATDATA to mxs_spi.c driver
Lukasz Majewski [Thu, 5 Sep 2019 07:54:58 +0000 (09:54 +0200)]
spi: Add support for SPL_OF_PLATDATA to mxs_spi.c driver

After this patch the mxs_spi.c DM/DTS driver can be used at early SPL to
read payload from SPI-NOR memories.

It was necessary to adjust its name to 'fsl_imx_2{38}_spi' to match
requirements for SPL_OF_PLATDATA usage.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
5 years agospi: fix: Call mxs_reset_block() during DM/DTS probe
Lukasz Majewski [Thu, 5 Sep 2019 07:54:57 +0000 (09:54 +0200)]
spi: fix: Call mxs_reset_block() during DM/DTS probe

Without this change the DM/DTS version of mxs_spi driver doesn't reset the
SPI IP block in probe.
As a result this driver (when used solely on U-Boot proper) relies on reset
performed by mxs spi driver in SPL.

In the use case where eMMC is used in SPL as a boot primary device, the
mxs_reset_block() is not called at all and DM/DTS aware SPI driver in
U-Boot proper is malfunctioning.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
5 years agospl: Init proper struct driver member (platdata_auto_alloc_size) for mxs_spi
Lukasz Majewski [Thu, 5 Sep 2019 07:54:56 +0000 (09:54 +0200)]
spl: Init proper struct driver member (platdata_auto_alloc_size) for mxs_spi

This change initializes proper member of struct driver -
platdata_auto_alloc_size instead of priv_auto_alloc_size, which is setup
twice.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
5 years agodts: imx28: Remove #include "imx28.dtsi" from imx28-u-boot.dtsi file
Lukasz Majewski [Thu, 5 Sep 2019 07:54:55 +0000 (09:54 +0200)]
dts: imx28: Remove #include "imx28.dtsi" from imx28-u-boot.dtsi file

After this change it is possible to use imx28-<board>-u-boot.dtsi with
the imx28-u-boot.dtsi explicitly included without breaking setup from
imx28-<board>.dts file.

The problem is that the imx28.dtsi included in a wrong place overrides the
changes made in imx28-<board>.dts. As a result some devices are "disabled"
in the final DTB.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
5 years agoimx: Introduce CONFIG_SPL_FORCE_MMC_BOOT to force MMC boot on falcon mode
Lukasz Majewski [Mon, 9 Sep 2019 13:32:13 +0000 (15:32 +0200)]
imx: Introduce CONFIG_SPL_FORCE_MMC_BOOT to force MMC boot on falcon mode

This change tries to fix the following problem:

- The board boots (to be more precise - ROM loads SPL) from a slow SPI-NOR
  memory.
  As a result the spl_boot_device() will return SPI-NOR as a boot device
  (which is correct).

- The problem is that in 'falcon boot' the eMMC is used as a boot medium to
  load kernel from its partition.
  Calling spl_boot_device() will break things as it returns SPI-NOR device.

To fix this issue the new CONFIG_SPL_FORCE_MMC_BOOT Kconfig flag is
introduced to handle this special use case. By default it is not defined,
so there is no change in the legacy code flow.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
5 years agoimx: Rewrite display5 get_board_id() function to use dm_gpio_* API
Lukasz Majewski [Tue, 3 Sep 2019 14:38:50 +0000 (16:38 +0200)]
imx: Rewrite display5 get_board_id() function to use dm_gpio_* API

The get_board_id() function was using the old gpio_* compatibility layer
to read HW and SW ID numbers encoded on the PCB board.

After this change the new dm_gpio* API is used for this purpose.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
5 years agoimx: Convert emergency pad of display5 to use dm_gpio* functions
Lukasz Majewski [Tue, 3 Sep 2019 14:38:49 +0000 (16:38 +0200)]
imx: Convert emergency pad of display5 to use dm_gpio* functions

After this change the display5's emergency gpio use dm_gpio* functions
instead of legacy ones (gpio*) to read its state.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
5 years agoARM: Update display5_factory_defconfig after switch to DM/DTS and uuu utility
Lukasz Majewski [Tue, 3 Sep 2019 14:38:47 +0000 (16:38 +0200)]
ARM: Update display5_factory_defconfig after switch to DM/DTS and uuu utility

This commit updates the display5_factory_defconfig file after the switch
to DM/DTS for this board.

Moreover, the VID and PID for SPL running SDP gadget have been updated to
allow seamless work with 'uuu' utility from NXP (the imx_usb doesn't work
properly after embedding the u-boot proper into fitImage - problem with IVT
embedding in FIT).

Example to use 'uuu' session:

cat << EOF > display5_recovery.lst
uuu_version 1.2.135
SDP: boot -f /srv/tftp/SPL
SDPU: write -f /srv/tftp/u-boot-dtb.img -addr 0x10000000
SDPU: jump -addr 0x10000000
SDPU: done
EOF

sudo ./uuu/uuu display5_recovery.lst

Signed-off-by: Lukasz Majewski <lukma@denx.de>
5 years agoARM: display5: Remove common.c file (after DM/DTS U-Boot proper conversion)
Lukasz Majewski [Tue, 3 Sep 2019 14:38:46 +0000 (16:38 +0200)]
ARM: display5: Remove common.c file (after DM/DTS U-Boot proper conversion)

The common.c file content can be safely moved to spl.c file after
performing the DM/DTS conversion for the U-Boot proper.

It contains the non DM/DTS setup code, which now is only used by SPL.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
5 years agoDM: WDT: Convert WDT driver to use DM/DTS (including SYSRESET)
Lukasz Majewski [Tue, 3 Sep 2019 14:38:45 +0000 (16:38 +0200)]
DM: WDT: Convert WDT driver to use DM/DTS (including SYSRESET)

This commit enables support for CONFIG_WDT in the U-Boot proper. Moreover,
the SYSRESET_WATCHDOG driver is used to support 'reset' command.

As SPL is not yet ready for DM conversion, the CONFIG_HW_WATCHDOG is
enabled for it. This allows the legacy SPL code to work properly.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
5 years agoARM: display5: Remove UART initialization code after DM/DTS conversion (non-console)
Lukasz Majewski [Tue, 3 Sep 2019 14:38:44 +0000 (16:38 +0200)]
ARM: display5: Remove UART initialization code after DM/DTS conversion (non-console)

This UART is not used in U-Boot, so there is no need to initialize it.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
5 years agoDM: SPI: Convert display5 to use SPI with DM/DTS (but no in SPL)
Lukasz Majewski [Tue, 3 Sep 2019 14:38:43 +0000 (16:38 +0200)]
DM: SPI: Convert display5 to use SPI with DM/DTS (but no in SPL)

The DM/DTS support for SPI is disabled on purpose for SPL, as it is not
supported as of time of this conversion.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
5 years agoDM: eth: Switch display5 board to use DM_ETH
Lukasz Majewski [Tue, 3 Sep 2019 14:38:42 +0000 (16:38 +0200)]
DM: eth: Switch display5 board to use DM_ETH

After this commit the display5 device would use FEC driver supporting
driver model (DM_ETH).

Signed-off-by: Lukasz Majewski <lukma@denx.de>
5 years agoDM: mmc: Switch display5 board to use DM_MMC and BLK (USDHC)
Lukasz Majewski [Tue, 3 Sep 2019 14:38:41 +0000 (16:38 +0200)]
DM: mmc: Switch display5 board to use DM_MMC and BLK (USDHC)

After this commit the display5 device would use eMMC driver supporting
driver model (DM_MMC and BLK).

Signed-off-by: Lukasz Majewski <lukma@denx.de>
5 years agoARM: imx: defconfig: Enable 'regulator' and 'pmic' commands on display5
Lukasz Majewski [Tue, 3 Sep 2019 14:38:40 +0000 (16:38 +0200)]
ARM: imx: defconfig: Enable 'regulator' and 'pmic' commands on display5

Signed-off-by: Lukasz Majewski <lukma@denx.de>
5 years agoDM: I2C: Switch display5 board to use DM_I2C
Lukasz Majewski [Tue, 3 Sep 2019 14:38:39 +0000 (16:38 +0200)]
DM: I2C: Switch display5 board to use DM_I2C

After this commit the display5 device would use I2C driver supporting
driver model (DM_I2C).

The 'i2c' and 'eeprom' commands now use DM I2C drivers and initialize
on-bus devices according to device tree description.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
5 years agoARM: imx: defconfig: Enable CONFIG_PINCTRL{_IMX6} on display5's defconfig
Lukasz Majewski [Tue, 3 Sep 2019 14:38:38 +0000 (16:38 +0200)]
ARM: imx: defconfig: Enable CONFIG_PINCTRL{_IMX6} on display5's defconfig

Enable PINCTRL for i.MX6 soc based display5 after DM/DTS conversion.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
5 years agofix: defconfig: Enable OF_CONTROL for display5_factory
Lukasz Majewski [Tue, 3 Sep 2019 14:38:37 +0000 (16:38 +0200)]
fix: defconfig: Enable OF_CONTROL for display5_factory

This change fixes issue with building display5 "factory" U-Boot variant
when the display5 board gains DM/DTS support.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
5 years agoimx: bk4: Print proper HW revision of VF610's BK4 board
Lukasz Majewski [Sat, 27 Jul 2019 22:17:05 +0000 (00:17 +0200)]
imx: bk4: Print proper HW revision of VF610's BK4 board

This code uses HW difference on the USB_RESET pin (added PULL UP resistor
on the L333 rev) to distinguish between two BK4 HW revisions.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
5 years agopico-imx6: Add Falcon mode
Fabio Estevam [Wed, 18 Sep 2019 01:04:57 +0000 (22:04 -0300)]
pico-imx6: Add Falcon mode

Add Falcon mode support, which allows the SPL to load and
jump to the Linux kernel directly, without the need of loading
U-Boot proper.

CONFIG_SPL_OS_BOOT=y needs to be passed in the defconfig
in order to use Falcon mode.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
5 years agopico-imx6: Add splashscreen support
Fabio Estevam [Tue, 17 Sep 2019 17:17:07 +0000 (14:17 -0300)]
pico-imx6: Add splashscreen support

Add splashscreen support. Tested with the parallel
FT5x06-WVGA panel.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
5 years agopico-imx6: Add Ethernet support
Fabio Estevam [Mon, 16 Sep 2019 17:15:00 +0000 (14:15 -0300)]
pico-imx6: Add Ethernet support

Add Ethernet support.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
5 years agopico-imx6: Fix bootmenu handling
Otavio Salvador [Wed, 19 Jun 2019 18:03:44 +0000 (15:03 -0300)]
pico-imx6: Fix bootmenu handling

We should use a common script to allow booting the U-Boot console as
fallback so we ended using a 'default_boot' and 'base_boot'
environment scripts to accomplish that.

Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
5 years agopico-imx6: Add initial support
Fabio Estevam [Tue, 11 Jun 2019 01:24:12 +0000 (22:24 -0300)]
pico-imx6: Add initial support

Add the initial support for the pico-imx6 variants.

DDR initialization is based on the TechNexion's U-Boot code.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
5 years agomx6: clock: Allow enable_ipu_clock() to be built for SPL code
Fabio Estevam [Fri, 12 Jul 2019 12:10:35 +0000 (09:10 -0300)]
mx6: clock: Allow enable_ipu_clock() to be built for SPL code

Allow enable_ipu_clock() to be built for SPL code. This is done
in preparation for configuring the NoC registers on i.MX6QP in SPL.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
5 years agomx53loco: Fix U-Boot corruption after saving the environment
Fabio Estevam [Fri, 30 Aug 2019 16:58:29 +0000 (13:58 -0300)]
mx53loco: Fix U-Boot corruption after saving the environment

U-Boot binary has grown in such a way that it goes beyond the reserved
area for the environment variables.

Running "saveenv" causes U-Boot to hang because of this overlap.

Fix this problem by increasing the CONFIG_ENV_OFFSET size.

Also, in order to prevent this same problem in the future, use
CONFIG_BOARD_SIZE_LIMIT, which will detect the overlap in build-time.

CONFIG_BOARD_SIZE_LIMIT does not accept math expressions, so declare
CONFIG_ENV_OFFSET with its direct value instead.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
5 years agoboard: imx6dl_mamoj: set the value for CSF size
Stefano Babic [Fri, 20 Sep 2019 06:51:29 +0000 (08:51 +0200)]
board: imx6dl_mamoj: set the value for CSF size

Default value is too high and it covers the worst case. SPL for
imx6dl_mamoj becomes too big and cannot fit into the OCRAM, but CSF size
can be reduced.

Signed-off-by: Stefano Babic <sbabic@denx.de>
CC: Jagan Teki <jagan@amarulasolutions.com>
CC: Breno Lima <breno.lima@nxp.com>
5 years agoconfigs: Sync all baseboard specific pico-imx7d
Otavio Salvador [Mon, 16 Sep 2019 11:14:48 +0000 (08:14 -0300)]
configs: Sync all baseboard specific pico-imx7d

This syncs all baseboard specific defconfig using the
pico-imx7d_defconfig as base. It changes:

 - pico-dwarf-imx7d_defconfig
 - pico-hobbit-imx7d_defconfig
 - pico-nymph-imx7d_defconfig
 - pico-pi-imx7d_defconfig

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
5 years agoconfigs: pico-imx7d: Convert to DM_VIDEO
Joris Offouga [Fri, 30 Aug 2019 12:44:36 +0000 (14:44 +0200)]
configs: pico-imx7d: Convert to DM_VIDEO

This commit convert all pico-imx7d to DM_VIDEO

Signed-off-by: Joris Offouga <offougajoris@gmail.com>
5 years agoARM: dts: pico-imx7d: sync device tree with v5.3-rc6
Joris Offouga [Fri, 30 Aug 2019 12:42:59 +0000 (14:42 +0200)]
ARM: dts: pico-imx7d: sync device tree with v5.3-rc6

Synchronize device tree with v5.3-rc6 label

Signed-off-by: Joris Offouga <offougajoris@gmail.com>
5 years agoARM: dts: pico-imx7d: Add u-boot.dtsi for uboot specific dts change
Joris Offouga [Fri, 30 Aug 2019 12:39:49 +0000 (14:39 +0200)]
ARM: dts: pico-imx7d: Add u-boot.dtsi for uboot specific dts change

This commit introduce u-boot.dtsi

Signed-off-by: Joris Offouga <offougajoris@gmail.com>
Suggested-by: Peng Fan <peng.fan@nxp.com>
5 years agoimx: fix missing MAINTAINERS pico boards
Stefano Babic [Mon, 16 Sep 2019 06:36:23 +0000 (08:36 +0200)]
imx: fix missing MAINTAINERS pico boards

Add missing files pico-nymph-imx7d_defconfig and
c>onfigs/pico-dwarf-imx7d_defconfig

Signed-off-by: Stefano Babic <sbabic@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
CC: Fabio Estevam <festevam@gmail.com>
CC: Otavio Salvador <otavio@ossystems.com.br>
5 years agoimx: sksimx6_defconfig: remove SPL misc option to fix build error
Anatolij Gustschin [Sat, 14 Sep 2019 11:30:49 +0000 (13:30 +0200)]
imx: sksimx6_defconfig: remove SPL misc option to fix build error

Remove CONFIG_SPL_DRIVERS_MISC_SUPPORT since it is already defined
in include/configs/mx6_common.h for SPL builds. When this option
is in defconfig, we get build warnings (or errors when building
with -Werror).

Signed-off-by: Anatolij Gustschin <agust@denx.de>
5 years agopico: Convert to CONFIG_FSL_USDHC
Fabio Estevam [Sat, 14 Sep 2019 12:14:19 +0000 (09:14 -0300)]
pico: Convert to CONFIG_FSL_USDHC

The eSDHC config symbol has been converted to CONFIG_FSL_USDHC, so
adjust it accordingly in order to fix the build errors:

https://travis-ci.org/sbabic/u-boot-imx/jobs/584781580#L1287

Reported-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
5 years agologos: Add the TechNexion's logo
Fabio Estevam [Tue, 11 Dec 2018 02:06:49 +0000 (00:06 -0200)]
logos: Add the TechNexion's logo

Add the TechNexion's logo from their internal U-Boot tree.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
5 years agopico-imx7d: Provide a way to escape the Falcon mode
Fabio Estevam [Wed, 11 Sep 2019 17:30:28 +0000 (14:30 -0300)]
pico-imx7d: Provide a way to escape the Falcon mode

When CONFIG_SPL_OS_BOOT is selected, it is still convenient to be able
to escape from Falcon mode and boot to U-Boot proper.

Add a mechanism that allows booting in U-Boot proper when the
key 'c' is entered on console at boot time.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
5 years agopico-imx7d: Add instructions for booting in Falcon mode
Fabio Estevam [Wed, 11 Sep 2019 17:29:52 +0000 (14:29 -0300)]
pico-imx7d: Add instructions for booting in Falcon mode

Improve the README by adding instructions on how to boot using
Falcon mode, which allows the SPL to load the kernel directly,
without using U-Boot proper.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
5 years agopico-imx7d: Add NYMPH baseboard support
Otavio Salvador [Thu, 11 Apr 2019 12:19:42 +0000 (09:19 -0300)]
pico-imx7d: Add NYMPH baseboard support

This add the boot menu option for the NYMPH baseboard as well as a
specific config file for users which wish to use it as a pre-defined
board.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
5 years agopico-imx7d: Add DWARF baseboard support
Otavio Salvador [Thu, 11 Apr 2019 12:17:48 +0000 (09:17 -0300)]
pico-imx7d: Add DWARF baseboard support

This add the boot menu option for the DWARF baseboard as well as a
specific config file for users which wish to use it as a pre-defined
board.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
5 years agopico-imx7d: Sync pico-hobbit-imx7d_defconfig
Fabio Berton [Fri, 23 Aug 2019 18:01:00 +0000 (15:01 -0300)]
pico-imx7d: Sync pico-hobbit-imx7d_defconfig

Update pico-hobbit-imx7d_defconfig using pico-imx7d_defconfig as base
to fix device tree file generation. With this all pico-imx7d are
creating u-boot-dtb.img files.

Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
5 years agopico-imx6ul: Provide a way to escape the Falcon mode
Fabio Estevam [Wed, 11 Sep 2019 17:33:44 +0000 (14:33 -0300)]
pico-imx6ul: Provide a way to escape the Falcon mode

When CONFIG_SPL_OS_BOOT is selected, it is still convenient to be able
to escape from Falcon mode and boot to U-Boot proper.

Add a mechanism that allows booting in U-Boot proper when the
key 'c' is entered on console at boot time.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
5 years agopico-imx6ul: Update the Falcon mode instructions
Fabio Estevam [Wed, 11 Sep 2019 17:32:29 +0000 (14:32 -0300)]
pico-imx6ul: Update the Falcon mode instructions

Sync the Falcon mode instructions with the ones fro pico-imx7d.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
5 years agopico-imx6ul: Add LCD support
Fabio Estevam [Tue, 10 Sep 2019 01:23:39 +0000 (22:23 -0300)]
pico-imx6ul: Add LCD support

Add support for the VXT VL050-8048NT-C01 panel connected through
the 24 bit parallel LCDIF interface.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
5 years agopico-imx6ul: Increase the CONFIG_ENV_OFFSET size
Fabio Estevam [Thu, 12 Sep 2019 14:15:54 +0000 (11:15 -0300)]
pico-imx6ul: Increase the CONFIG_ENV_OFFSET size

U-Boot binary has grown in such a way that it goes beyond the reserved
area for the environment variables.

Running "saveenv" causes U-Boot to hang because of this overlap.

Fix this problem by increasing the CONFIG_ENV_OFFSET size.

Also, in order to prevent this same problem in the future, use
CONFIG_BOARD_SIZE_LIMIT, which will detect the overlap in build-time.

CONFIG_BOARD_SIZE_LIMIT does not accept math expressions, so declare
CONFIG_ENV_OFFSET with its direct value instead.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
5 years agopico-imx6ul: Add DWARF baseboard support
Otavio Salvador [Sun, 7 Apr 2019 19:43:02 +0000 (16:43 -0300)]
pico-imx6ul: Add DWARF baseboard support

This add the boot menu option for the DWARF baseboard as well as a
specific config file for users which wish to use it as a pre-defined
board.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
5 years agoRevert "habv4: tools: Avoid hardcoded CSF size for SPL targets"
Stefano Babic [Fri, 13 Sep 2019 16:53:03 +0000 (18:53 +0200)]
Revert "habv4: tools: Avoid hardcoded CSF size for SPL targets"

This reverts commit 62a52f3f85bf33e286632e99f0d39b2c166af0c4.

5 years agohabv4: tools: Avoid hardcoded CSF size for SPL targets
Breno Matheus Lima [Thu, 18 Jul 2019 12:34:15 +0000 (12:34 +0000)]
habv4: tools: Avoid hardcoded CSF size for SPL targets

Currently it's not possible to authenticate the U-Boot proper of
mx6ul_14x14_evk_defconfig target:

Authenticate image from DDR location 0x877fffc0...
bad magic magic=0x0 length=0x00 version=0x3
bad length magic=0x0 length=0x00 version=0x3
bad version magic=0x0 length=0x00 version=0x3
spl: ERROR:  image authentication fail

Commit 0633e134784a ("imx: hab: Increase CSF_SIZE for i.MX6 and
i.MX7 devices") has increased CSF_SIZE to avoid a possible issue
when booting encrypted boot images.

Commit d21bd69b6e95 ("tools: mkimage: add firmware-ivt image type
for HAB verification") is hardcoding the CSF and IVT sizes, the
new CSF size is not being considered and u-boot-ivt.img fails to
boot.

Avoid hardcoded CSF and IVT size to fix this issue.

Signed-off-by: Breno Lima <breno.lima@nxp.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
5 years agoimx8: cpu: fix mac fuse word for i.MX8QM
Peng Fan [Mon, 26 Aug 2019 08:12:23 +0000 (08:12 +0000)]
imx8: cpu: fix mac fuse word for i.MX8QM

i.MX8QM does not share same FUSE MAC word index, so update the word
index for i.MX8QM.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agoimx8: move i.MX8 cpu desc code to drivers/cpu/imx8_cpu.c
Peng Fan [Mon, 26 Aug 2019 08:12:19 +0000 (08:12 +0000)]
imx8: move i.MX8 cpu desc code to drivers/cpu/imx8_cpu.c

Move cpu desc code to cpu driver directory and name it imx8_cpu.c
No functional change.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agoimx: scu_api: add sc_pm_is_partition_started
Peng Fan [Mon, 26 Aug 2019 08:12:16 +0000 (08:12 +0000)]
imx: scu_api: add sc_pm_is_partition_started

Add sc_pm_is_partition_started to check whether a partition
has been started. This will be used to detect M4 partition booted up or
not, then we could choose which dtb to use. If M4 is up, we need
use dtb, such as imx8qm-mek-rpmsg.dtb.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agoimx8: fdt: add optee node
Peng Fan [Mon, 26 Aug 2019 08:12:13 +0000 (08:12 +0000)]
imx8: fdt: add optee node

Add OP-TEE device tree node for Linux according to args passed from ATF.
If ATF has been built with OP-TEE running, boot_pointer[1] will indicate
that.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agoimx8: save args passed from ATF
Peng Fan [Mon, 26 Aug 2019 08:12:09 +0000 (08:12 +0000)]
imx8: save args passed from ATF

We use information from ATF to know whether OP-TEE is running or not.
So save args passed from ATF.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agoimx8: fdt: configure sid for masters
Peng Fan [Mon, 26 Aug 2019 08:12:06 +0000 (08:12 +0000)]
imx8: fdt: configure sid for masters

On i.MX8QM, sid is programmable, so we could program sid according the
value encoded in device tree.

This patch support legacy bindings which are still being used by XEN
and new bindings used by Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agoimx: scu_api: add sc_rm_set_master_sid
Peng Fan [Mon, 26 Aug 2019 08:12:03 +0000 (08:12 +0000)]
imx: scu_api: add sc_rm_set_master_sid

Add sc_rm_set_master_sid to set stream sid of masters to make
sure they could use smmu.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agoconfigs: imx8qm/qxp_mek: enable CONFIG_OF_SYSTEM_SETUP
Peng Fan [Mon, 26 Aug 2019 08:12:00 +0000 (08:12 +0000)]
configs: imx8qm/qxp_mek: enable CONFIG_OF_SYSTEM_SETUP

Enable CONFIG_OF_SYSTEM_SETUP to let U-Boot could disable
device tree nodes that could not be used by Linux.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agoimx8: disable node when the resource is not owned
Peng Fan [Mon, 26 Aug 2019 08:11:56 +0000 (08:11 +0000)]
imx8: disable node when the resource is not owned

When resource is not assigned to non-secure Linux, if linux continue
to use the node, linux may crash or hang. So need to set the node
status to disabled for not owned resources.

The resource id is in the power-domains property in device tree,
so parse the power-domains property to get the resource id and
use scfw api to check whether it is owned by current partition.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agoimx8qm: correct fdt_file
Peng Fan [Mon, 26 Aug 2019 08:11:53 +0000 (08:11 +0000)]
imx8qm: correct fdt_file

imx8qm-mek.dtb is the correct fdt file, not fsl-imx8qxp-mek.dtb

Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agoimx8qm: power up SMMU
Peng Fan [Mon, 26 Aug 2019 08:11:49 +0000 (08:11 +0000)]
imx8qm: power up SMMU

There is SMMU in i.MX8QM. To use SMMU in Linux, need power up it.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agoimx: sys_proto: add is_imx8qm helper
Peng Fan [Mon, 26 Aug 2019 08:11:46 +0000 (08:11 +0000)]
imx: sys_proto: add is_imx8qm helper

Add is_imx8qm helper which could be used by SoC and Driver code.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agoimx8: Probe the SCU driver by using uclass function
Ye Li [Mon, 26 Aug 2019 08:11:42 +0000 (08:11 +0000)]
imx8: Probe the SCU driver by using uclass function

Since SCU MU driver has been bound in dm_init, so we don't need to
bind it again. Just replace by using uclass function to probe it.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agodoc: imx: mkimage: introduce i.MX8 image format
Peng Fan [Thu, 22 Aug 2019 07:42:49 +0000 (07:42 +0000)]
doc: imx: mkimage: introduce i.MX8 image format

Introduce i.MX8 container set configuration file and add example

Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agoimx8qm_mek: switch to use container image
Peng Fan [Thu, 22 Aug 2019 07:42:46 +0000 (07:42 +0000)]
imx8qm_mek: switch to use container image

Because FIT could not be used for AHAB secure boot on i.MX8,
so switch to use container image that could let SPL verify
ATF and U-Boot with AHAB.

Enable HUSH_PARSER in defconfig to make run netboot could work.

Note: The AHAB related code has not been added.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agoimx8qxp_mek: switch to use container image
Peng Fan [Thu, 22 Aug 2019 07:42:43 +0000 (07:42 +0000)]
imx8qxp_mek: switch to use container image

Because FIT could not be used for AHAB secure boot on i.MX8,
so switch to use container image that could let SPL verify
ATF and U-Boot with AHAB.

Note: The AHAB related code has not been added.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agoimx: add container target
Peng Fan [Thu, 22 Aug 2019 07:42:41 +0000 (07:42 +0000)]
imx: add container target

To support SPL loading container file, add a new Makefile target,
and introduce a new Kconfig file to source the cfg file which
will be parsed by mkimage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agospl: mmc: support loading i.MX container format file
Peng Fan [Thu, 22 Aug 2019 07:42:38 +0000 (07:42 +0000)]
spl: mmc: 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>
5 years agoimx8: support parsing i.MX8 Container file
Peng Fan [Thu, 22 Aug 2019 07:42:33 +0000 (07:42 +0000)]
imx8: support parsing i.MX8 Container file

Add parsing i.MX8 Container file support, this is to let
SPL could load images in a container file to destination address.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agoimx: imx8qxp_mek: fix CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR
Peng Fan [Wed, 21 Aug 2019 08:28:15 +0000 (08:28 +0000)]
imx: imx8qxp_mek: fix CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR

The first stage of flash.bin is larger than 584 * 512, so when
writting u-boot.itb, some data will be override. Enlarge the
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR to fix boot.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agoimx: imx6qdl: dtsi: move U-Boot specific change to u-boot.dtsi
Peng Fan [Wed, 14 Aug 2019 09:27:06 +0000 (09:27 +0000)]
imx: imx6qdl: dtsi: move U-Boot specific change to u-boot.dtsi

The changes were added by following patch:
commit <9002e735e717> ("imx: mx6sabresd: fix boot hang with video")
commit <f45ec8fcfb86> ("imx6: dts: add 'u-boot, dm-pre-reloc' to soc and ipu nodes")

Let's move the U-Boot specific change to imx6qdl-u-boot.dtsi

Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agoimx: mx6sabresd: fix usb start when DM enabled
Peng Fan [Wed, 14 Aug 2019 09:13:04 +0000 (09:13 +0000)]
imx: mx6sabresd: fix usb start when DM enabled

Enable CONFIG_DM_REGULATOR_FIXED to let vbus regulator work.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agoimx: configs: Cleanup CONFIG_SECURE_BOOT comments
Breno Matheus Lima [Thu, 18 Jul 2019 12:34:30 +0000 (12:34 +0000)]
imx: configs: Cleanup CONFIG_SECURE_BOOT comments

Since commit 6e1f4d2652e7 ("arm: imx-common: add SECURE_BOOT option
to Kconfig") the SECURE_BOOT option is selected through Kconfig.

Cleanup comments in code to align with this change.

Signed-off-by: Breno Lima <breno.lima@nxp.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
5 years agoimx6: spl: Reduce SPL limit size in case CONFIG_SECURE_BOOT is enabled
Breno Matheus Lima [Thu, 18 Jul 2019 12:34:23 +0000 (12:34 +0000)]
imx6: spl: Reduce SPL limit size in case CONFIG_SECURE_BOOT is enabled

In case CONFIG_SECURE_BOOT is enabled we need to limit the SPL size to
avoid a possible HAB failure event:

--------- HAB Event 1 -----------------
event data:
        0xdb 0x00 0x14 0x42 0x33 0x22 0x33 0x00
        0x00 0x00 0x00 0x0f 0x00 0x90 0x70 0x00
        0x00 0x01 0x10 0x00
STS = HAB_FAILURE (0x33)
RSN = HAB_INV_ADDRESS (0x22)
CTX = HAB_CTX_TARGET (0x33)
ENG = HAB_ENG_ANY (0x00)

As explained in Commit 23612534fe0f ("spl: imx6: Provide a SPL_SIZE_LIMIT
default") the i.MX6 SPL size limit is 68KB.

The ROM code is copying the image size defined in boot data to its
respective load address, in case we exceed the OCRAM free region a
HAB invalid address failure event is generated.

The maximum CSF size is defined in CONFIG_CSF_SIZE, reduce SPL size
limit based on this configuration.

Signed-off-by: Breno Lima <breno.lima@nxp.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
5 years agoKconfig: Migrate CONFIG_CSF_SIZE to Kconfig
Breno Matheus Lima [Thu, 18 Jul 2019 12:34:08 +0000 (12:34 +0000)]
Kconfig: Migrate CONFIG_CSF_SIZE to Kconfig

Move CONFIG_CSF_SIZE to Kconfig and define default value as 0x4000.

mx8mqevk requires 0x2000 add this configuration in imx8mq_evk_defconfig
file.

Signed-off-by: Breno Lima <breno.lima@nxp.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
5 years agomx6sabresd: Reduce overall SPL size
Fabio Estevam [Tue, 23 Jul 2019 15:20:46 +0000 (12:20 -0300)]
mx6sabresd: Reduce overall SPL size

Currently the SPL binary is 67 kB, which leaves only 1 kB of free
internal RAM space.

The following options can be safely removed to save some precious
SPL space:

- CONFIG_SPL_FS_EXT4: u-boot-dtb.img is stored in raw sector via dd
command (at offset 69 kB)
- CONFIG_SPL_I2C_SUPPORT: I2C is not used during SPL
- CONFIG_SPL_OS_BOOT: no need to make Falcon mode supported
by default

After this change the SPL binary size gets down to 51 kB.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
5 years agoi.MX7ULP: Change clock rate calculation for NIC1 BUS and EXT
Ye Li [Mon, 22 Jul 2019 01:25:10 +0000 (01:25 +0000)]
i.MX7ULP: Change clock rate calculation for NIC1 BUS and EXT

On i.MX7ULP B0, there is change in NIC clock dividers architecture.
On A0, the NIC1 BUS and EXT dividers were in a chain with NIC1 DIV, but
on B0 they are parallel with NIC1 DIV. So now the dividers are independent.
This patch modifies the scg_nic_get_rate function according to this change.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
5 years agoi.MX7ULP: Set A7 core frequency to 500Mhz for B0 chip
Ye Li [Mon, 22 Jul 2019 01:25:08 +0000 (01:25 +0000)]
i.MX7ULP: Set A7 core frequency to 500Mhz for B0 chip

The normal target frequency for ULP A7 core is 500Mhz, but now ROM
set the core frequency to 413Mhz. So change it to 500Mhz in u-boot.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agoi.MX7ULP: Add CPU revision check for B0
Peng Fan [Mon, 22 Jul 2019 01:25:05 +0000 (01:25 +0000)]
i.MX7ULP: Add CPU revision check for B0

Since there is no register for CPU revision, we use ROM version to
check the A0 or B0 chip.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agoi.MX7ULP: Workaround APLL PFD2 to 345.6Mhz
Ye Li [Mon, 22 Jul 2019 01:25:03 +0000 (01:25 +0000)]
i.MX7ULP: Workaround APLL PFD2 to 345.6Mhz

The GPU uses APLL PFD2 as its clock parent (483.84Mhz) with divider
set to 1. This frequecy is out of ULP A0 spec. The MAX rate for GPU
is 350Mhz. So we simply configure the APLL PFD2 to 345.6Mhz (FRAC=28)
to workaround the problem. The correct fix should let GPU handle the
clock rate in kernel.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agoi.MX7ULP: Fix SPLL/APLL clock rate calculation issue
Ye Li [Mon, 22 Jul 2019 01:25:00 +0000 (01:25 +0000)]
i.MX7ULP: Fix SPLL/APLL clock rate calculation issue

The num/denom is a float value, but in the calculation it is convert
to integer 0, and cause the result wrong.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agoi.MX7ULP: evk: Enable fuse comamnd
Peng Fan [Mon, 22 Jul 2019 01:24:57 +0000 (01:24 +0000)]
i.MX7ULP: evk: Enable fuse comamnd

Enable fuse command

Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agomisc: Kconfig: make i.MX7ULP could use MXC_OCOTP
Peng Fan [Mon, 22 Jul 2019 01:24:55 +0000 (01:24 +0000)]
misc: Kconfig: make i.MX7ULP could use MXC_OCOTP

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