[PATCH] include: configs: soc64: Use CONFIG_SPL_ATF to differentiate bootfile

2021-04-29 Thread Siew Chin Lim
nt variable. We shouldn't use CONFIG_FIT because it is enabled by default for U-Boot Proper. Signed-off-by: Siew Chin Lim --- include/configs/socfpga_soc64_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/configs/socfpga_soc64_common.h b/include/configs/so

[v2 00/17] Add Intel N5X SoC support

2021-04-30 Thread Siew Chin Lim
review again for this patch. common.h need to be included before clock_manager.h. Patch 15: - Remove socfpga_n5x.dtsi - Reuse socfpga_agilex.dtsi in socfpga_n5x_socdk.dts and update n5x data accordingly. Patch 17: - Move linux_qspi_enable from bootcommand Siew Chin Lim (16): arm:

[v2 02/17] arm: socfpga: Changed base_addr_s10.h to base_addr_soc64.h

2021-04-30 Thread Siew Chin Lim
Rename to common file name to used by all SOC64 devices and change "_S10_" to "_SOC64_" in base_addr_soc64.h. Signed-off-by: Siew Chin Lim --- .../include/mach/{base_addr_s10.h => base_addr_soc64.h} | 8 include/configs/socfpga_soc64_common.h

[v2 01/17] arm: socfpga: Move linux_qspi_enable from bootcommand to board_prep_linux function

2021-04-30 Thread Siew Chin Lim
d 'linux_qspi_enable' will refer to 'fdt_addr' environment value to retrieve the device tree node. Signed-off-by: Siew Chin Lim --- v2: - New patch in n5x series, the change is needed to execute 'linux_qspi_enable' correctly in ATF boot flow

[v2 03/17] arm: socfpga: Add base address for Intel N5X device

2021-04-30 Thread Siew Chin Lim
Reuse base_addr_soc64.h for Intel N5X device, the address is the same as Agilex. Signed-off-by: Siew Chin Lim --- arch/arm/mach-socfpga/include/mach/base_addr_soc64.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-socfpga/include/mach/base_addr_soc64.h b

[v2 04/17] arm: socfpga: Add handoff data support for Intel N5X device

2021-04-30 Thread Siew Chin Lim
N5X support both HPS handoff data and DDR handoff data. Existing HPS handoff functions are restructured to support both existing devices and N5X device. Signed-off-by: Siew Chin Lim Signed-off-by: Tien Fong Chee --- v2: - Enabled auto detect the endianness from the magic word - Merged and

[v2 06/17] arm: socfpga: Get clock manager base address for Intel N5X device

2021-04-30 Thread Siew Chin Lim
Add N5X clock manager to socfpga_get_managers_addr function. Signed-off-by: Siew Chin Lim --- arch/arm/mach-socfpga/misc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/mach-socfpga/misc.c b/arch/arm/mach-socfpga/misc.c index 64a7c9d652..9305bec38a 100644 --- a/arch/arm/mach

[v2 05/17] drivers: clk: Add clock driver for Intel N5X device

2021-04-30 Thread Siew Chin Lim
Add clock manager driver for N5X. Provides clock initialization and get_rate functions. Signed-off-by: Siew Chin Lim --- v2: - common.h need to be included before clock_manager.h - Remove unnecessary comment : write 1 to clear - Remove unnecessary () in the code --- drivers/clk/altera/Makefile

[v2 07/17] drivers: clk: Add memory clock driver for Intel N5X device

2021-04-30 Thread Siew Chin Lim
Add memory clock manager driver for N5X. Provides memory clock initialization and enable functions. Signed-off-by: Siew Chin Lim --- v2: - common.h need to be included before clock_manager.h - For consistency, use small letter fo 0x0c and 0x1c in macros --- drivers/clk/altera/Makefile

[v2 09/17] arm: socfpga: Add clock manager for Intel N5X device

2021-04-30 Thread Siew Chin Lim
Add clock manager for N5X. Signed-off-by: Siew Chin Lim --- ...k_manager_agilex.c => clock_manager_n5x.c} | 32 +-- .../mach-socfpga/include/mach/clock_manager.h | 2 ++ .../include/mach/clock_manager_n5x.h | 12 +++ 3 files changed, 29 insertions(+), 17 deleti

[v2 08/17] arm: socfpga: Move cm_get_mpu_clk_hz function declaration to clock_manager.h

