* [PATCH] clk: clk-fixed-factor: compile clk of provider only if it is enabled @ 2025-07-30 3:50 chalianis1 2025-07-30 3:50 ` [PATCH] arm: efi: add a dummy efi arch on ARM64 chalianis1 2025-07-30 6:23 ` [PATCH] clk: clk-fixed-factor: compile clk of provider only if it is enabled Ahmad Fatoum 0 siblings, 2 replies; 5+ messages in thread From: chalianis1 @ 2025-07-30 3:50 UTC (permalink / raw) To: s.hauer; +Cc: barebox, Chali Anis From: Chali Anis <chalianis1@gmail.com> This permits to not compile when it's not used, fix undefined reference error. Signed-off-by: Chali Anis <chalianis1@gmail.com> --- drivers/clk/clk-fixed-factor.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/clk/clk-fixed-factor.c b/drivers/clk/clk-fixed-factor.c index d2c808d40c63..ea04a4bf7f0f 100644 --- a/drivers/clk/clk-fixed-factor.c +++ b/drivers/clk/clk-fixed-factor.c @@ -97,6 +97,8 @@ struct clk_hw *clk_hw_register_fixed_factor(struct device *dev, flags, mult, div)); } +#ifdef CONFIG_COMMON_CLK_OF_PROVIDER + /** * of_fixed_factor_clk_setup() - Setup function for simple fixed factor clock */ @@ -130,3 +132,4 @@ static int of_fixed_factor_clk_setup(struct device_node *node) } CLK_OF_DECLARE(fixed_factor_clk, "fixed-factor-clock", of_fixed_factor_clk_setup); +#endif -- 2.34.1 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] arm: efi: add a dummy efi arch on ARM64 2025-07-30 3:50 [PATCH] clk: clk-fixed-factor: compile clk of provider only if it is enabled chalianis1 @ 2025-07-30 3:50 ` chalianis1 2025-07-30 6:12 ` Ahmad Fatoum 2025-07-30 6:23 ` [PATCH] clk: clk-fixed-factor: compile clk of provider only if it is enabled Ahmad Fatoum 1 sibling, 1 reply; 5+ messages in thread From: chalianis1 @ 2025-07-30 3:50 UTC (permalink / raw) To: s.hauer; +Cc: barebox, Chali Anis From: Chali Anis <chalianis1@gmail.com> this arch will forces a generic arm 64 cpu, which will produce an efi payload on ARM 64, this works with a virtual machine using qemu-system-aarch64, need further work to support real hardware. Submit the patch in case someone is interrested in working to have a full support for efi payload on real hardware. Signed-off-by: Chali Anis <chalianis1@gmail.com> --- Documentation/boards/efi.rst | 11 +++- arch/arm/Kconfig | 1 + arch/arm/configs/efi_defconfig | 101 +++++++++++++++++++++++++++++++++ arch/arm/mach-efi/Kconfig | 10 ++++ arch/arm/mach-efi/Makefile | 1 + 5 files changed, 123 insertions(+), 1 deletion(-) create mode 100644 arch/arm/configs/efi_defconfig create mode 100644 arch/arm/mach-efi/Kconfig create mode 100644 arch/arm/mach-efi/Makefile diff --git a/Documentation/boards/efi.rst b/Documentation/boards/efi.rst index 869e5e88172f..872b0c2388ce 100644 --- a/Documentation/boards/efi.rst +++ b/Documentation/boards/efi.rst @@ -23,7 +23,7 @@ x86_64 binary currently is tested. Building barebox for EFI ------------------------ -Use the following to build barebox for EFI: +Use the following to build barebox for EFI for x86: .. code-block:: sh @@ -31,6 +31,15 @@ Use the following to build barebox for EFI: make efi_defconfig make +for EFI on arm 64 use: + +.. code-block:: sh + + export ARCH=arm + export CROSS_COMPILE=aarch64-linux-gnu- + make efi_defconfig + make + The resulting EFI image is ``barebox.efi`` (or the barebox-flash-image link). Running barebox on EFI systems diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index d283ef7793a1..d5dd6abc416f 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -276,6 +276,7 @@ source "arch/arm/mach-vexpress/Kconfig" source "arch/arm/mach-tegra/Kconfig" source "arch/arm/mach-zynq/Kconfig" source "arch/arm/mach-zynqmp/Kconfig" +source "arch/arm/mach-efi/Kconfig" config BOARD_ARM_VIRT bool diff --git a/arch/arm/configs/efi_defconfig b/arch/arm/configs/efi_defconfig new file mode 100644 index 000000000000..5fe998ed4d4d --- /dev/null +++ b/arch/arm/configs/efi_defconfig @@ -0,0 +1,101 @@ +CONFIG_EFI_ARM64=y +CONFIG_64BIT=y +CONFIG_MMU=y +CONFIG_MALLOC_SIZE=0x0 +CONFIG_MALLOC_TLSF=y +CONFIG_HUSH_FANCY_PROMPT=y +CONFIG_CMDLINE_EDITING=y +CONFIG_AUTO_COMPLETE=y +CONFIG_MENU=y +# CONFIG_TIMESTAMP is not set +CONFIG_BOOTM_SHOW_TYPE=y +CONFIG_BOOTM_VERBOSE=y +CONFIG_BOOTM_INITRD=y +CONFIG_BLSPEC=y +CONFIG_CONSOLE_ACTIVATE_ALL=y +CONFIG_PARTITION_DISK_EFI=y +CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y +CONFIG_STATE=y +CONFIG_BOOTCHOOSER=y +CONFIG_RESET_SOURCE=y +CONFIG_DEBUG_LL=y +CONFIG_CMD_DMESG=y +CONFIG_LONGHELP=y +CONFIG_CMD_IOMEM=y +CONFIG_CMD_IMD=y +CONFIG_CMD_MEMINFO=y +CONFIG_CMD_GO=y +CONFIG_CMD_LOADB=y +CONFIG_CMD_RESET=y +CONFIG_CMD_UIMAGE=y +CONFIG_CMD_BOOTCHOOSER=y +CONFIG_CMD_PARTITION=y +CONFIG_CMD_EXPORT=y +CONFIG_CMD_LOADENV=y +CONFIG_CMD_PRINTENV=y +CONFIG_CMD_MAGICVAR=y +CONFIG_CMD_MAGICVAR_HELP=y +CONFIG_CMD_SAVEENV=y +CONFIG_CMD_FILETYPE=y +CONFIG_CMD_LN=y +CONFIG_CMD_MD5SUM=y +CONFIG_CMD_UNCOMPRESS=y +CONFIG_CMD_LET=y +CONFIG_CMD_MSLEEP=y +CONFIG_CMD_READF=y +CONFIG_CMD_SLEEP=y +CONFIG_CMD_DHCP=y +CONFIG_CMD_PING=y +CONFIG_CMD_TFTP=y +CONFIG_CMD_ECHO_E=y +CONFIG_CMD_EDIT=y +CONFIG_CMD_MENU=y +CONFIG_CMD_MENUTREE=y +CONFIG_CMD_READLINE=y +CONFIG_CMD_TIMEOUT=y +CONFIG_CMD_CRC=y +CONFIG_CMD_CRC_CMP=y +CONFIG_CMD_MM=y +CONFIG_CMD_DETECT=y +CONFIG_CMD_FLASH=y +CONFIG_CMD_POWEROFF=y +CONFIG_CMD_WD=y +CONFIG_CMD_2048=y +CONFIG_CMD_BAREBOX_UPDATE=y +CONFIG_CMD_OF_DIFF=y +CONFIG_CMD_OF_NODE=y +CONFIG_CMD_OF_PROPERTY=y +CONFIG_CMD_OFTREE=y +CONFIG_CMD_TIME=y +CONFIG_CMD_STATE=y +CONFIG_NET=y +CONFIG_NET_NETCONSOLE=y +CONFIG_OFDEVICE=y +CONFIG_OF_BAREBOX_DRIVERS=y +CONFIG_OF_BAREBOX_ENV_IN_FS=y +CONFIG_DRIVER_SERIAL_EFI=y +CONFIG_DRIVER_SERIAL_EFI_STDIO=y +CONFIG_DRIVER_NET_EFI_SNP=y +# CONFIG_SPI is not set +CONFIG_DISK=y +CONFIG_DISK_WRITE=y +CONFIG_VIDEO=y +CONFIG_FRAMEBUFFER_CONSOLE=y +CONFIG_DRIVER_VIDEO_EFI_GOP=y +CONFIG_FINTEK_SUPERIO=y +CONFIG_SMSC_SUPERIO=y +CONFIG_STATE_DRV=y +CONFIG_WATCHDOG=y +CONFIG_WATCHDOG_EFI=y +CONFIG_F71808E_WDT=y +CONFIG_ITCO_WDT=y +# CONFIG_PINCTRL is not set +CONFIG_PCI_EFI=y +CONFIG_FS_EXT4=y +CONFIG_FS_TFTP=y +CONFIG_FS_NFS=y +CONFIG_FS_EFI=y +CONFIG_FS_EFIVARFS=y +CONFIG_FS_FAT=y +CONFIG_FS_FAT_WRITE=y +CONFIG_FS_FAT_LFN=y diff --git a/arch/arm/mach-efi/Kconfig b/arch/arm/mach-efi/Kconfig new file mode 100644 index 000000000000..2bc4feca0581 --- /dev/null +++ b/arch/arm/mach-efi/Kconfig @@ -0,0 +1,10 @@ +config EFI_ARM64 + bool "EFI on ARM64" + select CPU_V8 + select CPU_SUPPORTS_64BIT_KERNEL + select HAVE_EFI_PAYLOAD + select EFI_PAYLOAD + select CLOCKSOURCE_EFI + depends on 64BIT + default y + diff --git a/arch/arm/mach-efi/Makefile b/arch/arm/mach-efi/Makefile new file mode 100644 index 000000000000..16a218658ade --- /dev/null +++ b/arch/arm/mach-efi/Makefile @@ -0,0 +1 @@ +obj- := __dummy__.o -- 2.34.1 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] arm: efi: add a dummy efi arch on ARM64 2025-07-30 3:50 ` [PATCH] arm: efi: add a dummy efi arch on ARM64 chalianis1 @ 2025-07-30 6:12 ` Ahmad Fatoum 0 siblings, 0 replies; 5+ messages in thread From: Ahmad Fatoum @ 2025-07-30 6:12 UTC (permalink / raw) To: chalianis1, s.hauer; +Cc: barebox Hi, On 30.07.25 05:50, chalianis1@gmail.com wrote: > From: Chali Anis <chalianis1@gmail.com> > > this arch will forces a generic arm 64 cpu, which will > produce an efi payload on ARM 64, this works with a virtual > machine using qemu-system-aarch64, need further work to support > real hardware. > Submit the patch in case someone is interrested in working > to have a full support for efi payload on real hardware. Thanks for your patch. For the Virt platforms we decided to use the multi defconfigs to cut down on the number of configs. I think efi_defconfig is useful to have, because it shares little with other existing configs, but it might confuse users to provide it before it is a viable target, i.e. can actually boot a kernel via EFI... I just submitted an alternative patch for multi_v8_efi_defconfig, which could be used as stepping stone for further work. What do you think? > -Use the following to build barebox for EFI: > +Use the following to build barebox for EFI for x86: > > .. code-block:: sh > > @@ -31,6 +31,15 @@ Use the following to build barebox for EFI: > make efi_defconfig > make > > +for EFI on arm 64 use: > + > +.. code-block:: sh > + > + export ARCH=arm > + export CROSS_COMPILE=aarch64-linux-gnu- > + make efi_defconfig > + make > + > The resulting EFI image is ``barebox.efi`` (or the barebox-flash-image link). > > Running barebox on EFI systems > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig > index d283ef7793a1..d5dd6abc416f 100644 > --- a/arch/arm/Kconfig > +++ b/arch/arm/Kconfig > @@ -276,6 +276,7 @@ source "arch/arm/mach-vexpress/Kconfig" > source "arch/arm/mach-tegra/Kconfig" > source "arch/arm/mach-zynq/Kconfig" > source "arch/arm/mach-zynqmp/Kconfig" > +source "arch/arm/mach-efi/Kconfig" > > config BOARD_ARM_VIRT > bool > diff --git a/arch/arm/configs/efi_defconfig b/arch/arm/configs/efi_defconfig > new file mode 100644 > index 000000000000..5fe998ed4d4d > +CONFIG_VIDEO=y > +CONFIG_FRAMEBUFFER_CONSOLE=y > +CONFIG_DRIVER_VIDEO_EFI_GOP=y This doesn't work correctly on ARM yet > +CONFIG_FINTEK_SUPERIO=y > +CONFIG_SMSC_SUPERIO=y These are likely not used with ARM systems > +CONFIG_STATE_DRV=y > +CONFIG_WATCHDOG=y > +CONFIG_WATCHDOG_EFI=y > +CONFIG_F71808E_WDT=y > +CONFIG_ITCO_WDT=y Not relevant to ARM systems. > +++ b/arch/arm/mach-efi/Kconfig > @@ -0,0 +1,10 @@ > +config EFI_ARM64 > + bool "EFI on ARM64" > + select CPU_V8 > + select CPU_SUPPORTS_64BIT_KERNEL > + select HAVE_EFI_PAYLOAD > + select EFI_PAYLOAD EFI_PAYLOAD is still gated behind COMPILE_TEST, so I think this should result in a warning. > + select CLOCKSOURCE_EFI Wrong indentation. Cheers, Ahmad -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] clk: clk-fixed-factor: compile clk of provider only if it is enabled 2025-07-30 3:50 [PATCH] clk: clk-fixed-factor: compile clk of provider only if it is enabled chalianis1 2025-07-30 3:50 ` [PATCH] arm: efi: add a dummy efi arch on ARM64 chalianis1 @ 2025-07-30 6:23 ` Ahmad Fatoum [not found] ` <CAL+1fyCC0V3MO4tmgBJumbdPn7_BhQc-60s3QhGjye0rQQVpPw@mail.gmail.com> 1 sibling, 1 reply; 5+ messages in thread From: Ahmad Fatoum @ 2025-07-30 6:23 UTC (permalink / raw) To: chalianis1, s.hauer; +Cc: barebox Hi Anis, On 30.07.25 05:50, chalianis1@gmail.com wrote: > From: Chali Anis <chalianis1@gmail.com> > > This permits to not compile when it's not used, fix undefined > reference error. Normally undefined references are garbage collected by the linker if the code that references them is going to be discarded as well. We have configurations with and without OF support that make use of clocks in CI I think, so I am curious to know what configuration you used to provoke the error. Cheers, Ahma > > Signed-off-by: Chali Anis <chalianis1@gmail.com> > --- > drivers/clk/clk-fixed-factor.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/clk/clk-fixed-factor.c b/drivers/clk/clk-fixed-factor.c > index d2c808d40c63..ea04a4bf7f0f 100644 > --- a/drivers/clk/clk-fixed-factor.c > +++ b/drivers/clk/clk-fixed-factor.c > @@ -97,6 +97,8 @@ struct clk_hw *clk_hw_register_fixed_factor(struct device *dev, > flags, mult, div)); > } > > +#ifdef CONFIG_COMMON_CLK_OF_PROVIDER > + > /** > * of_fixed_factor_clk_setup() - Setup function for simple fixed factor clock > */ > @@ -130,3 +132,4 @@ static int of_fixed_factor_clk_setup(struct device_node *node) > } > CLK_OF_DECLARE(fixed_factor_clk, "fixed-factor-clock", > of_fixed_factor_clk_setup); > +#endif -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <CAL+1fyCC0V3MO4tmgBJumbdPn7_BhQc-60s3QhGjye0rQQVpPw@mail.gmail.com>]
* Re: [PATCH] clk: clk-fixed-factor: compile clk of provider only if it is enabled [not found] ` <CAL+1fyCC0V3MO4tmgBJumbdPn7_BhQc-60s3QhGjye0rQQVpPw@mail.gmail.com> @ 2025-08-04 9:41 ` Ahmad Fatoum 0 siblings, 0 replies; 5+ messages in thread From: Ahmad Fatoum @ 2025-08-04 9:41 UTC (permalink / raw) To: anis chali; +Cc: BAREBOX Hi, [adding back barebox mailing list] On 7/30/25 08:57, anis chali wrote: > Hi Ahmad, > I will check back tomorrow, but I faced the issue when I compiled efi > on arm64 using the clocksource efi will compile the stuff inside the > fixed clock and there is a code using of variant that raised an > undefined reference but maybe it's all good since arm64 support device > trees, so adding the config to enable of tree support will eliminate the > issue. If there is a build error, it should be fixed. I was just wondering how you ran into it. Cheers, Ahmad > > Cheers, > Anis > > > Le mer. 30 juil. 2025, 02:23, Ahmad Fatoum <a.fatoum@pengutronix.de > <mailto:a.fatoum@pengutronix.de>> a écrit : > > Hi Anis, > > On 30.07.25 05:50, chalianis1@gmail.com > <mailto:chalianis1@gmail.com> wrote: > > From: Chali Anis <chalianis1@gmail.com <mailto:chalianis1@gmail.com>> > > > > This permits to not compile when it's not used, fix undefined > > reference error. > > Normally undefined references are garbage collected by the linker if > the code that references them is going to be discarded as well. > > We have configurations with and without OF support that make use > of clocks in CI I think, so I am curious to know what configuration > you used to provoke the error. > > Cheers, > Ahma > > > > > Signed-off-by: Chali Anis <chalianis1@gmail.com > <mailto:chalianis1@gmail.com>> > > --- > > drivers/clk/clk-fixed-factor.c | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/drivers/clk/clk-fixed-factor.c b/drivers/clk/clk- > fixed-factor.c > > index d2c808d40c63..ea04a4bf7f0f 100644 > > --- a/drivers/clk/clk-fixed-factor.c > > +++ b/drivers/clk/clk-fixed-factor.c > > @@ -97,6 +97,8 @@ struct clk_hw > *clk_hw_register_fixed_factor(struct device *dev, > > flags, mult, > div)); > > } > > > > +#ifdef CONFIG_COMMON_CLK_OF_PROVIDER > > + > > /** > > * of_fixed_factor_clk_setup() - Setup function for simple fixed > factor clock > > */ > > @@ -130,3 +132,4 @@ static int of_fixed_factor_clk_setup(struct > device_node *node) > > } > > CLK_OF_DECLARE(fixed_factor_clk, "fixed-factor-clock", > > of_fixed_factor_clk_setup); > > +#endif > > > -- > Pengutronix e.K. | > | > Steuerwalder Str. 21 | http:// > www.pengutronix.de/ <http://www.pengutronix.de/> | > 31137 Hildesheim, Germany | Phone: > +49-5121-206917-0 | > Amtsgericht Hildesheim, HRA 2686 | Fax: > +49-5121-206917-5555 | > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-08-04 9:42 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2025-07-30 3:50 [PATCH] clk: clk-fixed-factor: compile clk of provider only if it is enabled chalianis1 2025-07-30 3:50 ` [PATCH] arm: efi: add a dummy efi arch on ARM64 chalianis1 2025-07-30 6:12 ` Ahmad Fatoum 2025-07-30 6:23 ` [PATCH] clk: clk-fixed-factor: compile clk of provider only if it is enabled Ahmad Fatoum [not found] ` <CAL+1fyCC0V3MO4tmgBJumbdPn7_BhQc-60s3QhGjye0rQQVpPw@mail.gmail.com> 2025-08-04 9:41 ` Ahmad Fatoum
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox