Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mpsl|softdevice_controller: add SoC-specific (D)PPI defines #1660

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 19 additions & 10 deletions mpsl/include/mpsl.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,33 @@ extern "C" {
#define MPSL_BUILD_REVISION_SIZE 20

/* Reserved (D)PPI, PPIB and IPCT resources for the supported platforms. */
/* This corresponds to the PPI channels 19, 30, and 31. */
#define MPSL_NRF52_PPI_CHANNELS_USED_MASK (0xc0080000)
/* This corresponds to the DPPI channels 0, 1, and 2. */
#define MPSL_NRF53_DPPIC_CHANNELS_USED_MASK (0x00000007)
#define MPSL_NRF54L_DPPIC10_CHANNELS_USED_MASK (0x00000001)
#define MPSL_NRF54L_DPPIC20_CHANNELS_USED_MASK (0x00000001)
#define MPSL_NRF54L_PPIB11_CHANNELS_USED_MASK (0x00000001)
#define MPSL_NRF54L_PPIB21_CHANNELS_USED_MASK (0x00000001)
#define MPSL_NRF54H_DPPIC020_CHANNELS_USED_MASK (0x00000001)
#define MPSL_NRF54H_IPCT130_CHANNELS_USED_MASK (0x00000001)

#if defined(NRF52_SERIES)
#define MPSL_RESERVED_PPI_CHANNELS ((1UL << 19) | (1UL << 30) | (1UL << 31))
/* This corresponds to the PPI channels 19, 30, and 31. */
#define MPSL_PPI_CHANNELS_USED_MASK (0xc0080000)
#define MPSL_PPI_CHANNELS_USED_MASK MPSL_NRF52_PPI_CHANNELS_USED_MASK
#elif defined(NRF53_SERIES)
#define MPSL_RESERVED_PPI_CHANNELS ((1UL << 0) | (1UL << 1) | (1UL << 2))
/* This corresponds to the DPPI channels 0, 1, and 2. */
#define MPSL_DPPIC_CHANNELS_USED_MASK (0x00000007)
#define MPSL_DPPIC_CHANNELS_USED_MASK MPSL_NRF53_DPPIC_CHANNELS_USED_MASK
#elif defined(NRF54L_SERIES)
#define MPSL_RESERVED_PPI_CHANNELS (1UL << 0)
#define MPSL_DPPIC10_CHANNELS_USED_MASK (0x00000001)
#define MPSL_DPPIC20_CHANNELS_USED_MASK (0x00000001)
#define MPSL_PPIB11_CHANNELS_USED_MASK (0x00000001)
#define MPSL_PPIB21_CHANNELS_USED_MASK (0x00000001)
#define MPSL_DPPIC10_CHANNELS_USED_MASK MPSL_NRF54L_DPPIC10_CHANNELS_USED_MASK
#define MPSL_DPPIC20_CHANNELS_USED_MASK MPSL_NRF54L_DPPIC20_CHANNELS_USED_MASK
#define MPSL_PPIB11_CHANNELS_USED_MASK MPSL_NRF54L_PPIB11_CHANNELS_USED_MASK
#define MPSL_PPIB21_CHANNELS_USED_MASK MPSL_NRF54L_PPIB21_CHANNELS_USED_MASK
#elif defined(NRF54H_SERIES) || defined(GRTC_PRESENT)
#define MPSL_RESERVED_PPI_CHANNELS (1UL << 0)
#define MPSL_DPPIC020_CHANNELS_USED_MASK (0x00000001)
#define MPSL_IPCT130_CHANNELS_USED_MASK (0x00000001)
#define MPSL_DPPIC020_CHANNELS_USED_MASK MPSL_NRF54H_DPPIC020_CHANNELS_USED_MASK
#define MPSL_IPCT130_CHANNELS_USED_MASK MPSL_NRF54H_IPCT130_CHANNELS_USED_MASK
#else
#error Unknown NRF series.
#endif
Expand Down
31 changes: 21 additions & 10 deletions softdevice_controller/include/sdc_soc.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,33 @@ extern "C" {
#include <stdint.h>
#include <stdbool.h>

#define SDC_NRF52_PPI_CHANNELS_USED_MASK (0xfffe0000)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this change will be overwritten by the next deploy of SDC. It should be done here instead https://projecttools.nordicsemi.no/bitbucket/projects/DRGN/repos/dragoon/browse/stack/projects/sdc/include/sdc_soc.h

#define SDC_NRF53_DPPI_CHANNELS_USED_MASK (0x00001ff8)
#define SDC_NRF54L_DPPIC10_CHANNELS_USED_MASK (0x00000ffe)
#define SDC_NRF54L_DPPIC00_CHANNELS_USED_MASK (0x0000000a)
#define SDC_NRF54L_PPIB00_CHANNELS_USED_MASK (0x0000000f)
#define SDC_NRF54L_PPIB10_CHANNELS_USED_MASK (0x0000000f)
#define SDC_NRF54H_DPPIC020_CHANNELS_USED_MASK (0x00000ffe)
#define SDC_NRF54H_DPPIC030_CHANNELS_USED_MASK (0x0000000a)
#define SDC_NRF54H_PPIB020_CHANNELS_USED_MASK (0x0000000f)
#define SDC_NRF54H_PPIB030_CHANNELS_USED_MASK (0x0000000f)

#if defined(NRF52_SERIES)
/* PPI channels 17 - 31, for the nRF52 Series */
#define SDC_PPI_CHANNELS_USED_MASK (0xfffe0000)
#define SDC_PPI_CHANNELS_USED_MASK SDC_NRF52_PPI_CHANNELS_USED_MASK
#elif defined(NRF53_SERIES)
/* PPI channels 3 - 12, for the nRF53 Series */
#define SDC_DPPI_CHANNELS_USED_MASK (0x00001ff8)
#define SDC_DPPI_CHANNELS_USED_MASK SDC_NRF53_DPPI_CHANNELS_USED_MASK
#elif defined(NRF54L_SERIES)
#define SDC_DPPIC10_CHANNELS_USED_MASK (0x00000ffe)
#define SDC_DPPIC00_CHANNELS_USED_MASK (0x0000000a)
#define SDC_PPIB00_CHANNELS_USED_MASK (0x0000000f)
#define SDC_PPIB10_CHANNELS_USED_MASK (0x0000000f)
#define SDC_DPPIC10_CHANNELS_USED_MASK SDC_NRF54L_DPPIC10_CHANNELS_USED_MASK
#define SDC_DPPIC00_CHANNELS_USED_MASK SDC_NRF54L_DPPIC00_CHANNELS_USED_MASK
#define SDC_PPIB00_CHANNELS_USED_MASK SDC_NRF54L_PPIB00_CHANNELS_USED_MASK
#define SDC_PPIB10_CHANNELS_USED_MASK SDC_NRF54L_PPIB10_CHANNELS_USED_MASK
#elif defined(NRF54H_SERIES) || defined(GRTC_PRESENT)
#define SDC_DPPIC020_CHANNELS_USED_MASK (0x00000ffe)
#define SDC_DPPIC030_CHANNELS_USED_MASK (0x0000000a)
#define SDC_PPIB020_CHANNELS_USED_MASK (0x0000000f)
#define SDC_PPIB030_CHANNELS_USED_MASK (0x0000000f)
#define SDC_DPPIC020_CHANNELS_USED_MASK SDC_NRF54H_DPPIC020_CHANNELS_USED_MASK
#define SDC_DPPIC030_CHANNELS_USED_MASK SDC_NRF54H_DPPIC030_CHANNELS_USED_MASK
#define SDC_PPIB020_CHANNELS_USED_MASK SDC_NRF54H_PPIB020_CHANNELS_USED_MASK
#define SDC_PPIB030_CHANNELS_USED_MASK SDC_NRF54H_PPIB030_CHANNELS_USED_MASK
#endif

/**
Expand Down