2021-04-30 Thread Siew Chin Lim
Move cm_get_mpu_clk_hz function declaration from individual device's clock manager header file to common clock_manager.h. Signed-off-by: Siew Chin Lim --- arch/arm/mach-socfpga/include/mach/clock_manager.h | 1 + arch/arm/mach-socfpga/include/mach/clock_manager_agilex.h | 2 --

[v2 10/17] arm: socfpga: Changed misc_s10.c to misc_soc64.c

2021-04-30 Thread Siew Chin Lim
Rename to common file name to used by all SOC64 devices. No functionality change. Signed-off-by: Siew Chin Lim --- arch/arm/mach-socfpga/Makefile | 4 ++-- arch/arm/mach-socfpga/{misc_s10.c => misc_soc64.c} | 12 ++-- 2 files changed, 8 insertions(+), 8 deleti

[v2 11/17] ddr: socfpga: Enable memory test on memory size less than 1GB

2021-04-30 Thread Siew Chin Lim
From: Tien Fong Chee Minimum 1GB memory size is required in current memory test, so this patch improves the memory test for processing memory size less than 1GB, and the size in power of two. Signed-off-by: Tien Fong Chee --- v2: - Renamed local variable “total_size” to “remaining_size” --- d

[v2 13/17] arm: socfpga: Add SPL for Intel N5X device

2021-04-30 Thread Siew Chin Lim
Add SPL for N5X. Signed-off-by: Siew Chin Lim --- .../mach-socfpga/{spl_agilex.c => spl_n5x.c} | 37 +++ 1 file changed, 22 insertions(+), 15 deletions(-) copy arch/arm/mach-socfpga/{spl_agilex.c => spl_n5x.c} (83%) diff --git a/arch/arm/mach-socfpga/spl_agilex.c b/ar

[v2 15/17] arm: dts: Add base dtsi and devkit dts for Intel N5X device

2021-04-30 Thread Siew Chin Lim
Add device tree for N5X. Signed-off-by: Siew Chin Lim Signed-off-by: Tien Fong Chee --- v2: - Remove socfpga_n5x.dtsi - Reuse socfpga_agilex.dtsi in socfpga_n5x_socdk.dts and update n5x data accordingly. --- arch/arm/dts/Makefile | 1 + ...ex-u-boot.dtsi

[v2 14/17] board: intel: Add socdk board support for Intel N5X device

2021-04-30 Thread Siew Chin Lim
Add N5X SoC devkit board. Signed-off-by: Siew Chin Lim --- board/intel/n5x-socdk/MAINTAINERS | 7 +++ board/{altera/stratix10-socdk => intel/n5x-socdk}/Makefile | 2 +- .../{altera/stratix10-socdk => intel/n5x-socdk}/socfpga.c | 2 +- 3 files changed, 9 inse

[v2 12/17] ddr: altera: Add SDRAM driver for Intel N5X device

2021-04-30 Thread Siew Chin Lim
DMEM binaries are also part of bitstream, this bitstream would be loaded to OCRAM by SDM, and configured by DDR driver. Signed-off-by: Siew Chin Lim Signed-off-by: Tien Fong Chee --- v2: - Move is_ddr_init_skipped and its helper functions to DDR driver and converted function to positive checking

[v2 16/17] include: configs: Add Intel N5X device CONFIGs

2021-04-30 Thread Siew Chin Lim
Add CONFIGs for N5X. Signed-off-by: Siew Chin Lim --- include/configs/socfpga_n5x_socdk.h | 45 + 1 file changed, 45 insertions(+) create mode 100644 include/configs/socfpga_n5x_socdk.h diff --git a/include/configs/socfpga_n5x_socdk.h b/include/configs

[v2 17/17] arm: socfpga: Enable Intel N5X device build

2021-04-30 Thread Siew Chin Lim
Add defconfig for N5X to support legacy, ATF and VAB boot flow. Signed-off-by: Siew Chin Lim --- v2: - Move linux_qspi_enable from bootcommand --- arch/arm/mach-socfpga/Kconfig | 21 +- arch/arm/mach-socfpga/Makefile| 28

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

2020-12-21 Thread Siew Chin Lim
ger driver arm: socfpga: soc64: Add ATF support for FPGA reconfig driver arm: socfpga: mailbox: Add 'SYSTEM_RESET' PSCI support to mbox_reset_cold() arm: socfpga: soc64: SSBL shall not setup stack on OCRAM arm: socfpga: soc64: Skip handoff data access in SSBL configs: socfpga: A

[v5 01/18] arm: socfpga: Add function for checking description from FIT image

2020-12-21 Thread Siew Chin Lim
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 no

[v5 02/18] arm: socfpga: soc64: Load FIT image with ATF support

