[PATCH v1 16/16] configs: socfpga: Add defconfig for Agilex and Stratix 10 with ATF support

2020-08-16 Thread Chee Hong Ang
ll occupy the address range starting from 0x1000. Signed-off-by: Chee Hong Ang --- configs/socfpga_agilex_atf_defconfig| 71 configs/socfpga_stratix10_atf_defconfig | 73 + 2 files changed, 144 insertions(+) create mode 10064

[PATCH v1 15/16] arm: socfpga: soc64: Skip handoff data access in SSBL

2020-08-16 Thread Chee Hong Ang
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 --- arch/arm/mach-socfpga/wrap_pll_config_s10.c | 3 ++- 1 file changed, 2 insertions

[PATCH v1 14/16] arm: socfpga: soc64: SSBL shall not setup stack on OCRAM

2020-08-16 Thread Chee Hong Ang
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 --- include/configs/socfpga_soc64_common.h | 5 + 1 file changed, 5 insertions(+) diff --git a/include/configs/socfpga_soc64_common.h b

[PATCH v1 12/16] arm: socfpga: soc64: Add ATF support for FPGA reconfig driver

2020-08-16 Thread Chee Hong Ang
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 --- drivers/fpga/intel_sdm_mb.c | 139 1 file changed, 139 insertions(+) diff --git a/drivers/fpga

[PATCH v1 11/16] arm: socfpga: soc64: Add ATF support for Reset Manager driver

2020-08-16 Thread Chee Hong Ang
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 --- arch/arm/mach-socfpga/reset_manager_s10.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/arch/arm/mach-socfpga

[PATCH v1 13/16] arm: socfpga: mailbox: Add 'SYSTEM_RESET' PSCI support to mbox_reset_cold()

2020-08-16 Thread Chee Hong Ang
mbox_reset_cold() will invoke ATF's PSCI service when running in non-secure mode (EL2). Signed-off-by: Chee Hong Ang --- arch/arm/mach-socfpga/mailbox_s10.c | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/arm/mach-socfpga/mailbox_s10.c b/arch/arm/mach-socfpga/mailbox_s10.c index

[PATCH v1 10/16] net: designware: socfpga: Add ATF support for MAC driver

2020-08-16 Thread Chee Hong Ang
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 --- drivers/net/dwmac_socfpga.c | 43 + 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/drivers/net

[PATCH v1 08/16] arm: socfpga: soc64: Define SMC function identifiers for PSCI SiP services

2020-08-16 Thread Chee Hong Ang
bitstream FPGA reconfiguration, Remote System Update (RSU) and etc. Signed-off-by: Chee Hong Ang --- include/linux/intel-smc.h | 573 ++ 1 file changed, 573 insertions(+) create mode 100644 include/linux/intel-smc.h diff --git a/include/linux/intel-smc.h b/include

[PATCH v1 06/16] arm: socfpga: Disable "spin-table" method for booting Linux

2020-08-16 Thread Chee Hong Ang
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 --- arch/arm/mach-socfpga/Kconfig | 2 -- 1 file changed, 2 deletions(-) diff --git a/arc

[PATCH v1 09/16] mmc: dwmmc: socfpga: Add ATF support for MMC driver

2020-08-16 Thread Chee Hong Ang
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 --- drivers/mmc/socfpga_dw_mmc.c | 20 1 file changed, 20 insertions(+) diff --git a/drivers/mmc/socfpga_dw_mmc.c b/drivers/mmc

[PATCH v1 05/16] arm: socfpga: soc64: Override 'lowlevel_init' to support ATF

2020-08-16 Thread Chee Hong Ang
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 --- arch/arm/mach-socfpga/Makefile

[PATCH v1 07/16] arm: socfpga: soc64: Add SMC helper function for Intel SOCFPGA (64bits)

2020-08-16 Thread Chee Hong Ang
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 --- arch/arm/mach-socfpga/Makefile | 2 + arch/arm/mach-socfpga/include/mach/smc_api.h | 13 + arch/arm

[PATCH v1 04/16] arm: socfpga: soc64: Load FIT image with ATF support

2020-08-16 Thread Chee Hong Ang
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. Signed-off-by: Chee Hong Ang --- include/configs/socfpga_soc64_common.h | 4 1 file changed, 4 insertions(+) diff --git a/include/configs

[PATCH v1 02/16] arm: socfpga: soc64: Add FIT generator script for pack itb with ATF

2020-08-16 Thread Chee Hong Ang
Generate a FIT image for Intel SOCFPGA (64bits) which include U-boot proper, ATF and DTB for U-boot proper. Signed-off-by: Chee Hong Ang --- board/altera/soc64/fit_spl_atf.sh | 91 +++ 1 file changed, 91 insertions(+) create mode 100755 board/altera/soc64

[PATCH v1 03/16] arm: socfpga: Add function for checking description from FIT image

