History log of /u-boot/arch/arm/mach-imx/imx8/cpu.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# d678a59d 18-May-2024 Tom Rini <trini@konsulko.com>

Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""

When bringing in the series 'arm: dts: am62-beagleplay: Fix Beagleplay
Ethernet"' I failed to notice that b4 noticed it was based on next and
so took that as the base commit and merged that part of next to master.

This reverts commit c8ffd1356d42223cbb8c86280a083cc3c93e6426, reversing
changes made to 2ee6f3a5f7550de3599faef9704e166e5dcace35.

Reported-by: Jonas Karlman <jonas@kwiboo.se>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 371d0b55 30-Apr-2024 Tom Rini <trini@konsulko.com>

arm: imx: Remove <common.h> and add needed includes

Remove <common.h> from all mach-imx, CPU specific sub-directories and
include/asm/arch-mx* files and when needed add missing include files
directly.

Acked-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# f8b874f5 26-Mar-2024 Fabio Estevam <festevam@denx.de>

imx8: Add a default reset_cpu() implementation

Add a weak default reset_cpu() implementation just like
it is done on arch/arm/mach-imx/cpu.c.

This allows the removal of the empty reset_cpu() in several
board files.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Tested-by: Hiago De Franco <hiago.franco@toradex.com> # Toradex Colibri iMX8X

# c4bc7db9 31-Jan-2024 Igor Opaniuk <igor.opaniuk@foundries.io>

imx: imx8: print reset cause

Add support for printing reset cause during boot.

Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>

# f72d0d4a 21-Aug-2023 Simon Glass <sjg@chromium.org>

event: Convert existing spy records to simple

Very few of the existing event-spy records use the arguments they are
passed. Update them to use a simple spy instead, to simplify the code.

Where an adaptor function is currently used, remove it where possible.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e8cd1f60 15-Jun-2023 Ye Li <ye.li@nxp.com>

imx: imx8: bootaux: Add i.MX8 M4 boot support

1. Implement bootaux for the M4 boot on i.MX8QM and QXP. Users need to download
M4 image to any DDR address first. Then use the
"bootaux <M4 download DDR address> [M4 core id]" to boot CM4_0
or CM4_1, the default core id is 0 for CM4_0.

Since current M4 only supports running in TCM. The bootaux will copy
the M4 image from DDR to its TCML.

2. Implment bootaux for HIFI on QXP
command: bootaux 0x81000000 1

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# dd654caa 15-Jun-2023 Peng Fan <peng.fan@nxp.com>

imx: mach: correct SCU API usage

The return value is int type, not sc_err_t(u8), correct the usage.

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

# 99ac6c76 27-Apr-2023 Peng Fan <peng.fan@nxp.com>

imx: move imx8 sci header file to include/firmware/imx

Move imx8 sci header file to include/firmware/imx, then we could
use build macro to reuse some i.MX8 drivers for i.MX9, such as
drivers/cpu/imx8_cpu.c.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Stefano Babic <sbabic@denx.de>

# 55171aed 04-May-2023 Simon Glass <sjg@chromium.org>

dm: Emit the arch_cpu_init_dm() even only before relocation

The original function was only called once, before relocation. The new
one is called again after relocation. This was not the intent of the
original call. Fix this by renaming and updating the calling logic.

With this, chromebook_link64 makes it through SPL.

Fixes: 7fe32b3442f0 ("event: Convert arch_cpu_init_dm() to use events")
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 98463903 20-Oct-2022 Simon Glass <sjg@chromium.org>

Rename CONFIG_SYS_TEXT_BASE to CONFIG_TEXT_BASE

The current name is inconsistent with SPL which uses CONFIG_SPL_TEXT_BASE
and this makes it imposible to use CONFIG_VAL().

Rename it to resolve this problem.

Signed-off-by: Simon Glass <sjg@chromium.org>

# cda8f873 11-May-2022 Ye Li <ye.li@nxp.com>

caam: Fix crash in case caam_jr_probe failed

If probing caam_jr returns failure, the variable "dev" will not be
initialized, so we can't use dev->name for the error print.
Otherwise it will cause crash.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Gaurav Jain <gaurav.jain@nxp.com>

# cb5d0419 24-Mar-2022 Gaurav Jain <gaurav.jain@nxp.com>

crypto/fsl: i.MX8: Enable Job ring driver model.

i.MX8(QM/QXP) - added support for JR driver model.
sec is initialized based on job ring information processed
from device tree.

Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# 7fe32b34 04-Mar-2022 Simon Glass <sjg@chromium.org>

event: Convert arch_cpu_init_dm() to use events

Instead of a special function, send an event after driver model is inited
and adjust the boards which use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b9d66a06 30-Aug-2021 Tom Rini <trini@konsulko.com>

imx: Convert SERIAL_TAG support to ENV_VARS_UBOOT_RUNTIME_CONFIG

No iMX platforms have supported ATAG-based booting. They have however
re-used the CONFIG_SERIAL_TAG option as a way to enable support of
reading the OTP fuses and setting the serial# environment variable in
some cases. Change the warp7 support to use this symbol, use this for
updating the rest of the imx7 code, and update the imx8 conditionals.

Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: NXP i.MX U-Boot Team <uboot-imx@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>

# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>

# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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

# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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

# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>

# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>

# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>

# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>

# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>

# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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

# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>

# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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

# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>

# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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

# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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

# 2fdb1a1d 18-Oct-2018 Anatolij Gustschin <agust@denx.de>

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>

# 70b4b49b 18-Oct-2018 Anatolij Gustschin <agust@denx.de>

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>

