Re: [PATCH 1/1] arm: socfpga: n5x: Enable system manager driver for N5X
"Chee, Tien Fong via U-Boot" <[email protected]>
| Newsgroups | gmane.comp.boot-loaders.u-boot.general,gmane.comp.boot-loaders.u-boot |
|---|---|
| Message-ID | <[email protected]> |
On 14/8/2026 4:46 pm, [email protected] wrote: > From: Alif Zakuan Yuslaimi <[email protected]> > > The base address of system manager can be retrieved using the DT framework > through the system manager driver. > > Enable system manager support for N5X by probing the system manager > driver during SPL and U-Boot proper board_early_init_f, matching the > Agilex and Stratix10 DM path. Drop the of_flat_tree altr,sys-mgr lookup > for N5X so the base comes only from DM. > > Signed-off-by: Alif Zakuan Yuslaimi <[email protected]> > Signed-off-by: Tien Fong Chee <[email protected]> > --- > arch/arm/dts/socfpga_n5x-u-boot.dtsi | 4 ++++ > arch/arm/mach-socfpga/Makefile | 1 + > arch/arm/mach-socfpga/misc.c | 3 ++- > arch/arm/mach-socfpga/spl_n5x.c | 1 + > board/intel/n5x-socdk/Makefile | 6 ++++++ > board/intel/n5x-socdk/socfpga.c | 12 ++++++++++++ > configs/socfpga_n5x_defconfig | 1 + > 7 files changed, 27 insertions(+), 1 deletion(-) > create mode 100644 board/intel/n5x-socdk/Makefile > create mode 100644 board/intel/n5x-socdk/socfpga.c > > diff --git a/arch/arm/dts/socfpga_n5x-u-boot.dtsi b/arch/arm/dts/socfpga_n5x-u-boot.dtsi > index e27a64651e1..53f8bd84ea5 100644 > --- a/arch/arm/dts/socfpga_n5x-u-boot.dtsi > +++ b/arch/arm/dts/socfpga_n5x-u-boot.dtsi > @@ -9,6 +9,10 @@ > #include <dt-bindings/clock/n5x-clock.h> > > /{ > + aliases { > + sysmgr = &sysmgr; > + }; > + > memory { > #address-cells = <2>; > #size-cells = <2>; > diff --git a/arch/arm/mach-socfpga/Makefile b/arch/arm/mach-socfpga/Makefile > index b6f35ddacc4..6b1051c671d 100644 > --- a/arch/arm/mach-socfpga/Makefile > +++ b/arch/arm/mach-socfpga/Makefile > @@ -102,6 +102,7 @@ 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 > +obj-y += altera-sysmgr.o > endif > > ifdef CONFIG_XPL_BUILD > diff --git a/arch/arm/mach-socfpga/misc.c b/arch/arm/mach-socfpga/misc.c > index 1eef7893e54..ee57ef6b927 100644 > --- a/arch/arm/mach-socfpga/misc.c > +++ b/arch/arm/mach-socfpga/misc.c > @@ -263,7 +263,8 @@ void socfpga_get_managers_addr(void) > > if (!IS_ENABLED(CONFIG_ARCH_SOCFPGA_AGILEX) && > !IS_ENABLED(CONFIG_ARCH_SOCFPGA_AGILEX7M) && > - !IS_ENABLED(CONFIG_ARCH_SOCFPGA_AGILEX5)) { > + !IS_ENABLED(CONFIG_ARCH_SOCFPGA_AGILEX5) && > + !IS_ENABLED(CONFIG_ARCH_SOCFPGA_N5X)) { > ret = socfpga_get_base_addr("altr,sys-mgr", > &socfpga_sysmgr_base); > if (ret) > diff --git a/arch/arm/mach-socfpga/spl_n5x.c b/arch/arm/mach-socfpga/spl_n5x.c > index a49be837921..c9c89c52231 100644 > --- a/arch/arm/mach-socfpga/spl_n5x.c > +++ b/arch/arm/mach-socfpga/spl_n5x.c > @@ -28,6 +28,7 @@ void board_init_f(ulong dummy) > if (ret) > hang(); > > + socfpga_get_sys_mgr_addr(); > socfpga_get_managers_addr(); > > /* Ensure watchdog is paused when debugging is happening */ > diff --git a/board/intel/n5x-socdk/Makefile b/board/intel/n5x-socdk/Makefile > new file mode 100644 > index 00000000000..2e105adf942 > --- /dev/null > +++ b/board/intel/n5x-socdk/Makefile > @@ -0,0 +1,6 @@ > +# SPDX-License-Identifier: GPL-2.0 > +# > +# Copyright (C) 2026 Altera Corporation <www.altera.com> > +# > + > +obj-y := socfpga.o > diff --git a/board/intel/n5x-socdk/socfpga.c b/board/intel/n5x-socdk/socfpga.c > new file mode 100644 > index 00000000000..f8facf79204 > --- /dev/null > +++ b/board/intel/n5x-socdk/socfpga.c > @@ -0,0 +1,12 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Copyright (C) 2026 Altera Corporation <www.altera.com> > + */ > + > +#include <asm/arch/misc.h> > + > +int board_early_init_f(void) > +{ > + socfpga_get_sys_mgr_addr(); > + return 0; > +} > diff --git a/configs/socfpga_n5x_defconfig b/configs/socfpga_n5x_defconfig > index 3b3916e676d..9b1382cbd75 100644 > --- a/configs/socfpga_n5x_defconfig > +++ b/configs/socfpga_n5x_defconfig > @@ -28,6 +28,7 @@ CONFIG_USE_BOOTARGS=y > 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_BOARD_EARLY_INIT_F=y > CONFIG_SYS_PBSIZE=2079 > CONFIG_SPL_MAX_SIZE=0x40000 > # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set Reviewed-by: Tien Fong Chee <[email protected]> Best regards, Tien Fong