2020-08-16 Thread Chee Hong Ang
are allowed to override this 'weak' function in their specific board implementation. Signed-off-by: Chee Hong Ang --- arch/arm/mach-socfpga/board.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-socfpga/board.c b/arch/arm/mach-socfpga/board.c index

[PATCH v1 01/16] arm: socfpga: soc64: Remove CONFIG_OF_EMBED

2020-08-16 Thread Chee Hong Ang
CONFIG_OF_EMBED was primarily enabled to support the S10/Agilex spl hex file requirements. Since this option now produces a warning during build, and the spl hex can be created using alternate methods, CONFIG_OF_EMBED is no longer needed. Signed-off-by: Chee Hong Ang --- configs

[PATCH v1 00/16] Enable ARM Trusted Firmware for U-Boot

2020-08-16 Thread Chee Hong Ang
pport for SoCFPGA SoC64 platforms https://lists.denx.de/pipermail/u-boot/2020-August/422509.html arm: socfpga: soc64: Disable CONFIG_PSCI_RESET https://lists.denx.de/pipermail/u-boot/2020-August/423373.html Chee Hong Ang (16): arm: socfpga: soc64: Remove CONFIG_OF_EMBED arm: socfpga: soc64: Add FIT ge

[PATCH v1] arm: socfpga: soc64: Disable CONFIG_PSCI_RESET

2020-08-13 Thread Chee Hong Ang
Don't invoke 'SYSTEM_RESET' PSCI function because PSCI function calls are not supported by u-boot running in EL3. Signed-off-by: Chee Hong Ang --- configs/socfpga_agilex_defconfig| 1 + configs/socfpga_stratix10_defconfig | 1 + 2 files changed, 2 insertions(+) diff --git a/configs

[PATCH v1 5/5] arm: socfpga: mailbox: Add mailbox retry support

2020-08-11 Thread Chee Hong Ang
Foon Tan Signed-off-by: Chee Hong Ang --- arch/arm/mach-socfpga/mailbox_s10.c | 40 ++--- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/arch/arm/mach-socfpga/mailbox_s10.c b/arch/arm/mach-socfpga/mailbox_s10.c index a9ec818492..18d44924e6 100644 --- a/arch

[PATCH v1 1/5] arm: socfpga: mailbox: Refactor mailbox timeout event handling

2020-08-11 Thread Chee Hong Ang
Add miliseconds delay when waiting for mailbox event to happen before timeout. This will ensure the timeout duration is predictive. Signed-off-by: Chee Hong Ang --- arch/arm/mach-socfpga/mailbox_s10.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/arch/arm

[PATCH v1 4/5] arm: socfpga: mailbox: Update mailbox response codes

2020-08-11 Thread Chee Hong Ang
From: Ley Foon Tan Sync latest mailbox response codes from SDM firmware. Signed-off-by: Ley Foon Tan Signed-off-by: Chee Hong Ang --- .../mach-socfpga/include/mach/mailbox_s10.h | 38 ++- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-socfpga

[PATCH v1 0/5] SoCFPGA mailbox driver fixes and enhancements

2020-08-11 Thread Chee Hong Ang
Fixes: - Proper timeout implementation - Always read mailbox response data before returning mailbox status to caller Enhancement: - Auto retry on mailbox sending - Send large mailbox message Chee Hong Ang (3): arm: socfpga: mailbox: Refactor mailbox timeout event handling arm: socfpga

[PATCH v1 3/5] arm: socfpga: mailbox: Support sending large mailbox command

2020-08-11 Thread Chee Hong Ang
Mailbox command which is too large to fit into the mailbox FIFO command buffer can be sent to SDM in multiple parts. Signed-off-by: Chee Hong Ang --- arch/arm/mach-socfpga/mailbox_s10.c | 113 +++- 1 file changed, 78 insertions(+), 35 deletions(-) diff --git a/arch/arm

[PATCH v1 2/5] arm: socfpga: mailbox: Always read mailbox responses before returning status

2020-08-11 Thread Chee Hong Ang
Mailbox driver should always check for the length of the response and read the response data before returning the response status to caller. Signed-off-by: Chee Hong Ang --- arch/arm/mach-socfpga/mailbox_s10.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/arm

[PATCH v3 1/1] Makefile: socfpga: Generate sfp file with 4 SPL images

2020-08-11 Thread Chee Hong Ang
-padding). 4 x (SPL(64KB) + zero-padding(64KB)) = 512KB Signed-off-by: Chee Hong Ang --- v3 changes: - add 'u-boot-splx4.sfp' make target (4 x SPL image without paddings) - add 'u-boot-spl-padx4.sfp' make target (4 x SPL image with 64KB paddings) - Update commit message (refer to commit message

[PATCH v2] Makefile: socfpga: Generate spl/u-boot-splx4.sfp with 4 SPL images

2020-08-11 Thread Chee Hong Ang
is followed by 64KB of zero-padding). Signed-off-by: Chee Hong Ang --- Makefile | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 4483a9b..f4631f1 100644 --- a/Makefile +++ b/Makefile @@ -1582,8 +1582,9 @@ u-boot.spr: spl/u-boot-spl.img u