# 1ef20a3d 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# 930b5952 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# c1aae21d 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# 8aa1505b 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# 60d33fcd 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# 371d0b55 30-Apr-2024 Tom Rini <trini@konsulko.com>

arm: imx: Remove <common.h> and add needed includes

Remove <common.h> from all mach-imx, CPU specific sub-directories and
include/asm/arch-mx* files and when needed add missing include files
directly.

Acked-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# f8b874f5 26-Mar-2024 Fabio Estevam <festevam@denx.de>

imx8: Add a default reset_cpu() implementation

Add a weak default reset_cpu() implementation just like
it is done on arch/arm/mach-imx/cpu.c.

This allows the removal of the empty reset_cpu() in several
board files.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Tested-by: Hiago De Franco <hiago.franco@toradex.com> # Toradex Colibri iMX8X

# c4bc7db9 31-Jan-2024 Igor Opaniuk <igor.opaniuk@foundries.io>

imx: imx8: print reset cause

Add support for printing reset cause during boot.

Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>

# f72d0d4a 21-Aug-2023 Simon Glass <sjg@chromium.org>

event: Convert existing spy records to simple

Very few of the existing event-spy records use the arguments they are
passed. Update them to use a simple spy instead, to simplify the code.

Where an adaptor function is currently used, remove it where possible.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e8cd1f60 15-Jun-2023 Ye Li <ye.li@nxp.com>

imx: imx8: bootaux: Add i.MX8 M4 boot support

1. Implement bootaux for the M4 boot on i.MX8QM and QXP. Users need to download
M4 image to any DDR address first. Then use the
"bootaux <M4 download DDR address> [M4 core id]" to boot CM4_0
or CM4_1, the default core id is 0 for CM4_0.

Since current M4 only supports running in TCM. The bootaux will copy
the M4 image from DDR to its TCML.

2. Implment bootaux for HIFI on QXP
command: bootaux 0x81000000 1

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# dd654caa 15-Jun-2023 Peng Fan <peng.fan@nxp.com>

imx: mach: correct SCU API usage

The return value is int type, not sc_err_t(u8), correct the usage.

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

# 99ac6c76 27-Apr-2023 Peng Fan <peng.fan@nxp.com>

imx: move imx8 sci header file to include/firmware/imx

Move imx8 sci header file to include/firmware/imx, then we could
use build macro to reuse some i.MX8 drivers for i.MX9, such as
drivers/cpu/imx8_cpu.c.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Stefano Babic <sbabic@denx.de>

# 55171aed 04-May-2023 Simon Glass <sjg@chromium.org>

dm: Emit the arch_cpu_init_dm() even only before relocation

The original function was only called once, before relocation. The new
one is called again after relocation. This was not the intent of the
original call. Fix this by renaming and updating the calling logic.

With this, chromebook_link64 makes it through SPL.

Fixes: 7fe32b3442f0 ("event: Convert arch_cpu_init_dm() to use events")
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 98463903 20-Oct-2022 Simon Glass <sjg@chromium.org>

Rename CONFIG_SYS_TEXT_BASE to CONFIG_TEXT_BASE

The current name is inconsistent with SPL which uses CONFIG_SPL_TEXT_BASE
and this makes it imposible to use CONFIG_VAL().

Rename it to resolve this problem.

Signed-off-by: Simon Glass <sjg@chromium.org>

# cda8f873 11-May-2022 Ye Li <ye.li@nxp.com>

caam: Fix crash in case caam_jr_probe failed

If probing caam_jr returns failure, the variable "dev" will not be
initialized, so we can't use dev->name for the error print.
Otherwise it will cause crash.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Gaurav Jain <gaurav.jain@nxp.com>

# cb5d0419 24-Mar-2022 Gaurav Jain <gaurav.jain@nxp.com>

crypto/fsl: i.MX8: Enable Job ring driver model.

i.MX8(QM/QXP) - added support for JR driver model.
sec is initialized based on job ring information processed
from device tree.

Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# 7fe32b34 04-Mar-2022 Simon Glass <sjg@chromium.org>

event: Convert arch_cpu_init_dm() to use events

Instead of a special function, send an event after driver model is inited
and adjust the boards which use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b9d66a06 30-Aug-2021 Tom Rini <trini@konsulko.com>

imx: Convert SERIAL_TAG support to ENV_VARS_UBOOT_RUNTIME_CONFIG

No iMX platforms have supported ATAG-based booting. They have however
re-used the CONFIG_SERIAL_TAG option as a way to enable support of
reading the OTP fuses and setting the serial# environment variable in
some cases. Change the warp7 support to use this symbol, use this for
updating the rest of the imx7 code, and update the imx8 conditionals.

Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: NXP i.MX U-Boot Team <uboot-imx@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>

# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>

# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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

# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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

# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>

# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>

# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>

# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>

# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>

# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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

# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>

# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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

# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>

# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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

# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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

# 2fdb1a1d 18-Oct-2018 Anatolij Gustschin <agust@denx.de>

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>

# 70b4b49b 18-Oct-2018 Anatolij Gustschin <agust@denx.de>

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>

# 1ef20a3d 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# 930b5952 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# c1aae21d 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# 8aa1505b 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# 60d33fcd 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# f8b874f5 26-Mar-2024 Fabio Estevam <festevam@denx.de>

imx8: Add a default reset_cpu() implementation

Add a weak default reset_cpu() implementation just like
it is done on arch/arm/mach-imx/cpu.c.

This allows the removal of the empty reset_cpu() in several
board files.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Tested-by: Hiago De Franco <hiago.franco@toradex.com> # Toradex Colibri iMX8X

# c4bc7db9 31-Jan-2024 Igor Opaniuk <igor.opaniuk@foundries.io>

imx: imx8: print reset cause

Add support for printing reset cause during boot.

Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>

# f72d0d4a 21-Aug-2023 Simon Glass <sjg@chromium.org>

event: Convert existing spy records to simple

Very few of the existing event-spy records use the arguments they are
passed. Update them to use a simple spy instead, to simplify the code.

Where an adaptor function is currently used, remove it where possible.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e8cd1f60 15-Jun-2023 Ye Li <ye.li@nxp.com>

imx: imx8: bootaux: Add i.MX8 M4 boot support

1. Implement bootaux for the M4 boot on i.MX8QM and QXP. Users need to download
M4 image to any DDR address first. Then use the
"bootaux <M4 download DDR address> [M4 core id]" to boot CM4_0
or CM4_1, the default core id is 0 for CM4_0.

Since current M4 only supports running in TCM. The bootaux will copy
the M4 image from DDR to its TCML.

2. Implment bootaux for HIFI on QXP
command: bootaux 0x81000000 1

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# dd654caa 15-Jun-2023 Peng Fan <peng.fan@nxp.com>

imx: mach: correct SCU API usage

The return value is int type, not sc_err_t(u8), correct the usage.

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

# 99ac6c76 27-Apr-2023 Peng Fan <peng.fan@nxp.com>

imx: move imx8 sci header file to include/firmware/imx

Move imx8 sci header file to include/firmware/imx, then we could
use build macro to reuse some i.MX8 drivers for i.MX9, such as
drivers/cpu/imx8_cpu.c.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Stefano Babic <sbabic@denx.de>

# 55171aed 04-May-2023 Simon Glass <sjg@chromium.org>

dm: Emit the arch_cpu_init_dm() even only before relocation

The original function was only called once, before relocation. The new
one is called again after relocation. This was not the intent of the
original call. Fix this by renaming and updating the calling logic.

With this, chromebook_link64 makes it through SPL.

Fixes: 7fe32b3442f0 ("event: Convert arch_cpu_init_dm() to use events")
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 98463903 20-Oct-2022 Simon Glass <sjg@chromium.org>

Rename CONFIG_SYS_TEXT_BASE to CONFIG_TEXT_BASE

The current name is inconsistent with SPL which uses CONFIG_SPL_TEXT_BASE
and this makes it imposible to use CONFIG_VAL().

Rename it to resolve this problem.

Signed-off-by: Simon Glass <sjg@chromium.org>

# cda8f873 11-May-2022 Ye Li <ye.li@nxp.com>

caam: Fix crash in case caam_jr_probe failed

If probing caam_jr returns failure, the variable "dev" will not be
initialized, so we can't use dev->name for the error print.
Otherwise it will cause crash.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Gaurav Jain <gaurav.jain@nxp.com>

# cb5d0419 24-Mar-2022 Gaurav Jain <gaurav.jain@nxp.com>

crypto/fsl: i.MX8: Enable Job ring driver model.

i.MX8(QM/QXP) - added support for JR driver model.
sec is initialized based on job ring information processed
from device tree.

Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# 7fe32b34 04-Mar-2022 Simon Glass <sjg@chromium.org>

event: Convert arch_cpu_init_dm() to use events

Instead of a special function, send an event after driver model is inited
and adjust the boards which use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b9d66a06 30-Aug-2021 Tom Rini <trini@konsulko.com>

imx: Convert SERIAL_TAG support to ENV_VARS_UBOOT_RUNTIME_CONFIG

No iMX platforms have supported ATAG-based booting. They have however
re-used the CONFIG_SERIAL_TAG option as a way to enable support of
reading the OTP fuses and setting the serial# environment variable in
some cases. Change the warp7 support to use this symbol, use this for
updating the rest of the imx7 code, and update the imx8 conditionals.

Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: NXP i.MX U-Boot Team <uboot-imx@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>

# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>

# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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

# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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

# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>

# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>

# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>

# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>

# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>

# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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

# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>

# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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

# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>

# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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

# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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

# 2fdb1a1d 18-Oct-2018 Anatolij Gustschin <agust@denx.de>

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>

# 70b4b49b 18-Oct-2018 Anatolij Gustschin <agust@denx.de>

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>

# 1ef20a3d 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# 930b5952 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# c1aae21d 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# 8aa1505b 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# 60d33fcd 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# c4bc7db9 31-Jan-2024 Igor Opaniuk <igor.opaniuk@foundries.io>

imx: imx8: print reset cause

Add support for printing reset cause during boot.

Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>

# f72d0d4a 21-Aug-2023 Simon Glass <sjg@chromium.org>

event: Convert existing spy records to simple

Very few of the existing event-spy records use the arguments they are
passed. Update them to use a simple spy instead, to simplify the code.

Where an adaptor function is currently used, remove it where possible.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e8cd1f60 15-Jun-2023 Ye Li <ye.li@nxp.com>

imx: imx8: bootaux: Add i.MX8 M4 boot support

1. Implement bootaux for the M4 boot on i.MX8QM and QXP. Users need to download
M4 image to any DDR address first. Then use the
"bootaux <M4 download DDR address> [M4 core id]" to boot CM4_0
or CM4_1, the default core id is 0 for CM4_0.

Since current M4 only supports running in TCM. The bootaux will copy
the M4 image from DDR to its TCML.

2. Implment bootaux for HIFI on QXP
command: bootaux 0x81000000 1

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# dd654caa 15-Jun-2023 Peng Fan <peng.fan@nxp.com>

imx: mach: correct SCU API usage

The return value is int type, not sc_err_t(u8), correct the usage.

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

# 99ac6c76 27-Apr-2023 Peng Fan <peng.fan@nxp.com>

imx: move imx8 sci header file to include/firmware/imx

Move imx8 sci header file to include/firmware/imx, then we could
use build macro to reuse some i.MX8 drivers for i.MX9, such as
drivers/cpu/imx8_cpu.c.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Stefano Babic <sbabic@denx.de>

# 55171aed 04-May-2023 Simon Glass <sjg@chromium.org>

dm: Emit the arch_cpu_init_dm() even only before relocation

The original function was only called once, before relocation. The new
one is called again after relocation. This was not the intent of the
original call. Fix this by renaming and updating the calling logic.

With this, chromebook_link64 makes it through SPL.

Fixes: 7fe32b3442f0 ("event: Convert arch_cpu_init_dm() to use events")
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 98463903 20-Oct-2022 Simon Glass <sjg@chromium.org>

Rename CONFIG_SYS_TEXT_BASE to CONFIG_TEXT_BASE

The current name is inconsistent with SPL which uses CONFIG_SPL_TEXT_BASE
and this makes it imposible to use CONFIG_VAL().

Rename it to resolve this problem.

Signed-off-by: Simon Glass <sjg@chromium.org>

# cda8f873 11-May-2022 Ye Li <ye.li@nxp.com>

caam: Fix crash in case caam_jr_probe failed

If probing caam_jr returns failure, the variable "dev" will not be
initialized, so we can't use dev->name for the error print.
Otherwise it will cause crash.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Gaurav Jain <gaurav.jain@nxp.com>

# cb5d0419 24-Mar-2022 Gaurav Jain <gaurav.jain@nxp.com>

crypto/fsl: i.MX8: Enable Job ring driver model.

i.MX8(QM/QXP) - added support for JR driver model.
sec is initialized based on job ring information processed
from device tree.

Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# 7fe32b34 04-Mar-2022 Simon Glass <sjg@chromium.org>

event: Convert arch_cpu_init_dm() to use events

Instead of a special function, send an event after driver model is inited
and adjust the boards which use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b9d66a06 30-Aug-2021 Tom Rini <trini@konsulko.com>

imx: Convert SERIAL_TAG support to ENV_VARS_UBOOT_RUNTIME_CONFIG

No iMX platforms have supported ATAG-based booting. They have however
re-used the CONFIG_SERIAL_TAG option as a way to enable support of
reading the OTP fuses and setting the serial# environment variable in
some cases. Change the warp7 support to use this symbol, use this for
updating the rest of the imx7 code, and update the imx8 conditionals.

Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: NXP i.MX U-Boot Team <uboot-imx@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>

# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>

# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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

# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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

# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>

# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>

# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>

# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>

# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>

# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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

# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>

# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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

# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>

# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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

# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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

# 2fdb1a1d 18-Oct-2018 Anatolij Gustschin <agust@denx.de>

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>

# 70b4b49b 18-Oct-2018 Anatolij Gustschin <agust@denx.de>

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>

# 1ef20a3d 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# 930b5952 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# c1aae21d 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# 8aa1505b 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# 60d33fcd 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# f72d0d4a 21-Aug-2023 Simon Glass <sjg@chromium.org>

event: Convert existing spy records to simple

Very few of the existing event-spy records use the arguments they are
passed. Update them to use a simple spy instead, to simplify the code.

Where an adaptor function is currently used, remove it where possible.

Signed-off-by: Simon Glass <sjg@chromium.org>

# e8cd1f60 15-Jun-2023 Ye Li <ye.li@nxp.com>

imx: imx8: bootaux: Add i.MX8 M4 boot support

1. Implement bootaux for the M4 boot on i.MX8QM and QXP. Users need to download
M4 image to any DDR address first. Then use the
"bootaux <M4 download DDR address> [M4 core id]" to boot CM4_0
or CM4_1, the default core id is 0 for CM4_0.

Since current M4 only supports running in TCM. The bootaux will copy
the M4 image from DDR to its TCML.

2. Implment bootaux for HIFI on QXP
command: bootaux 0x81000000 1

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# dd654caa 15-Jun-2023 Peng Fan <peng.fan@nxp.com>

imx: mach: correct SCU API usage

The return value is int type, not sc_err_t(u8), correct the usage.

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

# 99ac6c76 27-Apr-2023 Peng Fan <peng.fan@nxp.com>

imx: move imx8 sci header file to include/firmware/imx

Move imx8 sci header file to include/firmware/imx, then we could
use build macro to reuse some i.MX8 drivers for i.MX9, such as
drivers/cpu/imx8_cpu.c.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Stefano Babic <sbabic@denx.de>

# 55171aed 04-May-2023 Simon Glass <sjg@chromium.org>

dm: Emit the arch_cpu_init_dm() even only before relocation

The original function was only called once, before relocation. The new
one is called again after relocation. This was not the intent of the
original call. Fix this by renaming and updating the calling logic.

With this, chromebook_link64 makes it through SPL.

Fixes: 7fe32b3442f0 ("event: Convert arch_cpu_init_dm() to use events")
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 98463903 20-Oct-2022 Simon Glass <sjg@chromium.org>

Rename CONFIG_SYS_TEXT_BASE to CONFIG_TEXT_BASE

The current name is inconsistent with SPL which uses CONFIG_SPL_TEXT_BASE
and this makes it imposible to use CONFIG_VAL().

Rename it to resolve this problem.

Signed-off-by: Simon Glass <sjg@chromium.org>

# cda8f873 11-May-2022 Ye Li <ye.li@nxp.com>

caam: Fix crash in case caam_jr_probe failed

