platform/kernel/u-boot.git
3 years agotools: socfpgaimage: update padding flow
Ley Foon Tan [Wed, 13 Jan 2021 10:53:05 +0000 (18:53 +0800)]
tools: socfpgaimage: update padding flow

The existing socfpgaimage always pads the image to the maximum size of
OCRAM size. This will break in the encryption flow where it expects the
image to be un-padded. The encryption tool will do the encryption for
the whole image and append the signature key at end of the image.
The signature key will append to beyond the size of OCRAM if the image
is padded with the maximum size before encryption.

Move the padding step from socfpgaimage to Makefile and pads with objcopy
command.

socfpgaimage will pad the image with 16 bytes aligned (including CRC word),
this is a requirement in encryption flow.

Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
3 years agoconfigs: socfpga: Add CONFIG_SPL_PAD_TO
Ley Foon Tan [Tue, 22 Dec 2020 01:53:25 +0000 (09:53 +0800)]
configs: socfpga: Add CONFIG_SPL_PAD_TO

Add CONFIG_SPL_PAD_TO for Gen5 and Arria 10. CONFIG_SPL_PAD_TO is set to
size of OCRAM.

This is preparation for image padding change in socfpgaimage.

Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
3 years agotools: socfpgaimage: Print image header information
Ley Foon Tan [Fri, 11 Dec 2020 06:46:47 +0000 (14:46 +0800)]
tools: socfpgaimage: Print image header information

Print image header information if the header is verified.

Example output from mkimage "-l" option:

$ ./tools/mkimage -l spl/u-boot-spl.sfp
Image Type      : Cyclone V / Arria V SoC Image
Validation word : 0x31305341
Version         : 0x00000000
Flags           : 0x00000000
Program length  : 0x00003a59
Header checksum : 0x00000188

$ ./tools/mkimage -l spl/u-boot-spl.sfp
Image Type      : Arria 10 SoC Image
Validation word : 0x31305341
Version         : 0x00000001
Flags           : 0x00000000
Header length   : 0x00000014
Program length  : 0x000138e0
Program entry   : 0x00000014
Header checksum : 0x00000237

Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
3 years agoconfigs: socfpga: Add defconfig for Agilex and Stratix 10 with ATF support
Chee Hong Ang [Thu, 24 Dec 2020 10:21:13 +0000 (18:21 +0800)]
configs: socfpga: Add defconfig for Agilex and Stratix 10 with ATF support

Booting Agilex and Stratix 10 with ATF support.

SPL now loads ATF (BL31), U-Boot proper and DTB from FIT
image. The new boot flow with ATF support is as follow:

SPL -> ATF (BL31) -> U-Boot proper -> OS (Linux)

U-Boot proper now starts at 0x200000 (CONFIG_SYS_TEXT_BASE).
ATF will occupy the address range starting from 0x1000.

Signed-off-by: Chee Hong Ang <chee.hong.ang@intel.com>
Signed-off-by: Siew Chin Lim <elly.siew.chin.lim@intel.com>
3 years agoarm: socfpga: soc64: Enable FIT image generation using binman
Siew Chin Lim [Thu, 24 Dec 2020 10:21:12 +0000 (18:21 +0800)]
arm: socfpga: soc64: Enable FIT image generation using binman

Enable BINMAN when using Arm-Trusted-Firmware (ATF) to
generate FIT images.

Signed-off-by: Siew Chin Lim <elly.siew.chin.lim@intel.com>
3 years agoarm: socfpga: dts: soc64: Add binman node of FIT image with ATF support
Siew Chin Lim [Thu, 24 Dec 2020 10:21:11 +0000 (18:21 +0800)]
arm: socfpga: dts: soc64: Add binman node of FIT image with ATF support

Add binman node to device tree to generate the FIT image for u-boot
(u-boot.itb) and OS kernel (kernel.itb).

u-boot.itb contains arm trusted firmware (ATF), u-boot proper and
u-boot device tree for ATF u-boot flow.

kernel.itb contains Linux Image and Linux device tree.

Signed-off-by: Siew Chin Lim <elly.siew.chin.lim@intel.com>
3 years agoarm: socfpga: soc64: Skip handoff data access in SSBL
Chee Hong Ang [Thu, 24 Dec 2020 10:21:10 +0000 (18:21 +0800)]
arm: socfpga: soc64: Skip handoff data access in SSBL

SPL already setup the Clock Manager with the handoff data
from OCRAM. When the Clock Manager's driver get probed again
in SSBL, it shall skip the handoff data access in OCRAM.

Signed-off-by: Chee Hong Ang <chee.hong.ang@intel.com>
3 years agoarm: socfpga: soc64: SSBL shall not setup stack on OCRAM
Chee Hong Ang [Thu, 24 Dec 2020 10:21:09 +0000 (18:21 +0800)]
arm: socfpga: soc64: SSBL shall not setup stack on OCRAM

Since SSBL is running in DRAM, it shall setup the stack in DRAM
instead of OCRAM which is occupied by SPL and handoff data.

Signed-off-by: Chee Hong Ang <chee.hong.ang@intel.com>
3 years agoarm: socfpga: mailbox: Add 'SYSTEM_RESET' PSCI support to mbox_reset_cold()
Chee Hong Ang [Thu, 24 Dec 2020 10:21:08 +0000 (18:21 +0800)]
arm: socfpga: mailbox: Add 'SYSTEM_RESET' PSCI support to mbox_reset_cold()

mbox_reset_cold() will invoke ATF's PSCI service when running in
non-secure mode (EL2).

Signed-off-by: Chee Hong Ang <chee.hong.ang@intel.com>
3 years agoarm: socfpga: soc64: Add ATF support for FPGA reconfig driver
Chee Hong Ang [Thu, 24 Dec 2020 10:21:07 +0000 (18:21 +0800)]
arm: socfpga: soc64: Add ATF support for FPGA reconfig driver

In non-secure mode (EL2), FPGA reconfiguration driver calls the
SMC/PSCI services provided by ATF to configure the FPGA.

Signed-off-by: Chee Hong Ang <chee.hong.ang@intel.com>
3 years agoarm: socfpga: soc64: Add ATF support for Reset Manager driver
Chee Hong Ang [Thu, 24 Dec 2020 10:21:06 +0000 (18:21 +0800)]
arm: socfpga: soc64: Add ATF support for Reset Manager driver

In non-secure mode (EL2), Reset Manager driver calls the
SMC/PSCI service provided by ATF to enable/disable the
SOCFPGA bridges.

Signed-off-by: Chee Hong Ang <chee.hong.ang@intel.com>
Signed-off-by: Siew Chin Lim <elly.siew.chin.lim@intel.com>
3 years agonet: designware: socfpga: Add ATF support for MAC driver
Chee Hong Ang [Thu, 24 Dec 2020 10:21:05 +0000 (18:21 +0800)]
net: designware: socfpga: Add ATF support for MAC driver

In non-secure mode (EL2), MAC driver calls the SMC/PSCI services
provided by ATF to setup the PHY interface.