[PATCH v1] arm: socfpga: soc64: Add timeout waiting for NOC idle ACK

2020-08-10 Thread Chee Hong Ang
Add timeout waiting for NOC idle ACK during FPGA bridge disable/enable. Signed-off-by: Chee Hong Ang --- arch/arm/mach-socfpga/reset_manager_s10.c | 25 - 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/arch/arm/mach-socfpga/reset_manager_s10.c b/arch/arm

[PATCH v1 3/3] arm: socfpga: agilex: Enable FPGA Full Reconfiguration support

2020-08-06 Thread Chee Hong Ang
Enable FPGA full reconfiguration support with Intel FPGA SDM Mailbox driver for Agilex. Signed-off-by: Chee Hong Ang --- arch/arm/mach-socfpga/Kconfig | 1 + drivers/fpga/Kconfig | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-socfpga/Kconfig b/arch

[PATCH v1 0/3] Rename Stratix10 FPGA driver and support Agilex

2020-08-06 Thread Chee Hong Ang
- Rename Stratix10 FPGA driver to 'Intel FPGA SDM Mailbox'. - Add watchdog reset when configuring the FPGA. - Enable 'Intel FPGA SDM Mailbox' for Agilex. Chee Hong Ang (3): fpga: altera: Rename Stratix10 FPGA to Intel FPGA SDM Mailbox fpga: intel_sdm_mb: Add watchdog reset arm: socfpga

[PATCH v1 2/3] fpga: intel_sdm_mb: Add watchdog reset

2020-08-06 Thread Chee Hong Ang
Ensure watchdog reset is not triggered if the fpga reconfiguration is taking too long. Signed-off-by: Chee Hong Ang --- drivers/fpga/intel_sdm_mb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/fpga/intel_sdm_mb.c b/drivers/fpga/intel_sdm_mb.c index 3508231191..9a1dc2c0c8

[PATCH v1 1/3] fpga: altera: Rename Stratix10 FPGA to Intel FPGA SDM Mailbox

2020-08-06 Thread Chee Hong Ang
Rename Stratix10 FPGA driver to Intel FPGA SDM Mailbox driver because it is using generic SDM (Secure Device Manager) Mailbox interface shared by other platform (e.g. Agilex) as well. Signed-off-by: Chee Hong Ang --- arch/arm/mach-socfpga/Kconfig| 2 +- arch/arm/mach-socfpga

[PATCH v2] arm: socfpga: Use DM watchdog timer

2020-08-05 Thread Chee Hong Ang
All SoCFPGA platforms (except Cyclone V) are now switching to CONFIG_WDT (driver model for watchdog timer drivers) from CONFIG_HW_WATCHDOG. Signed-off-by: Chee Hong Ang --- arch/arm/dts/socfpga_agilex_socdk-u-boot.dtsi| 4 arch/arm/dts/socfpga_arria10_socdk-u-boot.dtsi | 4 arch

[PATCH v2] arm: socfpga: soc64: Check FPGA Config status register before bridge reset

2020-08-05 Thread Chee Hong Ang
Instead of querying SDM for FPGA configuration status through mailbox messages, U-Boot now checks System Manager's FPGA Config status register for FPGA configuration status before resetting bridge. Signed-off-by: Chee Hong Ang --- arch/arm/mach-socfpga/include/mach/misc.h | 5

[PATCH v1] arm: socfpga: Use DM watchdog timer

2020-08-05 Thread Chee Hong Ang
All SoCFPGA platforms (except Cyclone V) are now switching to CONFIG_WDT (driver model for watchdog timer drivers) from CONFIG_HW_WATCHDOG. Signed-off-by: Chee Hong Ang --- arch/arm/dts/socfpga_agilex_socdk-u-boot.dtsi | 4 arch/arm/dts/socfpga_arria10_socdk-u-boot.dtsi | 4 arch/arm

[PATCH v1 0/2] Print reset information in SPL

2020-08-05 Thread Chee Hong Ang
Show reset information such as reset types (cold/warm) and which events triggered the reset. Chee Hong Ang (2): arm: socfpga: soc64: Add SDM triggered warm reset bit mask arm: socfpga: soc64: Show reset state in SPL .../include/mach/reset_manager_soc64.h | 12 ++-- arch

[PATCH v1 1/2] arm: socfpga: soc64: Add SDM triggered warm reset bit mask

2020-08-05 Thread Chee Hong Ang
Include SDM triggered warm reset bit (BIT1) in Reset Manager's stat register when checking for HPS warm reset status. Refactor the warm reset mask macro for clarity purpose. Signed-off-by: Chee Hong Ang --- arch/arm/mach-socfpga/include/mach/reset_manager_soc64.h | 11 +-- 1 file

[PATCH v1 2/2] arm: socfpga: soc64: Show reset state in SPL

