@web-font-path: "roboto-debian.css";
Loading...
Searching...
No Matches
config.h
1/*
2 * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef _BOOT_STAGE2_CONFIG_H
8#define _BOOT_STAGE2_CONFIG_H
9
10// NOTE THIS HEADER IS INCLUDED FROM ASSEMBLY
11
12#include "pico.h"
13
14// PICO_CONFIG: PICO_FLASH_SPI_CLKDIV, Clock divider from clk_sys to use for serial flash communications in boot stage 2. On RP2040 this must be a multiple of 2. This define applies to compilation of the boot stage 2 not the main application, type=int, default=varies; often specified in board header, advanced=true, group=boot_stage2
15
16// PICO_CONFIG: PICO_BUILD_BOOT_STAGE2_NAME, Name of the boot stage 2 if selected in the build system. This define applies to compilation of the boot stage 2 not the main application, group=boot_stage2
17#ifdef PICO_BUILD_BOOT_STAGE2_NAME
18 #define _BOOT_STAGE2_SELECTED
19#else
20 // check that multiple boot stage 2 options haven't been set...
21
22// PICO_CONFIG: PICO_BOOT_STAGE2_CHOOSE_IS25LP080, Select boot2_is25lp080 as the boot stage 2 when no boot stage 2 selection is made by the CMake build. This define applies to compilation of the boot stage 2 not the main application, type=bool, default=0, group=boot_stage2
23#ifndef PICO_BOOT_STAGE2_CHOOSE_IS25LP080
24 #define PICO_BOOT_STAGE2_CHOOSE_IS25LP080 0
25#elif PICO_BOOT_STAGE2_CHOOSE_IS25LP080
26 #ifdef _BOOT_STAGE2_SELECTED
27 #error multiple boot stage 2 options chosen
28 #endif
29 #define _BOOT_STAGE2_SELECTED
30#endif
31// PICO_CONFIG: PICO_BOOT_STAGE2_CHOOSE_W25Q080, Select boot2_w25q080 as the boot stage 2 when no boot stage 2 selection is made by the CMake build. This define applies to compilation of the boot stage 2 not the main application, type=bool, default=0, group=boot_stage2
32#ifndef PICO_BOOT_STAGE2_CHOOSE_W25Q080
33 #define PICO_BOOT_STAGE2_CHOOSE_W25Q080 0
34#elif PICO_BOOT_STAGE2_CHOOSE_W25Q080
35 #ifdef _BOOT_STAGE2_SELECTED
36 #error multiple boot stage 2 options chosen
37 #endif
38 #define _BOOT_STAGE2_SELECTED
39#endif
40// PICO_CONFIG: PICO_BOOT_STAGE2_CHOOSE_W25X10CL, Select boot2_w25x10cl as the boot stage 2 when no boot stage 2 selection is made by the CMake build. This define applies to compilation of the boot stage 2 not the main application, type=bool, default=0, group=boot_stage2
41#ifndef PICO_BOOT_STAGE2_CHOOSE_W25X10CL
42 #define PICO_BOOT_STAGE2_CHOOSE_W25X10CL 0
43#elif PICO_BOOT_STAGE2_CHOOSE_W25X10CL
44 #ifdef _BOOT_STAGE2_SELECTED
45 #error multiple boot stage 2 options chosen
46 #endif
47 #define _BOOT_STAGE2_SELECTED
48#endif
49// PICO_CONFIG: PICO_BOOT_STAGE2_CHOOSE_AT25SF128A, Select boot2_at25sf128a as the boot stage 2 when no boot stage 2 selection is made by the CMake build. This define applies to compilation of the boot stage 2 not the main application, type=bool, default=0, group=boot_stage2
50#ifndef PICO_BOOT_STAGE2_CHOOSE_AT25SF128A
51 #define PICO_BOOT_STAGE2_CHOOSE_AT25SF128A 0
52#elif PICO_BOOT_STAGE2_CHOOSE_AT25SF128A
53 #ifdef _BOOT_STAGE2_SELECTED
54 #error multiple boot stage 2 options chosen
55 #endif
56 #define _BOOT_STAGE2_SELECTED
57#endif
58
59// PICO_CONFIG: PICO_BOOT_STAGE2_CHOOSE_GENERIC_03H, Select boot2_generic_03h as the boot stage 2 when no boot stage 2 selection is made by the CMake build. This define applies to compilation of the boot stage 2 not the main application, type=bool, default=1, group=boot_stage2
60#if defined(PICO_BOOT_STAGE2_CHOOSE_GENERIC_03H) && PICO_BOOT_STAGE2_CHOOSE_GENERIC_03H
61 #ifdef _BOOT_STAGE2_SELECTED
62 #error multiple boot stage 2 options chosen
63 #endif
64 #define _BOOT_STAGE2_SELECTED
65#endif
66
67#endif // PICO_BUILD_BOOT_STAGE2_NAME
68
69#ifdef PICO_BUILD_BOOT_STAGE2_NAME
70 // boot stage 2 is configured by cmake, so use the name specified there
71 #define PICO_BOOT_STAGE2_NAME PICO_BUILD_BOOT_STAGE2_NAME
72#else
73 // boot stage 2 is selected by board config header, so we have to do some work
74 #if PICO_BOOT_STAGE2_CHOOSE_IS25LP080
75 #define _BOOT_STAGE2 boot2_is25lp080
76 #elif PICO_BOOT_STAGE2_CHOOSE_W25Q080
77 #define _BOOT_STAGE2 boot2_w25q080
78 #elif PICO_BOOT_STAGE2_CHOOSE_W25X10CL
79 #define _BOOT_STAGE2 boot2_w25x10cl
80 #elif PICO_BOOT_STAGE2_CHOOSE_AT25SF128A
81 #define _BOOT_STAGE2 boot2_at25sf128a
82 #elif !defined(PICO_BOOT_STAGE2_CHOOSE_GENERIC_03H) || PICO_BOOT_STAGE2_CHOOSE_GENERIC_03H
83 #undef PICO_BOOT_STAGE2_CHOOSE_GENERIC_03H
84 #define PICO_BOOT_STAGE2_CHOOSE_GENERIC_03H 1
85 #define _BOOT_STAGE2 boot2_generic_03h
86 #else
87 #error no boot stage 2 is defined by PICO_BOOT_STAGE2_CHOOSE_ macro
88 #endif
89 // we can't include cdefs in assembly, so define our own, but avoid conflict with real ones for c inclusion
90 #define PICO_BOOT_STAGE2_NAME __PICO_XSTRING(_BOOT_STAGE2)
91 #define PICO_BOOT_STAGE2_ASM __PICO_XSTRING(__PICO_CONCAT1(_BOOT_STAGE2,.S))
92#endif
93#endif