2020-12-21 Thread Siew Chin Lim
e Hong Ang Signed-off-by: Siew Chin Lim --- include/configs/socfpga_soc64_common.h | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/include/configs/socfpga_soc64_common.h b/include/configs/socfpga_soc64_common.h index fb5e2e8aaf..990f879b07 100644 --- a/inclu

[v5 03/18] arm: socfpga: soc64: Override 'lowlevel_init' to support ATF

2020-12-21 Thread Siew Chin Lim
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-socfpg

[v5 04/18] arm: socfpga: Disable "spin-table" method for booting Linux

2020-12-21 Thread Siew Chin Lim
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 deletions(-) diff --gi

[v5 05/18] arm: socfpga: soc64: Add SMC helper function for Intel SOCFPGA (64bits)

2020-12-21 Thread Siew Chin Lim
From: Chee Hong Ang 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 co

[v5 06/18] arm: socfpga: soc64: Define SMC function identifiers for PSCI SiP services

2020-12-21 Thread Siew Chin Lim
sters access, 2nd phase bitstream FPGA reconfiguration, Remote System Update (RSU) and etc. Signed-off-by: Chee Hong Ang Signed-off-by: Siew Chin Lim --- include/linux/intel-smc.h | 573 ++ 1 file changed, 573 insertions(+) create mode 100644 include/

[v5 08/18] mmc: dwmmc: Change designware MMC 'clksel' callback function to return status

2020-12-21 Thread Siew Chin Lim
en 'clksel' fail. Signed-off-by: Siew Chin Lim --- drivers/mmc/ca_dw_mmc.c | 4 +++- drivers/mmc/dw_mmc.c | 9 +++-- drivers/mmc/exynos_dw_mmc.c | 4 +++- drivers/mmc/nexell_dw_mmc.c | 4 +++- drivers/mmc/socfpga_dw_mmc.c | 4 +++- include/dwmmc.h | 2 +-

[v5 07/18] arm: socfpga: Add secure register access helper functions for SoC 64bits

2020-12-21 Thread Siew Chin Lim
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 --- v5 --- Return error code instead of hang the system if fail to

[v5 10/18] net: designware: socfpga: Add ATF support for MAC driver

2020-12-21 Thread Siew Chin Lim
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 Signed-off-by: Siew Chin Lim --- v5 --- Call secure register access helper function to write the secure register. Return error if fail

[v5 09/18] mmc: dwmmc: socfpga: Add ATF support for MMC driver

2020-12-21 Thread Siew Chin Lim
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 Signed-off-by: Siew Chin Lim --- v5 --- Call secure register access helper function to write the secure register. Return

[v5 11/18] arm: socfpga: soc64: Add ATF support for Reset Manager driver

2020-12-21 Thread Siew Chin Lim
From: 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 Signed-off-by: Siew Chin Lim --- arch/arm/mach-socfpga/reset_manager_s10.c | 13 + 1 file changed, 13

[v5 12/18] arm: socfpga: soc64: Add ATF support for FPGA reconfig driver

2020-12-21 Thread Siew Chin Lim
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/intel_sdm_mb.c | 139 1 file changed, 139 insertions(+) diff

[v5 13/18] arm: socfpga: mailbox: Add 'SYSTEM_RESET' PSCI support to mbox_reset_cold()

2020-12-21 Thread Siew Chin Lim
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 | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/arm/mach-socfpga/mailbox_s10.c b/arch/arm/mach-socfpga

[v5 14/18] arm: socfpga: soc64: SSBL shall not setup stack on OCRAM

2020-12-21 Thread Siew Chin Lim
From: 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/socfp

[v5 15/18] arm: socfpga: soc64: Skip handoff data access in SSBL

2020-12-21 Thread Siew Chin Lim
From: 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 chang

[v5 16/18] arm: socfpga: dts: soc64: Add binman node of FIT image with ATF support

2020-12-21 Thread Siew Chin Lim
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

[v5 17/18] arm: socfpga: soc64: Enable FIT image generation using binman

2020-12-21 Thread Siew Chin Lim
Enable BINMAN when using Arm-Trusted-Firmware (ATF) to generate FIT images. Signed-off-by: Siew Chin Lim --- v4 --- Adjust BINMAN sequence in code, sorted by alphabetical order. v5 --- Revert all changes in Makefile for BINMAN: (1) Remove target "fit-itb", directly use binman

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

2020-12-21 Thread Siew Chin Lim
TEXT_BASE). ATF will occupy the address range starting from 0x1000. Signed-off-by: Chee Hong Ang Signed-off-by: Siew Chin Lim --- ...ilex_defconfig => socfpga_agilex_atf_defconfig} | 22 ...0_defconfig => socfpga_stratix10_atf_defconfig} | 24 +- 2 fi

[v6 00/18] Enable ARM Trusted Firmware for U-Boot

2020-12-23 Thread Siew Chin Lim
rm: socfpga: soc64: Skip handoff data access in SSBL configs: socfpga: Add defconfig for Agilex and Stratix 10 with ATF support Siew Chin Lim (4): arm: socfpga: Add secure register access helper functions for SoC 64bits mmc: dwmmc: Change designware MMC 'clksel' callback function to

[v6 01/18] arm: socfpga: Add function for checking description from FIT image

2020-12-23 Thread Siew Chin Lim
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 no

[v6 02/18] arm: socfpga: soc64: Load FIT image with ATF support

2020-12-23 Thread Siew Chin Lim
e Hong Ang Signed-off-by: Siew Chin Lim --- include/configs/socfpga_soc64_common.h | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/include/configs/socfpga_soc64_common.h b/include/configs/socfpga_soc64_common.h index fb5e2e8aaf..990f879b07 100644 --- a/inclu

[v6 03/18] arm: socfpga: soc64: Override 'lowlevel_init' to support ATF

2020-12-23 Thread Siew Chin Lim
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-socfpg

[v6 04/18] arm: socfpga: Disable "spin-table" method for booting Linux

2020-12-23 Thread Siew Chin Lim
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 deletions(-) diff --gi

[v6 05/18] arm: socfpga: soc64: Add SMC helper function for Intel SOCFPGA (64bits)

2020-12-23 Thread Siew Chin Lim
From: Chee Hong Ang 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 co

[v6 07/18] arm: socfpga: Add secure register access helper functions for SoC 64bits

2020-12-23 Thread Siew Chin Lim
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 --- v5 --- Return error code instead of hang the system if fail to

[v6 06/18] arm: socfpga: soc64: Define SMC function identifiers for PSCI SiP services

2020-12-23 Thread Siew Chin Lim
sters access, 2nd phase bitstream FPGA reconfiguration, Remote System Update (RSU) and etc. Signed-off-by: Chee Hong Ang Signed-off-by: Siew Chin Lim --- include/linux/intel-smc.h | 573 ++ 1 file changed, 573 insertions(+) create mode 100644 include/

[v6 08/18] mmc: dwmmc: Change designware MMC 'clksel' callback function to return status

2020-12-23 Thread Siew Chin Lim
en 'clksel' fail. Signed-off-by: Siew Chin Lim --- drivers/mmc/ca_dw_mmc.c | 4 +++- drivers/mmc/dw_mmc.c | 9 +++-- drivers/mmc/exynos_dw_mmc.c | 4 +++- drivers/mmc/nexell_dw_mmc.c | 4 +++- drivers/mmc/socfpga_dw_mmc.c | 4 +++- include/dwmmc.h | 2 +-

[v6 09/18] mmc: dwmmc: socfpga: Add ATF support for MMC driver

2020-12-23 Thread Siew Chin Lim
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 Signed-off-by: Siew Chin Lim --- v5 --- Call secure register access helper function to write the secure register. Return

[v6 10/18] net: designware: socfpga: Add ATF support for MAC driver

2020-12-23 Thread Siew Chin Lim
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 Signed-off-by: Siew Chin Lim --- v5 --- Call secure register access helper function to write the secure register. Return error if fail

[v6 11/18] arm: socfpga: soc64: Add ATF support for Reset Manager driver

2020-12-23 Thread Siew Chin Lim
From: 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 Signed-off-by: Siew Chin Lim --- arch/arm/mach-socfpga/reset_manager_s10.c | 13 + 1 file changed, 13

[v6 12/18] arm: socfpga: soc64: Add ATF support for FPGA reconfig driver

2020-12-23 Thread Siew Chin Lim
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/intel_sdm_mb.c | 139 1 file changed, 139 insertions(+) diff

[v6 13/18] arm: socfpga: mailbox: Add 'SYSTEM_RESET' PSCI support to mbox_reset_cold()

2020-12-23 Thread Siew Chin Lim
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 | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/arm/mach-socfpga/mailbox_s10.c b/arch/arm/mach-socfpga

[v6 14/18] arm: socfpga: soc64: SSBL shall not setup stack on OCRAM

2020-12-23 Thread Siew Chin Lim
From: 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/socfp

