risc-v/esp32c3: Configure clock and call board initialize at startup.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
This commit is contained in:
parent
c76e201ebd
commit
39016f6d68
2 changed files with 65 additions and 2 deletions
|
|
@ -29,10 +29,11 @@
|
||||||
|
|
||||||
#include <arch/board/board.h>
|
#include <arch/board/board.h>
|
||||||
|
|
||||||
#include "chip.h"
|
|
||||||
#include "esp32c3.h"
|
#include "esp32c3.h"
|
||||||
|
#include "esp32c3_clockconfig.h"
|
||||||
#include "esp32c3_irq.h"
|
#include "esp32c3_irq.h"
|
||||||
#include "esp32c3_lowputc.h"
|
#include "esp32c3_lowputc.h"
|
||||||
|
#include "esp32c3_start.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
|
|
@ -66,6 +67,10 @@ void __esp32c3_start(void)
|
||||||
{
|
{
|
||||||
uint32_t *dest;
|
uint32_t *dest;
|
||||||
|
|
||||||
|
/* Set CPU frequency */
|
||||||
|
|
||||||
|
esp32c3_clockconfig();
|
||||||
|
|
||||||
/* Configure the UART so we can get debug output */
|
/* Configure the UART so we can get debug output */
|
||||||
|
|
||||||
esp32c3_lowsetup();
|
esp32c3_lowsetup();
|
||||||
|
|
@ -83,7 +88,11 @@ void __esp32c3_start(void)
|
||||||
|
|
||||||
showprogress('B');
|
showprogress('B');
|
||||||
|
|
||||||
/* Call nx_start() */
|
/* Initialize onboard resources */
|
||||||
|
|
||||||
|
esp32c3_board_initialize();
|
||||||
|
|
||||||
|
/* Bring up NuttX */
|
||||||
|
|
||||||
nx_start();
|
nx_start();
|
||||||
|
|
||||||
|
|
|
||||||
54
arch/risc-v/src/esp32c3/esp32c3_start.h
Normal file
54
arch/risc-v/src/esp32c3/esp32c3_start.h
Normal file
|
|
@ -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 */
|
||||||
Loading…
Add table
Reference in a new issue