2020-08-05 Thread Chee Hong Ang
Print reset state (warm/cold) together with the source (watchdog/MPU) which has triggered the warm reset on S10 & Agilex. Signed-off-by: Chee Hong Ang --- .../include/mach/reset_manager_soc64.h | 1 + arch/arm/mach-socfpga/reset_manager_s10.c

[PATCH v1] arm: socfpga: soc64: Check FPGA Config status register before bridge reset

2020-08-05 Thread Chee Hong Ang
Instead of querying SDM for FPGA configuration status through mailbox messages, U-Boot now checks System Manager's FPGA Config status register for FPGA configuration status before resetting bridge. Signed-off-by: Chee Hong Ang --- arch/arm/mach-socfpga/include/mach/misc.h | 5

[PATCH v2 2/2] sysreset: socfpga: agilex: Enable sysreset support

2020-08-05 Thread Chee Hong Ang
Enable sysreset support for Agilex platform. Signed-off-by: Chee Hong Ang --- arch/arm/Kconfig | 2 +- drivers/sysreset/Kconfig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 03fc614..617d5ad 100644 --- a/arch/arm/Kconfig

[PATCH v2 0/2] Enable sysreset support for SoCFPGA SoC64 platforms

2020-08-05 Thread Chee Hong Ang
Rename S10 sysreset driver to common name (SoC64). SoCFPGA sysreset driver supports S10 and Agilex platforms now. Chee Hong Ang (2): sysreset: socfpga: soc64: Rename SYSRESET SoCFPGA driver for S10 to SoC64 sysreset: socfpga: agilex: Enable sysreset support arch/arm/Kconfig

[PATCH v2 1/2] sysreset: socfpga: soc64: Rename SYSRESET SoCFPGA driver for S10 to SoC64

2020-08-05 Thread Chee Hong Ang
Rename the driver from S10 to SoC64 because Intel Agilex platform also using the this SYSRESET SoCFPGA driver for S10. Signed-off-by: Chee Hong Ang --- arch/arm/Kconfig| 2 +- drivers/sysreset/Kconfig

[PATCH v1] configs: socfpga: soc64: Avoid SPL enter infinite loop during exception

2020-08-05 Thread Chee Hong Ang
, watchdog shall be triggered and Remote System Update mechanism shall load the next production image or factory safe image. Signed-off-by: Chin Liang See Signed-off-by: Chee Hong Ang --- configs/socfpga_agilex_defconfig| 1 + configs/socfpga_stratix10_defconfig | 1 + 2 files changed, 2

[PATCH v1] spi: cadence_qspi: Probe fail if QSPI clock is not set

2020-08-05 Thread Chee Hong Ang
If the QSPI clock is not set (read as 0), QSPI driver probe shall fail and prevent further QSPI access. Signed-off-by: Chee Hong Ang --- drivers/spi/cadence_qspi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/spi/cadence_qspi.c b/drivers/spi/cadence_qspi.c index 1e85749209

[PATCH v1] sysreset: socfpga: agilex: Enable sysreset support

2020-08-05 Thread Chee Hong Ang
Enable sysreset support for Agilex platform. Signed-off-by: Chee Hong Ang --- arch/arm/Kconfig | 2 +- drivers/sysreset/Kconfig | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 6b8a32c38d..105b5f08a9 100644 --- a/arch

[PATCH v1] spi: cadence-qspi: Fix QSPI write issues

2020-08-05 Thread Chee Hong Ang
device. This patch prevent the driver from disable/enable the QSPI controller too soon and inadvertently halting any ongoing flash read/write access by ensuring the QSPI controller is always in idle mode after each read/write access. Signed-off-by: Chee Hong Ang --- drivers/spi/cadence_qspi_apb.c

[PATCH v1] Makefile: socfpga: Generate spl/u-boot-splx4.sfp with 4 SPL images

2020-08-05 Thread Chee Hong Ang
Generate spl/u-boot-splx4.sfp which consist of 4 SPL images required for booting up Cyclone5/Arria10. Signed-off-by: Chee Hong Ang --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 2629a74..13429a0 100644 --- a/Makefile +++ b

[PATCH] arm: socfpga: soc64: Initialize timer in SPL only

2020-07-10 Thread Chee Hong Ang
Timer only need to be initialized once in SPL. This patch remove the redundancy of initializing the timer again in U-Boot proper Signed-off-by: Chee Hong Ang --- arch/arm/mach-socfpga/timer_s10.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-socfpga

[PATCH] arm: socfpga: soc64: Remove PHY interface setup from misc arch init

2020-07-10 Thread Chee Hong Ang
'dwmac_socfpga' driver will setup the PHY interface during probe. PHY interface setup in arch_misc_init() is no longer needed. Signed-off-by: Chee Hong Ang --- arch/arm/mach-socfpga/misc_s10.c | 84 +--- 1 file changed, 1 insertion(+), 83 deletions(-) diff --git

[PATCH v1 4/4] clk: agilex: Additional membus writes for HPS PLL