Signed-off-by: Chee Hong Ang <chee.hong.ang@intel.com>
Signed-off-by: Siew Chin Lim <elly.siew.chin.lim@intel.com>
3 years agommc: dwmmc: socfpga: Add ATF support for MMC driver
Chee Hong Ang [Thu, 24 Dec 2020 10:21:04 +0000 (18:21 +0800)]
mmc: dwmmc: socfpga: Add ATF support for MMC driver

In non-secure mode (EL2), MMC driver calls the SMC/PSCI services
provided by ATF to set SDMMC's DRVSEL and SMPLSEL.

Signed-off-by: Chee Hong Ang <chee.hong.ang@intel.com>
Signed-off-by: Siew Chin Lim <elly.siew.chin.lim@intel.com>
3 years agommc: dwmmc: Change designware MMC 'clksel' callback function to return status
Siew Chin Lim [Thu, 24 Dec 2020 10:21:03 +0000 (18:21 +0800)]
mmc: dwmmc: Change designware MMC 'clksel' callback function to return status

Change 'clksel' callback function to allow the code to return a
status.

This patch is a preparation for enabling Arm-Trusted-Firmware (ATF)
in Intel SoC FPGA. This patch does not change functionality.

When using Arm-Trusted-Firmware (ATF) in Intel SoC FPGA, the MMC clock
related register is secure register which is required to be written
via SMC/PCSI call. It is possible that U-Boot fail to write the
register if there is unexpected error between U-Boot and ATF.
As a result, there maybe signal integrity on MMC connection due to
clock. So, the code should reports error to user when 'clksel' fail.

Signed-off-by: Siew Chin Lim <elly.siew.chin.lim@intel.com>
3 years agoarm: socfpga: Add secure register access helper functions for SoC 64bits
Siew Chin Lim [Thu, 24 Dec 2020 10:21:02 +0000 (18:21 +0800)]
arm: socfpga: Add secure register access helper functions for SoC 64bits

These secure register access functions allow U-Boot proper running
at EL2 (non-secure) to access System Manager's secure registers
by calling the ATF's PSCI runtime services (EL3/secure).

Signed-off-by: Siew Chin Lim <elly.siew.chin.lim@intel.com>
Reviewed-by: Ley Foon Tan <ley.foon.tan@intel.com>
3 years agoarm: socfpga: soc64: Define SMC function identifiers for PSCI SiP services
Chee Hong Ang [Thu, 24 Dec 2020 10:21:01 +0000 (18:21 +0800)]
arm: socfpga: soc64: Define SMC function identifiers for PSCI SiP services

This header file defines the Secure Monitor Call (SMC) message
protocol for ATF (BL31) PSCI runtime services. It includes all
the PSCI SiP function identifiers for the secure runtime services
provided by ATF. The secure runtime services include System Manager's
registers access, 2nd phase bitstream FPGA reconfiguration, Remote
System Update (RSU) and etc.

Signed-off-by: Chee Hong Ang <chee.hong.ang@intel.com>
Signed-off-by: Siew Chin Lim <elly.siew.chin.lim@intel.com>
3 years agoarm: socfpga: soc64: Add SMC helper function for Intel SOCFPGA (64bits)
Chee Hong Ang [Thu, 24 Dec 2020 10:21:00 +0000 (18:21 +0800)]
arm: socfpga: soc64: Add SMC helper function for Intel SOCFPGA (64bits)

invoke_smc() allow U-Boot proper running in non-secure mode (EL2)
to invoke SMC call to ATF's PSCI runtime services such as
System Manager's registers access, 2nd phase bitstream FPGA
reconfiguration, Remote System Update (RSU) and etc.

smc_send_mailbox() is a send mailbox command helper function which invokes
the ATF's PSCI runtime service (function ID: INTEL_SIP_SMC_MBOX_SEND_CMD)
to send mailbox messages to Secure Device Manager (SDM).

Signed-off-by: Chee Hong Ang <chee.hong.ang@intel.com>
3 years agoarm: socfpga: Disable "spin-table" method for booting Linux
Chee Hong Ang [Thu, 24 Dec 2020 10:20:59 +0000 (18:20 +0800)]
arm: socfpga: Disable "spin-table" method for booting Linux

Standard PSCI function "CPU_ON" provided by ATF is now used
by Linux kernel to bring up the secondary CPUs to enable SMP
booting in Linux on SoC 64bits platform.

Signed-off-by: Chee Hong Ang <chee.hong.ang@intel.com>
3 years agoarm: socfpga: soc64: Override 'lowlevel_init' to support ATF
Chee Hong Ang [Thu, 24 Dec 2020 10:20:58 +0000 (18:20 +0800)]
arm: socfpga: soc64: Override 'lowlevel_init' to support ATF

Override 'lowlevel_init' to make sure secondary CPUs trapped
in ATF instead of SPL. After ATF is initialized, it will signal
the secondary CPUs to jump from SPL to ATF waiting to be 'activated'
by Linux OS via PSCI call.

Signed-off-by: Chee Hong Ang <chee.hong.ang@intel.com>
3 years agoarm: socfpga: soc64: Load FIT image with ATF support
Chee Hong Ang [Thu, 24 Dec 2020 10:20:57 +0000 (18:20 +0800)]
arm: socfpga: soc64: Load FIT image with ATF support

Instead of loading u-boot proper image (u-boot.img), SPL
now loads FIT image (u-boot.itb) which includes u-boot
proper, ATF and u-boot proper's DTB.

For OS, u-boot now loads FIT images (kernel.itb) which
includes Linux Image and Linux's DTB.

Signed-off-by: Chee Hong Ang <chee.hong.ang@intel.com>
Signed-off-by: Siew Chin Lim <elly.siew.chin.lim@intel.com>
3 years agoarm: socfpga: Add function for checking description from FIT image
Chee Hong Ang [Thu, 24 Dec 2020 10:20:56 +0000 (18:20 +0800)]
arm: socfpga: Add function for checking description from FIT image

Add board_fit_config_name_match() for matching board name with
device tree files in FIT image. This will ensure correct DTB
file is loaded for different board type. Currently, we are not
supporting multiple device tree files in FIT image therefore this
function basically do nothing for now.
Users are allowed to override this 'weak' function in their
specific board implementation.

Signed-off-by: Chee Hong Ang <chee.hong.ang@intel.com>
3 years agoMerge tag 'u-boot-stm32-20210113' of https://gitlab.denx.de/u-boot/custodians/u-boot-stm
Tom Rini [Wed, 13 Jan 2021 20:00:53 +0000 (15:00 -0500)]
Merge tag 'u-boot-stm32-20210113' of https://gitlab.denx.de/u-boot/custodians/u-boot-stm

- Enable logging features for stm32mp15 boards
- Update MAINTAINERS emails for STI and STM32
- Activate OF_LIVE for ST stm32mp15 boards
- Switch to MCO2 for PHY 50 MHz clock for DHCOM boards
- Correction in stm32prog command on uart: always flush DFU on start command
- Update USB-C power detection algorithm on DK boards