If probing caam_jr returns failure, the variable "dev" will not be
initialized, so we can't use dev->name for the error print.
Otherwise it will cause crash.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Gaurav Jain <gaurav.jain@nxp.com>

# cb5d0419 24-Mar-2022 Gaurav Jain <gaurav.jain@nxp.com>

crypto/fsl: i.MX8: Enable Job ring driver model.

i.MX8(QM/QXP) - added support for JR driver model.
sec is initialized based on job ring information processed
from device tree.

Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# 7fe32b34 04-Mar-2022 Simon Glass <sjg@chromium.org>

event: Convert arch_cpu_init_dm() to use events

Instead of a special function, send an event after driver model is inited
and adjust the boards which use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b9d66a06 30-Aug-2021 Tom Rini <trini@konsulko.com>

imx: Convert SERIAL_TAG support to ENV_VARS_UBOOT_RUNTIME_CONFIG

No iMX platforms have supported ATAG-based booting. They have however
re-used the CONFIG_SERIAL_TAG option as a way to enable support of
reading the OTP fuses and setting the serial# environment variable in
some cases. Change the warp7 support to use this symbol, use this for
updating the rest of the imx7 code, and update the imx8 conditionals.

Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: NXP i.MX U-Boot Team <uboot-imx@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>

# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>

# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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

# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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

# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>

# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>

# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>

# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>

# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>

# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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

# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>

# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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

# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>

# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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

# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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

# 2fdb1a1d 18-Oct-2018 Anatolij Gustschin <agust@denx.de>

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>

# 70b4b49b 18-Oct-2018 Anatolij Gustschin <agust@denx.de>

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>

# 1ef20a3d 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# 930b5952 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# c1aae21d 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# 8aa1505b 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# 60d33fcd 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# e8cd1f60 15-Jun-2023 Ye Li <ye.li@nxp.com>

imx: imx8: bootaux: Add i.MX8 M4 boot support

1. Implement bootaux for the M4 boot on i.MX8QM and QXP. Users need to download
M4 image to any DDR address first. Then use the
"bootaux <M4 download DDR address> [M4 core id]" to boot CM4_0
or CM4_1, the default core id is 0 for CM4_0.

Since current M4 only supports running in TCM. The bootaux will copy
the M4 image from DDR to its TCML.

2. Implment bootaux for HIFI on QXP
command: bootaux 0x81000000 1

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# dd654caa 15-Jun-2023 Peng Fan <peng.fan@nxp.com>

imx: mach: correct SCU API usage

The return value is int type, not sc_err_t(u8), correct the usage.

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

# 99ac6c76 27-Apr-2023 Peng Fan <peng.fan@nxp.com>

imx: move imx8 sci header file to include/firmware/imx

Move imx8 sci header file to include/firmware/imx, then we could
use build macro to reuse some i.MX8 drivers for i.MX9, such as
drivers/cpu/imx8_cpu.c.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Stefano Babic <sbabic@denx.de>

# 55171aed 04-May-2023 Simon Glass <sjg@chromium.org>

dm: Emit the arch_cpu_init_dm() even only before relocation

The original function was only called once, before relocation. The new
one is called again after relocation. This was not the intent of the
original call. Fix this by renaming and updating the calling logic.

With this, chromebook_link64 makes it through SPL.

Fixes: 7fe32b3442f0 ("event: Convert arch_cpu_init_dm() to use events")
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 98463903 20-Oct-2022 Simon Glass <sjg@chromium.org>

Rename CONFIG_SYS_TEXT_BASE to CONFIG_TEXT_BASE

The current name is inconsistent with SPL which uses CONFIG_SPL_TEXT_BASE
and this makes it imposible to use CONFIG_VAL().

Rename it to resolve this problem.

Signed-off-by: Simon Glass <sjg@chromium.org>

# cda8f873 11-May-2022 Ye Li <ye.li@nxp.com>

caam: Fix crash in case caam_jr_probe failed

If probing caam_jr returns failure, the variable "dev" will not be
initialized, so we can't use dev->name for the error print.
Otherwise it will cause crash.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Gaurav Jain <gaurav.jain@nxp.com>

# cb5d0419 24-Mar-2022 Gaurav Jain <gaurav.jain@nxp.com>

crypto/fsl: i.MX8: Enable Job ring driver model.

i.MX8(QM/QXP) - added support for JR driver model.
sec is initialized based on job ring information processed
from device tree.

Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# 7fe32b34 04-Mar-2022 Simon Glass <sjg@chromium.org>

event: Convert arch_cpu_init_dm() to use events

Instead of a special function, send an event after driver model is inited
and adjust the boards which use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b9d66a06 30-Aug-2021 Tom Rini <trini@konsulko.com>

imx: Convert SERIAL_TAG support to ENV_VARS_UBOOT_RUNTIME_CONFIG

No iMX platforms have supported ATAG-based booting. They have however
re-used the CONFIG_SERIAL_TAG option as a way to enable support of
reading the OTP fuses and setting the serial# environment variable in
some cases. Change the warp7 support to use this symbol, use this for
updating the rest of the imx7 code, and update the imx8 conditionals.

Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: NXP i.MX U-Boot Team <uboot-imx@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>

# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>

# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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

# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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

# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>

# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>

# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>

# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>

# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>

# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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

# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>

# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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

# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>

# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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

# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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

# 2fdb1a1d 18-Oct-2018 Anatolij Gustschin <agust@denx.de>

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>

# 70b4b49b 18-Oct-2018 Anatolij Gustschin <agust@denx.de>

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>

# 1ef20a3d 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# 930b5952 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# c1aae21d 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# 8aa1505b 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# 60d33fcd 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# 99ac6c76 27-Apr-2023 Peng Fan <peng.fan@nxp.com>

imx: move imx8 sci header file to include/firmware/imx

Move imx8 sci header file to include/firmware/imx, then we could
use build macro to reuse some i.MX8 drivers for i.MX9, such as
drivers/cpu/imx8_cpu.c.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Stefano Babic <sbabic@denx.de>

# 55171aed 04-May-2023 Simon Glass <sjg@chromium.org>

dm: Emit the arch_cpu_init_dm() even only before relocation

The original function was only called once, before relocation. The new
one is called again after relocation. This was not the intent of the
original call. Fix this by renaming and updating the calling logic.

With this, chromebook_link64 makes it through SPL.

Fixes: 7fe32b3442f0 ("event: Convert arch_cpu_init_dm() to use events")
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 98463903 20-Oct-2022 Simon Glass <sjg@chromium.org>

Rename CONFIG_SYS_TEXT_BASE to CONFIG_TEXT_BASE

The current name is inconsistent with SPL which uses CONFIG_SPL_TEXT_BASE
and this makes it imposible to use CONFIG_VAL().

Rename it to resolve this problem.

Signed-off-by: Simon Glass <sjg@chromium.org>

# cda8f873 11-May-2022 Ye Li <ye.li@nxp.com>

caam: Fix crash in case caam_jr_probe failed

If probing caam_jr returns failure, the variable "dev" will not be
initialized, so we can't use dev->name for the error print.
Otherwise it will cause crash.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Gaurav Jain <gaurav.jain@nxp.com>

# cb5d0419 24-Mar-2022 Gaurav Jain <gaurav.jain@nxp.com>

crypto/fsl: i.MX8: Enable Job ring driver model.

i.MX8(QM/QXP) - added support for JR driver model.
sec is initialized based on job ring information processed
from device tree.

Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# 7fe32b34 04-Mar-2022 Simon Glass <sjg@chromium.org>

event: Convert arch_cpu_init_dm() to use events

Instead of a special function, send an event after driver model is inited
and adjust the boards which use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b9d66a06 30-Aug-2021 Tom Rini <trini@konsulko.com>

imx: Convert SERIAL_TAG support to ENV_VARS_UBOOT_RUNTIME_CONFIG

No iMX platforms have supported ATAG-based booting. They have however
re-used the CONFIG_SERIAL_TAG option as a way to enable support of
reading the OTP fuses and setting the serial# environment variable in
some cases. Change the warp7 support to use this symbol, use this for
updating the rest of the imx7 code, and update the imx8 conditionals.

Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: NXP i.MX U-Boot Team <uboot-imx@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>

# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>

# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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

# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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

# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>

# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>

# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>

# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>

# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>

# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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

# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>

# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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

# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>

# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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

# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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

# 2fdb1a1d 18-Oct-2018 Anatolij Gustschin <agust@denx.de>

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>

# 70b4b49b 18-Oct-2018 Anatolij Gustschin <agust@denx.de>

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>

# 1ef20a3d 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# 930b5952 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# c1aae21d 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# 8aa1505b 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# 60d33fcd 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# 98463903 20-Oct-2022 Simon Glass <sjg@chromium.org>

Rename CONFIG_SYS_TEXT_BASE to CONFIG_TEXT_BASE

The current name is inconsistent with SPL which uses CONFIG_SPL_TEXT_BASE
and this makes it imposible to use CONFIG_VAL().

Rename it to resolve this problem.

Signed-off-by: Simon Glass <sjg@chromium.org>

# cda8f873 11-May-2022 Ye Li <ye.li@nxp.com>

caam: Fix crash in case caam_jr_probe failed

If probing caam_jr returns failure, the variable "dev" will not be
initialized, so we can't use dev->name for the error print.
Otherwise it will cause crash.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Gaurav Jain <gaurav.jain@nxp.com>

# cb5d0419 24-Mar-2022 Gaurav Jain <gaurav.jain@nxp.com>

crypto/fsl: i.MX8: Enable Job ring driver model.

i.MX8(QM/QXP) - added support for JR driver model.
sec is initialized based on job ring information processed
from device tree.

Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# 7fe32b34 04-Mar-2022 Simon Glass <sjg@chromium.org>

event: Convert arch_cpu_init_dm() to use events

Instead of a special function, send an event after driver model is inited
and adjust the boards which use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b9d66a06 30-Aug-2021 Tom Rini <trini@konsulko.com>

imx: Convert SERIAL_TAG support to ENV_VARS_UBOOT_RUNTIME_CONFIG

No iMX platforms have supported ATAG-based booting. They have however
re-used the CONFIG_SERIAL_TAG option as a way to enable support of
reading the OTP fuses and setting the serial# environment variable in
some cases. Change the warp7 support to use this symbol, use this for
updating the rest of the imx7 code, and update the imx8 conditionals.

Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: NXP i.MX U-Boot Team <uboot-imx@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>

# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>

# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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

# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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

# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>

# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>

# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>

# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>

# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>

# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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

# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>

# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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

# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>

# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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

# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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

# 2fdb1a1d 18-Oct-2018 Anatolij Gustschin <agust@denx.de>

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>

# 70b4b49b 18-Oct-2018 Anatolij Gustschin <agust@denx.de>

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>

# 1ef20a3d 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# 930b5952 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# c1aae21d 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# 8aa1505b 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# 60d33fcd 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# cda8f873 11-May-2022 Ye Li <ye.li@nxp.com>

caam: Fix crash in case caam_jr_probe failed

If probing caam_jr returns failure, the variable "dev" will not be
initialized, so we can't use dev->name for the error print.
Otherwise it will cause crash.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Gaurav Jain <gaurav.jain@nxp.com>

# cb5d0419 24-Mar-2022 Gaurav Jain <gaurav.jain@nxp.com>

crypto/fsl: i.MX8: Enable Job ring driver model.

i.MX8(QM/QXP) - added support for JR driver model.
sec is initialized based on job ring information processed
from device tree.

Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# 7fe32b34 04-Mar-2022 Simon Glass <sjg@chromium.org>

event: Convert arch_cpu_init_dm() to use events

Instead of a special function, send an event after driver model is inited
and adjust the boards which use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b9d66a06 30-Aug-2021 Tom Rini <trini@konsulko.com>

imx: Convert SERIAL_TAG support to ENV_VARS_UBOOT_RUNTIME_CONFIG

No iMX platforms have supported ATAG-based booting. They have however
re-used the CONFIG_SERIAL_TAG option as a way to enable support of
reading the OTP fuses and setting the serial# environment variable in
some cases. Change the warp7 support to use this symbol, use this for
updating the rest of the imx7 code, and update the imx8 conditionals.

Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: NXP i.MX U-Boot Team <uboot-imx@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>

# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>

# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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

# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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

# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>

# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>

# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>

# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>

# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>

# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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

# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>

# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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

# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>

# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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

# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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

# 2fdb1a1d 18-Oct-2018 Anatolij Gustschin <agust@denx.de>

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>

# 70b4b49b 18-Oct-2018 Anatolij Gustschin <agust@denx.de>

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>

# 1ef20a3d 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# 930b5952 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# c1aae21d 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# 8aa1505b 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# 60d33fcd 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# cb5d0419 24-Mar-2022 Gaurav Jain <gaurav.jain@nxp.com>

crypto/fsl: i.MX8: Enable Job ring driver model.

i.MX8(QM/QXP) - added support for JR driver model.
sec is initialized based on job ring information processed
from device tree.

Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>

# 7fe32b34 04-Mar-2022 Simon Glass <sjg@chromium.org>

event: Convert arch_cpu_init_dm() to use events

Instead of a special function, send an event after driver model is inited
and adjust the boards which use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b9d66a06 30-Aug-2021 Tom Rini <trini@konsulko.com>

imx: Convert SERIAL_TAG support to ENV_VARS_UBOOT_RUNTIME_CONFIG

No iMX platforms have supported ATAG-based booting. They have however
re-used the CONFIG_SERIAL_TAG option as a way to enable support of
reading the OTP fuses and setting the serial# environment variable in
some cases. Change the warp7 support to use this symbol, use this for
updating the rest of the imx7 code, and update the imx8 conditionals.

Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: NXP i.MX U-Boot Team <uboot-imx@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>

# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>

# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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

# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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

# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>

# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>

# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>

# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>

# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>

# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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

# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>

# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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

# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>

# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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

# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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

# 2fdb1a1d 18-Oct-2018 Anatolij Gustschin <agust@denx.de>

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>

# 70b4b49b 18-Oct-2018 Anatolij Gustschin <agust@denx.de>

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>

# 1ef20a3d 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# 930b5952 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# c1aae21d 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# 8aa1505b 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# 60d33fcd 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# 7fe32b34 04-Mar-2022 Simon Glass <sjg@chromium.org>

event: Convert arch_cpu_init_dm() to use events

Instead of a special function, send an event after driver model is inited
and adjust the boards which use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>

# b9d66a06 30-Aug-2021 Tom Rini <trini@konsulko.com>

imx: Convert SERIAL_TAG support to ENV_VARS_UBOOT_RUNTIME_CONFIG

No iMX platforms have supported ATAG-based booting. They have however
re-used the CONFIG_SERIAL_TAG option as a way to enable support of
reading the OTP fuses and setting the serial# environment variable in
some cases. Change the warp7 support to use this symbol, use this for
updating the rest of the imx7 code, and update the imx8 conditionals.

Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: NXP i.MX U-Boot Team <uboot-imx@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>

# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>

# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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

# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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

# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>

# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>

# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>

# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>

# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>

# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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

# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>

# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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

# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>

# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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

# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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

# 2fdb1a1d 18-Oct-2018 Anatolij Gustschin <agust@denx.de>

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>

# 70b4b49b 18-Oct-2018 Anatolij Gustschin <agust@denx.de>

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>

# 1ef20a3d 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# 930b5952 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# c1aae21d 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# 8aa1505b 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# 60d33fcd 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# b9d66a06 30-Aug-2021 Tom Rini <trini@konsulko.com>

imx: Convert SERIAL_TAG support to ENV_VARS_UBOOT_RUNTIME_CONFIG

No iMX platforms have supported ATAG-based booting. They have however
re-used the CONFIG_SERIAL_TAG option as a way to enable support of
reading the OTP fuses and setting the serial# environment variable in
some cases. Change the warp7 support to use this symbol, use this for
updating the rest of the imx7 code, and update the imx8 conditionals.

Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: NXP i.MX U-Boot Team <uboot-imx@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>

# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>

# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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

# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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

# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>

# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>

# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>

# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>

# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>

# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>

# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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

# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>

# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>

# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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

# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>

# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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

# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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

# 2fdb1a1d 18-Oct-2018 Anatolij Gustschin <agust@denx.de>

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>

# 70b4b49b 18-Oct-2018 Anatolij Gustschin <agust@denx.de>

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>

# 1ef20a3d 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# 930b5952 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# c1aae21d 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# 8aa1505b 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# 60d33fcd 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>

# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 401d1c4f 30-Oct-2020 Simon Glass <sjg@chromium.org>