2020-07-10 Thread Chee Hong Ang
Add additional membus writes to configure main and peripheral PLL for Agilex's clock manager. Signed-off-by: Chee Hong Ang --- drivers/clk/altera/clk-agilex.c | 94 +++-- 1 file changed, 78 insertions(+), 16 deletions(-) diff --git a/drivers/clk/altera/clk-agilex.c

[PATCH v1 3/4] clk: agilex: Handle clock configuration differently in SPL and U-Boot proper

2020-07-10 Thread Chee Hong Ang
being setup by SPL (Clock Manager NOT in 'boot mode') to prevent any inaccurate clocking issues happened on HPS peripherals such as UART, MAC and etc. Signed-off-by: Chee Hong Ang --- drivers/clk/altera/clk-agilex.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/clk/altera

[PATCH v1 0/4] Agilex's clock driver updates and fixes

2020-07-10 Thread Chee Hong Ang
- Add clock enable. - Add clock source for NAND. - Add additional PLL configurations via mebus writes. - U-Boot proper will not re-initialize the clock again if it's already initialized by SPL. Chee Hong Ang (2): clk: agilex: Handle clock configuration differently in SPL and U-Boot proper

[PATCH v1 1/4] clk: agilex: Add NAND clock support

2020-07-10 Thread Chee Hong Ang
From: Ley Foon Tan Add get nand_clk and nand_x clock support. Signed-off-by: Ley Foon Tan Signed-off-by: Chee Hong Ang --- drivers/clk/altera/clk-agilex.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/clk/altera/clk-agilex.c b/drivers/clk/altera/clk-agilex.c index 0042958f4c

[PATCH v1 2/4] clk: agilex: Add clock enable support

2020-07-10 Thread Chee Hong Ang
Tan Signed-off-by: Chee Hong Ang --- drivers/clk/altera/clk-agilex.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/clk/altera/clk-agilex.c b/drivers/clk/altera/clk-agilex.c index 2ef9292f93..b5cf187364 100644 --- a/drivers/clk/altera/clk-agilex.c +++ b/drivers/clk/altera/clk

[PATCH v5 17/17] configs: socfpga: Add defconfig for Agilex and Stratix 10 with ATF support

2020-03-12 Thread chee . hong . ang
From: "Ang, Chee Hong" 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 0x20 (CONFIG_SYS_TEXT_BASE).

[PATCH v5 16/17] arm: socfpga: mailbox: Add 'SYSTEM_RESET' PSCI support to mbox_reset_cold()

2020-03-12 Thread chee . hong . ang
From: Chee Hong Ang mbox_reset_cold() will invoke ATF's PSCI service when running in non-secure mode (EL2). Signed-off-by: Chee Hong Ang --- arch/arm/mach-socfpga/mailbox_s10.c | 4 1 file changed, 4 insertions(+) diff --git a/arch/arm/mach-socfpga/mailbox_s10.c b/arch/arm/mach-socfpga

[PATCH v5 15/17] arm: socfpga: stratix10: Add ATF support for FPGA reconfig driver

2020-03-12 Thread chee . hong . ang
From: Chee Hong Ang 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 --- drivers/fpga/stratix10.c | 141 ++- 1 file changed, 140 insertions(+), 1

[PATCH v5 11/17] net: designware: socfpga: Add ATF support for MAC driver

2020-03-12 Thread chee . hong . ang
From: Chee Hong Ang 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 --- drivers/net/dwmac_socfpga.c | 43 +++ 1 file changed, 39 insertions(+), 4 deletions

[PATCH v5 13/17] arm: socfpga: stratix10: Initialize timer in SPL

2020-03-12 Thread chee . hong . ang
From: Chee Hong Ang Initialize timer in SPL running in secure mode (EL3) and skip timer initialization in U-Boot proper running in non-secure mode (EL2). Signed-off-by: Chee Hong Ang --- arch/arm/mach-socfpga/timer_s10.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[PATCH v5 12/17] arm: socfpga: Add ATF support for Reset Manager driver

2020-03-12 Thread chee . hong . ang
From: Chee Hong Ang In non-secure mode (EL2), Reset Manager driver calls the SMC/PSCI services provided by ATF to enable/disable the SOCFPGA bridges. Signed-off-by: Chee Hong Ang --- arch/arm/mach-socfpga/reset_manager_s10.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/arch

[PATCH v5 14/17] arm: socfpga: Add ATF support to query FPGA configuration status

2020-03-12 Thread chee . hong . ang
From: Chee Hong Ang In EL3, do_bridge_reset() directly send mailbox commands to SDM to query the FPGA configuration status. If running in non-secure mode (EL2), it invokes SMC service calls to ATF (EL3) to perform the query. Signed-off-by: Chee Hong Ang --- arch/arm/mach-socfpga/misc_s10.c

[PATCH v5 09/17] arm: socfpga: soc64: Remove PHY interface setup from misc arch init

