RTEMS 6.1-rc6
Loading...
Searching...
No Matches
tms570_hwinit.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
12/*
13 * Copyright (C) 2022 Airbus U.S. Space & Defense, Inc
14 * Copyright (C) 2014 Premysl Houdek <kom541000@gmail.com>
15 *
16 * Google Summer of Code 2014 at
17 * Czech Technical University in Prague
18 * Zikova 1903/4
19 * 166 36 Praha 6
20 * Czech Republic
21 *
22 * Redistribution and use in source and binary forms, with or without
23 * modification, are permitted provided that the following conditions
24 * are met:
25 * 1. Redistributions of source code must retain the above copyright
26 * notice, this list of conditions and the following disclaimer.
27 * 2. Redistributions in binary form must reproduce the above copyright
28 * notice, this list of conditions and the following disclaimer in the
29 * documentation and/or other materials provided with the distribution.
30 *
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
32 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
33 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
34 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
35 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
36 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
37 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
38 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
39 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
40 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGE.
42 */
43
44#ifndef LIBBSP_ARM_TMS570_HWINIT_H
45#define LIBBSP_ARM_TMS570_HWINIT_H
46
47#include <bspopts.h>
48#include <stdint.h>
49#include <bsp/start.h>
50
51static inline bool tms570_running_from_tcram( void )
52{
53 uintptr_t fncptr = (uintptr_t)bsp_start_hook_0;
54 return (fncptr - TMS570_MEMORY_SRAM_ORIGIN) < TMS570_MEMORY_SRAM_SIZE;
55}
56
57static inline bool tms570_running_from_sdram( void )
58{
59 uintptr_t fncptr = (uintptr_t)bsp_start_hook_0;
60 return (fncptr - TMS570_MEMORY_SDRAM_ORIGIN) < TMS570_MEMORY_SDRAM_SIZE;
61}
62
63/* Ti TMS570 core setup implemented in assembly */
64void _esmCcmErrorsClear_( void );
65void _coreEnableEventBusExport_( void );
66void _errata_CORTEXR4_66_( void );
67void _errata_CORTEXR4_57_( void );
68void _coreEnableRamEcc_( void );
69void _coreDisableRamEcc_( void );
70void _mpuInit_( void );
71
72void tms570_memory_init( uint32_t ram );
73void tms570_trim_lpo_init( void );
74void tms570_flash_init( void );
75void tms570_periph_init( void );
76void tms570_system_hw_init( void );
77void tms570_esm_init( void );
78
79/*
80 * The following functions that must be implemented on a per-board basis for
81 * any BSP variant with hardware initialization. These configure MCU
82 * peripherals that are specific to a particular board.
83 */
84
88void tms570_emif_sdram_init(void);
89
93void tms570_pll_init(void);
94
100void tms570_map_clock_init(void);
101
106void tms570_pinmux_init(void);
107
108#endif /* LIBBSP_ARM_TMS570_HWINIT_H */
void bsp_start_hook_0(void)
Start entry hook 0.
Definition: bspstarthooks.c:49
void tms570_esm_init(void)
Error signaling module initialization (HCG:esmInit)
Definition: init_esm.c:50
void tms570_pinmux_init(void)
Initialize the tms570 PINMUX peripheral. This maps signals to pin terminals.
Definition: hwinit-lc4357-hdk.c:123
void tms570_pll_init(void)
Initialize PLLs source divider/multipliers.
Definition: hwinit-lc4357-hdk.c:198
void tms570_map_clock_init(void)
Initialize the tms570 Global Clock Manager (GCM) registers which sub-divide the input clock source (g...
Definition: hwinit-lc4357-hdk.c:263
void tms570_trim_lpo_init(void)
Adjust Low-Frequency (LPO) oscilator (HCG:trimLPO)
Definition: init_system.c:60
void tms570_flash_init(void)
Setup Flash memory parameters and timing (HCG:setupFlash)
Definition: init_system.c:85
void tms570_emif_sdram_init(void)
Initialize the External Memory InterFace (EMIF) peripheral.
Definition: hwinit-lc4357-hdk.c:136
void tms570_system_hw_init(void)
TMS570 system hardware initialization (HCG:systemInit)
Definition: init_system.c:152
void tms570_periph_init(void)
Power-up all peripherals and enable their clocks (HCG:periphInit)
Definition: init_system.c:117