- 
                Notifications
    
You must be signed in to change notification settings  - Fork 8.2k
 
modules: hal_nordic: Add multi-instance DPPI and PPIB drivers #79857
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
Changes from 1 commit
7d0bb13
              5493079
              9e1fe34
              ab861fd
              895b8bc
              File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| 
          
            
          
           | 
    @@ -26,8 +26,77 @@ config NRFX_COMP | |
| depends on $(dt_has_compat,$(DT_COMPAT_NORDIC_NRF_COMP)) | ||
| 
     | 
||
| config NRFX_DPPI | ||
| bool "DPPI allocator" | ||
| depends on $(dt_has_compat,$(DT_COMPAT_NORDIC_NRF_DPPIC)) | ||
| bool | ||
| 
     | 
||
| config NRFX_DPPI0 | ||
| bool "DPPI0 driver instance" | ||
| depends on $(dt_nodelabel_has_compat,dppic,$(DT_COMPAT_NORDIC_NRF_DPPIC)) | ||
| 
         There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that for consistency it would be good to use  There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm reluctant to changing labels of nodes that existed for years, as it might break compatibility somewhere for no good reason really. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can extend the existing nodelabel like this: in devicetree and update  to keep backward compatibility There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I haven't suggested changing a label but adding another one:  There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll address this in a follow up commit then. I want to avoid adding more changes here, as it will block further activities related to nrfx v3.9.  | 
||
| select NRFX_DPPI | ||
| 
     | 
||
| config NRFX_DPPI00 | ||
| bool "DPPI00 driver instance" | ||
| depends on $(dt_nodelabel_has_compat,dppic00,$(DT_COMPAT_NORDIC_NRF_DPPIC)) | ||
| select NRFX_DPPI | ||
| 
     | 
||
| config NRFX_DPPI10 | ||
| bool "DPPI10 driver instance" | ||
| depends on $(dt_nodelabel_has_compat,dppic10,$(DT_COMPAT_NORDIC_NRF_DPPIC)) | ||
| select NRFX_DPPI | ||
| 
     | 
||
| config NRFX_DPPI20 | ||
| bool "DPPI20 driver instance" | ||
| depends on $(dt_nodelabel_has_compat,dppic20,$(DT_COMPAT_NORDIC_NRF_DPPIC)) | ||
| select NRFX_DPPI | ||
| 
     | 
||
| config NRFX_DPPI30 | ||
| bool "DPPI30 driver instance" | ||
| depends on $(dt_nodelabel_has_compat,dppic30,$(DT_COMPAT_NORDIC_NRF_DPPIC)) | ||
| select NRFX_DPPI | ||
| 
     | 
||
| config NRFX_DPPI020 | ||
| bool "DPPI020 driver instance" | ||
| depends on $(dt_nodelabel_has_compat,dppic020,$(DT_COMPAT_NORDIC_NRF_DPPIC_LOCAL)) | ||
| select NRFX_DPPI | ||
| 
     | 
||
| config NRFX_DPPI120 | ||
| bool "DPPI120 driver instance" | ||
| depends on $(dt_nodelabel_has_compat,dppic120,$(DT_COMPAT_NORDIC_NRF_DPPIC_GLOBAL)) | ||
| select NRFX_DPPI | ||
| 
     | 
||
| config NRFX_DPPI130 | ||
| bool "DPPI130 driver instance" | ||
| depends on $(dt_nodelabel_has_compat,dppic130,$(DT_COMPAT_NORDIC_NRF_DPPIC_GLOBAL)) | ||
| select NRFX_DPPI | ||
| 
     | 
||
| config NRFX_DPPI131 | ||
| bool "DPPI131 driver instance" | ||
| depends on $(dt_nodelabel_has_compat,dppic131,$(DT_COMPAT_NORDIC_NRF_DPPIC_GLOBAL)) | ||
| select NRFX_DPPI | ||
| 
     | 
||
| config NRFX_DPPI132 | ||
| bool "DPPI132 driver instance" | ||
| depends on $(dt_nodelabel_has_compat,dppic132,$(DT_COMPAT_NORDIC_NRF_DPPIC_GLOBAL)) | ||
| select NRFX_DPPI | ||
| 
     | 
