Add Intel N5X SoC support
Subsystems (5)
v6 cover Add Intel N5X SoC support
This is the 6th version of patchset to add Intel N5X SoC[1] support.
Intel N5X SoC is with a 64-bit quad core ARM Cortex-A53 MPCore hard processor system (HPS). New IPs in N5X are clock manager and DDR subsystem, other IPs have minor changes compared to Agilex.
Intel N5X SoC supports legacy boot without ATF for debugging purpose, ATF boot, and ATF boot with VAB enabled.
Patch status:
Have changes: Patch 15
Other patches unchanged.
Detail changelog can find in commit message.
v5->v6:
--------
Patch 15:
- Sort the node name in alphanumeric order in socfpga_n5x_socdk-u-boot.dtsi
- Remove duplicated qspi node from socfpga_n5x_socdk-u-boot.dtsi, It is defined in socfpga_n5x_socdk.dtsi
- Remove the incorrect clkmgr compatible name in socfpga_n5x_socdk.dtsi
History:
--------
[v1] https://patchwork.ozlabs.org/project/uboot/cover/[email protected]/
[v2] https://patchwork.ozlabs.org/project/uboot/cover/[email protected]/
[v3] https://patchwork.ozlabs.org/project/uboot/cover/[email protected]/
[v4] https://patchwork.ozlabs.org/project/uboot/cover/[email protected]/
[v5] https://patchwork.ozlabs.org/project/uboot/cover/[email protected]/
Siew Chin Lim (14):
arm: socfpga: Move linux_qspi_enable from bootcommand to
board_prep_linux function
arm: socfpga: Changed base_addr_s10.h to base_addr_soc64.h
arm: socfpga: Add base address for Intel N5X device
drivers: clk: Add clock driver for Intel N5X device
arm: socfpga: Get clock manager base address for Intel N5X device
drivers: clk: Add memory clock driver for Intel N5X device
arm: socfpga: Move cm_get_mpu_clk_hz function declaration to
clock_manager.h
arm: socfpga: Add clock manager for Intel N5X device
arm: socfpga: Changed misc_s10.c to misc_soc64.c
arm: socfpga: Add SPL for Intel N5X device
board: intel: Add socdk board support for Intel N5X device
arm: dts: Add base dtsi and devkit dts for Intel N5X device
include: configs: Add Intel N5X device CONFIGs
arm: socfpga: Enable Intel N5X device build
Tien Fong Chee (3):
arm: socfpga: Add handoff data support for Intel N5X device
ddr: socfpga: Enable memory test on memory size less than 1GB
ddr: altera: Add SDRAM driver for Intel N5X device
arch/arm/dts/Makefile | 1 +
arch/arm/dts/socfpga_n5x-u-boot.dtsi | 191 ++
arch/arm/dts/socfpga_n5x_socdk-u-boot.dtsi | 63 +
arch/arm/dts/socfpga_n5x_socdk.dts | 122 ++
arch/arm/mach-socfpga/Kconfig | 21 +-
arch/arm/mach-socfpga/Makefile | 32 +-
arch/arm/mach-socfpga/board.c | 17 +-
arch/arm/mach-socfpga/clock_manager_n5x.c | 80 +
.../mach/{base_addr_s10.h => base_addr_soc64.h} | 11 +-
arch/arm/mach-socfpga/include/mach/clock_manager.h | 3 +
.../include/mach/clock_manager_agilex.h | 2 -
.../include/mach/clock_manager_arria10.h | 1 -
.../mach-socfpga/include/mach/clock_manager_gen5.h | 1 -
.../mach-socfpga/include/mach/clock_manager_n5x.h | 12 +
.../mach-socfpga/include/mach/clock_manager_s10.h | 1 -
arch/arm/mach-socfpga/include/mach/firewall.h | 6 +
arch/arm/mach-socfpga/include/mach/handoff_soc64.h | 38 +-
.../include/mach/system_manager_soc64.h | 10 +-
arch/arm/mach-socfpga/misc.c | 3 +
arch/arm/mach-socfpga/{misc_s10.c => misc_soc64.c} | 12 +-
arch/arm/mach-socfpga/spl_n5x.c | 94 +
arch/arm/mach-socfpga/system_manager_soc64.c | 18 +-
arch/arm/mach-socfpga/wrap_handoff_soc64.c | 132 +-
board/intel/n5x-socdk/MAINTAINERS | 7 +
board/intel/n5x-socdk/Makefile | 7 +
board/intel/n5x-socdk/socfpga.c | 7 +
configs/socfpga_agilex_atf_defconfig | 2 +-
...lex_atf_defconfig => socfpga_n5x_atf_defconfig} | 13 +-
..._agilex_atf_defconfig => socfpga_n5x_defconfig} | 28 +-
...lex_atf_defconfig => socfpga_n5x_vab_defconfig} | 14 +-
configs/socfpga_stratix10_atf_defconfig | 2 +-
drivers/clk/altera/Makefile | 4 +-
drivers/clk/altera/clk-mem-n5x.c | 136 ++
drivers/clk/altera/clk-mem-n5x.h | 84 +
drivers/clk/altera/clk-n5x.c | 489 +++++
drivers/clk/altera/clk-n5x.h | 217 ++
drivers/ddr/altera/Makefile | 3 +-
drivers/ddr/altera/sdram_n5x.c | 2298 ++++++++++++++++++++
drivers/ddr/altera/sdram_soc64.c | 94 +-
drivers/ddr/altera/sdram_soc64.h | 1 +
include/configs/socfpga_n5x_socdk.h | 45 +
include/configs/socfpga_soc64_common.h | 2 +-
include/dt-bindings/clock/n5x-clock.h | 71 +
43 files changed, 4276 insertions(+), 119 deletions(-)
create mode 100644 arch/arm/dts/socfpga_n5x-u-boot.dtsi
create mode 100644 arch/arm/dts/socfpga_n5x_socdk-u-boot.dtsi
create mode 100644 arch/arm/dts/socfpga_n5x_socdk.dts
create mode 100644 arch/arm/mach-socfpga/clock_manager_n5x.c
rename arch/arm/mach-socfpga/include/mach/{base_addr_s10.h => base_addr_soc64.h} (85%)
create mode 100644 arch/arm/mach-socfpga/include/mach/clock_manager_n5x.h
rename arch/arm/mach-socfpga/{misc_s10.c => misc_soc64.c} (100%)
create mode 100644 arch/arm/mach-socfpga/spl_n5x.c
create mode 100644 board/intel/n5x-socdk/MAINTAINERS
create mode 100644 board/intel/n5x-socdk/Makefile
create mode 100644 board/intel/n5x-socdk/socfpga.c
copy configs/{socfpga_agilex_atf_defconfig => socfpga_n5x_atf_defconfig} (83%)
copy configs/{socfpga_agilex_atf_defconfig => socfpga_n5x_defconfig} (64%)
copy configs/{socfpga_agilex_atf_defconfig => socfpga_n5x_vab_defconfig} (82%)
create mode 100644 drivers/clk/altera/clk-mem-n5x.c
create mode 100644 drivers/clk/altera/clk-mem-n5x.h
create mode 100644 drivers/clk/altera/clk-n5x.c
create mode 100644 drivers/clk/altera/clk-n5x.h
create mode 100644 drivers/ddr/altera/sdram_n5x.c
create mode 100644 include/configs/socfpga_n5x_socdk.h
create mode 100644 include/dt-bindings/clock/n5x-clock.hSignature · 1 line
2.13.0
PATCH v6 1/17 arm: socfpga: Move linux_qspi_enable from bootcommand to board_prep_linux function
Move 'linux_qspi_enable' from bootcommand to board_prep_linux function when OS booted from FIT image for Stratix 10 and Agilex. This flow is common for all Intel SOC64 devices.
U-Boot will update 'fdt_addr' environment value based on FIT image in board_prep_linux function, and 'linux_qspi_enable' will refer to 'fdt_addr' environment value to retrieve the device tree node.
--- arch/arm/mach-socfpga/board.c | 17 +++++++++-------- configs/socfpga_agilex_atf_defconfig | 2 +- configs/socfpga_stratix10_atf_defconfig | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-)
arch/arm/mach-socfpga/board.c +9 -8
@@ -116,17 +116,18 @@ void board_fit_image_post_process(const void *fit, int node, void **p_image,#if !IS_ENABLED (CONFIG_SPL_BUILD ) &&IS_ENABLED (CONFIG_FIT )void board_prep_linux (bootm_headers_t *images) { -if (IS_ENABLED (CONFIG_SOCFPGA_SECURE_VAB_AUTH ) && - !IS_ENABLED (CONFIG_SOCFPGA_SECURE_VAB_AUTH_ALLOW_NON_FIT_IMAGE )) { -/* -* Ensure the OS is always booted from FIT and with -* VAB signed certificate -*/ -if (!images->fit_uname_cfg) { +if (!images->fit_uname_cfg) { +if (IS_ENABLED (CONFIG_SOCFPGA_SECURE_VAB_AUTH ) && + !IS_ENABLED (CONFIG_SOCFPGA_SECURE_VAB_AUTH_ALLOW_NON_FIT_IMAGE )) { +/* +* Ensure the OS is always booted from FIT and with +* VAB signed certificate +*/ printf ("Please use FIT with VAB signed images!\n" );hang (); } - + }else { +/* Update fdt_addr in enviroment variable */ env_set_hex ("fdt_addr" , (ulong )images->ft_addr);debug ("images->ft_addr = 0x%08lx\n" , (ulong )images->ft_addr); }
configs/socfpga_agilex_atf_defconfig +1 -1
@@ -22,7 +22,7 @@ CONFIG_BOOTDELAY=5 CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="earlycon" CONFIG_USE_BOOTCOMMAND=y -CONFIG_BOOTCOMMAND="run fatscript; run mmcfitload; run linux_qspi_enable; run mmcfitboot" +CONFIG_BOOTCOMMAND="run fatscript; run mmcfitload; run mmcfitboot" CONFIG_SPL_CRC32=y CONFIG_SPL_CACHE=y CONFIG_SPL_SPI_LOAD=y
configs/socfpga_stratix10_atf_defconfig +1 -1
@@ -22,7 +22,7 @@ CONFIG_BOOTDELAY=5 CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="earlycon" CONFIG_USE_BOOTCOMMAND=y -CONFIG_BOOTCOMMAND="run fatscript; run mmcfitload; run linux_qspi_enable; run mmcfitboot" +CONFIG_BOOTCOMMAND="run fatscript; run mmcfitload; run mmcfitboot" CONFIG_SPL_CRC32=y CONFIG_SPL_SPI_LOAD=y CONFIG_SPL_ATF=y
Signature · 1 line
2.13.0
PATCH v6 2/17 arm: socfpga: Changed base_addr_s10.h to base_addr_soc64.h
In reply to Siew Chin LimRename to common file name to used by all SOC64 devices and change "_S10_" to "_SOC64_" in base_addr_soc64.h.
---
.../include/mach/{base_addr_s10.h => base_addr_soc64.h} | 8 ++++----
include/configs/socfpga_soc64_common.h | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
rename arch/arm/mach-socfpga/include/mach/{base_addr_s10.h => base_addr_soc64.h} (89%)arch/arm/mach-socfpga/include/mach/base_addr_soc64.h renamed from arch/arm/mach-socfpga/include/mach/base_addr_s10.h +4 -4
@@ -1,10 +1,10 @@/* SPDX-License-Identifier: GPL-2.0 */ /* -* Copyright (C) 2016-2017 Intel Corporation <www.intel.com> +* Copyright (C) 2016-2021 Intel Corporation <www.intel.com> */ -#ifndef _SOCFPGA_S10_BASE_HARDWARE_H_ -#define _SOCFPGA_S10_BASE_HARDWARE_H_ +#ifndef _SOCFPGA_SOC64_BASE_HARDWARE_H_ +#define _SOCFPGA_SOC64_BASE_HARDWARE_H_#define SOCFPGA_CCU_ADDRESS 0xf7000000#define SOCFPGA_SDR_SCHEDULER_ADDRESS 0xf8000400
@@ -44,4 +44,4 @@#define GICD_BASE 0xfffc1000#define GICC_BASE 0xfffc2000 -#endif /* _SOCFPGA_S10_BASE_HARDWARE_H_ */ +#endif /* _SOCFPGA_SOC64_BASE_HARDWARE_H_ */
include/configs/socfpga_soc64_common.h +1 -1
@@ -7,7 +7,7 @@#ifndef __CONFIG_SOCFPGA_SOC64_COMMON_H__#define __CONFIG_SOCFPGA_SOC64_COMMON_H__ -#include <asm/arch/base_addr_s10.h> +#include <asm/arch/base_addr_soc64.h> #include <asm/arch/handoff_soc64.h> #include <linux/stringify.h>
Signature · 1 line
2.13.0
PATCH v6 3/17 arm: socfpga: Add base address for Intel N5X device
In reply to Siew Chin LimReuse base_addr_soc64.h for Intel N5X device, the address is the same as Agilex.
--- arch/arm/mach-socfpga/include/mach/base_addr_soc64.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/mach-socfpga/include/mach/base_addr_soc64.h +2 -1
@@ -10,7 +10,8 @@#define SOCFPGA_SDR_SCHEDULER_ADDRESS 0xf8000400#define SOCFPGA_HMC_MMR_IO48_ADDRESS 0xf8010000#define SOCFPGA_SDR_ADDRESS 0xf8011000 -#ifdef CONFIG_TARGET_SOCFPGA_AGILEX +#if IS_ENABLED (CONFIG_TARGET_SOCFPGA_AGILEX ) || \ +IS_ENABLED (CONFIG_TARGET_SOCFPGA_N5X )#define SOCFPGA_FW_MPU_DDR_SCR_ADDRESS 0xf8020200#else #define SOCFPGA_FW_MPU_DDR_SCR_ADDRESS 0xf8020100
Signature · 1 line
2.13.0
PATCH v6 4/17 arm: socfpga: Add handoff data support for Intel N5X device
In reply to Siew Chin LimFrom: Tien Fong Chee <[email protected]>
N5X support both HPS handoff data and DDR handoff data. Existing HPS handoff functions are restructured to support both existing devices and N5X device.
--- arch/arm/mach-socfpga/include/mach/handoff_soc64.h | 38 +++++- arch/arm/mach-socfpga/system_manager_soc64.c | 18 +-- arch/arm/mach-socfpga/wrap_handoff_soc64.c | 132 +++++++++++++++------ 3 files changed, 140 insertions(+), 48 deletions(-)
arch/arm/mach-socfpga/include/mach/handoff_soc64.h +33 -5
@@ -1,6 +1,6 @@/* SPDX-License-Identifier: GPL-2.0 * -* Copyright (C) 2016-2020 Intel Corporation <www.intel.com> +* Copyright (C) 2016-2021 Intel Corporation <www.intel.com> * */
@@ -23,8 +23,36 @@#define SOC64_HANDOFF_OFFSET_DATA 0x10#define SOC64_HANDOFF_SIZE 4096 +#if IS_ENABLED (CONFIG_TARGET_SOCFPGA_STRATIX10 ) || \ +IS_ENABLED (CONFIG_TARGET_SOCFPGA_AGILEX )#define SOC64_HANDOFF_BASE 0xFFE3F000#define SOC64_HANDOFF_MISC (SOC64_HANDOFF_BASE + 0x610) +#elif IS_ENABLED (CONFIG_TARGET_SOCFPGA_N5X ) +#define SOC64_HANDOFF_BASE 0xFFE5F000 +#define SOC64_HANDOFF_MISC (SOC64_HANDOFF_BASE + 0x630) + +/* DDR handoff */ +#define SOC64_HANDOFF_DDR_BASE 0xFFE5C000 +#define SOC64_HANDOFF_DDR_MAGIC 0x48524444 +#define SOC64_HANDOFF_DDR_UMCTL2_MAGIC 0x4C54434D +#define SOC64_HANDOFF_DDR_UMCTL2_DDR4_TYPE 0x34524444 +#define SOC64_HANDOFF_DDR_UMCTL2_LPDDR4_0_TYPE 0x3044504C +#define SOC64_HANDOFF_DDR_UMCTL2_LPDDR4_1_TYPE 0x3144504C +#define SOC64_HANDOFF_DDR_MEMRESET_BASE (SOC64_HANDOFF_DDR_BASE + 0xC) +#define SOC64_HANDOFF_DDR_UMCTL2_SECTION (SOC64_HANDOFF_DDR_BASE + 0x10) +#define SOC64_HANDOFF_DDR_PHY_MAGIC 0x43594850 +#define SOC64_HANDOFF_DDR_PHY_INIT_ENGINE_MAGIC 0x45594850 +#define SOC64_HANDOFF_DDR_PHY_BASE_OFFSET 0x8 +#define SOC64_HANDOFF_DDR_UMCTL2_TYPE_OFFSET 0x8 +#define SOC64_HANDOFF_DDR_UMCTL2_BASE_ADDR_OFFSET 0xC +#define SOC64_HANDOFF_DDR_TRAIN_IMEM_1D_SECTION 0xFFE50000 +#define SOC64_HANDOFF_DDR_TRAIN_DMEM_1D_SECTION 0xFFE58000 +#define SOC64_HANDOFF_DDR_TRAIN_IMEM_2D_SECTION 0xFFE44000 +#define SOC64_HANDOFF_DDR_TRAIN_DMEM_2D_SECTION 0xFFE4C000 +#define SOC64_HANDOFF_DDR_TRAIN_IMEM_LENGTH SZ_32K +#define SOC64_HANDOFF_DDR_TRAIN_DMEM_LENGTH SZ_16K +#endif +#define SOC64_HANDOFF_MUX (SOC64_HANDOFF_BASE + 0x10)#define SOC64_HANDOFF_IOCTL (SOC64_HANDOFF_BASE + 0x1A0)#define SOC64_HANDOFF_FPGA (SOC64_HANDOFF_BASE + 0x330)
@@ -52,11 +80,11 @@#include <asm/types.h> enum endianness {LITTLE_ENDIAN =0 , -BIG_ENDIAN +BIG_ENDIAN , +UNKNOWN_ENDIANNESS }; -int socfpga_get_handoff_size (void *handoff_address,enum endianness endian); -int socfpga_handoff_read (void *handoff_address,void *table,u32 table_len, -enum endianness big_endian); +int socfpga_get_handoff_size (void *handoff_address); +int socfpga_handoff_read (void *handoff_address,void *table,u32 table_len);#endif #endif /* _HANDOFF_SOC64_H_ */
arch/arm/mach-socfpga/system_manager_soc64.c +9 -9
@@ -1,6 +1,6 @@// SPDX-License-Identifier: GPL-2.0 /* -* Copyright (C) 2016-2018 Intel Corporation <www.intel.com> +* Copyright (C) 2016-2021 Intel Corporation <www.intel.com> * */
@@ -66,10 +66,10 @@ void populate_sysmgr_fpgaintf_module(void)void populate_sysmgr_pinmux (void ) {u32 len, i; -u32 len_mux =socfpga_get_handoff_size ((void *)SOC64_HANDOFF_MUX ,BIG_ENDIAN ); -u32 len_ioctl =socfpga_get_handoff_size ((void *)SOC64_HANDOFF_IOCTL ,BIG_ENDIAN ); -u32 len_fpga =socfpga_get_handoff_size ((void *)SOC64_HANDOFF_FPGA ,BIG_ENDIAN ); -u32 len_delay =socfpga_get_handoff_size ((void *)SOC64_HANDOFF_DELAY ,BIG_ENDIAN ); +u32 len_mux =socfpga_get_handoff_size ((void *)SOC64_HANDOFF_MUX ); +u32 len_ioctl =socfpga_get_handoff_size ((void *)SOC64_HANDOFF_IOCTL ); +u32 len_fpga =socfpga_get_handoff_size ((void *)SOC64_HANDOFF_FPGA ); +u32 len_delay =socfpga_get_handoff_size ((void *)SOC64_HANDOFF_DELAY ); len = (len_mux > len_ioctl) ? len_mux : len_ioctl; len = (len > len_fpga) ? len : len_fpga;
@@ -79,7 +79,7 @@ void populate_sysmgr_pinmux(void)/* setup the pin sel */ len = (len_mux <SOC64_HANDOFF_MUX_LEN ) ? len_mux :SOC64_HANDOFF_MUX_LEN ; -socfpga_handoff_read ((void *)SOC64_HANDOFF_MUX , handoff_table, len,BIG_ENDIAN ); +socfpga_handoff_read ((void *)SOC64_HANDOFF_MUX , handoff_table, len);for (i =0 ; i < len; i = i +2 ) { writel(handoff_table[i + 1], handoff_table[i] +
@@ -89,7 +89,7 @@ void populate_sysmgr_pinmux(void)/* setup the pin ctrl */ len = (len_ioctl <SOC64_HANDOFF_IOCTL_LEN ) ? len_ioctl :SOC64_HANDOFF_IOCTL_LEN ; -socfpga_handoff_read ((void *)SOC64_HANDOFF_IOCTL , handoff_table, len,BIG_ENDIAN ); +socfpga_handoff_read ((void *)SOC64_HANDOFF_IOCTL , handoff_table, len);for (i =0 ; i < len; i = i +2 ) { writel(handoff_table[i + 1], handoff_table[i] +
@@ -99,7 +99,7 @@ void populate_sysmgr_pinmux(void)/* setup the fpga use */ len = (len_fpga <SOC64_HANDOFF_FPGA_LEN ) ? len_fpga :SOC64_HANDOFF_FPGA_LEN ; -socfpga_handoff_read ((void *)SOC64_HANDOFF_FPGA , handoff_table, len,BIG_ENDIAN ); +socfpga_handoff_read ((void *)SOC64_HANDOFF_FPGA , handoff_table, len);for (i =0 ; i < len; i = i +2 ) { writel(handoff_table[i + 1], handoff_table[i] +
@@ -109,7 +109,7 @@ void populate_sysmgr_pinmux(void)/* setup the IO delay */ len = (len_delay <SOC64_HANDOFF_DELAY_LEN ) ? len_delay :SOC64_HANDOFF_DELAY_LEN ; -socfpga_handoff_read ((void *)SOC64_HANDOFF_DELAY , handoff_table, len,BIG_ENDIAN ); +socfpga_handoff_read ((void *)SOC64_HANDOFF_DELAY , handoff_table, len);for (i =0 ; i < len; i = i +2 ) { writel(handoff_table[i + 1], handoff_table[i] +
arch/arm/mach-socfpga/wrap_handoff_soc64.c +98 -34
157 lines not on this page · raw message
Signature · 1 line
2.13.0
PATCH v6 5/17 drivers: clk: Add clock driver for Intel N5X device
In reply to Siew Chin LimAdd clock manager driver for N5X. Provides clock initialization and get_rate functions.
--- drivers/clk/altera/Makefile | 3 +- drivers/clk/altera/clk-n5x.c | 489 ++++++++++++++++++++++++++++++++++ drivers/clk/altera/clk-n5x.h | 217 +++++++++++++++ include/dt-bindings/clock/n5x-clock.h | 71 +++++ 4 files changed, 779 insertions(+), 1 deletion(-) create mode 100644 drivers/clk/altera/clk-n5x.c create mode 100644 drivers/clk/altera/clk-n5x.h create mode 100644 include/dt-bindings/clock/n5x-clock.h
drivers/clk/altera/Makefile +2 -1
@@ -1,7 +1,8 @@ # SPDX-License-Identifier: GPL-2.0+ # -# Copyright (C) 2018 Marek Vasut <[email protected]> +# Copyright (C) 2018-2021 Marek Vasut <[email protected]> # obj-$(CONFIG_TARGET_SOCFPGA_AGILEX) += clk-agilex.o obj-$(CONFIG_TARGET_SOCFPGA_ARRIA10) += clk-arria10.o +obj-$(CONFIG_TARGET_SOCFPGA_N5X) += clk-n5x.o
drivers/clk/altera/clk-n5x.c new file +489 -0
489 lines not on this page · raw message
drivers/clk/altera/clk-n5x.h new file +217 -0
217 lines not on this page · raw message
include/dt-bindings/clock/n5x-clock.h new file +71 -0
71 lines not on this page · raw message
Signature · 1 line
2.13.0
PATCH v6 6/17 arm: socfpga: Get clock manager base address for Intel N5X device
In reply to Siew Chin LimAdd N5X clock manager to socfpga_get_managers_addr function.
--- arch/arm/mach-socfpga/misc.c | 3 +++ 1 file changed, 3 insertions(+)
arch/arm/mach-socfpga/misc.c +3 -0
@@ -254,6 +254,9 @@ void socfpga_get_managers_addr(void)#ifdef CONFIG_TARGET_SOCFPGA_AGILEX ret =socfpga_get_base_addr ("intel,agilex-clkmgr" , &socfpga_clkmgr_base); +#elif IS_ENABLED (CONFIG_TARGET_SOCFPGA_N5X ) + ret =socfpga_get_base_addr ("intel,n5x-clkmgr" , + &socfpga_clkmgr_base);#else ret =socfpga_get_base_addr ("altr,clk-mgr" , &socfpga_clkmgr_base);#endif
Signature · 1 line
2.13.0
PATCH v6 7/17 drivers: clk: Add memory clock driver for Intel N5X device
In reply to Siew Chin LimAdd memory clock manager driver for N5X. Provides memory clock initialization and enable functions.
--- drivers/clk/altera/Makefile | 1 + drivers/clk/altera/clk-mem-n5x.c | 136 +++++++++++++++++++++++++++++++++++++++ drivers/clk/altera/clk-mem-n5x.h | 84 ++++++++++++++++++++++++ 3 files changed, 221 insertions(+) create mode 100644 drivers/clk/altera/clk-mem-n5x.c create mode 100644 drivers/clk/altera/clk-mem-n5x.h
drivers/clk/altera/Makefile +1 -0
@@ -6,3 +6,4 @@ obj-$(CONFIG_TARGET_SOCFPGA_AGILEX) += clk-agilex.o obj-$(CONFIG_TARGET_SOCFPGA_ARRIA10) += clk-arria10.o obj-$(CONFIG_TARGET_SOCFPGA_N5X) += clk-n5x.o +obj-$(CONFIG_TARGET_SOCFPGA_N5X) += clk-mem-n5x.o
drivers/clk/altera/clk-mem-n5x.c new file +136 -0
136 lines not on this page · raw message
drivers/clk/altera/clk-mem-n5x.h new file +84 -0
84 lines not on this page · raw message
Signature · 1 line
2.13.0
PATCH v6 8/17 arm: socfpga: Move cm_get_mpu_clk_hz function declaration to clock_manager.h
In reply to Siew Chin LimMove cm_get_mpu_clk_hz function declaration from individual device's clock manager header file to common clock_manager.h.
--- arch/arm/mach-socfpga/include/mach/clock_manager.h | 1 + arch/arm/mach-socfpga/include/mach/clock_manager_agilex.h | 2 -- arch/arm/mach-socfpga/include/mach/clock_manager_arria10.h | 1 - arch/arm/mach-socfpga/include/mach/clock_manager_gen5.h | 1 - arch/arm/mach-socfpga/include/mach/clock_manager_s10.h | 1 - 5 files changed, 1 insertion(+), 5 deletions(-)
arch/arm/mach-socfpga/include/mach/clock_manager.h +1 -0
@@ -12,6 +12,7 @@ phys_addr_t socfpga_get_clkmgr_addr(void);void cm_wait_for_lock (u32 mask);int cm_wait_for_fsm (void );void cm_print_clock_quick_summary (void ); +unsigned long cm_get_mpu_clk_hz (void );unsigned int cm_get_qspi_controller_clk_hz (void );#if defined(CONFIG_TARGET_SOCFPGA_SOC64 )
arch/arm/mach-socfpga/include/mach/clock_manager_agilex.h +0 -2
@@ -6,8 +6,6 @@#ifndef _CLOCK_MANAGER_AGILEX_#define _CLOCK_MANAGER_AGILEX_ -unsigned long cm_get_mpu_clk_hz (void ); -#include <asm/arch/clock_manager_soc64.h> #include "../../../../../drivers/clk/altera/clk-agilex.h"
arch/arm/mach-socfpga/include/mach/clock_manager_arria10.h +0 -1
@@ -68,7 +68,6 @@ int cm_basic_init(const void *blob);#include <linux/bitops.h> unsigned int cm_get_l4_sp_clk_hz (void ); -unsigned long cm_get_mpu_clk_hz (void );#endif /* __ASSEMBLY__ */
arch/arm/mach-socfpga/include/mach/clock_manager_gen5.h +0 -1
@@ -96,7 +96,6 @@ struct cm_config {#define CLKMGR_PERPLL_EN CLKMGR_GEN5_PERPLL_EN/* Clock speed accessors */ -unsigned long cm_get_mpu_clk_hz (void );unsigned long cm_get_sdram_clk_hz (void );unsigned int cm_get_l4_sp_clk_hz (void );unsigned int cm_get_mmc_controller_clk_hz (void );
arch/arm/mach-socfpga/include/mach/clock_manager_s10.h +0 -1
@@ -11,7 +11,6 @@#include <linux/bitops.h> /* Clock speed accessors */ -unsigned long cm_get_mpu_clk_hz (void );unsigned long cm_get_sdram_clk_hz (void );unsigned int cm_get_l4_sp_clk_hz (void );unsigned int cm_get_mmc_controller_clk_hz (void );
Signature · 1 line
2.13.0
PATCH v6 9/17 arm: socfpga: Add clock manager for Intel N5X device
In reply to Siew Chin LimAdd clock manager for N5X.
---
...{clock_manager_agilex.c => clock_manager_n5x.c} | 32 ++++++++++------------
arch/arm/mach-socfpga/include/mach/clock_manager.h | 2 ++
.../mach-socfpga/include/mach/clock_manager_n5x.h | 12 ++++++++
3 files changed, 29 insertions(+), 17 deletions(-)
copy arch/arm/mach-socfpga/{clock_manager_agilex.c => clock_manager_n5x.c} (64%)
create mode 100644 arch/arm/mach-socfpga/include/mach/clock_manager_n5x.harch/arm/mach-socfpga/clock_manager_n5x.c renamed from arch/arm/mach-socfpga/clock_manager_agilex.c +15 -17
@@ -1,19 +1,18 @@// SPDX-License-Identifier: GPL-2.0 /* -* Copyright (C) 2019 Intel Corporation <www.intel.com> +* Copyright (C) 2020-2021 Intel Corporation <www.intel.com> * */ -#include <clk.h> #include <common.h> -#include <dm.h> -#include <log.h> -#include <malloc.h> #include <asm/arch/clock_manager.h> #include <asm/arch/system_manager.h> #include <asm/global_data.h> #include <asm/io.h> -#include <dt-bindings/clock/agilex-clock.h> +#include <clk.h> +#include <dm.h> +#include <dt-bindings/clock/n5x-clock.h> +#include <malloc.h> DECLARE_GLOBAL_DATA_PTR ;
@@ -25,7 +24,7 @@ static ulong cm_get_rate_dm(u32 id)int ret; ret =uclass_get_device_by_driver (UCLASS_CLK , -DM_DRIVER_GET (socfpga_agilex_clk), +DM_DRIVER_GET (socfpga_n5x_clk), &dev);if (ret)return 0 ;
@@ -39,8 +38,7 @@ static ulong cm_get_rate_dm(u32 id)clk_free (&clk); -if ((rate == (unsigned long )-ENOSYS ) || - (rate == (unsigned long )-ENXIO ) || +if ((rate == (unsigned long )-ENXIO ) || (rate == (unsigned long )-EIO )) {debug ("%s id %u: clk_get_rate err: %ld\n" , __func__, id, rate);
@@ -57,26 +55,26 @@ static u32 cm_get_rate_dm_khz(u32 id)unsigned long cm_get_mpu_clk_hz (void ) { -return cm_get_rate_dm (AGILEX_MPU_CLK ); +return cm_get_rate_dm (N5X_MPU_CLK ); }unsigned int cm_get_l4_sys_free_clk_hz (void ) { -return cm_get_rate_dm (AGILEX_L4_SYS_FREE_CLK ); +return cm_get_rate_dm (N5X_L4_SYS_FREE_CLK ); }void cm_print_clock_quick_summary (void ) {printf ("MPU %10d kHz\n" , -cm_get_rate_dm_khz (AGILEX_MPU_CLK )); +cm_get_rate_dm_khz (N5X_MPU_CLK ));printf ("L4 Main %8d kHz\n" , -cm_get_rate_dm_khz (AGILEX_L4_MAIN_CLK )); +cm_get_rate_dm_khz (N5X_L4_MAIN_CLK ));printf ("L4 sys free %8d kHz\n" , -cm_get_rate_dm_khz (AGILEX_L4_SYS_FREE_CLK )); +cm_get_rate_dm_khz (N5X_L4_SYS_FREE_CLK ));printf ("L4 MP %8d kHz\n" , -cm_get_rate_dm_khz (AGILEX_L4_MP_CLK )); +cm_get_rate_dm_khz (N5X_L4_MP_CLK ));printf ("L4 SP %8d kHz\n" , -cm_get_rate_dm_khz (AGILEX_L4_SP_CLK )); +cm_get_rate_dm_khz (N5X_L4_SP_CLK ));printf ("SDMMC %8d kHz\n" , -cm_get_rate_dm_khz (AGILEX_SDMMC_CLK )); +cm_get_rate_dm_khz (N5X_SDMMC_CLK )); }
arch/arm/mach-socfpga/include/mach/clock_manager.h +2 -0
@@ -28,6 +28,8 @@ int cm_set_qspi_controller_clk_hz(u32 clk_hz);#include <asm/arch/clock_manager_s10.h> #elif defined(CONFIG_TARGET_SOCFPGA_AGILEX )#include <asm/arch/clock_manager_agilex.h> +#elif IS_ENABLED (CONFIG_TARGET_SOCFPGA_N5X ) +#include <asm/arch/clock_manager_n5x.h> #endif #endif /* _CLOCK_MANAGER_H_ */
arch/arm/mach-socfpga/include/mach/clock_manager_n5x.h new file +12 -0
@@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* Copyright (C) 2020-2021 Intel Corporation <www.intel.com> +*/ + +#ifndef _CLOCK_MANAGER_N5X_ +#define _CLOCK_MANAGER_N5X_ + +#include <asm/arch/clock_manager_soc64.h> +#include "../../../../../drivers/clk/altera/clk-n5x.h" + +#endif /* _CLOCK_MANAGER_N5X_ */
Signature · 1 line
2.13.0
PATCH v6 10/17 arm: socfpga: Changed misc_s10.c to misc_soc64.c
In reply to Siew Chin LimRename to common file name to used by all SOC64 devices. No functionality change.
---
arch/arm/mach-socfpga/Makefile | 4 ++--
arch/arm/mach-socfpga/{misc_s10.c => misc_soc64.c} | 12 ++++++------
2 files changed, 8 insertions(+), 8 deletions(-)
rename arch/arm/mach-socfpga/{misc_s10.c => misc_soc64.c} (100%)arch/arm/mach-socfpga/Makefile +2 -2
@@ -32,7 +32,7 @@ ifdef CONFIG_TARGET_SOCFPGA_STRATIX10 obj-y += clock_manager_s10.o obj-y += lowlevel_init_soc64.o obj-y += mailbox_s10.o -obj-y += misc_s10.o +obj-y += misc_soc64.o obj-y += mmu-arm64_s10.o obj-y += reset_manager_s10.o obj-y += system_manager_soc64.o
@@ -45,7 +45,7 @@ ifdef CONFIG_TARGET_SOCFPGA_AGILEX obj-y += clock_manager_agilex.o obj-y += lowlevel_init_soc64.o obj-y += mailbox_s10.o -obj-y += misc_s10.o +obj-y += misc_soc64.o obj-y += mmu-arm64_s10.o obj-y += reset_manager_s10.o obj-$(CONFIG_SOCFPGA_SECURE_VAB_AUTH) += secure_vab.o
arch/arm/mach-socfpga/misc_soc64.c renamed from arch/arm/mach-socfpga/misc_s10.c +6 -6
@@ -6,16 +6,16 @@#include <altera.h> #include <common.h> -#include <env.h> -#include <errno.h> -#include <init.h> -#include <log.h> -#include <asm/global_data.h> -#include <asm/io.h> #include <asm/arch/mailbox_s10.h> #include <asm/arch/misc.h> #include <asm/arch/reset_manager.h> #include <asm/arch/system_manager.h> +#include <asm/io.h> +#include <asm/global_data.h> +#include <env.h> +#include <errno.h> +#include <init.h> +#include <log.h> DECLARE_GLOBAL_DATA_PTR ;
Signature · 1 line
2.13.0
PATCH v6 11/17 ddr: socfpga: Enable memory test on memory size less than 1GB
In reply to Siew Chin LimFrom: Tien Fong Chee <[email protected]>
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.
--- drivers/ddr/altera/sdram_soc64.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-)
drivers/ddr/altera/sdram_soc64.c +21 -3
@@ -1,6 +1,6 @@// SPDX-License-Identifier: GPL-2.0 /* -* Copyright (C) 2016-2019 Intel Corporation <www.intel.com> +* Copyright (C) 2016-2021 Intel Corporation <www.intel.com> * */
@@ -182,6 +182,7 @@ void sdram_size_check(struct bd_info *bd)phys_size_t total_ram_check =0 ;phys_size_t ram_check =0 ;phys_addr_t start =0 ; +phys_size_t size, remaining_size;int bank;/* Sanity check ensure correct SDRAM size specified */
@@ -189,10 +190,27 @@ void sdram_size_check(struct bd_info *bd)for (bank =0 ; bank <CONFIG_NR_DRAM_BANKS ; bank++) { start = bd->bi_dram[bank].start; + remaining_size = bd->bi_dram[bank].size;while (ram_check < bd->bi_dram[bank].size) { - ram_check +=get_ram_size ((void *)(start + ram_check), - (phys_size_t )SZ_1G ); + size =min ((phys_addr_t )SZ_1G , + (phys_addr_t )remaining_size); + +/* +* Ensure the size is power of two, this is requirement +* to run get_ram_size() / memory test +*/ +if (size !=0 && ((size & (size -1 )) ==0 )) { + ram_check +=get_ram_size ((void *) + (start + ram_check), size); + remaining_size = bd->bi_dram[bank].size - + ram_check; + }else { +puts ("DDR: Memory test requires SDRAM size " ); +puts ("in power of two!\n" ); +hang (); + } } + total_ram_check += ram_check; ram_check =0 ; }
Signature · 1 line
2.13.0
PATCH v6 12/17 ddr: altera: Add SDRAM driver for Intel N5X device
In reply to Siew Chin LimFrom: Tien Fong Chee <[email protected]>
The DDR subsystem in Diamond Mesa is consisted of controller, PHY, memory reset manager and memory clock manager.
Configuration settings of controller, PHY and memory reset manager is come from DDR handoff data in bitstream, which contain the register base addresses and user settings from tool.
Configuration settings of memory clock manager is come from the HPS handoff data in bitstream, however the register base address is defined in device tree.
The calibration is fully done in HPS, which requires IMEM and DMEM binaries loading to PHY SRAM for running this calibration, both IMEM and DMEM binaries are also part of bitstream, this bitstream would be loaded to OCRAM by SDM, and configured by DDR driver.
--- arch/arm/mach-socfpga/include/mach/firewall.h | 6 + .../include/mach/system_manager_soc64.h | 10 +- drivers/ddr/altera/Makefile | 3 +- drivers/ddr/altera/sdram_n5x.c | 2298 ++++++++++++++++++++ drivers/ddr/altera/sdram_soc64.c | 70 + drivers/ddr/altera/sdram_soc64.h | 1 + 6 files changed, 2386 insertions(+), 2 deletions(-) create mode 100644 drivers/ddr/altera/sdram_n5x.c
arch/arm/mach-socfpga/include/mach/firewall.h +6 -0
@@ -115,10 +115,16 @@ struct socfpga_firwall_l4_sys {/* Firewall MPU DDR SCR registers */ #define FW_MPU_DDR_SCR_EN 0x00#define FW_MPU_DDR_SCR_EN_SET 0x04 +#define FW_MPU_DDR_SCR_MPUREGION0ADDR_BASE 0x10 +#define FW_MPU_DDR_SCR_MPUREGION0ADDR_BASEEXT 0x14#define FW_MPU_DDR_SCR_MPUREGION0ADDR_LIMIT 0x18#define FW_MPU_DDR_SCR_MPUREGION0ADDR_LIMITEXT 0x1c + +#define FW_MPU_DDR_SCR_NONMPUREGION0ADDR_BASE 0x90 +#define FW_MPU_DDR_SCR_NONMPUREGION0ADDR_BASEEXT 0x94#define FW_MPU_DDR_SCR_NONMPUREGION0ADDR_LIMIT 0x98#define FW_MPU_DDR_SCR_NONMPUREGION0ADDR_LIMITEXT 0x9c +#define FW_MPU_DDR_SCR_NONMPUREGION0ADDR_LIMITEXT_FIELD 0xff#define MPUREGION0_ENABLE BIT(0)#define NONMPUREGION0_ENABLE BIT(8)
arch/arm/mach-socfpga/include/mach/system_manager_soc64.h +9 -1
@@ -1,6 +1,6 @@/* SPDX-License-Identifier: GPL-2.0 */ /* -* Copyright (C) 2019 Intel Corporation <www.intel.com> +* Copyright (C) 2019-2021 Intel Corporation <www.intel.com> */ #ifndef _SYSTEM_MANAGER_SOC64_H_
@@ -28,8 +28,12 @@ void populate_sysmgr_pinmux(void);#define SYSMGR_SOC64_FPGAINTF_EN2 0x6c#define SYSMGR_SOC64_FPGAINTF_EN3 0x70#define SYSMGR_SOC64_DMA_L3MASTER 0x74 +#if IS_ENABLED (CONFIG_TARGET_SOCFPGA_N5X ) +#define SYSMGR_SOC64_DDR_MODE 0xb8 +#else #define SYSMGR_SOC64_HMC_CLK 0xb4#define SYSMGR_SOC64_IO_PA_CTRL 0xb8 +#endif #define SYSMGR_SOC64_NOC_TIMEOUT 0xc0#define SYSMGR_SOC64_NOC_IDLEREQ_SET 0xc4#define SYSMGR_SOC64_NOC_IDLEREQ_CLR 0xc8
@@ -143,4 +147,8 @@ void populate_sysmgr_pinmux(void);#define SYSMGR_WDDBG_PAUSE_ALL_CPU 0x0F0F0F0F +#if IS_ENABLED (CONFIG_TARGET_SOCFPGA_N5X ) +#define SYSMGR_SOC64_DDR_MODE_MSK BIT(0) +#endif +#endif /* _SYSTEM_MANAGER_SOC64_H_ */
drivers/ddr/altera/Makefile +2 -1
@@ -4,11 +4,12 @@ # Wolfgang Denk, DENX Software Engineering, [email protected]. # # (C) Copyright 2010, Thomas Chou <[email protected]> -# Copyright (C) 2014 Altera Corporation <www.altera.com> +# Copyright (C) 2014-2021 Altera Corporation <www.altera.com> ifdef CONFIG_$(SPL_)ALTERA_SDRAM obj-$(CONFIG_TARGET_SOCFPGA_GEN5) += sdram_gen5.o sequencer.o obj-$(CONFIG_TARGET_SOCFPGA_ARRIA10) += sdram_arria10.o obj-$(CONFIG_TARGET_SOCFPGA_STRATIX10) += sdram_soc64.o sdram_s10.o obj-$(CONFIG_TARGET_SOCFPGA_AGILEX) += sdram_soc64.o sdram_agilex.o +obj-$(CONFIG_TARGET_SOCFPGA_N5X) += sdram_soc64.o sdram_n5x.o endif
drivers/ddr/altera/sdram_n5x.c new file +2298 -0
2,298 lines not on this page · raw message
drivers/ddr/altera/sdram_soc64.c +70 -0
99 lines not on this page · raw message
drivers/ddr/altera/sdram_soc64.h +1 -0
@@ -180,6 +180,7 @@ int emif_reset(struct altera_sdram_plat *plat);int poll_hmc_clock_status (void );void sdram_clear_mem (phys_addr_t addr,phys_size_t size);void sdram_init_ecc_bits (struct bd_info *bd); +void sdram_set_firewall (struct bd_info *bd);void sdram_size_check (struct bd_info *bd);phys_size_t sdram_calculate_size (struct altera_sdram_plat *plat);int sdram_mmr_init_full (struct udevice *dev);
Signature · 1 line
2.13.0
PATCH v6 13/17 arm: socfpga: Add SPL for Intel N5X device
In reply to Siew Chin LimAdd SPL for N5X.
---
arch/arm/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%)arch/arm/mach-socfpga/spl_n5x.c renamed from arch/arm/mach-socfpga/spl_agilex.c +22 -15
@@ -1,27 +1,26 @@// SPDX-License-Identifier: GPL-2.0 /* -* Copyright (C) 2019 Intel Corporation <www.intel.com> +* Copyright (C) 2020-2021 Intel Corporation <www.intel.com> * */ -#include <init.h> -#include <log.h> -#include <asm/global_data.h> -#include <asm/io.h> -#include <asm/u-boot.h> -#include <asm/utils.h> #include <common.h> -#include <hang.h> -#include <image.h> -#include <spl.h> #include <asm/arch/clock_manager.h> #include <asm/arch/firewall.h> #include <asm/arch/mailbox_s10.h> #include <asm/arch/misc.h> #include <asm/arch/reset_manager.h> #include <asm/arch/system_manager.h> -#include <watchdog.h> +#include <asm/global_data.h> +#include <asm/io.h> +#include <asm/u-boot.h> +#include <asm/utils.h> #include <dm/uclass.h> +#include <hang.h> +#include <image.h> +#include <init.h> +#include <spl.h> +#include <watchdog.h> DECLARE_GLOBAL_DATA_PTR ;
@@ -54,27 +53,35 @@ void board_init_f(ulong dummy)sysmgr_pinmux_init (); +preloader_console_init (); + ret =uclass_get_device (UCLASS_CLK ,0 , &dev);if (ret) { -debug ("Clock init failed: %d\n" , ret); +printf ("Clock init failed: %d\n" , ret); +hang (); + } + + ret =uclass_get_device (UCLASS_CLK ,1 , &dev); +if (ret) { +printf ("Memory clock init failed: %d\n" , ret);hang (); } -preloader_console_init ();print_reset_info ();cm_print_clock_quick_summary ();firewall_setup (); + ret =uclass_get_device (UCLASS_CACHE ,0 , &dev);if (ret) { -debug ("CCU init failed: %d\n" , ret); +printf ("CCU init failed: %d\n" , ret);hang (); }#if CONFIG_IS_ENABLED (ALTERA_SDRAM ) ret =uclass_get_device (UCLASS_RAM ,0 , &dev);if (ret) { -debug ("DRAM init failed: %d\n" , ret); +printf ("DRAM init failed: %d\n" , ret);hang (); }#endif
Signature · 1 line
2.13.0
PATCH v6 14/17 board: intel: Add socdk board support for Intel N5X device
In reply to Siew Chin LimAdd N5X SoC devkit board.
---
board/intel/n5x-socdk/MAINTAINERS | 7 +++++++
board/{altera/stratix10-socdk => intel/n5x-socdk}/Makefile | 2 +-
board/{altera/stratix10-socdk => intel/n5x-socdk}/socfpga.c | 2 +-
3 files changed, 9 insertions(+), 2 deletions(-)
create mode 100644 board/intel/n5x-socdk/MAINTAINERS
copy board/{altera/stratix10-socdk => intel/n5x-socdk}/Makefile (50%)
copy board/{altera/stratix10-socdk => intel/n5x-socdk}/socfpga.c (52%)board/intel/n5x-socdk/MAINTAINERS new file +7 -0
@@ -0,0 +1,7 @@ +SOCFPGA BOARD +M: Chee Tien Fong <[email protected]> +M: Lim Siew Chin <[email protected]> +S: Maintained +F: board/intel/n5x-socdk/ +F: include/configs/socfpga_n5x_socdk.h +F: configs/socfpga_n5x_atf_defconfig
board/intel/n5x-socdk/Makefile renamed from board/altera/stratix10-socdk/Makefile +1 -1
@@ -1,5 +1,5 @@ # -# Copyright (C) 2016-2017 Intel Corporation <www.intel.com> +# Copyright (C) 2020-2021 Intel Corporation <www.intel.com> # # SPDX-License-Identifier: GPL-2.0 #
board/intel/n5x-socdk/socfpga.c renamed from board/altera/stratix10-socdk/socfpga.c +1 -1
@@ -1,6 +1,6 @@// SPDX-License-Identifier: GPL-2.0 /* -* Copyright (C) 2016-2018 Intel Corporation <www.intel.com> +* Copyright (C) 2020-2021 Intel Corporation <www.intel.com> * */
Signature · 1 line
2.13.0
PATCH v6 15/17 arm: dts: Add base dtsi and devkit dts for Intel N5X device
In reply to Siew Chin LimAdd device tree for N5X.
---
v6:
- Sort the node name in alphanumeric order in socfpga_n5x_socdk-u-boot.dtsi
- Remove duplicated qspi node from socfpga_n5x_socdk-u-boot.dtsi, It is defined in socfpga_n5x_socdk.dtsi
- Remove the incorrect clkmgr compatible name in socfpga_n5x_socdk.dtsi
v5:
- Obsolete 5th version of patch because it set the wrong compatible name for clkmgr in device tree.
v4:
- Reuse socfpga_n5x_socdk.dts from Linux and add U-boot specifc dts to u-boot.dtsi. Linux socfpga_n5x_socdk.dts:
https://github.com/altera-opensource/linux-socfpga/blob/socfpga-5.4.114-lts/arch/arm64/boot/dts/intel/socfpga_n5x_socdk.dts
v3:
- Update comment for memory example code
- Move all common dts settings for N5X from socfpga_n5x_socdk.dts to socfpga_n5x-u-boot.dtsi
- Remove unused parameter "u-boot,boot0"
v2:
- Remove socfpga_n5x.dtsi
- Reuse socfpga_agilex.dtsi in socfpga_n5x_socdk.dts and update n5x data accordingly.
---
arch/arm/dts/Makefile | 1 +
arch/arm/dts/socfpga_n5x-u-boot.dtsi | 191 +++++++++++++++++++++
arch/arm/dts/socfpga_n5x_socdk-u-boot.dtsi | 63 +++++++
...fpga_agilex_socdk.dts => socfpga_n5x_socdk.dts} | 59 +++----
4 files changed, 275 insertions(+), 39 deletions(-)
create mode 100644 arch/arm/dts/socfpga_n5x-u-boot.dtsi
create mode 100644 arch/arm/dts/socfpga_n5x_socdk-u-boot.dtsi
copy arch/arm/dts/{socfpga_agilex_socdk.dts => socfpga_n5x_socdk.dts} (82%)arch/arm/dts/Makefile +1 -0
@@ -400,6 +400,7 @@ dtb-$(CONFIG_ARCH_SOCFPGA) += \ socfpga_cyclone5_socrates.dtb \ socfpga_cyclone5_sr1500.dtb \ socfpga_cyclone5_vining_fpga.dtb \ + socfpga_n5x_socdk.dtb \ socfpga_stratix10_socdk.dtb dtb-$(CONFIG_TARGET_DRA7XX_EVM) += dra72-evm.dtb dra7-evm.dtb \
arch/arm/dts/socfpga_n5x-u-boot.dtsi new file +191 -0
191 lines not on this page · raw message
arch/arm/dts/socfpga_n5x_socdk-u-boot.dtsi new file +63 -0
63 lines not on this page · raw message
arch/arm/dts/socfpga_n5x_socdk.dts renamed from arch/arm/dts/socfpga_agilex_socdk.dts +20 -39
106 lines not on this page · raw message
Signature · 1 line
2.13.0
Re: [v6 15/17] arm: dts: Add base dtsi and devkit dts for Intel N5X device
Quoted 31 lines · Siew Chin Lim
Add device tree for N5X.
Signed-off-by Siew Chin Lim <[email protected]>Signed-off-by Tien Fong Chee <[email protected]>---
v6:
- Sort the node name in alphanumeric order insocfpga_n5x_socdk-u-boot.dtsi
- Remove duplicated qspi node fromsocfpga_n5x_socdk-u-boot.dtsi, It is defined insocfpga_n5x_socdk.dtsi
- Remove the incorrect clkmgr compatible name insocfpga_n5x_socdk.dtsiv5:
- Obsolete 5th version of patch because it set the wrong compatible name for clkmgr in device tree.v4:
- Reusesocfpga_n5x_socdk.dtsfrom Linux and add U-boot specifc dts tou-boot.dtsi. Linuxsocfpga_n5x_socdk.dts:
https://github.com/altera-opensource/linux-socfpga/blob/socfpga-5.4.114-lts/arch/arm64/boot/dts/intel/socfpga_n5x_socdk.dtsv3:
- Update comment for memory example code
- Move all common dts settings for N5X fromsocfpga_n5x_socdk.dtstosocfpga_n5x-u-boot.dtsi
- Remove unused parameter "u-boot,boot0"v2:
- Removesocfpga_n5x.dtsi
- Reusesocfpga_agilex.dtsiinsocfpga_n5x_socdk.dtsand update n5x data accordingly.
Quoted 10 lines
---
arch/arm/dts/Makefile | 1 +
arch/arm/dts/socfpga_n5x-u-boot.dtsi | 191 +++++++++++++++++++++
arch/arm/dts/socfpga_n5x_socdk-u-boot.dtsi | 63 +++++++
...fpga_agilex_socdk.dts => socfpga_n5x_socdk.dts} | 59 +++----
4 files changed, 275 insertions(+), 39 deletions(-)
create mode 100644 arch/arm/dts/socfpga_n5x-u-boot.dtsi
create mode 100644 arch/arm/dts/socfpga_n5x_socdk-u-boot.dtsi
copy arch/arm/dts/{socfpga_agilex_socdk.dts => socfpga_n5x_socdk.dts} (82%)Regards
Ley Foon
PATCH v6 16/17 include: configs: Add Intel N5X device CONFIGs
In reply to Siew Chin LimAdd CONFIGs for N5X.
--- include/configs/socfpga_n5x_socdk.h | 45 +++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 include/configs/socfpga_n5x_socdk.h
include/configs/socfpga_n5x_socdk.h new file +45 -0
@@ -0,0 +1,45 @@ +/* SPDX-License-Identifier: GPL-2.0 +* +* Copyright (C) 2020-2021 Intel Corporation <www.intel.com> +* +*/ + +#ifndef __CONFIG_SOCFGPA_N5X_H__ +#define __CONFIG_SOCFGPA_N5X_H__ + +#include <configs/socfpga_soc64_common.h> + +#undef CONFIG_EXTRA_ENV_SETTINGS +#define CONFIG_EXTRA_ENV_SETTINGS \ + "loadaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \ + "bootfile=" CONFIG_BOOTFILE "\0" \ + "fdt_addr=1100000\0" \ + "fdtimage=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \ + "mmcroot=/dev/mmcblk0p2\0" \ + "mmcboot=setenv bootargs " CONFIG_BOOTARGS \ + " root=${mmcroot} rw rootwait;" \ + "booti ${loadaddr} - ${fdt_addr}\0" \ + "mmcload=mmc rescan;" \ + "load mmc 0:1 ${loadaddr} ${bootfile};" \ + "load mmc 0:1 ${fdt_addr} ${fdtimage}\0" \ + "mmcfitboot=setenv bootargs " CONFIG_BOOTARGS \ + " root=${mmcroot} rw rootwait;" \ + "bootm ${loadaddr}\0" \ + "mmcfitload=mmc rescan;" \ + "load mmc 0:1 ${loadaddr} ${bootfile}\0" \ + "ramboot=setenv bootargs " CONFIG_BOOTARGS";" \ + "booti ${loadaddr} - ${fdt_addr}\0" \ + "linux_qspi_enable=if sf probe; then " \ + "echo Enabling QSPI at Linux DTB...;" \ + "fdt addr ${fdt_addr}; fdt resize;" \ + "fdt set /soc/spi@ff8d2000 status okay;" \ + "if fdt set /soc/clocks/qspi-clk clock-frequency" \ + " ${qspi_clock}; then" \ + " else fdt set /soc/clkmgr/clocks/qspi_clk clock-frequency" \ + " ${qspi_clock}; fi; fi\0" \ + "scriptaddr=0x02100000\0" \ + "scriptfile=u-boot.scr\0" \ + "fatscript=if fatload mmc 0:1 ${scriptaddr} ${scriptfile};" \ + "then source ${scriptaddr}; fi\0" + +#endif /* __CONFIG_SOCFGPA_N5X_H__ */
Signature · 1 line
2.13.0
PATCH v6 17/17 arm: socfpga: Enable Intel N5X device build
In reply to Siew Chin LimAdd defconfig for N5X to support legacy, ATF and VAB boot flow.
---
arch/arm/mach-socfpga/Kconfig | 21 +++++++++++++++-
arch/arm/mach-socfpga/Makefile | 28 ++++++++++++++++++----
...lex_vab_defconfig => socfpga_n5x_atf_defconfig} | 12 +++++-----
...fpga_agilex_defconfig => socfpga_n5x_defconfig} | 13 +++++-----
...lex_vab_defconfig => socfpga_n5x_vab_defconfig} | 11 +++++----
5 files changed, 61 insertions(+), 24 deletions(-)
copy configs/{socfpga_agilex_vab_defconfig => socfpga_n5x_atf_defconfig} (87%)
copy configs/{socfpga_agilex_defconfig => socfpga_n5x_defconfig} (83%)
copy configs/{socfpga_agilex_vab_defconfig => socfpga_n5x_vab_defconfig} (87%)arch/arm/mach-socfpga/Kconfig +20 -1
@@ -8,7 +8,7 @@ config NR_DRAM_BANKS config SOCFPGA_SECURE_VAB_AUTH bool "Enable boot image authentication with Secure Device Manager" - depends on TARGET_SOCFPGA_AGILEX + depends on TARGET_SOCFPGA_AGILEX || TARGET_SOCFPGA_N5X select FIT_IMAGE_POST_PROCESS select SHA384 select SHA512_ALGO
@@ -91,6 +91,22 @@ config TARGET_SOCFPGA_GEN5 imply SPL_SYS_MALLOC_SIMPLE imply SPL_USE_TINY_PRINTF +config TARGET_SOCFPGA_N5X + bool + select ARMV8_MULTIENTRY + select ARMV8_SET_SMPEN + select BINMAN if SPL_ATF + select CLK + select FPGA_INTEL_SDM_MAILBOX + select NCORE_CACHE + select SPL_ALTERA_SDRAM + select SPL_CLK if SPL + select TARGET_SOCFPGA_SOC64 + +config TARGET_SOCFPGA_N5X_SOCDK + bool "Intel eASIC SoCDK (N5X)" + select TARGET_SOCFPGA_N5X + config TARGET_SOCFPGA_SOC64 bool
@@ -185,6 +201,7 @@ config SYS_BOARD default "de10-nano" if TARGET_SOCFPGA_TERASIC_DE10_NANO default "is1" if TARGET_SOCFPGA_IS1 default "mcvevk" if TARGET_SOCFPGA_ARIES_MCVEVK + default "n5x-socdk" if TARGET_SOCFPGA_N5X_SOCDK default "secu1" if TARGET_SOCFPGA_ARRIA5_SECU1 default "sockit" if TARGET_SOCFPGA_TERASIC_SOCKIT default "socrates" if TARGET_SOCFPGA_EBV_SOCRATES
@@ -194,6 +211,7 @@ config SYS_BOARD config SYS_VENDOR default "intel" if TARGET_SOCFPGA_AGILEX_SOCDK + default "intel" if TARGET_SOCFPGA_N5X_SOCDK default "altera" if TARGET_SOCFPGA_ARRIA5_SOCDK default "altera" if TARGET_SOCFPGA_ARRIA10_SOCDK default "altera" if TARGET_SOCFPGA_CYCLONE5_SOCDK
@@ -223,6 +241,7 @@ config SYS_CONFIG_NAME default "socfpga_de10_nano" if TARGET_SOCFPGA_TERASIC_DE10_NANO default "socfpga_is1" if TARGET_SOCFPGA_IS1 default "socfpga_mcvevk" if TARGET_SOCFPGA_ARIES_MCVEVK + default "socfpga_n5x_socdk" if TARGET_SOCFPGA_N5X_SOCDK default "socfpga_sockit" if TARGET_SOCFPGA_TERASIC_SOCKIT default "socfpga_socrates" if TARGET_SOCFPGA_EBV_SOCRATES default "socfpga_sr1500" if TARGET_SOCFPGA_SR1500
arch/arm/mach-socfpga/Makefile +23 -5
@@ -4,7 +4,7 @@ # Wolfgang Denk, DENX Software Engineering, [email protected]. # # Copyright (C) 2012-2017 Altera Corporation <www.altera.com> -# Copyright (C) 2017-2020 Intel Corporation <www.intel.com> +# Copyright (C) 2017-2021 Intel Corporation <www.intel.com> obj-y += board.o obj-y += clock_manager.o
@@ -56,6 +56,21 @@ obj-y += wrap_handoff_soc64.o obj-y += wrap_pll_config_soc64.o endif +ifdef CONFIG_TARGET_SOCFPGA_N5X +obj-y += clock_manager_n5x.o +obj-y += lowlevel_init_soc64.o +obj-y += mailbox_s10.o +obj-y += misc_soc64.o +obj-y += mmu-arm64_s10.o +obj-y += reset_manager_s10.o +obj-$(CONFIG_SOCFPGA_SECURE_VAB_AUTH) += secure_vab.o +obj-y += system_manager_soc64.o +obj-y += timer_s10.o +obj-$(CONFIG_SOCFPGA_SECURE_VAB_AUTH) += vab.o +obj-y += wrap_handoff_soc64.o +obj-y += wrap_pll_config_soc64.o +endif + ifdef CONFIG_SPL_BUILD ifdef CONFIG_TARGET_SOCFPGA_GEN5 obj-y += spl_gen5.o
@@ -64,18 +79,21 @@ obj-y += wrap_iocsr_config.o obj-y += wrap_pinmux_config.o obj-y += wrap_sdram_config.o endif +ifdef CONFIG_TARGET_SOCFPGA_SOC64 +obj-y += firewall.o +obj-y += spl_soc64.o +endif ifdef CONFIG_TARGET_SOCFPGA_ARRIA10 obj-y += spl_a10.o endif ifdef CONFIG_TARGET_SOCFPGA_STRATIX10 -obj-y += firewall.o obj-y += spl_s10.o -obj-y += spl_soc64.o endif ifdef CONFIG_TARGET_SOCFPGA_AGILEX -obj-y += firewall.o obj-y += spl_agilex.o -obj-y += spl_soc64.o +endif +ifdef CONFIG_TARGET_SOCFPGA_N5X +obj-y += spl_n5x.o endif else obj-$(CONFIG_SPL_ATF) += secure_reg_helper.o
configs/socfpga_n5x_atf_defconfig renamed from configs/socfpga_agilex_vab_defconfig +6 -6
@@ -8,11 +8,10 @@ CONFIG_ENV_SIZE=0x1000 CONFIG_ENV_OFFSET=0x200 CONFIG_SYS_SPI_U_BOOT_OFFS=0x02000000 CONFIG_DM_GPIO=y -CONFIG_DEFAULT_DEVICE_TREE="socfpga_agilex_socdk" +CONFIG_DEFAULT_DEVICE_TREE="socfpga_n5x_socdk" CONFIG_SPL_TEXT_BASE=0xFFE00000 -CONFIG_SOCFPGA_SECURE_VAB_AUTH=y -CONFIG_TARGET_SOCFPGA_AGILEX_SOCDK=y -CONFIG_IDENT_STRING="socfpga_agilex" +CONFIG_TARGET_SOCFPGA_N5X_SOCDK=y +CONFIG_IDENT_STRING="socfpga_n5x" CONFIG_SPL_FS_FAT=y CONFIG_FIT=y CONFIG_SPL_FIT_SIGNATURE=y
@@ -21,7 +20,7 @@ CONFIG_SPL_LOAD_FIT_ADDRESS=0x02000000 # CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_BOOTDELAY=5 CONFIG_USE_BOOTARGS=y -CONFIG_BOOTARGS="earlycon" +CONFIG_BOOTARGS="earlycon panic=-1 earlyprintk=ttyS0,115200" CONFIG_USE_BOOTCOMMAND=y CONFIG_BOOTCOMMAND="run fatscript; run mmcfitload; run mmcfitboot" CONFIG_SPL_CRC32=y
@@ -30,7 +29,7 @@ CONFIG_SPL_SPI_LOAD=y CONFIG_SPL_ATF=y CONFIG_SPL_ATF_NO_PLATFORM_PARAM=y CONFIG_HUSH_PARSER=y -CONFIG_SYS_PROMPT="SOCFPGA_AGILEX # " +CONFIG_SYS_PROMPT="SOCFPGA_N5X # " CONFIG_CMD_MEMTEST=y CONFIG_CMD_GPIO=y CONFIG_CMD_I2C=y
@@ -44,6 +43,7 @@ CONFIG_CMD_CACHE=y CONFIG_CMD_EXT4=y CONFIG_CMD_FAT=y CONFIG_CMD_FS_GENERIC=y +CONFIG_CMD_WDT=y CONFIG_ENV_IS_IN_MMC=y CONFIG_NET_RANDOM_ETHADDR=y CONFIG_SPL_DM_SEQ_ALIAS=y
configs/socfpga_n5x_defconfig renamed from configs/socfpga_agilex_defconfig +6 -7
@@ -3,27 +3,25 @@ CONFIG_ARCH_SOCFPGA=y CONFIG_SYS_TEXT_BASE=0x1000 CONFIG_SYS_MALLOC_F_LEN=0x2000 CONFIG_NR_DRAM_BANKS=2 -CONFIG_SYS_MEMTEST_START=0x00000000 -CONFIG_SYS_MEMTEST_END=0x3fe00000 CONFIG_ENV_SIZE=0x1000 CONFIG_ENV_OFFSET=0x200 CONFIG_SYS_SPI_U_BOOT_OFFS=0x3c00000 CONFIG_DM_GPIO=y -CONFIG_DEFAULT_DEVICE_TREE="socfpga_agilex_socdk" +CONFIG_DEFAULT_DEVICE_TREE="socfpga_n5x_socdk" CONFIG_SPL_TEXT_BASE=0xFFE00000 -CONFIG_TARGET_SOCFPGA_AGILEX_SOCDK=y -CONFIG_IDENT_STRING="socfpga_agilex" +CONFIG_TARGET_SOCFPGA_N5X_SOCDK=y +CONFIG_IDENT_STRING="socfpga_n5x" CONFIG_SPL_FS_FAT=y # CONFIG_PSCI_RESET is not set CONFIG_BOOTDELAY=5 CONFIG_USE_BOOTARGS=y -CONFIG_BOOTARGS="earlycon" +CONFIG_BOOTARGS="earlycon panic=-1 earlyprintk=ttyS0,115200" CONFIG_USE_BOOTCOMMAND=y CONFIG_BOOTCOMMAND="run fatscript; run mmcload; run linux_qspi_enable; run mmcboot" CONFIG_SPL_CACHE=y CONFIG_SPL_SPI_LOAD=y CONFIG_HUSH_PARSER=y -CONFIG_SYS_PROMPT="SOCFPGA_AGILEX # " +CONFIG_SYS_PROMPT="SOCFPGA_N5X # " CONFIG_CMD_MEMTEST=y CONFIG_CMD_GPIO=y CONFIG_CMD_I2C=y
@@ -37,6 +35,7 @@ CONFIG_CMD_CACHE=y CONFIG_CMD_EXT4=y CONFIG_CMD_FAT=y CONFIG_CMD_FS_GENERIC=y +CONFIG_CMD_WDT=y CONFIG_ENV_IS_IN_MMC=y CONFIG_NET_RANDOM_ETHADDR=y CONFIG_SPL_DM_SEQ_ALIAS=y
configs/socfpga_n5x_vab_defconfig renamed from configs/socfpga_agilex_vab_defconfig +6 -5
@@ -8,11 +8,11 @@ CONFIG_ENV_SIZE=0x1000 CONFIG_ENV_OFFSET=0x200 CONFIG_SYS_SPI_U_BOOT_OFFS=0x02000000 CONFIG_DM_GPIO=y -CONFIG_DEFAULT_DEVICE_TREE="socfpga_agilex_socdk" +CONFIG_DEFAULT_DEVICE_TREE="socfpga_n5x_socdk" CONFIG_SPL_TEXT_BASE=0xFFE00000 CONFIG_SOCFPGA_SECURE_VAB_AUTH=y -CONFIG_TARGET_SOCFPGA_AGILEX_SOCDK=y -CONFIG_IDENT_STRING="socfpga_agilex" +CONFIG_TARGET_SOCFPGA_N5X_SOCDK=y +CONFIG_IDENT_STRING="socfpga_n5x" CONFIG_SPL_FS_FAT=y CONFIG_FIT=y CONFIG_SPL_FIT_SIGNATURE=y
@@ -21,7 +21,7 @@ CONFIG_SPL_LOAD_FIT_ADDRESS=0x02000000 # CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_BOOTDELAY=5 CONFIG_USE_BOOTARGS=y -CONFIG_BOOTARGS="earlycon" +CONFIG_BOOTARGS="earlycon panic=-1 earlyprintk=ttyS0,115200" CONFIG_USE_BOOTCOMMAND=y CONFIG_BOOTCOMMAND="run fatscript; run mmcfitload; run mmcfitboot" CONFIG_SPL_CRC32=y
@@ -30,7 +30,7 @@ CONFIG_SPL_SPI_LOAD=y CONFIG_SPL_ATF=y CONFIG_SPL_ATF_NO_PLATFORM_PARAM=y CONFIG_HUSH_PARSER=y -CONFIG_SYS_PROMPT="SOCFPGA_AGILEX # " +CONFIG_SYS_PROMPT="SOCFPGA_N5X # " CONFIG_CMD_MEMTEST=y CONFIG_CMD_GPIO=y CONFIG_CMD_I2C=y
@@ -44,6 +44,7 @@ CONFIG_CMD_CACHE=y CONFIG_CMD_EXT4=y CONFIG_CMD_FAT=y CONFIG_CMD_FS_GENERIC=y +CONFIG_CMD_WDT=y CONFIG_ENV_IS_IN_MMC=y CONFIG_NET_RANDOM_ETHADDR=y CONFIG_SPL_DM_SEQ_ALIAS=y
Signature · 1 line
2.13.0