2020-03-12 Thread chee . hong . ang
From: Chee Hong Ang 'dwmac_socfpga' driver will setup the PHY interface during probe. PHY interface setup in arch_misc_init() is no longer needed. Signed-off-by: Chee Hong Ang --- arch/arm/mach-socfpga/misc_s10.c | 85 +--- 1 file changed, 1 insertion

[PATCH v5 10/17] mmc: dwmmc: socfpga: Add ATF support for MMC driver

2020-03-12 Thread chee . hong . ang
From: Chee Hong Ang 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 --- drivers/mmc/socfpga_dw_mmc.c | 21 + 1 file changed, 21 insertions(+) diff --git a/drivers/mmc

[PATCH v5 08/17] arm: socfpga: Define SMC function identifiers for PSCI SiP services

2020-03-12 Thread chee . hong . ang
From: Chee Hong Ang 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

[PATCH v5 05/17] arm: socfpga: Override 'lowlevel_init' to support ATF

2020-03-12 Thread chee . hong . ang
From: Chee Hong Ang 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 --- arch/arm/mach

[PATCH v5 07/17] arm: socfpga: Add SMC helper function for Intel SOCFPGA (64bits)

2020-03-12 Thread chee . hong . ang
From: Chee Hong Ang 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. Signed-off-by: Chee Hong Ang --- arch/arm/mach

[PATCH v5 06/17] arm: socfpga: Disable "spin-table" method for booting Linux

2020-03-12 Thread chee . hong . ang
From: Chee Hong Ang 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 --- arch/arm/mach-socfpga/Kconfig | 2 -- 1 file changed, 2 deletion

[PATCH v5 00/17] Enable ARM Trusted Firmware for U-Boot

2020-03-12 Thread chee . hong . ang
on: https://lists.denx.de/pipermail/u-boot/2019-September/384906.html Ang, Chee Hong (1): configs: socfpga: Add defconfig for Agilex and Stratix 10 with ATF support Chee Hong Ang (16): configs: agilex: Remove CONFIG_OF_EMBED arm: socfpga: add fit source file for pack itb with ATF arm: so

[PATCH v5 03/17] arm: socfpga: Add function for checking description from FIT image

2020-03-12 Thread chee . hong . ang
From: Chee Hong Ang 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

[PATCH v5 02/17] arm: socfpga: add fit source file for pack itb with ATF

2020-03-12 Thread chee . hong . ang
From: Chee Hong Ang Generate a FIT image for Intel SOCFPGA (64bits) which include U-boot proper, ATF and DTB for U-boot proper. Signed-off-by: Chee Hong Ang --- board/altera/soc64/its/fit_spl_atf.its | 52 ++ 1 file changed, 52 insertions(+) create mode 100644

[PATCH v5 01/17] configs: agilex: Remove CONFIG_OF_EMBED

2020-03-12 Thread chee . hong . ang
From: Chee Hong Ang CONFIG_OF_EMBED was primarily enabled to support the agilex spl hex file requirements. Since this option now produces a warning during build, and the spl hex can be created using alternate methods, CONFIG_OF_EMBED is no longer needed. Signed-off-by: Chee Hong Ang

[PATCH v5 04/17] arm: socfpga: Load FIT image with ATF support

2020-03-12 Thread chee . hong . ang
From: Chee Hong Ang 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. Signed-off-by: Chee Hong Ang --- include/configs/socfpga_soc64_common.h | 4 1 file changed, 4 insertions(+) diff

[PATCH v4 21/21] configs: socfpga: Add defconfig for Agilex and Stratix 10 without ATF support

2020-03-09 Thread chee . hong . ang
From: Chee Hong Ang Booting Agilex and Stratix 10 without ATF support. SPL -> U-Boot proper -> OS (Linux) Signed-off-by: Chee Hong Ang --- configs/socfpga_agilex_nofw_defconfig| 59 ++ configs/socfpga_stratix10_nofw_defconfi

[PATCH v4 20/21] arm: socfpga: mailbox: Add 'SYSTEM_RESET' PSCI support to mbox_reset_cold()

2020-03-09 Thread chee . hong . ang
From: Chee Hong Ang mbox_reset_cold() will invoke ATF's PSCI service when running in non-secure mode (EL2). Signed-off-by: Chee Hong Ang --- arch/arm/mach-socfpga/mailbox_s10.c | 4 1 file changed, 4 insertions(+) diff --git a/arch/arm/mach-socfpga/mailbox_s10.c b/arch/arm/mach-socfpga

[PATCH v4 19/21] arm: socfpga: stratix10: Add ATF support for FPGA reconfig driver

2020-03-09 Thread chee . hong . ang
From: Chee Hong Ang 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 --- drivers/fpga/stratix10.c | 141 ++- 1 file changed, 140 insertions(+), 1

[PATCH v4 17/21] arm: socfpga: stratix10: Initialize timer in SPL