[v6 15/18] arm: socfpga: soc64: Skip handoff data access in SSBL

2020-12-23 Thread Siew Chin Lim
From: 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 chang

[v6 16/18] arm: socfpga: dts: soc64: Add binman node of FIT image with ATF support

2020-12-23 Thread Siew Chin Lim
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

[v6 17/18] arm: socfpga: soc64: Enable FIT image generation using binman

2020-12-23 Thread Siew Chin Lim
Enable BINMAN when using Arm-Trusted-Firmware (ATF) to generate FIT images. Signed-off-by: Siew Chin Lim --- v4 --- Adjust BINMAN sequence in code, sorted by alphabetical order. v5 --- Revert all changes in Makefile for BINMAN: (1) Remove target "fit-itb", directly use binman

[v6 18/18] configs: socfpga: Add defconfig for Agilex and Stratix 10 with ATF support

2020-12-23 Thread Siew Chin Lim
TEXT_BASE). ATF will occupy the address range starting from 0x1000. Signed-off-by: Chee Hong Ang Signed-off-by: Siew Chin Lim --- ...ilex_defconfig => socfpga_agilex_atf_defconfig} | 22 ...0_defconfig => socfpga_stratix10_atf_defconfig} | 24 +- 2 fi

[v7 00/18] Enable ARM Trusted Firmware for U-Boot

2020-12-24 Thread Siew Chin Lim
rm: socfpga: soc64: Skip handoff data access in SSBL configs: socfpga: Add defconfig for Agilex and Stratix 10 with ATF support Siew Chin Lim (4): arm: socfpga: Add secure register access helper functions for SoC 64bits mmc: dwmmc: Change designware MMC 'clksel' callback functi

[v7 01/18] arm: socfpga: Add function for checking description from FIT image

2020-12-24 Thread Siew Chin Lim
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 no

[v7 02/18] arm: socfpga: soc64: Load FIT image with ATF support

2020-12-24 Thread Siew Chin Lim
e Hong Ang Signed-off-by: Siew Chin Lim --- include/configs/socfpga_soc64_common.h | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/include/configs/socfpga_soc64_common.h b/include/configs/socfpga_soc64_common.h index fb5e2e8aaf..990f879b07 100644 --- a/inclu

[v7 03/18] arm: socfpga: soc64: Override 'lowlevel_init' to support ATF

2020-12-24 Thread Siew Chin Lim
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-socfpg

[v7 04/18] arm: socfpga: Disable "spin-table" method for booting Linux

2020-12-24 Thread Siew Chin Lim
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 deletions(-) diff --gi

[v7 05/18] arm: socfpga: soc64: Add SMC helper function for Intel SOCFPGA (64bits)

2020-12-24 Thread Siew Chin Lim
From: Chee Hong Ang 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 co

[v7 06/18] arm: socfpga: soc64: Define SMC function identifiers for PSCI SiP services

2020-12-24 Thread Siew Chin Lim
sters access, 2nd phase bitstream FPGA reconfiguration, Remote System Update (RSU) and etc. Signed-off-by: Chee Hong Ang Signed-off-by: Siew Chin Lim --- include/linux/intel-smc.h | 573 ++ 1 file changed, 573 insertions(+) create mode 100644 include/

[v7 09/18] mmc: dwmmc: socfpga: Add ATF support for MMC driver

2020-12-24 Thread Siew Chin Lim
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 Signed-off-by: Siew Chin Lim --- v5 --- Call secure register access helper function to write the secure register. Return

[v7 08/18] mmc: dwmmc: Change designware MMC 'clksel' callback function to return status

2020-12-24 Thread Siew Chin Lim
en 'clksel' fail. Signed-off-by: Siew Chin Lim --- drivers/mmc/ca_dw_mmc.c | 4 +++- drivers/mmc/dw_mmc.c | 9 +++-- drivers/mmc/exynos_dw_mmc.c | 4 +++- drivers/mmc/nexell_dw_mmc.c | 4 +++- drivers/mmc/socfpga_dw_mmc.c | 4 +++- include/dwmmc.h | 2 +-

[v7 07/18] arm: socfpga: Add secure register access helper functions for SoC 64bits

2020-12-24 Thread Siew Chin Lim
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 --- v5 --- Return error code instead of hang the system if fail to

[v7 10/18] net: designware: socfpga: Add ATF support for MAC driver

2020-12-24 Thread Siew Chin Lim
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 Signed-off-by: Siew Chin Lim --- v5 --- Call secure register access helper function to write the secure register. Return error if fail

