On Mon, Jan 12, 2026 at 11:13 AM Eugen Hristev <[email protected]> wrote: > > > > On 1/12/26 11:52, Robert Marko wrote: > > On Mon, Jan 12, 2026 at 9:46 AM Eugen Hristev <[email protected]> > > wrote: > >> > >> > >> > >> On 12/30/25 23:01, Robert Marko wrote: > >>> Move the arch specific atmel_serial.h header from AT91 to the generic > >>> include/dm/platform_data. > >>> > >>> This will be used for support on Microchip LAN969x. > >>> > >>> Signed-off-by: Robert Marko <[email protected]> > >>> --- > >>> board/bluewater/gurnard/gurnard.c | 2 +- > >>> board/siemens/corvus/board.c | 2 +- > >>> board/siemens/smartweb/smartweb.c | 2 +- > >>> board/siemens/taurus/taurus.c | 2 +- > >>> drivers/serial/atmel_usart.c | 2 +- > >>> .../include/mach => include/dm/platform_data}/atmel_serial.h | 0 > >>> 6 files changed, 5 insertions(+), 5 deletions(-) > >>> rename {arch/arm/mach-at91/include/mach => > >>> include/dm/platform_data}/atmel_serial.h (100%) > >>> > >>> diff --git a/board/bluewater/gurnard/gurnard.c > >>> b/board/bluewater/gurnard/gurnard.c > >>> index 3275803226a..71db6409721 100644 > >>> --- a/board/bluewater/gurnard/gurnard.c > >>> +++ b/board/bluewater/gurnard/gurnard.c > >>> @@ -29,7 +29,7 @@ > >>> #include <asm/arch/at91_rstc.h> > >>> #include <asm/arch/at91_rtc.h> > >>> #include <asm/arch/at91_sck.h> > >>> -#include <asm/arch/atmel_serial.h> > >>> +#include <dm/platform_data/atmel_serial.h> > >>> #include <asm/arch/clk.h> > >>> #include <asm/arch/gpio.h> > >>> #include <dm/uclass-internal.h> > >>> diff --git a/board/siemens/corvus/board.c b/board/siemens/corvus/board.c > >>> index a8714e055d7..7a70a7dfc8b 100644 > >>> --- a/board/siemens/corvus/board.c > >>> +++ b/board/siemens/corvus/board.c > >>> @@ -20,7 +20,7 @@ > >>> #include <asm/arch/at91sam9_smc.h> > >>> #include <asm/arch/at91_common.h> > >>> #include <asm/arch/at91_rstc.h> > >>> -#include <asm/arch/atmel_serial.h> > >>> +#include <dm/platform_data/atmel_serial.h> > >>> #include <asm/arch/gpio.h> > >>> #include <asm/gpio.h> > >>> #include <asm/arch/clk.h> > >>> diff --git a/board/siemens/smartweb/smartweb.c > >>> b/board/siemens/smartweb/smartweb.c > >>> index 6fa3ca573ae..ce16aad3b98 100644 > >>> --- a/board/siemens/smartweb/smartweb.c > >>> +++ b/board/siemens/smartweb/smartweb.c > >>> @@ -25,7 +25,7 @@ > >>> #include <asm/arch/at91sam9260_matrix.h> > >>> #include <asm/arch/at91sam9_smc.h> > >>> #include <asm/arch/at91_common.h> > >>> -#include <asm/arch/atmel_serial.h> > >>> +#include <dm/platform_data/atmel_serial.h> > >>> #include <asm/arch/at91_spi.h> > >>> #include <spi.h> > >>> #include <asm/arch/clk.h> > >>> diff --git a/board/siemens/taurus/taurus.c b/board/siemens/taurus/taurus.c > >>> index 252b0787124..690c00046fa 100644 > >>> --- a/board/siemens/taurus/taurus.c > >>> +++ b/board/siemens/taurus/taurus.c > >>> @@ -24,7 +24,7 @@ > >>> #include <asm/arch/at91_rstc.h> > >>> #include <asm/arch/gpio.h> > >>> #include <asm/arch/at91sam9_sdramc.h> > >>> -#include <asm/arch/atmel_serial.h> > >>> +#include <dm/platform_data/atmel_serial.h> > >>> #include <asm/arch/clk.h> > >>> #include <asm/gpio.h> > >>> #include <linux/mtd/rawnand.h> > >>> diff --git a/drivers/serial/atmel_usart.c b/drivers/serial/atmel_usart.c > >>> index 0b35582aaa4..d6c3d4cbcc8 100644 > >>> --- a/drivers/serial/atmel_usart.c > >>> +++ b/drivers/serial/atmel_usart.c > >>> @@ -18,7 +18,7 @@ > >>> > >>> #include <asm/io.h> > >>> #if CONFIG_IS_ENABLED(DM_SERIAL) > >>> -#include <asm/arch/atmel_serial.h> > >>> +#include <dm/platform_data/atmel_serial.h> > >>> #endif > >>> #include <asm/arch/clk.h> > >>> #include <asm/arch/hardware.h> > >>> diff --git a/arch/arm/mach-at91/include/mach/atmel_serial.h > >>> b/include/dm/platform_data/atmel_serial.h > >>> similarity index 100% > >>> rename from arch/arm/mach-at91/include/mach/atmel_serial.h > >>> rename to include/dm/platform_data/atmel_serial.h > >> > >> Hello Robert, > >> > >> These patches break the build for some boards. e.g. corvus_defconfig > >> > >> > >> drivers/serial/atmel_usart.c: In function ‘atmel_serial_setbrg_internal’: > >> drivers/serial/atmel_usart.c:44:20: error: implicit declaration of > >> function ‘get_usart_clk_rate’ [-Werror=implicit-function-declaration] > >> 44 | usart_hz = get_usart_clk_rate(id); > >> | ^~~~~~~~~~~~~~~~~~ > >> AR spl/disk/built-in.a > >> CC spl/fs/fs_internal.o > >> cc1: some warnings being treated as errors > > > > So, somehow during the SPL build, the following is not evaluated as true: > > #if CONFIG_IS_ENABLED(ARCH_AT91) > > > > Which is rather weird as u-boot.cfg in the spl dir has: > > #define CONFIG_ARCH_AT91 1 > > > > So, this is some CONFIG_IS_ENABLED interaction with SPL that I am not > > really familiar with as > > #if IS_ENABLED(CONFIG_ARCH_AT91) works just fine and gets the header > > included. > > IIRC when the spl is being built, a dedicated config is being created > from the proper defconfig by selecting CONFIG_SPL_***
Ok, now that makes sense, CONFIG_IS_ENABLED basically will check for SPL_ARCH_AT91 which does not exist. > > You will have to check why the ARCH_AT91 is not selected for spl, which > is strange indeed Well, after looking at the expanded config there is a bunch of generic and ARCH-specific symbols that do not have the SPL_ variant generated. So, in this case use of IS_ENABLED seems more appropriate. > > > > > Regards, > > Robert > > > >> > >> > >> Please have a look, > >> thanks, > >> Eugen > >> > > > > > -- Robert Marko Staff Embedded Linux Engineer Sartura d.d. Lendavska ulica 16a 10000 Zagreb, Croatia Email: [email protected] Web: www.sartura.hr

