From 07aeb12b3010b9181a2a3e389d5b3b17dbf03298 Mon Sep 17 00:00:00 2001 From: Janne Rosberg Date: Mon, 14 Mar 2022 13:00:19 +0200 Subject: [PATCH] risc-v/common: add call to riscv_netinitialize() --- arch/risc-v/src/common/riscv_initialize.c | 6 ++++++ arch/risc-v/src/common/riscv_internal.h | 13 +++++++++++++ 2 files changed, 19 insertions(+) diff --git a/arch/risc-v/src/common/riscv_initialize.c b/arch/risc-v/src/common/riscv_initialize.c index 5c28680d37..872e415f8a 100644 --- a/arch/risc-v/src/common/riscv_initialize.c +++ b/arch/risc-v/src/common/riscv_initialize.c @@ -105,5 +105,11 @@ void up_initialize(void) riscv_serialinit(); #endif +#ifdef CONFIG_NET + /* Initialize the network */ + + riscv_netinitialize(); +#endif + board_autoled_on(LED_IRQSENABLED); } diff --git a/arch/risc-v/src/common/riscv_internal.h b/arch/risc-v/src/common/riscv_internal.h index 78379f0368..7c5a73f4e5 100644 --- a/arch/risc-v/src/common/riscv_internal.h +++ b/arch/risc-v/src/common/riscv_internal.h @@ -237,6 +237,19 @@ void riscv_serialinit(void); void riscv_earlyserialinit(void); #endif +/* Networking ***************************************************************/ + +/* Defined in board/xyz_network.c for board-specific Ethernet + * implementations, or chip/xyx_ethernet.c for chip-specific Ethernet + * implementations. + */ + +#if defined(CONFIG_NET) && !defined(CONFIG_NETDEV_LATEINIT) +void riscv_netinitialize(void); +#else +# define riscv_netinitialize() +#endif + /* Exception Handler ********************************************************/ void riscv_fault(int irq, uintptr_t *regs);