3 years agoMerge tag 'u-boot-amlogic-20210112' of https://gitlab.denx.de/u-boot/custodians/u...
Tom Rini [Tue, 12 Jan 2021 20:46:52 +0000 (15:46 -0500)]
Merge tag 'u-boot-amlogic-20210112' of https://gitlab.denx.de/u-boot/custodians/u-boot-amlogic

- sync amlogic GX & AXG DT to Linux 5.10
- Add new MESON_EE driver support for GXBB & AXG
- Add support for Libretech-CC v2, Wetek Core2, Beelink GT-King/Pro boards
- add driver for TDO tl070wsh30 panel driver
- meson: isolate loading of socinfo
- Add soc_rev to environment
- Enable G12A support for saradc
- Add correct mmcdev on VIM3(L) & Odroid-N2(C4)
- Read MAC from fuses for VIM3 & VIM3L boards

3 years agoMAINTAINERS: Update STi and STM32 maintainers emails in remaining files
Patrice Chotard [Mon, 4 Jan 2021 16:00:56 +0000 (17:00 +0100)]
MAINTAINERS: Update STi and STM32 maintainers emails in remaining files

A previous series already update STMicroelectronics emails maintainers
but some files have been omitted (Makefile, .dts, .dtsi and .rst files).
Update Patrick and my email address with the one dedicated to upstream
activities.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
3 years agoarm: stm32mp: stm32prog: always flush DFU on start command for uart
Patrick Delaunay [Fri, 11 Dec 2020 12:36:18 +0000 (13:36 +0100)]
arm: stm32mp: stm32prog: always flush DFU on start command for uart

Remove the test on data->dfu_seq, because dfu_seq=0 not only when
the DFU is not started (mask with 0xffff). This flush is mandatory
as the final treatment, common with USB, is done in DFU callback.

This patch avoids issue if the received length is a multiple of
the DFU packet.

For example if size of bootfs partition is egual to 0x4000000,
data->dfu_seq=0 at the end of the partition, the flush it not
requested and the phase is not increased in the callback.
U-Boot continue to request the bootfs in the next GetPhase command.

Fixes: 468f0508b58b ("stm32mp: stm32prog: add serial link support")
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 years agoconfigs: stm32mp1: activate OF_LIVE for DT live support
Patrick Delaunay [Fri, 11 Dec 2020 14:32:30 +0000 (15:32 +0100)]
configs: stm32mp1: activate OF_LIVE for DT live support

Activate the live DT to reduce the DT parsing time.

For example the boot time is reduced by 200ms on STM32MP157C-EV1 board
for stm32mp15_basic_defconfig (boot with SPL) or
stm32mp15_trusted_defconfig (boot with TF-A).

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
3 years agoARM: dts: stm32: Switch to MCO2 for PHY 50 MHz clock
Marek Vasut [Tue, 1 Dec 2020 10:34:48 +0000 (11:34 +0100)]
ARM: dts: stm32: Switch to MCO2 for PHY 50 MHz clock

The LAN8710i PHY currently uses 50 MHz clock direct from PLL4P.
To permit PLL4P to run at faster frequency, use MCO2 as a divider.
The PLL4P runs at 100 MHz, supplies MCO2 which divides it by 2 to
50MHz, and supplies the PHY with 50 MHz via pin PG2. The feedback
clock are fed back in via pin PA1.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Patrice Chotard <patrice.chotard@st.com>
Cc: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Ia9bf7119785d49b633a3ae761c3dc4a30b92628a

3 years agoARM: stm32: Use firmware property instead of loadables
Michal Simek [Mon, 5 Oct 2020 09:37:00 +0000 (11:37 +0200)]
ARM: stm32: Use firmware property instead of loadables

There shouldn't be a need to use loadables propertyn because u-boot can be
pointed by firmware property. This change should also speedup boot process
because loadables property is list of strings which code is going through.
On the other hand firmware can just point to one image.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
3 years agoboard: stm32pm1: update USB-C power detection algorithm on DK boards
Patrice Chotard [Fri, 16 Oct 2020 07:28:59 +0000 (09:28 +0200)]
board: stm32pm1: update USB-C power detection algorithm on DK boards

USB-C power supply which are Power Delivery compliant (USB-PD) are able
to provide different voltage/current (for example 5V/3A 9V/3A 12V/2.25A...)

In this case, the power supply need to negotiate the voltage/current to
use with the device using CC1/CC2 USB-C signals.

If this negotiation occurs during ADC measurement (done also on CC1/CC2
USB-C signals) some ADC acquisition can be corrupted which cause wrong
power supply current detection.

To avoid this, the power supply current detection algorithm is updated
as following:
  - perform an ADC measurement, if a 3A current is detected, continue the
    boot process.
  - else, wait 20ms (max tPDDebounce duration) to ensure that USB-PD
    negotiation is done and perform another ADC measurement.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
3 years agoconfigs: stm32mp15: enable LOG features
Patrick Delaunay [Fri, 6 Nov 2020 18:02:01 +0000 (19:02 +0100)]
configs: stm32mp15: enable LOG features

Activate the logging features in SPL and U-Boot
(CONFIG_LOG and CONFIG_SPL_LOG) and the command 'log' with
CONFIG_CMD_LOG.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
3 years agoboard: st: common: migrate trace to dev and log macro
Patrick Delaunay [Fri, 6 Nov 2020 18:02:00 +0000 (19:02 +0100)]
board: st: common: migrate trace to dev and log macro

Change pr_* to dev_ or log_ macro and define LOG_CATEGORY.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
3 years agoboard: st: stm32mp1: migrate trace to dev and log macro
Patrick Delaunay [Fri, 6 Nov 2020 18:01:59 +0000 (19:01 +0100)]
board: st: stm32mp1: migrate trace to dev and log macro

Change pr_* to dev_ or log_ macro and define LOG_CATEGORY.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
3 years agovideo: stm32_dsi: migrate trace to dev and log macro
Patrick Delaunay [Fri, 6 Nov 2020 18:01:58 +0000 (19:01 +0100)]
video: stm32_dsi: migrate trace to dev and log macro

Change pr_* to dev_ or log_ macro and define LOG_CATEGORY.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
3 years agovideo: stm32_ltdc: migrate trace to dev and log macro
Patrick Delaunay [Fri, 6 Nov 2020 18:01:57 +0000 (19:01 +0100)]
video: stm32_ltdc: migrate trace to dev and log macro

Change pr_* to dev_ or log_ macro and define LOG_CATEGORY.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
3 years agoserial: stm32: define LOG_CATEGORY
Patrick Delaunay [Fri, 6 Nov 2020 18:01:56 +0000 (19:01 +0100)]
serial: stm32: define LOG_CATEGORY

Define LOG_CATEGORY to allow filtering with log command.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
3 years agomemory: stm32-fmc2: migrate trace to dev and log macro
Patrick Delaunay [Fri, 6 Nov 2020 18:01:55 +0000 (19:01 +0100)]
memory: stm32-fmc2: migrate trace to dev and log macro