[v7 11/18] arm: socfpga: soc64: Add ATF support for Reset Manager driver

2020-12-24 Thread Siew Chin Lim
From: 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 Signed-off-by: Siew Chin Lim --- arch/arm/mach-socfpga/reset_manager_s10.c | 13 + 1 file changed, 13

[v7 12/18] arm: socfpga: soc64: Add ATF support for FPGA reconfig driver

2020-12-24 Thread Siew Chin Lim
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/intel_sdm_mb.c | 139 1 file changed, 139 insertions(+) diff

[v7 13/18] arm: socfpga: mailbox: Add 'SYSTEM_RESET' PSCI support to mbox_reset_cold()

2020-12-24 Thread Siew Chin Lim
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 | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/arm/mach-socfpga/mailbox_s10.c b/arch/arm/mach-socfpga

[v7 14/18] arm: socfpga: soc64: SSBL shall not setup stack on OCRAM

2020-12-24 Thread Siew Chin Lim
From: 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/socfp

[v7 15/18] arm: socfpga: soc64: Skip handoff data access in SSBL

2020-12-24 Thread Siew Chin Lim
From: 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 chang

[v7 17/18] arm: socfpga: soc64: Enable FIT image generation using binman

2020-12-24 Thread Siew Chin Lim
Enable BINMAN when using Arm-Trusted-Firmware (ATF) to generate FIT images. Signed-off-by: Siew Chin Lim --- v4 --- Adjust BINMAN sequence in code, sorted by alphabetical order. v5 --- Revert all changes in Makefile for BINMAN: (1) Remove target "fit-itb", directly use binman

[v7 16/18] arm: socfpga: dts: soc64: Add binman node of FIT image with ATF support

2020-12-24 Thread Siew Chin Lim
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

[v7 18/18] configs: socfpga: Add defconfig for Agilex and Stratix 10 with ATF support

2020-12-24 Thread Siew Chin Lim
TEXT_BASE). ATF will occupy the address range starting from 0x1000. Signed-off-by: Chee Hong Ang Signed-off-by: Siew Chin Lim --- ...ilex_defconfig => socfpga_agilex_atf_defconfig} | 22 ...0_defconfig => socfpga_stratix10_atf_defconfig} | 24 +- 2 fi

[v2 0/6] Add Vendor Authorized Boot (VAB) support

2021-01-07 Thread Siew Chin Lim
-- Enable ARM Trusted Firmware for U-Boot https://patchwork.ozlabs.org/project/uboot/cover/20201224102113.32972-1-elly.siew.chin@intel.com/ Siew Chin Lim (6): arm: socfpga: Move Stratix10 and Agilex to use TARGET_SOCFPGA_SOC64 arm: socfpga: soc64: Support Vendor Authorized Boot (VAB)

[v2 1/6] arm: socfpga: Move Stratix10 and Agilex to use TARGET_SOCFPGA_SOC64

2021-01-07 Thread Siew Chin Lim
Create common macro TARGET_SOCFPGA_SOC64 for Stratix10 and Agilex. Signed-off-by: Siew Chin Lim --- v2 --- - This is new patch in 2nd version of VAB series. This is code clean up without functional change. --- arch/arm/Kconfig| 6 +++--- arch/arm/mach

[v2 2/6] arm: socfpga: soc64: Support Vendor Authorized Boot (VAB)

2021-01-07 Thread Siew Chin Lim
Secure Device Manager (SDM) for authentication. U-Boot will validate the SHA384 of the image against the SHA384 hash stored in the VAB certificate before sending the image to SDM for authentication. Signed-off-by: Siew Chin Lim --- v2 --- - Renamed SECURE_VAB_AUTH* to SOCFPGA_SECURE_VAB_AUTH

[v2 3/6] arm: socfpga: cmd: Support 'vab' command

2021-01-07 Thread Siew Chin Lim
Support 'vab' command to perform vendor authentication. Command format: vab addr len Authorize 'len' bytes starting at 'addr' via vendor public key Signed-off-by: Siew Chin Lim --- arch/arm/mach-socfpga/Makefile | 1 + arch/

[v2 4/6] arm: socfpga: dts: soc64: Update filename in binman node of FIT image with VAB support

2021-01-07 Thread Siew Chin Lim
FIT image of Vendor Authentication Coot (VAB) contains signed images. Signed-off-by: Siew Chin Lim --- arch/arm/dts/socfpga_soc64_fit-u-boot.dtsi | 22 ++ 1 file changed, 22 insertions(+) diff --git a/arch/arm/dts/socfpga_soc64_fit-u-boot.dtsi b/arch/arm/dts

