Repository: raspberrypi/pico-sdk
File: src/rp2040/boot_stage2/include/boot_stage2/config.h (C/C++)

Code before:
/*
 * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#ifndef _BOOT_STAGE2_CONFIG_H
#define _BOOT_STAGE2_CONFIG_H

// NOTE THIS HEADER IS INCLUDED FROM ASSEMBLY

#include "pico.h"

// 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, type=int, default=varies; often specified in board header, advanced=true, group=boot_stage2

// PICO_CONFIG: PICO_BUILD_BOOT_STAGE2_NAME, Name of the boot stage 2 if selected in the build system, group=boot_stage2
#ifdef PICO_BUILD_BOOT_STAGE2_NAME
    #define _BOOT_STAGE2_SELECTED
#else
    // check that multiple boot stage 2 options haven't been set...

// 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, type=bool, default=0, group=boot_stage2
#ifndef PICO_BOOT_STAGE2_CHOOSE_IS25LP080
    #define PICO_BOOT_STAGE2_CHOOSE_IS25LP080 0
#elif PICO_BOOT_STAGE2_CHOOSE_IS25LP080
    #ifdef _BOOT_STAGE2_SELECTED
        #error multiple boot stage 2 options chosen
    #endif
    #define _BOOT_STAGE2_SELECTED
#endif
// 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, type=bool, default=0, group=boot_stage2
#ifndef PICO_BOOT_STAGE2_CHOOSE_W25Q080
    #define PICO_BOOT_STAGE2_CHOOSE_W25Q080 0
#elif PICO_BOOT_STAGE2_CHOOSE_W25Q080
    #ifdef _BOOT_STAGE2_SELECTED
        #error multiple boot stage 2 options chosen
    #endif
    #define _BOOT_STAGE2_SELECTED
#endif

Review comment (refactor):
~~This file is in `src/rp2040/...` so is already RP2040-specific, so the "On RP2040" part can probably be removed?~~
LOL, forget that! :rofl:  I'd forgotten that the "extract" scripts insist on the `description` properties being identical for different chip-specific headers (because of how they get displayed in the SDK PDF).

Code after:
/*
 * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#ifndef _BOOT_STAGE2_CONFIG_H
#define _BOOT_STAGE2_CONFIG_H

// NOTE THIS HEADER IS INCLUDED FROM ASSEMBLY

#include "pico.h"

// 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

// 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
#ifdef PICO_BUILD_BOOT_STAGE2_NAME
    #define _BOOT_STAGE2_SELECTED
#else
    // check that multiple boot stage 2 options haven't been set...

// 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
#ifndef PICO_BOOT_STAGE2_CHOOSE_IS25LP080
    #define PICO_BOOT_STAGE2_CHOOSE_IS25LP080 0
#elif PICO_BOOT_STAGE2_CHOOSE_IS25LP080
    #ifdef _BOOT_STAGE2_SELECTED
        #error multiple boot stage 2 options chosen
    #endif
    #define _BOOT_STAGE2_SELECTED
#endif
// 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
#ifndef PICO_BOOT_STAGE2_CHOOSE_W25Q080
    #define PICO_BOOT_STAGE2_CHOOSE_W25Q080 0
#elif PICO_BOOT_STAGE2_CHOOSE_W25Q080
    #ifdef _BOOT_STAGE2_SELECTED
        #error multiple boot stage 2 options chosen
    #endif
    #define _BOOT_STAGE2_SELECTED
#endif