Change pr_* to dev_ or log_ macro and define LOG_CATEGORY.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
3 years agomtd: stm32_fmc2: migrate trace to dev and log macro
Patrick Delaunay [Fri, 6 Nov 2020 18:01:54 +0000 (19:01 +0100)]
mtd: stm32_fmc2: migrate trace to dev and log macro

Change pr_* to dev_ or log_ macro and define LOG_CATEGORY.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
3 years agospi: stm32_qspi: migrate trace to dev and log macro
Patrick Delaunay [Fri, 6 Nov 2020 18:01:53 +0000 (19:01 +0100)]
spi: stm32_qspi: migrate trace to dev and log macro

Change debug/pr_* to log_* or dev_* macro and define LOG_CATEGORY.

Remove the "%s:" __func__  header as it is managed by dev macro
(dev->name is displayed) or log macro (CONFIG_LOGF_FUNC).

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
3 years agospi: stm32_spi: migrate trace to dev and log macro
Patrick Delaunay [Fri, 6 Nov 2020 18:01:52 +0000 (19:01 +0100)]
spi: stm32_spi: migrate trace to dev and log macro

Change debug/pr_debug to log_debug or dev_dbg macro and
define LOG_CATEGORY.

Remove the "%s:" __func__  header as it is managed by dev macro
(dev->name is displayed) or log macro (CONFIG_LOGF_FUNC).

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
3 years agophy: stm32-usbphyc: migrate trace to dev and log macro
Patrick Delaunay [Fri, 6 Nov 2020 18:01:51 +0000 (19:01 +0100)]
phy: stm32-usbphyc: migrate trace to dev and log macro

Change pr_debug to log_debug or dev_dbg macro and define LOG_CATEGORY.

Remove the "%s:" __func__  header as it is managed by dev macro
(dev->name is displayed) or log macro (CONFIG_LOGF_FUNC).

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
3 years agoi2c: stm32f7_i2c: migrate trace to dev and log macro
Patrick Delaunay [Fri, 6 Nov 2020 18:01:50 +0000 (19:01 +0100)]
i2c: stm32f7_i2c: migrate trace to dev and log macro

Change debug to dev_dbg macro and define LOG_CATEGORY.

Remove the "%s:" __func__  header as it is managed by dev macro
(dev->name is displayed) or log macro (CONFIG_LOGF_FUNC).

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
3 years agomailbox: stm32-ipcc: migrate trace to dev and log macro
Patrick Delaunay [Fri, 6 Nov 2020 18:01:49 +0000 (19:01 +0100)]
mailbox: stm32-ipcc: migrate trace to dev and log macro

Change debug to dev_dbg macro and define LOG_CATEGORY.

Remove the "%s:" __func__  header as it is managed by dev macro
(dev->name is displayed) or log macro (CONFIG_LOGF_FUNC).

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
3 years agoreset: stm32-reset: migrate trace to dev and log macro
Patrick Delaunay [Fri, 6 Nov 2020 18:01:48 +0000 (19:01 +0100)]
reset: stm32-reset: migrate trace to dev and log macro

Change debug to dev_dbg macro and define LOG_CATEGORY.

Remove the "%s:" __func__  header as it is managed by dev macro
(dev->name is displayed).

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
3 years agoclk: clk_stm32h7: migrate trace to dev and log macro
Patrick Delaunay [Fri, 6 Nov 2020 18:01:47 +0000 (19:01 +0100)]
clk: clk_stm32h7: migrate trace to dev and log macro

Change debug and pr_ macro to dev macro and define LOG_CATEGORY.

Remove the "%s:" __func__  header as it is managed by dev macro
(dev->name is displayed) or log macro (CONFIG_LOGF_FUNC).

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
3 years agoclk: clk_stm32f: migrate trace to dev and log macro
Patrick Delaunay [Fri, 6 Nov 2020 18:01:46 +0000 (19:01 +0100)]
clk: clk_stm32f: migrate trace to dev and log macro

Change debug and pr_ macro to dev macro and define LOG_CATEGORY.

Remove the "%s:" __func__  header as it is managed by dev macro
(dev->name is displayed) or log macro (CONFIG_LOGF_FUNC).

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
3 years agoclk: stm32mp1: migrate trace to dev and log macro
Patrick Delaunay [Fri, 6 Nov 2020 18:01:45 +0000 (19:01 +0100)]
clk: stm32mp1: migrate trace to dev and log macro

Change debug and pr_ macro to dev macro and define LOG_CATEGORY.

Remove the "%s:" __func__  header as it is managed by dev macro
(dev->name is displayed) or log macro (CONFIG_LOGF_FUNC).

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
3 years agomisc: rcc: keep the rcc device name for subnode
Patrick Delaunay [Fri, 6 Nov 2020 18:01:44 +0000 (19:01 +0100)]
misc: rcc: keep the rcc device name for subnode

Update the name associated with the RCC drivers to avoid
duplicated name with the driver name.

With this patch the traces displayed with log macro provide a
correct device name.

The rcc device name before the patch is:

 Class     Index  Probed  Driver                Name
-----------------------------------------------------------
 root          0  [ + ]   root_driver           root_driver
 simple_bus    0  [ + ]   simple_bus            |-- soc
 (...)
 nop           0  [ + ]   stm32-rcc             |   |-- rcc@50000000
 clk           0  [ + ]   stm32mp1_clk          |   |   |-- stm32mp1_clk
 reset         0  [ + ]   stm32_rcc_reset       |   |   `-- stm32_rcc_reset

And they become:
 (...)
 nop           0  [ + ]   stm32-rcc             |   |-- rcc@50000000
 clk           0  [ + ]   stm32mp1_clk          |   |   |-- rcc@50000000
 reset         0  [ + ]   stm32_rcc_reset       |   |   `-- rcc@50000000

The traces is correct:
stm32mp1_clk rcc@stm32mp1_clk: .....
=>
stm32mp1_clk rcc@50000000: .....

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
3 years agomisc: rcc: migrate trace to dev macro
Patrick Delaunay [Fri, 6 Nov 2020 18:01:43 +0000 (19:01 +0100)]
misc: rcc: migrate trace to dev macro

Change debug and pr_err to dev macro and define LOG_CATEGORY.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
3 years agopower: regulator: stm32-verfbuf: define LOG_CATEGORY
Patrick Delaunay [Fri, 6 Nov 2020 18:01:42 +0000 (19:01 +0100)]
power: regulator: stm32-verfbuf: define LOG_CATEGORY

Define LOG_CATEGORY to allow filtering with log command.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
3 years agowatchdog: stm32mp: migrate trace to dev macro
Patrick Delaunay [Fri, 6 Nov 2020 18:01:41 +0000 (19:01 +0100)]
watchdog: stm32mp: migrate trace to dev macro

Change debug and pr_err to dev macro and define LOG_CATEGORY.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
3 years agortc: stm32: migrate trace to log macro
Patrick Delaunay [Fri, 6 Nov 2020 18:01:40 +0000 (19:01 +0100)]
rtc: stm32: migrate trace to log macro