2020-03-09 Thread chee . hong . ang
From: Chee Hong Ang Initialize timer in SPL running in secure mode (EL3) and skip timer initialization in U-Boot proper running in non-secure mode (EL2). Signed-off-by: Chee Hong Ang --- arch/arm/mach-socfpga/timer_s10.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[PATCH v4 18/21] arm: socfpga: Add ATF support to query FPGA configuration status

2020-03-09 Thread chee . hong . ang
From: Chee Hong Ang In EL3, do_bridge_reset() directly send mailbox commands to SDM to query the FPGA configuration status. If running in non-secure mode (EL2), it invokes SMC service calls to ATF (EL3) to perform the query. Signed-off-by: Chee Hong Ang --- arch/arm/mach-socfpga/misc_s10.c

[PATCH v4 16/21] arm: socfpga: Add ATF support for Reset Manager driver

2020-03-09 Thread chee . hong . ang
From: Chee Hong Ang In non-secure mode (EL2), Reset Manager driver calls the SMC/PSCI services provided by ATF to enable/disable the SOCFPGA bridges. Signed-off-by: Chee Hong Ang --- arch/arm/mach-socfpga/reset_manager_s10.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/arch

[PATCH v4 15/21] net: designware: socfpga: MAC driver access System Manager via 'altera_sysmgr'

2020-03-09 Thread chee . hong . ang
From: Chee Hong Ang MAC driver now access System Manger's EMAC0/EMAC1/EMAC2 registers to set PHY mode via 'altera_sysmgr' driver. Signed-off-by: Chee Hong Ang --- drivers/net/dwmac_socfpga.c | 37 + 1 file changed, 17 insertions(+), 20 deletions(-) diff

[PATCH v4 13/21] mmc: dwmmc: socfpga: MMC driver access System Manager via 'altera_sysmgr'

2020-03-09 Thread chee . hong . ang
From: Chee Hong Ang MMC driver now access System Manager's SDMMC control register to set SDMMC's clock phase shift via 'altera_sysmgr' driver. Following entry need to be specified under MMC node in device tree: altr,sysmgr-syscon = < 'x' 'y' 'z'>; x = offset of the SDMCC control re

[PATCH v4 12/21] arch: arm: socfpga: Enable driver model for misc drivers.

2020-03-09 Thread chee . hong . ang
From: Chee Hong Ang Enable this misc driver model for 'altera_sysmgr' driver for socfpga platforms. Signed-off-by: Chee Hong Ang --- arch/arm/Kconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 8d9f7fc..4ee8ae0 100644 --- a/arch/arm/Kconfig

[PATCH v4 14/21] arch: arm: socfpga: Add 'altr, sysmgr-syscon' for MMC node in device tree

2020-03-09 Thread chee . hong . ang
From: Chee Hong Ang In device tree for all socfpga platforms, a phandle to System Manager ('altr,sysmgr-syscon') is needed for MMC node to enable the MMC driver to configure the SDMMC's clock phase shift via System Manager driver (altera_sysmgr). This phandle specifies the offset of the SDMCC

[PATCH v4 09/21] arm: socfpga: Define SMC function identifiers for PSCI SiP services

2020-03-09 Thread chee . hong . ang
From: Chee Hong Ang 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

[PATCH v4 08/21] arm: socfpga: Add SMC helper function for Intel SOCFPGA (64bits)

2020-03-09 Thread chee . hong . ang
From: Chee Hong Ang 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. Signed-off-by: Chee Hong Ang --- arch/arm/mach

[PATCH v4 10/21] arm: socfpga: soc64: Remove PHY interface setup from misc arch init

2020-03-09 Thread chee . hong . ang
From: Chee Hong Ang 'dwmac_socfpga' driver will setup the PHY interface during probe. PHY interface setup in arch_misc_init() is no longer needed. Signed-off-by: Chee Hong Ang --- arch/arm/mach-socfpga/misc_s10.c | 85 +--- 1 file changed, 1 insertion

[PATCH v4 05/21] arm: socfpga: Override 'lowlevel_init' to support ATF

2020-03-09 Thread chee . hong . ang
From: Chee Hong Ang 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 --- arch/arm/mach

[PATCH v4 11/21] misc: altera_sysmgr: Add Altera System Manager driver

2020-03-09 Thread chee . hong . ang
From: Chee Hong Ang This driver (misc uclass) handle the read/write access to System Manager. For 64 bits platforms, processor needs to be in secure mode to has write access to most of the System Manager's registers (except boot scratch registers). When the processor is running in EL2 (non

[PATCH v4 04/21] arm: socfpga: Load FIT image with ATF support

2020-03-09 Thread chee . hong . ang
From: Chee Hong Ang 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. Signed-off-by: Chee Hong Ang --- include/configs/socfpga_soc64_common.h | 4 1 file changed, 4 insertions(+) diff

[PATCH v4 07/21] arm: socfpga: Disable "spin-table" method for booting Linux