common: Drop asm/global_data.h from common header

Move this out of the common header and include it only where needed. In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly. Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

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


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

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


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

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


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

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


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

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


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

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


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 2f36a693 22-Oct-2020 Marcel Ziswiler <marcel.ziswiler@toradex.com>

imx8: allow overriding memory layout

Introduce weak function board_mem_get_layout() which allows overriding
the memory layout from board code in runtime, useful for handling
different SKU versions.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# f7ae49fc 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop log.h from common header

Move this header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 90526e9f 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop net.h from common header

Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# ed5b253d 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: check whether m4 partition booted

Add code to check m4 partition booted or not, we will use this
to runtime set device tree file that passed to Linux Kernel.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 42b26ddc 05-May-2020 Ye Li <ye.li@nxp.com>

imx8: Select boot device dynamically

For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6aead233 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section
for partition reboot. It adds a new section in image for saving
data section. When from cold boot, the data section will be saved
to that new section at SPL early phase. When from partition reboot,
the data section will be restored from the new section.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 81037672 05-May-2020 Peng Fan <peng.fan@nxp.com>

imx: imx8qm/qxp: add get_board_serial

Add get_board_serial support, the info could be got from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 7c351ff5 05-May-2020 Ye Li <ye.li@nxp.com>

imx: imx8qm/qxp: Fix issue in get_effective_memsize

When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff,
the get_effective_memsize does not return correct memory size.
There is a check in get_effective_memsize to find the memreg where
the u-boot is running, and return the size of that memreg as the result
of get_effective_memsize. When using aligned start, the value is
0x80200000 since it is 2MB aligned. Thus the finding of memreg will
fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is
0x80020000. This cause u-boot is relocated to the high memory where has
been occupied by Trusty OS.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 6fcb2ee7 04-May-2020 Leonard Crestez <leonard.crestez@nxp.com>

imx8: Replace SC_R_LAST with SC_R_NONE in DTB

We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 91527c9a 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9b4a205f 28-Dec-2019 Simon Glass <sjg@chromium.org>

common: Move RAM-sizing functions to init.h

These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 9edefc27 14-Nov-2019 Simon Glass <sjg@chromium.org>

common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# bae4e8cb 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 43c50873 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# 8f99438b 26-Aug-2019 Peng Fan <peng.fan@nxp.com>

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>


# bcf94abd 26-Aug-2019 Ye Li <ye.li@nxp.com>

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>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1796e509 25-Apr-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: get temperature when print cpu desc

Read the temperature when print cpu inforation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 1da39d3c 31-May-2019 Marcel Ziswiler <marcel@ziswiler.com>

imx8qm: fix cpu frequency reporting

CPU frequency reporting failed with the following error message being
printed:

sc_pm_get_clock_rate: resource:507 clk:2: res:3
Could not read CPU frequency: -22
CPU: NXP i.MX8QM RevB A53 at 0 MHz

Fix this by differentiating between the A35 as found on the i.MX 8QXP
and the A53 as found on the i.MX 8QM SoCs.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Max Krummenacher <max.krummenacher@toradex.com>


# 10015025 03-May-2019 Trevor Woerner <trevor@toganlabs.com>

CONFIG_SPL_SYS_[DI]CACHE_OFF: add

While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances
where these configuration items are conditional on SPL. This commit adds SPL
variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates
the configurations as required.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
[trini: Make the default depend on the setting for full U-Boot, update
more zynq hardware]
Signed-off-by: Tom Rini <trini@konsulko.com>


# 7f50af60 04-Mar-2019 Peng Fan <peng.fan@nxp.com>

imx8: add cpu support

Add cpu type and Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 75cd09cb 05-Feb-2019 Fabio Estevam <festevam@gmail.com>

imx8qxp: Fix the reported CPU frequency

Currently the CPU frequency is incorrectly reported:

CPU: NXP i.MX8QXP RevB A35 at 147228 MHz

Fix this problem by using a direct call to the SCU firmware to
retrieve the Cortex A35 CPU frequency.

With this change applied the CPU frequency is displayed correctly:

CPU: NXP i.MX8QXP RevB A35 at 1200 MHz

Tested-by: Marcelo Macedo <marcelo.macedo@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Andrejs Cainikovs <andrejs.cainikovs@netmodule.com>


# 9382f73b 18-Jan-2019 Peng Fan <peng.fan@nxp.com>

imx8: cpu: restrict checking ROM passover info for revA

Passover info only for revA.

move get_cpu_rev out of CONFIG_CPU to avoid build failure when using
get_cpu_rev in SPL.
Add a CONFIG_SPL_BUILD for passover usage, no need to execute it again
in normal U-Boot stage. Also if still checking passover info in normal
U-Boot stage, need to make the passover code executed after
arch_cpu_init_dm.
So to make it easy and clean, only execute the code for SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# da72574b 14-Dec-2018 Peng Fan <peng.fan@nxp.com>

imx8: cpu: correct info

The CPU banner printed is as following:
CPU: CPU: Freescale i.MX8QXP RevB A35 at 147228 MHz

1. Drop the CPU:
2. Change vendor from Freescale to NXP

Signed-off-by: Peng Fan <peng.fan@nxp.com>


# 2fdb1a1d 18-Oct-2018 Anatolij Gustschin <agust@denx.de>

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>


# 70b4b49b 18-Oct-2018 Anatolij Gustschin <agust@denx.de>

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>


# 1ef20a3d 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>


# 930b5952 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>


# c1aae21d 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>


# 8aa1505b 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>


# 60d33fcd 18-Oct-2018 Peng Fan <peng.fan@nxp.com>

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>