MCCI Trusted Bootloader
Simple trusted bootloader and tools for small embedded systems
mccibootloaderboard_catena5220_storageinit.c
Go to the documentation of this file.
1/*
2
3Module: mccibootloaderboard_catena5220_storageinit.c
4
5Function:
6 McciBootloaderBoard_Catena5220_storageInit()
7
8Copyright and License:
9 This file copyright (C) 2026 by
10
11 MCCI Corporation
12 3520 Krums Corners Road
13 Ithaca, NY 14850
14
15 See accompanying LICENSE file for copyright and license information.
16
17Author:
18 Pranau Ravikumar, MCCI Corporation September 2026
19
20*/
21
23
25#include "mcci_stm32l0xx.h"
26#include <stdbool.h>
27#include <stdint.h>
28#include <stdlib.h>
29
30/****************************************************************************\
31|
32| Manifest constants & typedefs.
33|
34\****************************************************************************/
35
36static void
37storagePowerOn(void);
38
39/****************************************************************************\
40|
41| Read-only data.
42|
43\****************************************************************************/
44
45
46
47/****************************************************************************\
48|
49| Variables.
50|
51\****************************************************************************/
52
53/*
54
55Name: storagePowerOn()
56
57Function:
58 Turn on the VOUT1 load switch that powers the flash and FRAM.
59
60Description:
61 On the Catena 5220, VOUT1 (which powers the SPI flash and the FRAM)
62 is gated by a TPS22960 load switch, enabled by PA7 (D10). There is no
63 PMIC on this board -- the enable line is a plain GPIO, driven directly
64 by the bootloader.
65
66 The TPS22960's internal soft-start limits the output rise time to
67 well under 1 ms; we wait 50 ms for margin (matching the analogous
68 delay used for the 4801's regulator) before touching the bus.
69
70Returns:
71 No explicit result.
72
73*/
74
75static void
77 {
78 // enable GPIOA
82 );
83
84 // make PA7 an output.
89 );
90
91 // drive PA7 (D10 / ON1) high to enable VOUT1.
95 );
96
97 // delay 50 ms for VOUT1 to come up.
99 }
100
101void
110
111
112/**** end of mccibootloaderboard_catena5220_storageinit.c ****/
static uint32_t McciArm_putRegOr(uint32_t reg, uint32_t orVal)
or 32-bit values to a cm0plus register
static uint32_t McciArm_putRegMasked(uint32_t reg, uint32_t maskVal, uint32_t modVal)
store to cm0plus register under mask
#define MCCI_BOOTLOADER_FIELD_SET_VALUE(fmask, val)
McciBootloaderPlatform_StorageInitFn_t McciBootloaderFlash_Mx25v8035f_storageInit
static void McciBootloaderPlatform_delayMs(uint32_t ms)
static void McciBootloaderPlatform_spiInit(void)
#define MCCI_STM32L0_GPIO_BSRR_BS_P(p)
compute port-bit set mask for bit p.
#define MCCI_STM32L0_GPIO_BSRR
#define MCCI_STM32L0_GPIO_MODER
#define MCCI_STM32L0_REG_GPIOA
Section 9.4.12: GPIO register map (1K)
#define MCCI_STM32L0_REG_RCC_IOPENR
GPIO clock enable.
#define MCCI_STM32L0_REG_RCC_IOPENR_IOPAEN
#define MCCI_STM32L0_GPIO_MODE_OUT
#define MCCI_STM32L0_GPIO_MODE_P(p)
compute the mask for the mode bits for port bits 0..15
static void storagePowerOn(void)
void McciBootloaderBoard_Catena5220_storageInit(void)