2020-03-09 Thread chee . hong . ang
From: Chee Hong Ang 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 --- arch/arm/mach-socfpga/Kconfig | 2 -- 1 file changed, 2 deletion

[PATCH v4 06/21] configs: socfpga: Enable FIT image loading with ATF support

2020-03-09 Thread chee . hong . ang
From: Chee Hong Ang 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 0x20 (CONFIG_SYS_TEXT_BASE). ATF will occupy the address range star

[PATCH v4 03/21] arm: socfpga: Add function for checking description from FIT image

2020-03-09 Thread chee . hong . ang
From: Chee Hong Ang 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

[PATCH v4 01/21] configs: agilex: Remove CONFIG_OF_EMBED

2020-03-09 Thread chee . hong . ang
From: Chee Hong Ang CONFIG_OF_EMBED was primarily enabled to support the agilex spl hex file requirements. Since this option now produces a warning during build, and the spl hex can be created using alternate methods, CONFIG_OF_EMBED is no longer needed. Signed-off-by: Chee Hong Ang

[PATCH v4 02/21] arm: socfpga: add fit source file for pack itb with ATF

2020-03-09 Thread chee . hong . ang
From: Chee Hong Ang Generate a FIT image for Intel SOCFPGA (64bits) which include U-boot proper, ATF and DTB for U-boot proper. Signed-off-by: Chee Hong Ang --- board/altera/soc64/its/fit_spl_atf.its | 52 ++ 1 file changed, 52 insertions(+) create mode 100644

[PATCH v4 00/21] Enable ARM Trusted Firmware for U-Boot

2020-03-09 Thread chee . hong . ang
access System Manager via the System Manager driver v3: https://lists.denx.de/pipermail/u-boot/2020-February/400986.html These patchsets have dependency on: https://lists.denx.de/pipermail/u-boot/2019-September/384906.html Chee Hong Ang (21): configs: agilex: Remove CONFIG_OF_EMBED arm: so

[PATCH v1 2/2] clk: socfpga: Switch to use ofnode API

2020-03-09 Thread chee . hong . ang
From: Chee Hong Ang Replace FDT API with more generic ofnode API. Signed-off-by: Chee Hong Ang --- drivers/clk/altera/clk-arria10.c | 52 +++- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/drivers/clk/altera/clk-arria10.c b/drivers/clk

[PATCH v1 1/2] clk: socfpga: Read the clock parent's register base in probe function

2020-03-09 Thread chee . hong . ang
From: Chee Hong Ang This commit (82de42fa14682d408da935adfb0f935354c5008f) calls child's ofdata_to_platdata() method before the parent is probed in dm core. This has caused the driver no longer able to get the correct parent clock's register base in the ofdata_to_platdata() method because

[PATCH v1 0/2] Fix A10 clock driver crash after changes in DM core

2020-03-09 Thread chee . hong . ang
a() method is called. Adjust the logic slightly so that probing parents is not done until afterwards. Signed-off-by: Simon Glass These patchsets fix the A10 driver issue and replce the FDT API with ofnode API. Chee Hong Ang (2): clk: socfpga: Read the clock parent's register base in probe func

[PATCH v3 20/21] arm: socfpga: mailbox: Add 'SYSTEM_RESET' PSCI support to mbox_reset_cold()

2020-02-20 Thread chee . hong . ang
From: Chee Hong Ang mbox_reset_cold() will invoke ATF's PSCI service when running in non-secure mode (EL2). Signed-off-by: Chee Hong Ang --- arch/arm/mach-socfpga/mailbox_s10.c | 4 1 file changed, 4 insertions(+) diff --git a/arch/arm/mach-socfpga/mailbox_s10.c b/arch/arm/mach-socfpga

[PATCH v3 19/21] arm: socfpga: stratix10: Add ATF support to FPGA reconfig driver

2020-02-20 Thread chee . hong . ang
From: Chee Hong Ang FPGA recpnfiguration driver will call the ATF's PSCI runtime services if it's running in non-secure mode (EL2). Signed-off-by: Chee Hong Ang --- drivers/fpga/stratix10.c | 141 ++- 1 file changed, 140 insertions(+), 1 deletion

[PATCH v3 21/21] configs: socfpga: Add defconfig for Agilex and Stratix 10 without ATF support

2020-02-20 Thread chee . hong . ang
From: Chee Hong Ang Booting Agilex and Stratix 10 without ATF support. SPL -> U-Boot proper -> OS (Linux) Signed-off-by: Chee Hong Ang --- configs/socfpga_agilex_nofw_defconfig| 59 ++ configs/socfpga_stratix10_nofw_defconfi

[PATCH v3 15/21] net: designware: socfpga: Secure register access in MAC driver

2020-02-20 Thread chee . hong . ang
From: Chee Hong Ang Allow MAC driver to access System Manager's EMAC control registers in non-secure mode. Signed-off-by: Chee Hong Ang --- drivers/net/dwmac_socfpga.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/dwmac_socfpga.c b/drivers/net

  1   2   3   >