diff --git a/arch/risc-v/src/esp32c3/esp32c3_start.c b/arch/risc-v/src/esp32c3/esp32c3_start.c index df89e3c7d6..ae06107baa 100644 --- a/arch/risc-v/src/esp32c3/esp32c3_start.c +++ b/arch/risc-v/src/esp32c3/esp32c3_start.c @@ -29,10 +29,11 @@ #include -#include "chip.h" #include "esp32c3.h" +#include "esp32c3_clockconfig.h" #include "esp32c3_irq.h" #include "esp32c3_lowputc.h" +#include "esp32c3_start.h" /**************************************************************************** * Pre-processor Definitions @@ -66,6 +67,10 @@ void __esp32c3_start(void) { uint32_t *dest; + /* Set CPU frequency */ + + esp32c3_clockconfig(); + /* Configure the UART so we can get debug output */ esp32c3_lowsetup(); @@ -83,7 +88,11 @@ void __esp32c3_start(void) showprogress('B'); - /* Call nx_start() */ + /* Initialize onboard resources */ + + esp32c3_board_initialize(); + + /* Bring up NuttX */ nx_start(); diff --git a/arch/risc-v/src/esp32c3/esp32c3_start.h b/arch/risc-v/src/esp32c3/esp32c3_start.h new file mode 100644 index 0000000000..8fa09558e0 --- /dev/null +++ b/arch/risc-v/src/esp32c3/esp32c3_start.h @@ -0,0 +1,54 @@ +/**************************************************************************** + * arch/risc-v/src/esp32c3/esp32c3_start.h + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#ifndef __ARCH_RISCV_SRC_ESP32C3_ESP32C3_START_H +#define __ARCH_RISCV_SRC_ESP32C3_ESP32C3_START_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Name: esp32c3_board_initialize + * + * Description: + * All ESP32 architectures must provide the following entry point. This + * entry point is called early in the initialization -- after all memory + * has been configured but before any devices have been initialized. + * + * Input Parameters: + * None + * + * Returned Value: + * None + * + ****************************************************************************/ + +void esp32c3_board_initialize(void); + +#endif /* __ARCH_RISCV_SRC_ESP32C3_ESP32C3_START_H */