Define LOG_CATEGORY to allow filtering with log command.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
3 years agohwspinlock: stm32: migrate trace to log macro
Patrick Delaunay [Fri, 6 Nov 2020 18:01:39 +0000 (19:01 +0100)]
hwspinlock: stm32: migrate trace to log macro

Define LOG_CATEGORY to allow filtering with log command.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
3 years agotimer: stm32: migrate trace to log macro
Patrick Delaunay [Fri, 6 Nov 2020 18:01:38 +0000 (19:01 +0100)]
timer: stm32: migrate trace to log macro

Define LOG_CATEGORY to allow filtering with log command.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
3 years agommc: stm32_sdmmc2: migrate trace to dev and log macro
Patrick Delaunay [Fri, 6 Nov 2020 18:01:37 +0000 (19:01 +0100)]
mmc: stm32_sdmmc2: migrate trace to dev and log macro

Define LOG_CATEGORY, use dev_ macro when it is possible.
Remove the "%s:" __func__  header as it is managed by dev macro
(dev->name is displayed) or log macro (CONFIG_LOGF_FUNC).

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
3 years agoram: stm32mp1: migrate trace to dev or log macro
Patrick Delaunay [Fri, 6 Nov 2020 18:01:36 +0000 (19:01 +0100)]
ram: stm32mp1: migrate trace to dev or log macro

Define LOG_CATEGORY, use dev_ macro when it is possible
and migrate other trace to log_ macro.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
3 years agoram: stm32: migrate trace to log macro
Patrick Delaunay [Fri, 6 Nov 2020 18:01:35 +0000 (19:01 +0100)]
ram: stm32: migrate trace to log macro

Define LOG_CATEGORY, change debug to dev_dbg and remove "%s:" __func__
header as it is managed by dev macro (dev->name is displayed)

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
3 years agoremoproc: stm32: migrate trace to log macro
Patrick Delaunay [Fri, 6 Nov 2020 18:01:34 +0000 (19:01 +0100)]
remoproc: stm32: migrate trace to log macro

Define LOG_CATEGORY and remove unneeded pr_fmt macro with the dev
macro as dev->name is displayed and CONFIG_LOGF_FUNC can be
activated for log macro.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
3 years agogpio: stm32-gpio: migrate trace to dev and log macro
Patrick Delaunay [Fri, 6 Nov 2020 18:01:33 +0000 (19:01 +0100)]
gpio: stm32-gpio: migrate trace to dev and log macro

Change debug to dev_dbg macro and define LOG_CATEGORY.

Remove dev->name as it is already displayed by dev macro.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
3 years agopinctrl: stm32: migrate trace to log macro
Patrick Delaunay [Fri, 6 Nov 2020 18:01:32 +0000 (19:01 +0100)]
pinctrl: stm32: migrate trace to log macro

Change debug to log macro and define LOG_CATEGORY.

Remove "%s:" with __func__ as it is managed by log macro
(CONFIG_LOGF_FUNC)

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
3 years agoarm: stm32mp: bsec: migrate trace to log macro
Patrick Delaunay [Fri, 6 Nov 2020 18:01:31 +0000 (19:01 +0100)]
arm: stm32mp: bsec: migrate trace to log macro

Define LOG_CATEGORY, change pr_debug to dev_dbg and remove "bsec:"
header as it is managed by log macro (dev->name is displayed)

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
3 years agoarm: stm32mp: migrate cmd_stm32prog to log macro
Patrick Delaunay [Fri, 6 Nov 2020 18:01:30 +0000 (19:01 +0100)]
arm: stm32mp: migrate cmd_stm32prog to log macro

Change debug and pr_ macro to log macro.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
3 years agoarm: stm32mp: migrate trace to log macro
Patrick Delaunay [Fri, 6 Nov 2020 18:01:29 +0000 (19:01 +0100)]
arm: stm32mp: migrate trace to log macro

Change debug and pr_ macro to log macro and define LOG_CATEGORY.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
3 years agoMerge tag 'ti-v2021.04-rc1' of https://gitlab.denx.de/u-boot/custodians/u-boot-ti
Tom Rini [Tue, 12 Jan 2021 14:32:48 +0000 (09:32 -0500)]
Merge tag 'ti-v2021.04-rc1' of https://gitlab.denx.de/u-boot/custodians/u-boot-ti

- DM support for OMAP PWM backlight
- USB host mode support for AM654
- Minor SPI fixes
- Add support k2g ice board with 1GHz silicon
- Fix GTC programming for K3 devices

3 years agoMerge tag 'u-boot-atmel-2021.04-a' of https://gitlab.denx.de/u-boot/custodians/u...
Tom Rini [Tue, 12 Jan 2021 14:32:20 +0000 (09:32 -0500)]
Merge tag 'u-boot-atmel-2021.04-a' of https://gitlab.denx.de/u-boot/custodians/u-boot-atmel

First set of u-boot-atmel features for 2021.04 cycle

This feature set includes the new board SAMA7G5 EK, the new evaluation
kit for Microchip AT91 SAMA7G5 SoC . The current board support includes
two configurations for booting from eMMC (SDMMC0), SD-Card (SDMMC1), and
support for two Ethernet interfaces.

3 years agoboard: amlogic: vim3: fix setup ethernet mac from efuse
Artem Lapkin [Tue, 12 Jan 2021 11:42:12 +0000 (19:42 +0800)]
board: amlogic: vim3: fix setup ethernet mac from efuse

Fix reading built-in ethernet MAC address from efuse

NOTE: MAC is stored in ASCII format, 1bytes = 2characters by 0 offset

if mac from efuse not valid we use meson_generate_serial_ethaddr

NOTE: remake odroid-n2.c from Neil Armstrong <narmstrong@baylibre.com>

Signed-off-by: Artem Lapkin <art@khadas.com>
[narmstrong: remove MAC print & spurious new endline]
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
3 years agoremoteproc: ti_k3_arm64: Program CNTFID0 register in GTC
Nishanth Menon [Wed, 6 Jan 2021 19:20:32 +0000 (13:20 -0600)]
remoteproc: ti_k3_arm64: Program CNTFID0 register in GTC

ARMv8's generic timer[1] picks up it's graycode from GTC. However,
the frequency of the GTC is supposed to be programmed in CNTFID0[2]
register prior to enabling the GTC in CNTCR[3] register.

In K3 architecture, GTC provides a central time to many parts of the
SoC including graycode to the generic timer in the ARMv8 subsystem.
However, due to the central nature and the need to enable the counter
early in the boot process, the R5 based u-boot enables GTC and
programs it's frequency based on central needs of the system. This
may not be a constant 200MHz based on the system. The bootloader is
supposed to program the FID0 register with the correct frequency it
has sourced for GTC from the central system controller OR from PLLs
as appropriate, and TF-A is supposed[4] to use that as the frequency for
it's local timer.

Currently we are programming just the CNTCR[3] register to enable the
GTC, however we dont let TF-A know the frequency that GTC is actually
running at. A mismatch in programmed frequency and what we program for
generic timer will, as we can imagine, all kind of weird mayhem.

So, program the CNTFID0 register with the clock frequency. Note:
assigned-clock-rates should have set the clock frequency, so the only
operation we need to explicitly do is to retrieve the frequency and
program it in FID0 register.

Since the valid in K3 for GTC clock frequencies are < U32_MAX, we can
just cast the ulong and continue.

[1] https://developer.arm.com/documentation/100095/0002/generic-timer/generic-timer-register-summary/aarch64-generic-timer-register-summary
[2] https://developer.arm.com/docs/ddi0595/h/external-system-registers/cntfid0
[3] https://developer.arm.com/docs/ddi0595/h/external-system-registers/cntcr
[4] https://github.com/ARM-software/arm-trusted-firmware/commit/6a22d9ea3c7fa28d053d3ba264b49b7396a86f9e

Signed-off-by: Nishanth Menon <nm@ti.com>
3 years agoarm: dts: k3-*-r5-*-board: Add GTC clock
Nishanth Menon [Wed, 6 Jan 2021 19:20:31 +0000 (13:20 -0600)]
arm: dts: k3-*-r5-*-board: Add GTC clock

Add GTC Clock definition as index 0 clock so that we can use the clock
node in the driver later on.

Signed-off-by: Nishanth Menon <nm@ti.com>
3 years agoNokia RX-51: Add test for U-Boot serial console
Pali Rohár [Sun, 29 Nov 2020 16:15:05 +0000 (17:15 +0100)]
Nokia RX-51: Add test for U-Boot serial console

This patch adds a new test which checks that U-Boot for Nokia RX-51 running
in qemu can print test line to serial console and also checks that test
line appeared on qemu serial console.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Pavel Machek <pavel@ucw.cz>
3 years agoNokia RX-51: Do not try calling both ext2load and ext4load
Pali Rohár [Mon, 30 Nov 2020 19:10:34 +0000 (20:10 +0100)]
Nokia RX-51: Do not try calling both ext2load and ext4load

Those two commands now doing same thing, reading from ext2/3/4 filesystem.
So remove useless duplicated call.

Signed-off-by: Pali Rohár <pali@kernel.org>
Acked-by: Pavel Machek <pavel@ucw.cz>
3 years agoboard: ti: am335x-ice: get CDCE913 clock device
Dario Binacchi [Tue, 29 Dec 2020 23:16:32 +0000 (00:16 +0100)]
board: ti: am335x-ice: get CDCE913 clock device

With support for other clock drivers, the potentially supported CDCE913
device can no longer be probed without specifying its DT node name.

Signed-off-by: Dario Binacchi <dariobin@libero.it>
3 years agovideo: omap: move drivers to 'ti' directory
Dario Binacchi [Tue, 29 Dec 2020 23:16:31 +0000 (00:16 +0100)]
video: omap: move drivers to 'ti' directory

Add drivers/video/ti/ folder and move all TI's code in this folder for
better maintenance.

Signed-off-by: Dario Binacchi <dariobin@libero.it>
3 years agovideo: omap: split the legacy code from the DM code
Dario Binacchi [Tue, 29 Dec 2020 23:16:30 +0000 (00:16 +0100)]
video: omap: split the legacy code from the DM code

The schedule for deprecating the features of the pre-driver-model puts
2019.17 as the deadline for the video subsystem. Furthermore, the latest
patches applied to the am335x-fb.c module have decreased the amount of
code shared with the pre-driver-model implementation. Splitting the two
implementations into two modules improves the readability of the code
and will make it easier to drop the pre-driver-model code.
I have not created a header file with the data structures and the
constants for accessing the LCD controller registers, but I preferred to
keep them inside the two c modules. This is a code replication until the
pre-driver-model version is dropped.

Signed-off-by: Dario Binacchi <dariobin@libero.it>
3 years agovideo: omap: set LCD clock rate through DM API
Dario Binacchi [Tue, 29 Dec 2020 23:16:29 +0000 (00:16 +0100)]
video: omap: set LCD clock rate through DM API

The patch configures the display DPLL using the functions provided by
the driver model API for the clock. The device tree contains everything
needed to get the DPLL clock. The round rate function developed for
calculating the DPLL multiplier and divisor and the platform routines
for accessing the DPLL registers are removed from the LCD driver code
because they are implemented inside the DPLL clock driver.

Signed-off-by: Dario Binacchi <dariobin@libero.it>
3 years agovideo: omap: drop domain clock enabling by SOC api
Dario Binacchi [Tue, 29 Dec 2020 23:16:28 +0000 (00:16 +0100)]
video: omap: drop domain clock enabling by SOC api

Enabling the domain clock is performed by the sysc interconnect target
module driver during the video device probing.

Signed-off-by: Dario Binacchi <dariobin@libero.it>
3 years agovideo: omap: add panel driver
Dario Binacchi [Tue, 29 Dec 2020 23:16:27 +0000 (00:16 +0100)]
video: omap: add panel driver

The previous version of am335x-fb.c contained the functionalities of two
drivers that this patch has split. It was a video type driver that used
the same registration compatible string that now registers a panel type
driver. The proof of this is that two compatible strings were referred
to within the same driver.
There are now two drivers, each with its own compatible string,
functions and API.
Furthermore, the panel driver, in addition to decoding the display
timings, is now also able to manage the backlight.

Signed-off-by: Dario Binacchi <dariobin@libero.it>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agodm: core: add a function to decode display timings
Dario Binacchi [Tue, 29 Dec 2020 23:16:26 +0000 (00:16 +0100)]
dm: core: add a function to decode display timings

The patch adds a function to get display timings from the device tree
node attached to the device.

Signed-off-by: Dario Binacchi <dariobin@libero.it>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agobus: ti: am33xx: add pwm subsystem driver
Dario Binacchi [Tue, 29 Dec 2020 23:16:25 +0000 (00:16 +0100)]
bus: ti: am33xx: add pwm subsystem driver

The TI PWMSS driver is a simple bus driver for providing clock and power
management for the PWM peripherals on TI AM33xx SoCs, namely eCAP,
eHRPWM and eQEP.

For DT binding details see Linux doc:
- Documentation/devicetree/bindings/pwm/pwm-tipwmss.txt

Signed-off-by: Dario Binacchi <dariobin@libero.it>
3 years agopwm: ti: am33xx: add enhanced pwm driver
Dario Binacchi [Tue, 29 Dec 2020 23:16:24 +0000 (00:16 +0100)]
pwm: ti: am33xx: add enhanced pwm driver

Enhanced high resolution PWM module (EHRPWM) hardware can be used to
generate PWM output over 2 channels. This commit adds PWM driver support
for EHRPWM device present on AM33XX SOC.

The code is based on the drivers/pwm/pwm-tiehrpwm.c driver of the Linux
kernel version 5.9-rc7.
For DT binding details see:
- Documentation/devicetree/bindings/pwm/pwm-tiehrpwm.txt