||
| config NRFX_DPPI133 | ||
| bool "DPPI133 driver instance" | ||
| depends on $(dt_nodelabel_has_compat,dppic133,$(DT_COMPAT_NORDIC_NRF_DPPIC_GLOBAL)) | ||
| select NRFX_DPPI | ||
| 
     | 
||
| config NRFX_DPPI134 | ||
| bool "DPPI134 driver instance" | ||
| depends on $(dt_nodelabel_has_compat,dppic134,$(DT_COMPAT_NORDIC_NRF_DPPIC_GLOBAL)) | ||
| select NRFX_DPPI | ||
| 
     | 
||
| config NRFX_DPPI135 | ||
| bool "DPPI135 driver instance" | ||
| depends on $(dt_nodelabel_has_compat,dppic135,$(DT_COMPAT_NORDIC_NRF_DPPIC_GLOBAL)) | ||
| select NRFX_DPPI | ||
| 
     | 
||
| config NRFX_DPPI136 | ||
| bool "DPPI136 driver instance" | ||
| depends on $(dt_nodelabel_has_compat,dppic136,$(DT_COMPAT_NORDIC_NRF_DPPIC_GLOBAL)) | ||
| select NRFX_DPPI | ||
| 
     | 
||
| config NRFX_EGU | ||
| bool | ||
| 
          
            
          
           | 
    ||
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| 
          
            
          
           | 
    @@ -107,13 +107,14 @@ static void ppi_rtc_to_ipc(union rtc_sync_channels channels, bool setup) | |
| /* Free DPPI and RTC channels */ | ||
| static void free_resources(union rtc_sync_channels channels) | ||
| { | ||
| nrfx_dppi_t dppi = NRFX_DPPI_INSTANCE(0); | ||
| 
         There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not define this as  There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This approach was suggested here: nrfconnect/sdk-nrf#18073 (comment) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't quite get how that justification given in the above comment applies to this case, but my point is that   | 
||
| nrfx_err_t err; | ||
| 
     | 
||
| nrfx_gppi_channels_disable(BIT(channels.ch.ppi)); | ||
| 
     | 
||
| z_nrf_rtc_timer_chan_free(channels.ch.rtc); | ||
| 
     | 
||
| err = nrfx_dppi_channel_free(channels.ch.ppi); | ||
| err = nrfx_dppi_channel_free(&dppi, channels.ch.ppi); | ||
| __ASSERT_NO_MSG(err == NRFX_SUCCESS); | ||
| } | ||
| 
     | 
||
| 
          
            
          
           | 
    @@ -224,20 +225,21 @@ static int mbox_rx_init(void *user_data) | |
| /* Setup RTC synchronization. */ | ||
| static int sync_rtc_setup(void) | ||
| { | ||
| nrfx_dppi_t dppi = NRFX_DPPI_INSTANCE(0); | ||
| nrfx_err_t err; | ||
| union rtc_sync_channels channels; | ||
| int32_t sync_rtc_ch; | ||
| int rv; | ||
| 
     | 
||
| err = nrfx_dppi_channel_alloc(&channels.ch.ppi); | ||
| err = nrfx_dppi_channel_alloc(&dppi, &channels.ch.ppi); | ||
| if (err != NRFX_SUCCESS) { | ||
| rv = -ENODEV; | ||
| goto bail; | ||
| } | ||
| 
     | 
||
| sync_rtc_ch = z_nrf_rtc_timer_chan_alloc(); | ||
| if (sync_rtc_ch < 0) { | ||
| nrfx_dppi_channel_free(channels.ch.ppi); | ||
| nrfx_dppi_channel_free(&dppi, channels.ch.ppi); | ||
| rv = sync_rtc_ch; | ||
| goto bail; | ||
| } | ||
| 
          
            
          
           | 
    ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be nice to add a comment that instance 0 is used here because
COUNTER_RTC_WITH_PPI_WRAPis currently only supported for nRF51/52/53/91 Series.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll try to add this in a follow up commit.