[v2 5/6] configs: socfpga: soc64: Move CONFIG_BOOTCOMMAND to defconfig

2021-01-07 Thread Siew Chin Lim
CONFIG_BOOTCOMMAND have been moved to Kconfig.boot. This patch move the CONFIG_BOOTCOMMAND macro from socfpga_soc64_common.h to *_defconfig file for both Stratix 10 and Agilex. Signed-off-by: Siew Chin Lim --- v2 --- - This is new patch in 2nd version of VAB series. This is code clean up

[v2 6/6] configs: socfpga: Add defconfig for Agilex with VAB support

2021-01-07 Thread Siew Chin Lim
Booting Agilex with Vendor Authorized Boot. Signed-off-by: Siew Chin Lim --- v2 --- - Renamed CONFIG_SECURE_VAB_AUTH to CONFIG_SOCFPGA_SECURE_VAB_AUTH - Add BOOTCOMMAND macro in defconfig --- .../{socfpga_agilex_atf_defconfig => socfpga_agilex_vab_defconfig} | 5 +++-- 1 file changed

[PATCH] arm: socfpga: smc: Remove unused SMC function ID

2021-03-12 Thread Siew Chin Lim
Remove unused SMC function ID 61 and 62. Signed-off-by: Siew Chin Lim --- include/linux/intel-smc.h | 52 --- 1 file changed, 52 deletions(-) diff --git a/include/linux/intel-smc.h b/include/linux/intel-smc.h index cacb410691..68d62be417 100644 --- a

[PATCH] arm: socfpga: Move Stratix10 and Agilex SPL common code

2021-03-15 Thread Siew Chin Lim
Move Stratix10 and Agilex SPL common code to spl_soc64.c. We are in preparation for new n5x device support. No functional change in this patch. Signed-off-by: Siew Chin Lim --- arch/arm/mach-socfpga/Makefile | 2 ++ arch/arm/mach-socfpga/spl_agilex.c | 16 arch/arm/mach

[v1 0/5] Restructure Stratix10 and Agilex handoff code

2021-03-15 Thread Siew Chin Lim
/ This patchset has dependency on: 1. arm: socfpga: Move Stratix10 and Agilex SPL common code https://patchwork.ozlabs.org/project/uboot/patch/20210315075916.26336-1-elly.siew.chin....@intel.com/ Siew Chin Lim (5): arm: socfpga: Rename Stratix10 and Agilex handoff common macros a

[v1 1/5] arm: socfpga: Rename Stratix10 and Agilex handoff common macros

2021-03-15 Thread Siew Chin Lim
Rename handoff_s10.h to handoff_soc64.h. Changed macros prefix from S10_HANDOFF to SOC64_HANDOFF. Signed-off-by: Siew Chin Lim --- arch/arm/mach-socfpga/clock_manager_s10.c | 2 +- arch/arm/mach-socfpga/include/mach/handoff_s10.h | 39 -- arch/arm/mach-socfpga

[v1 2/5] arm: socfpga: Changed wrap_pll_config_s10.c to wrap_pll_config_soc64.c

2021-03-15 Thread Siew Chin Lim
Rename to common file name to used by all SOC64 devices. Signed-off-by: Siew Chin Lim --- arch/arm/mach-socfpga/Makefile| 4 ++-- .../mach-socfpga/{wrap_pll_config_s10.c => wrap_pll_config_soc64.c} | 0 2 files changed, 2 insertions(+), 2 deleti

[v1 3/5] arm: socfpga: Changed system_manager_s10.c to system_manager_soc64.c

2021-03-15 Thread Siew Chin Lim
Rename to common file name to used by all SOC64 devices. No functionality change. Signed-off-by: Siew Chin Lim --- arch/arm/mach-socfpga/Makefile| 4 ++-- .../arm/mach-socfpga/{system_manager_s10.c => system_manager_soc64.c} | 0 2 files changed

[v1 4/5] arm: socfpga: Rearrange sequence of macros in handoff_soc64.h

2021-03-15 Thread Siew Chin Lim
Rearrange sequence of macros in handoff_soc64.h without any functionality change. In preparation for Stratix10 and Agilex handoff function restructuring. Signed-off-by: Siew Chin Lim --- arch/arm/mach-socfpga/include/mach/handoff_soc64.h | 22 -- 1 file changed, 12

[v1 5/5] arm: socfpga: Restructure Stratix10 and Agilex handoff code