Signed-off-by: Dario Binacchi <dariobin@libero.it>
3 years agoarm: dts: am335x: enable scm_clocks auto binding
Dario Binacchi [Tue, 29 Dec 2020 23:16:23 +0000 (00:16 +0100)]
arm: dts: am335x: enable scm_clocks auto binding

Adding the 'simple-bus' compatible string to the scm_clocks node will
allow its automatic binding.

Signed-off-by: Dario Binacchi <dariobin@libero.it>
3 years agoomap: timer: fix the rate setting
Dario Binacchi [Tue, 29 Dec 2020 23:16:22 +0000 (00:16 +0100)]
omap: timer: fix the rate setting

The prescaler (PTV) setting must be taken into account even when the
timer input clock frequency has been set.

Signed-off-by: Dario Binacchi <dariobin@libero.it>
3 years agofdt: translate address if #size-cells = <0>
Dario Binacchi [Tue, 29 Dec 2020 23:16:21 +0000 (00:16 +0100)]
fdt: translate address if #size-cells = <0>

The __of_translate_address routine translates an address from the
device tree into a CPU physical address. A note in the description of
the routine explains that the crossing of any level with
since inherited from IBM. This does not happen for Texas Instruments, or
at least for the beaglebone device tree. Without this patch, in fact,
the translation into physical addresses of the registers contained in the
am33xx-clocks.dtsi nodes would not be possible. They all have a parent
with #size-cells = <0>.

The CONFIG_OF_TRANSLATE_ZERO_SIZE_CELLS symbol makes translation
possible even in the case of crossing levels with #size-cells = <0>.

The patch acts conservatively on address translation, except for
removing a check within the of_translate_one function in the
drivers/core/of_addr.c file:

+
        ranges = of_get_property(parent, rprop, &rlen);
-       if (ranges == NULL && !of_empty_ranges_quirk(parent)) {
-               debug("no ranges; cannot translate\n");
-               return 1;
-       }
        if (ranges == NULL || rlen == 0) {
                offset = of_read_number(addr, na);
                memset(addr, 0, pna * 4);
debug("empty ranges; 1:1 translation\n");

There are two reasons:
1 The function of_empty_ranges_quirk always returns false, invalidating
  the following if statement in case of null ranges. Therefore one of
  the two checks is useless.

2 The implementation of the of_translate_one function found in the
  common/fdt_support.c file has removed this check while keeping the one
  about the 1:1 translation.

The patch adds a test and modifies a check for the correctness of an
address in the case of enabling translation also for zero size cells.
The added test checks translations of addresses generated by nodes of
a device tree similar to those you can find in the files am33xx.dtsi
and am33xx-clocks.dtsi for which the patch was created.

The patch was also tested on a beaglebone black board. The addresses
generated for the registers of the loaded drivers are those specified
by the AM335x reference manual.

Signed-off-by: Dario Binacchi <dariobin@libero.it>
Tested-by: Dario Binacchi <dariobin@libero.it>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoclk: move clk-ti-sci driver to 'ti' directory
Dario Binacchi [Tue, 29 Dec 2020 23:16:20 +0000 (00:16 +0100)]
clk: move clk-ti-sci driver to 'ti' directory

The patch moves the clk-ti-sci.c file to the 'ti' directory along with
all the other TI's drivers, and renames it clk-sci.c.

Signed-off-by: Dario Binacchi <dariobin@libero.it>
3 years agoarm: dts: am335x: enable prcm_clocks auto binding
Dario Binacchi [Tue, 29 Dec 2020 23:16:19 +0000 (00:16 +0100)]
arm: dts: am335x: enable prcm_clocks auto binding

Adding the 'simple-bus' compatible string to the prcm_clocks node will
allow its automatic binding.

Signed-off-by: Dario Binacchi <dariobin@libero.it>
3 years agoclk: ti: omap4: add clock manager driver
Dario Binacchi [Tue, 29 Dec 2020 23:16:18 +0000 (00:16 +0100)]
clk: ti: omap4: add clock manager driver

This minimal driver is only used to bind child devices.

For DT binding details see Linux doc:
- Documentation/devicetree/bindings/arm/omap/prcm.txt

Signed-off-by: Dario Binacchi <dariobin@libero.it>
3 years agoclk: ti: add support for clkctrl clocks
Dario Binacchi [Tue, 29 Dec 2020 23:06:39 +0000 (00:06 +0100)]
clk: ti: add support for clkctrl clocks

Until now the clkctrl clocks have been enabled/disabled through platform
routines. Thanks to this patch they can be enabled and configured directly
by the probed devices that need to use them.

For DT binding details see Linux doc:
- Documentation/devicetree/bindings/clock/ti-clkctrl.txt

Signed-off-by: Dario Binacchi <dariobin@libero.it>
3 years agoti: am33xx: fix do_enable_clocks() to accept NULL parameters
Dario Binacchi [Tue, 29 Dec 2020 23:06:38 +0000 (00:06 +0100)]
ti: am33xx: fix do_enable_clocks() to accept NULL parameters

Up till this commit passing NULL as input parameter was allowed, but not
handled properly. When a NULL parameter was passed to the function a data
abort was raised.

Signed-off-by: Dario Binacchi <dariobin@libero.it>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoarm: dts: am335x: include am33xx-u-boot.dtsi
Dario Binacchi [Tue, 29 Dec 2020 23:06:37 +0000 (00:06 +0100)]
arm: dts: am335x: include am33xx-u-boot.dtsi

Include the SoC U-boot DTS in each am335x-<board>-u-boot.dtsi.

Signed-off-by: Dario Binacchi <dariobin@libero.it>
3 years agoclk: ti: add gate clock driver
Dario Binacchi [Tue, 29 Dec 2020 23:06:36 +0000 (00:06 +0100)]
clk: ti: add gate clock driver

The patch adds support for TI gate clock binding. The code is based on
the drivers/clk/ti/gate.c driver of the Linux kernel version 5.9-rc7.
For DT binding details see:
- Documentation/devicetree/bindings/clock/ti/gate.txt

Signed-off-by: Dario Binacchi <dariobin@libero.it>
3 years agoclk: ti: add divider clock driver
Dario Binacchi [Tue, 29 Dec 2020 23:06:35 +0000 (00:06 +0100)]
clk: ti: add divider clock driver

The patch adds support for TI divider clock binding. The driver uses
routines provided by the common clock framework (ccf).

The code is based on the drivers/clk/ti/divider.c driver of the Linux
kernel version 5.9-rc7.
For DT binding details see:
- Documentation/devicetree/bindings/clock/ti/divider.txt

Signed-off-by: Dario Binacchi <dariobin@libero.it>
3 years agoclk: ti: am33xx: add DPLL clock drivers
Dario Binacchi [Tue, 29 Dec 2020 23:06:34 +0000 (00:06 +0100)]
clk: ti: am33xx: add DPLL clock drivers

The digital phase-locked loop (DPLL) provides all interface clocks and
functional clocks to the processor of the AM33xx device. The AM33xx
device integrates five different DPLLs:
 * Core DPLL
 * Per DPLL
 * LCD DPLL
 * DDR DPLL
 * MPU DPLL

The patch adds support for the compatible strings:
 * "ti,am3-dpll-core-clock"
 * "ti,am3-dpll-no-gate-clock"
 * "ti,am3-dpll-no-gate-j-type-clock"
 * "ti,am3-dpll-x2-clock"

The code is loosely based on the drivers/clk/ti/dpll.c drivers of the
Linux kernel version 5.9-rc7.
For DT binding details see:
- Documentation/devicetree/bindings/clock/ti/dpll.txt

Signed-off-by: Dario Binacchi <dariobin@libero.it>
3 years agoarm: ti: am33xx: add DPLL_EN_FAST_RELOCK_BYPASS macro
Dario Binacchi [Tue, 29 Dec 2020 23:06:33 +0000 (00:06 +0100)]
arm: ti: am33xx: add DPLL_EN_FAST_RELOCK_BYPASS macro

Add missing DPLL_EN_FAST_RELOCK_BYPASS macro. Used to put the DPLL in
idle bypass fast relock mode.

Signed-off-by: Dario Binacchi <dariobin@libero.it>
3 years agoclk: ti: add mux clock driver
Dario Binacchi [Tue, 29 Dec 2020 23:06:32 +0000 (00:06 +0100)]
clk: ti: add mux clock driver

The driver manages a register-mapped multiplexer with multiple input
clock signals or parents, one of which can be selected as output. It
uses routines provided by the common clock framework (ccf).

The code is based on the drivers/clk/ti/mux.c driver of the Linux
kernel version 5.9-rc7.
For DT binding details see:
- Documentation/devicetree/bindings/clock/ti/mux.txt

Signed-off-by: Dario Binacchi <dariobin@libero.it>
3 years agoclk: add clk_round_rate()
Dario Binacchi [Tue, 29 Dec 2020 23:06:31 +0000 (00:06 +0100)]
clk: add clk_round_rate()

It returns the rate which will be set if you ask clk_set_rate() to set
that rate. It provides a way to query exactly what rate you'll get if
you call clk_set_rate() with that same argument.
So essentially, clk_round_rate() and clk_set_rate() are equivalent
except the former does not modify the clock hardware in any way.

Signed-off-by: Dario Binacchi <dariobin@libero.it>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
3 years agoarm: dts: sync am33xx with Linux 5.9-rc7
Dario Binacchi [Tue, 29 Dec 2020 23:06:30 +0000 (00:06 +0100)]
arm: dts: sync am33xx with Linux 5.9-rc7

There have been several changes to the am33xx.dtsi, so this patch
re-syncs it with Linux.

Let's add proper interconnect hierarchy for l4 interconnect instances
with the related ti-sysc interconnect module data as documented in
Documentation/devicetree/bindings/bus/ti-sysc.txt of the Linux kernel.
With l4 interconnect hierarchy and ti-sysc interconnect target module
data in place, we can simply move all the related child devices to their
proper location and enable probing using ti-sysc.

The am33xx-clock.dtsi file is the same as that of the Linux kernel,
except for the reg property of the node l4-wkup-clkctrl@0.
As for the am33xx.dtsi file, all the devices with drivers not yet
implemented and those I was able to test with this patch have been moved
to am33xx-l4.dtsi. In case of any regressions, problem devices can be
reverted by moving them back and removing the related interconnect
target module node.

Signed-off-by: Dario Binacchi <dariobin@libero.it>
3 years agobus: ti: add minimal sysc interconnect target driver
Dario Binacchi [Tue, 29 Dec 2020 23:06:29 +0000 (00:06 +0100)]
bus: ti: add minimal sysc interconnect target driver

We can handle the sysc interconnect target module in a generic way for
many TI SoCs. Initially let's just enable domain clocks before the
children are probed.

The code is loosely based on the drivers/bus/ti-sysc.c of the Linux
kernel version 5.9-rc7.
For DT binding details see:
- Documentation/devicetree/bindings/bus/ti-sysc.txt

Signed-off-by: Dario Binacchi <dariobin@libero.it>
3 years agodt-bindings: bus: ti-sysc: resync with Linux 5.9-rc7
Dario Binacchi [Tue, 29 Dec 2020 23:06:28 +0000 (00:06 +0100)]
dt-bindings: bus: ti-sysc: resync with Linux 5.9-rc7

Add support for PRUSS SYSC type:
The PRUSS module has a SYSCFG which is unique. The SYSCFG has two
additional unique fields called STANDBY_INIT and SUB_MWAIT in addition
to regular IDLE_MODE and STANDBY_MODE fields. Add the bindings for this
new sysc type.

Add support for MCAN on dra76x:
The dra76x MCAN generic interconnect module has a its own format for the
bits in the control registers.

Signed-off-by: Dario Binacchi <dariobin@libero.it>
3 years agoclk: export generic routines
Dario Binacchi [Tue, 29 Dec 2020 23:06:27 +0000 (00:06 +0100)]
clk: export generic routines

Export routines that can be used by other drivers avoiding duplicating
code.

Signed-off-by: Dario Binacchi <dariobin@libero.it>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoarm:pdu001: Use pseudo partition UUID for LINUX kernel boot paramter root
Felix Brack [Fri, 18 Dec 2020 08:03:50 +0000 (09:03 +0100)]
arm:pdu001: Use pseudo partition UUID for LINUX kernel boot paramter root

As more and more LINUX drivers are modified to use asynchronous probing
instead of synchronous probing, relying on device names being equal in
U-Boot and LINUX is not possible anymore. This is also true for block
device names like mmc0, mmc1 ect.
With LINUX kernel commit a1a4891 the probing type for the sdhci-omap
driver has been set to asynchronous mode too (probe_type is now
PROBE_PREFER_ASYNCHRONOUS).
In the case of the PDU001 board this results in the devices mmc0 and
mmc1 being swapped between U-Boot and LINUX. Device mmc0 in U-Boot
becomes mmc1 in LINUX an vice versa. Hence using device name identifiers
with LINUX kernel parameter root does not work anymore.
This patch changes the LINUX kernel boot parameter root to use the
pseudo (since we use MBR not GPT) partition UUID to locate the partition
hosting the root file system.

Signed-off-by: Felix Brack <fb@ltec.ch>
3 years agoboard: ti: k2g: Add support for K2G ICE with 1GHz Silicon
Lokesh Vutla [Thu, 17 Dec 2020 17:28:07 +0000 (22:58 +0530)]
board: ti: k2g: Add support for K2G ICE with 1GHz Silicon

Add board detection support for K2G ICE with FlagChip 1GHz silicon.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
3 years agoarm: dts: k3-j721e: ddr: Update to 0.5.0 version of DDR config tool
Praneeth Bajjuri [Thu, 3 Dec 2020 23:43:47 +0000 (17:43 -0600)]
arm: dts: k3-j721e: ddr: Update to 0.5.0 version of DDR config tool

Update the ddr settings to use the DDR reg config tool rev 0.5.0.
This enables 4266MTs DDR configuration.

Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
Signed-off-by: Kevin Scholz <k-scholz@ti.com>