2021-03-15 Thread Siew Chin Lim
handoff function in wrap_handoff_soc64.c. Signed-off-by: Siew Chin Lim --- arch/arm/mach-socfpga/Makefile | 4 +- arch/arm/mach-socfpga/include/mach/handoff_soc64.h | 21 +++ .../include/mach/system_manager_soc64.h| 4 -- arch/arm/mach-socfpga

[v1 0/2] Store QSPI reference clock in kHz for SOCFPGA SOC64

2021-03-15 Thread Siew Chin Lim
2. Restructure Stratix10 and Agilex handoff code https://patchwork.ozlabs.org/project/uboot/cover/20210315094329.30282-1-elly.siew.chin@intel.com/ Siew Chin Lim (2): arm: socfpga: Move Stratix10 and Agilex clock manager common code arm: socfpga: Changed to store QSPI reference clock

[v1 2/2] arm: socfpga: Changed to store QSPI reference clock in kHz

2021-03-15 Thread Siew Chin Lim
bits, QSPI reference clock frequency is converted to kHz from Hz. Signed-off-by: Siew Chin Lim Signed-off-by: Tien Fong Chee --- arch/arm/mach-socfpga/clock_manager.c | 5 +-- .../include/mach/system_manager_soc64.h| 16 - arch/arm/mach-socfpga/mailbox_s10.c

[v1 1/2] arm: socfpga: Move Stratix10 and Agilex clock manager common code

2021-03-15 Thread Siew Chin Lim
Move duplicated function cm_get_qspi_controller_clk_hz to clock_manager.c. Signed-off-by: Siew Chin Lim Signed-off-by: Tien Fong Chee --- arch/arm/mach-socfpga/clock_manager.c | 15 --- arch/arm/mach-socfpga/clock_manager_agilex.c | 6 -- arch/arm

[PATCH] arm: socfpga: Only do 'is OS booted from FIT' checking when VAB is enabled

2021-03-22 Thread Siew Chin Lim
dtb file. Thus, we should not do 'if OS is booted from FIT' checking in board_prep_linux function. Signed-off-by: Siew Chin Lim --- arch/arm/mach-socfpga/board.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-socfpga/board.c b/arch/arm/mach-socf

[v2 0/5] Restructure Stratix10 and Agilex handoff code

2021-03-23 Thread Siew Chin Lim
cfpga: Move Stratix10 and Agilex SPL common code https://patchwork.ozlabs.org/project/uboot/patch/20210315075916.26336-1-elly.siew.chin@intel.com/ Siew Chin Lim (5): arm: socfpga: Rename Stratix10 and Agilex handoff common macros arm: socfpga: Changed wrap_pll_config_s10.c to wrap

[v2 1/5] arm: socfpga: Rename Stratix10 and Agilex handoff common macros

2021-03-23 Thread Siew Chin Lim
Rename handoff_s10.h to handoff_soc64.h. Changed macros prefix from S10_HANDOFF to SOC64_HANDOFF. Signed-off-by: Siew Chin Lim --- arch/arm/mach-socfpga/clock_manager_s10.c | 2 +- arch/arm/mach-socfpga/include/mach/handoff_s10.h | 39 -- arch/arm/mach-socfpga

[v2 2/5] arm: socfpga: Changed wrap_pll_config_s10.c to wrap_pll_config_soc64.c

2021-03-23 Thread Siew Chin Lim
Rename to common file name to used by all SOC64 devices. Signed-off-by: Siew Chin Lim --- arch/arm/mach-socfpga/Makefile| 4 ++-- .../mach-socfpga/{wrap_pll_config_s10.c => wrap_pll_config_soc64.c} | 0 2 files changed, 2 insertions(+), 2 deleti

[v2 3/5] arm: socfpga: Changed system_manager_s10.c to system_manager_soc64.c

2021-03-23 Thread Siew Chin Lim
Rename to common file name to used by all SOC64 devices. No functionality change. Signed-off-by: Siew Chin Lim --- arch/arm/mach-socfpga/Makefile| 4 ++-- .../arm/mach-socfpga/{system_manager_s10.c => system_manager_soc64.c} | 0 2 files changed

[v2 4/5] arm: socfpga: Rearrange sequence of macros in handoff_soc64.h

2021-03-23 Thread Siew Chin Lim
Rearrange sequence of macros in handoff_soc64.h without any functionality change. In preparation for Stratix10 and Agilex handoff function restructuring. Signed-off-by: Siew Chin Lim --- arch/arm/mach-socfpga/include/mach/handoff_soc64.h | 22 -- 1 file changed, 12

  1   2   3   4   >