Skip to content

adsp: Introduce ADSP SoC CDU clock driver - #3456

Open
qasim-ijaz wants to merge 24 commits into
adsp-6.18.31-yfrom
cdu
Open

adsp: Introduce ADSP SoC CDU clock driver#3456
qasim-ijaz wants to merge 24 commits into
adsp-6.18.31-yfrom
cdu

Conversation

@qasim-ijaz

Copy link
Copy Markdown

PR Description

This PR introduces a common Clock Distribution Unit (CDU) driver for the Analog Devices ADSP-SC573, ADSP-SC589, ADSP-SC594, and ADSP-SC598 SoCs. The CDU is separated into its own platform driver, with each configurable output modelled as a single CCF clock combining the input selector mux and output gate. New Device Tree nodes describe the CDU controller, its input clocks, and how those clocks are routed to peripherals across the SoC.

These changes also modernise the ADI clock infrastructure and align it with current upstream APIs and practices, making future Linux kernel upstream submission easier (which will come soon hopefully).

The driver was boot tested on ADSP-SC573, ADSP-SC589, ADSP-SC594, and ADSP-SC598 hardware. Before and after clk_summary dumps were compared on each platform. The new CDU clocks seem to preserve the existing clock rates, selected parents, enable states, and peripheral consumers, the clk_summary pre and post changes can be found below

PR Type

  • Bug fix (a change that fixes an issue)
  • New feature (a change that adds new functionality)
  • Breaking change (a change that affects other repos or cause CIs to fail)

PR Checklist

  • I have conducted a self-review of my own code changes
  • I have compiled my changes, including the documentation
  • I have tested the changes on the relevant hardware
  • I have updated the documentation outside this repo accordingly
  • I have provided links for the relevant upstream lore

@qasim-ijaz

qasim-ijaz commented Jul 22, 2026

Copy link
Copy Markdown
Author

Tested the driver on all SoCs, boots successully and clock trees seem valid. Clock tree dumps for all SoCs below:

root@adsp-sc598-som-ezkit:~# cat /sys/kernel/debug/clk/clk_summary                                                                                                                                                     
                                 enable  prepare  protect                                duty  hardware                            connection                                                                          
   clock                          count    count    count        rate   accuracy phase  cycle    enable   consumer                         id                                                                          
---------------------------------------------------------------------------------------------------------------------------------------------                                                                          
 emac1_clkin                         0       0        0        50000000    0          0     50000      Y   deviceless                      no_connection_id                                                            
 dummy                               0       0        0        0           0          0     50000      Y   deviceless                      no_connection_id                                                            
 sys_clkin1                          0       0        0        25000000    0          0     50000      Y   clocks@3108d000                 sys_clkin1                                                                  
                                                                                                           deviceless                      no_connection_id                                                            
 sys_clkin0                          2       2        0        25000000    0          0     50000      Y   clocks@3108d000                 sys_clkin0                                                                  
                                                                                                           deviceless                      no_connection_id                                                            
    cgu0_df                          1       1        0        25000000    0          0     50000      Y      deviceless                      no_connection_id                                                         
       cgu0_vco                      1       1        0        4000000000  0          0     50000      Y         deviceless                      no_connection_id                                                      
          cclk2_0                    0       0        0        1333333333  0          0     50000      Y            deviceless                      no_connection_id                                                   
          cgu0_pllclk                3       3        0        2000000000  0          0     50000      Y            deviceless                      no_connection_id                                                   
             cgu0_s1selexdiv         1       1        0        333333334   0          0     50000      Y               deviceless                      no_connection_id                                                
                cgu0_sclk1sel        1       1        0        333333334   0          0     50000      Y                  deviceless                      no_connection_id                                             
                   sclk1_0           1       1        0        333333334   0          0     50000      Y                     31002400.i2s                    sclk                                                      
                                                                                                                             deviceless                      no_connection_id                                          
                      spdif_sel      0       0        0        333333334   0          0     50000      Y                        deviceless                      no_connection_id                                       
                         spdif       0       0        0        333333334   0          0     50000      N                           deviceless                      no_connection_id                                    
             cgu0_odiv               0       0        0        250000000   0          0     50000      Y               deviceless                      no_connection_id                                                
                oclk_0               0       0        0        250000000   0          0     50000      N                  deviceless                      no_connection_id                                             
                   lp_ddr_sel        0       0        0        250000000   0          0     50000      Y                     deviceless                      no_connection_id                                          
                      lp_ddr         0       0        0        250000000   0          0     50000      N                        deviceless                      no_connection_id                                       
             cgu0_ddiv               0       0        0        666666667   0          0     50000      Y               deviceless                                                                                      
     no_connection_id                                                                                                                                                                                                  
                dclk_0               0       0        0        666666667   0          0     50000      N                  deviceless                      no_connection_id                                             
                   cdu_ddr_sel       0       0        0        666666667   0          0     50000      Y                     deviceless                      no_connection_id                                          
                      cdu_ddr        0       0        0        666666667   0          0     50000      N                        deviceless                      no_connection_id                                       
                   dclk_0_half       0       0        0        333333333   0          0     50000      Y                     deviceless                      no_connection_id                                          
             sysclk_0                1       1        0        500000000   0          0     50000      Y               deviceless                      no_connection_id                                                
                ospi_refclk_sel      0       0        0        500000000   0          0     50000      Y                  deviceless                      no_connection_id                                             
                   ospi_refclk       0       0        0        500000000   0          0     50000      N                     deviceless                      no_connection_id                                          
                cgu0_s1seldiv        0       0        0        250000000   0          0     50000      Y                  deviceless                      no_connection_id                                             
                cgu0_s0seldiv        1       1        0        125000000   0          0     50000      Y                  deviceless                      no_connection_id                                             
                   sclk0_0           6       6        0        125000000   0          0     50000      Y                     31008000.watchdog               adi-watchdog                                              
                                                                                                                             31003000.uart                   sclk0                                                     
                                                                                                                             31001600.twi                    sclk0                                                     
                                                                                                                             31001400.twi                    sclk0                                                     
                                                                                                                             gptimers@31018000               no_connection_id                                          
                                                                                                                             deviceless                      no_connection_id                                          
                      trace_sel      0       0        0        125000000   0          0     50000      Y                        deviceless                      no_connection_id                                       
                         trace       0       0        0        125000000   0          0     50000      N                           deviceless                      no_connection_id                                    
                      lp_sel         0       0        0        125000000   0          0     50000      Y                        deviceless                      no_connection_id                                       
                         lp          0       0        0        125000000   0          0     50000      N                           deviceless                      no_connection_id                                    
                      gige_sel       1       1        0        125000000   0          0     50000      Y                        deviceless                      no_connection_id                                       
                         gige        1       1        0        125000000   0          0     50000      Y                           31040000.ethernet               stmmaceth                                           
                                                                                                                                   deviceless                      no_connection_id                                    
                                                                                                                                                                                                                       
                      spi_sel        1       1        0        125000000   0          0     50000      Y                        deviceless                      no_connection_id                                       
                         spi         1       1        0        125000000   0          0     50000      Y                           31030000.spi                    spi                                                 
                                                                                                                                   deviceless                      no_connection_id                                    
             cgu0_cdiv               1       1        0        1000000000  0          0     50000      Y               deviceless                      no_connection_id                                                
                cclk0_0              2       2        0        1000000000  0          0     50000      Y                  deviceless                      no_connection_id                                             
                   sharc1_sel        1       1        0        1000000000  0          0     50000      Y                     deviceless                      no_connection_id                                          
                      sharc1         1       1        0        1000000000  0          0     50000      Y                        deviceless                      no_connection_id                                       
                   sharc0_sel        1       1        0        1000000000  0          0     50000      Y                     deviceless                      no_connection_id                                          
                      sharc0         1       1        0        1000000000  0          0     50000      Y                        deviceless                      no_connection_id                                       
    cgu1_in_sel                      2       2        0        25000000    0          0     50000      Y      deviceless                      no_connection_id                                                         
       3pll_df                       1       1        0        25000000    0          0     50000      Y         deviceless                      no_connection_id                                                      
          3pll_vco                   1       1        0        3200000000  0          0     50000      Y            deviceless                      no_connection_id                                                   
             3pll_pllclk             1       1        0        1600000000  0          0     50000      Y               deviceless                      no_connection_id                                                
                3pll_ddiv            1       1        0        800000000   0          0     50000      Y                  deviceless                      no_connection_id                                             
                   ddr               1       1        0        800000000   0          0     50000      Y                     deviceless                      no_connection_id                                          
       cgu1_df                       1       1        0        25000000    0          0     50000      Y         deviceless                      no_connection_id                                                      
          cgu1_vco                   2       2        0        3600000000  0          0     50000      Y            deviceless                      no_connection_id                                                   
             cclk2_1                 1       1        0        1200000000  0          0     50000      Y               deviceless                      no_connection_id                                                
                arm_sel              1       1        0        1200000000  0          0     50000      Y                  deviceless                      no_connection_id                                             
                   arm               1       1        0        1200000000  0          0     50000      Y                     deviceless                      no_connection_id                                          
             cgu1_pllclk             1       1        0        1800000000  0          0     50000      Y               deviceless                      no_connection_id                                                
                cgu1_s1selexdiv      0       0        0        20000000    0          0     50000      Y                  deviceless                      no_connection_id                                             
                   cgu1_sclk1sel     0       0        0        20000000    0          0     50000      Y                                                                                                               
     deviceless                      no_connection_id                                                                                                                                                                  
                      sclk1_1        0       0        0        20000000    0          0     50000      N                        deviceless                      no_connection_id                                       
                         sclk1_1_half 0       0        0        10000000    0          0     50000      Y                           deviceless                      no_connection_id                                   
                            emmc_timer_qmc_sel 0       0        0        10000000    0          0     50000      Y                              deviceless                      no_connection_id                       
                               emmc_timer_qmc 0       0        0        10000000    0          0     50000      N                                 deviceless                      no_connection_id                     
                cgu1_s0selexdiv      1       1        0        50000000    0          0     50000      Y                  deviceless                      no_connection_id                                             
                   cgu1_sclk0sel     1       1        0        50000000    0          0     50000      Y                     deviceless                      no_connection_id                                          
                      sclk0_1        1       1        0        50000000    0          0     50000      Y                        deviceless                      no_connection_id                                       
                         emmc_sel    1       1        0        50000000    0          0     50000      Y                           deviceless                      no_connection_id                                    
                            emmc     1       1        0        50000000    0          0     50000      Y                              310c7000.mmc                    core                                             
                                                                                                                                      deviceless                      no_connection_id                                 
                cgu1_odiv            0       0        0        112500000   0          0     50000      Y                  deviceless                      no_connection_id                                             
                   oclk_1            0       0        0        112500000   0          0     50000      N                     deviceless                      no_connection_id                                          
                      can_sel        0       0        0        112500000   0          0     50000      Y                        deviceless                      no_connection_id                                       
                         can         0       0        0        112500000   0          0     50000      N                           deviceless                      no_connection_id                                    
                cgu1_ddiv            0       0        0        100000000   0          0     50000      Y                  deviceless                      no_connection_id                                             
                   dclk_1            0       0        0        100000000   0          0     50000      N                     deviceless                      no_connection_id                                          
                      dclk_1_half    0       0        0        50000000    0          0     50000      Y                        deviceless                      no_connection_id                                       
                sysclk_1             0       0        0        225000000   0          0     50000      Y                  deviceless                      no_connection_id                                             
                   cgu1_s1seldiv     0       0        0        112500000   0          0     50000      Y                     deviceless                      no_connection_id                                          
                   cgu1_s0seldiv     0       0        0        56250000    0          0     50000      Y                     deviceless                      no_connection_id                                          
                cgu1_cdiv            0       0        0        112500000   0          0     50000      Y                  deviceless                      no_connection_id                                             
                   cclk0_1           0       0        0        112500000   0          0     50                                                                                                                         
000      N                     deviceless                      no_connection_id                                                                                                                                        
root@adsp-sc598-som-ezkit:~#
root@adsp-sc589-mini:/sys/kernel/debug/clk# cat clk_summary                                                                                                                               
                                 enable  prepare  protect                                duty  hardware                            connection                                             
   clock                          count    count    count        rate   accuracy phase  cycle    enable   consumer                         id                                             
---------------------------------------------------------------------------------------------------------------------------------------------                                             
 dummy                               0       0        0        0           0          0     50000      Y   deviceless                      no_connection_id                               
 sys_clkin1                          0       0        0        25000000    0          0     50000      Y   clocks@3108d000                 sys_clkin1                                     
                                                                                                           deviceless                      no_connection_id                               
 sys_clkin0                          2       2        0        25000000    0          0     50000      Y   clocks@3108d000                 sys_clkin0                                     
                                                                                                           deviceless                      no_connection_id                               
    cgu0_df                          1       1        0        25000000    0          0     50000      Y      deviceless                      no_connection_id                            
       cgu0_vco                      1       1        0        450000000   0          0     50000      Y         deviceless                      no_connection_id                         
          cgu0_pllclk                4       4        0        450000000   0          0     50000      Y            deviceless                      no_connection_id                      
             cgu0_odiv               1       1        0        150000000   0          0     50000      Y               deviceless                      no_connection_id                   
                oclk_0               1       1        0        150000000   0          0     50000      Y                  deviceless                      no_connection_id                
                   spdif_sel         0       0        0        150000000   0          0     50000      Y                     deviceless                      no_connection_id             
                      spdif          0       0        0        150000000   0          0     50000      N                        deviceless                      no_connection_id          
                   can_sel           0       0        0        150000000   0          0     50000      Y                     deviceless                      no_connection_id             
                      can            0       0        0        150000000   0          0     50000      N                        deviceless                      no_connection_id          
                   oclk_0_half       1       1        0        75000000    0          0     50000      Y                     deviceless                      no_connection_id             
                      sdio_sel       1       1        0        75000000    0          0     50000      Y                        deviceless                      no_connection_id          
                         sdio        1       1        0        75000000    0          0     50000      Y                           31010000.mmc                    ciu                    
                                                                                                                                   deviceless                      no_connection_id       
             cgu0_ddiv               1       1        0        450000000   0          0     50000      Y               deviceless                      no_connection_id                   
                dclk_0               1       1        0        450000000   0          0     50000      Y                  deviceless                      no_connection_id                
                   cdu_ddr_sel       1       1        0        450000000   0          0     50000      Y                     deviceless                      no_connection_id             
                      cdu_ddr        1       1        0        450000000   0          0     50000      Y                        deviceless                      no_connection_id          
             sysclk_0                2       2        0        225000000   0          0     50000      Y               deviceless                      no_connection_id                   
                cgu0_s1seldiv        1       1        0        112500000   0          0     50000      Y                  deviceless                      no_connection_id                
                   sclk1_0           2       2        0        112500000   0          0     50000      Y                     31002000.i2s-sport0             sclk                         
                                                                                                                             31042000.spi                    spi                          
                                                                                                                             deviceless                      no_connection_id             
                cgu0_s0seldiv        1       1        0        112500000   0          0     50000      Y                  deviceless                      no_connection_id                
                   sclk0_0           7       7        0        112500000   0          0     50000      Y                     31010000.mmc                    biu                          
                                                                                                                             31008000.watchdog               adi-watchdog                 
                                                                                                                             31044000.spi                    spi                          
                                                                                                                             31003000.uart                   sclk0                        
                                                                                                                             31001600.twi                    sclk0                        
                                                                                                                             31001500.twi                    sclk0                        
                                                                                                                             31001400.twi                    sclk0                        
                                                                                                                             gptimers@31001000               no_connection_id             
                                                                                                                             deviceless                      no_connection_id             
                      lp_sel         0       0        0        112500000   0          0     50000      Y                        deviceless                      no_connection_id          
                         lp          0       0        0        112500000   0          0     50000      N                           deviceless                      no_connection_id       
                      reserved_sel   0       0        0        112500000   0          0     50000      Y                        deviceless                      no_connection_id          
                         reserved    0       0        0        112500000   0          0     50000      N                           deviceless                      no_connection_id       
             cgu0_cdiv               2       2        0        450000000   0          0     50000      Y               deviceless                      no_connection_id                   
                cclk1_0              1       1        0        450000000   0          0     50000      N                  deviceless                      no_connection_id                
                   arm_sel           1       1        0        450000000   0          0     50000      Y                     deviceless                      no_connection_id             
                      arm            1       1        0        450000000   0          0     50000      Y                        deviceless                      no_connection_id          
                cclk0_0              2       2        0        450000000   0          0     50000      Y                  deviceless                      no_connection_id                
                   sharc1_sel        1       1        0        450000000   0          0     50000      Y                     deviceless                      no_connection_id             
                      sharc1         1       1        0        450000000   0          0     50000      Y                        deviceless                      no_connection_id          
                   sharc0_sel        1       1        0        450000000   0          0     50000      Y                     deviceless                      no_connection_id             
                      sharc0         1       1        0        450000000   0          0     50000      Y                        deviceless                      no_connection_id          
    cgu1_in_sel                      1       1        0        25000000    0          0     50000      Y      deviceless                      no_connection_id                            
       cgu1_df                       1       1        0        25000000    0          0     50000      Y         deviceless                      no_connection_id                         
          cgu1_vco                   1       1        0        125000000   0          0     50000      Y            deviceless                      no_connection_id                      
             cgu1_pllclk             1       1        0        125000000   0          0     50000      Y               deviceless                      no_connection_id                   
                cgu1_odiv            0       0        0        41666667    0          0     50000      Y                  deviceless                      no_connection_id                
                   oclk_1            0       0        0        41666667    0          0     50000      N                     deviceless                      no_connection_id             
                cgu1_ddiv            0       0        0        62500000    0          0     50000      Y                  deviceless                      no_connection_id                
                   dclk_1            0       0        0        62500000    0          0     50000      N                     deviceless                      no_connection_id             
                sysclk_1             0       0        0        62500000    0          0     50000      Y                  deviceless                      no_connection_id                
                   cgu1_s1seldiv     0       0        0        31250000    0          0     50000      Y                     deviceless                      no_connection_id             
                      sclk1_1        0       0        0        31250000    0          0     50000      N                        deviceless                      no_connection_id          
                   cgu1_s0seldiv     0       0        0        31250000    0          0     50000      Y                     deviceless                      no_connection_id             
                      sclk0_1        0       0        0        31250000    0          0     50000      N                        deviceless                      no_connection_id          
                cgu1_cdiv            1       1        0        125000000   0          0     50000      Y                  deviceless                      no_connection_id                
                   cclk1_1           0       0        0        125000000   0          0     50000      N                     deviceless                      no_connection_id             
                      cclk1_1_half   0       0        0        62500000    0          0     50000      Y                        deviceless                      no_connection_id          
                   cclk0_1           1       1        0        125000000   0          0     50000      Y                     deviceless                      no_connection_id             
                      gige_sel       1       1        0        125000000   0          0     50000      Y                        deviceless                      no_connection_id          
                         gige        1       1        0        125000000   0          0     50000      Y                           3100c000.ethernet               stmmaceth              
                                                                                                                                   deviceless                      no_connection_id       
root@adsp-sc589-mini:/sys/kernel/debug/clk#                                                                                                                                               
                                                                                                                                                                                          
root@adsp-sc594-som-ezkit:~# cat /sys/kernel/debug/clk/clk_summary                                                                                                                        
                                 enable  prepare  protect                                duty  hardware                            connection                                             
   clock                          count    count    count        rate   accuracy phase  cycle    enable   consumer                         id                                             
---------------------------------------------------------------------------------------------------------------------------------------------                                             
 dummy                               0       0        0        0           0          0     50000      Y   deviceless                      no_connection_id                               
 sys_clkin1                          0       0        0        25000000    0          0     50000      Y   clocks@3108d000                 sys_clkin1                                     
                                                                                                           deviceless                      no_connection_id                               
 sys_clkin0                          2       2        0        25000000    0          0     50000      Y   clocks@3108d000                 sys_clkin0                                     
                                                                                                           deviceless                      no_connection_id                               
    cgu0_df                          1       1        0        25000000    0          0     50000      Y      deviceless                      no_connection_id                            
       cgu0_vco                      1       1        0        2000000000  0          0     50000      Y         deviceless                      no_connection_id                         
          cgu0_pllclk                2       2        0        2000000000  0          0     50000      Y            deviceless                      no_connection_id                      
             cgu0_s1selexdiv         0       0        0        333333334   0          0     50000      Y               deviceless                      no_connection_id                   
                cgu0_sclk1sel        0       0        0        333333334   0          0     50000      Y                  deviceless                      no_connection_id                
                   sclk1_0           0       0        0        333333334   0          0     50000      N                     deviceless                      no_connection_id             
                      spdif_sel      0       0        0        333333334   0          0     50000      Y                        deviceless                      no_connection_id          
                         spdif       0       0        0        333333334   0          0     50000      N                           deviceless                      no_connection_id       
             cgu0_odiv               0       0        0        125000000   0          0     50000      Y               deviceless                      no_connection_id                   
                oclk_0               0       0        0        125000000   0          0     50000      N                  deviceless                      no_connection_id                
                   lpddr_sel         0       0        0        125000000   0          0     50000      Y                     deviceless                      no_connection_id             
                      lpddr          0       0        0        125000000   0          0     50000      N                        deviceless                      no_connection_id          
             cgu0_ddiv               0       0        0        1000000000  0          0     50000      Y               deviceless                      no_connection_id                   
                dclk_0               0       0        0        1000000000  0          0     50000      N                  deviceless                      no_connection_id                
             sysclk_0                1       1        0        500000000   0          0     50000      Y               deviceless                      no_connection_id                   
                ospi_sel             0       0        0        500000000   0          0     50000      Y                  deviceless                      no_connection_id                
                   ospi              0       0        0        500000000   0          0     50000      N                     deviceless                      no_connection_id             
                cgu0_s1seldiv        0       0        0        250000000   0          0     50000      Y                  deviceless                      no_connection_id                
                cgu0_s0seldiv        1       1        0        125000000   0          0     50000      Y                  deviceless                      no_connection_id                
                   sclk0_0           6       6        0        125000000   0          0     50000      Y                     31002400.i2s                    sclk                         
                                                                                                                             31008000.watchdog               adi-watchdog                 
                                                                                                                             31003000.uart                   sclk0                        
                                                                                                                             31001600.twi                    sclk0                        
                                                                                                                             gptimers@31018000               no_connection_id             
                                                                                                                             deviceless                      no_connection_id             
                      trace_sel      0       0        0        125000000   0          0     50000      Y                        deviceless                      no_connection_id          
                         trace       0       0        0        125000000   0          0     50000      N                           deviceless                      no_connection_id       
                      lp_sel         0       0        0        125000000   0          0     50000      Y                        deviceless                      no_connection_id          
                         lp          0       0        0        125000000   0          0     50000      N                           deviceless                      no_connection_id       
                      gige_sel       1       1        0        125000000   0          0     50000      Y                        deviceless                      no_connection_id          
                         gige        1       1        0        125000000   0          0     50000      Y                           31040000.ethernet               stmmaceth              
                                                                                                                                   deviceless                      no_connection_id       
                      spi_sel        1       1        0        125000000   0          0     50000      Y                        deviceless                      no_connection_id          
                         spi         1       1        0        125000000   0          0     50000      Y                           31030000.spi                    spi                    
                                                                                                                                   deviceless                      no_connection_id       
             cgu0_cdiv               2       2        0        1000000000  0          0     50000      Y               deviceless                      no_connection_id                   
                cclk1_0              1       1        0        1000000000  0          0     50000      N                  deviceless                      no_connection_id                
                   arm_sel           1       1        0        1000000000  0          0     50000      Y                     deviceless                      no_connection_id             
                      arm            1       1        0        1000000000  0          0     50000      Y                        deviceless                      no_connection_id          
                cclk0_0              2       2        0        1000000000  0          0     50000      Y                  deviceless                      no_connection_id                
                   sharc1_sel        1       1        0        1000000000  0          0     50000      Y                     deviceless                      no_connection_id             
                      sharc1         1       1        0        1000000000  0          0     50000      Y                        deviceless                      no_connection_id          
                   sharc0_sel        1       1        0        1000000000  0          0     50000      Y                     deviceless                      no_connection_id             
                      sharc0         1       1        0        1000000000  0          0     50000      Y                        deviceless                      no_connection_id          
    cgu1_in_sel                      1       1        0        25000000    0          0     50000      Y      deviceless                      no_connection_id                            
       cgu1_df                       1       1        0        25000000    0          0     50000      Y         deviceless                      no_connection_id                         
          cgu1_vco                   1       1        0        1600000000  0          0     50000      Y            deviceless                      no_connection_id                      
             cgu1_pllclk             1       1        0        1600000000  0          0     50000      Y               deviceless                      no_connection_id                   
                cgu1_s1selexdiv      0       0        0        50000000    0          0     50000      Y                  deviceless                      no_connection_id                
                cgu1_odiv            0       0        0        100000000   0          0     50000      Y                  deviceless                      no_connection_id                
                   oclk_1            0       0        0        100000000   0          0     50000      N                     deviceless                      no_connection_id             
                      can_sel        0       0        0        100000000   0          0     50000      Y                        deviceless                      no_connection_id          
                         can         0       0        0        100000000   0          0     50000      N                           deviceless                      no_connection_id       
                cgu1_ddiv            1       1        0        800000000   0          0     50000      Y                  deviceless                      no_connection_id                
                   dclk_1            1       1        0        800000000   0          0     50000      Y                     deviceless                      no_connection_id             
                      cdu_ddr_sel    1       1        0        800000000   0          0     50000      Y                        deviceless                      no_connection_id          
                         cdu_ddr     1       1        0        800000000   0          0     50000      Y                           deviceless                      no_connection_id       
                sysclk_1             0       0        0        400000000   0          0     50000      Y                  deviceless                      no_connection_id                
                   cgu1_s1seldiv     0       0        0        200000000   0          0     50000      Y                     deviceless                      no_connection_id             
                      cgu1_sclk1sel  0       0        0        200000000   0          0     50000      Y                        deviceless                      no_connection_id          
                         sclk1_1     0       0        0        200000000   0          0     50000      N                           deviceless                      no_connection_id       
                   cgu1_s0seldiv     0       0        0        100000000   0          0     50000      Y                     deviceless                      no_connection_id             
                      sclk0_1        0       0        0        100000000   0          0     50000      N                        deviceless                      no_connection_id          
                cgu1_cdiv            0       0        0        800000000   0          0     50000      Y                  deviceless                      no_connection_id                
                   cclk1_1           0       0        0        800000000   0          0     50000      N                     deviceless                      no_connection_id             
                   cclk0_1           0       0        0        800000000   0          0     50000      N                     deviceless                      no_connection_id             
root@adsp-sc594-som-ezkit:~#                                                                                                                                                              
                                                                                                                                                                                          
root@adsp-sc573-ezkit:~# cat /sys/kernel/debug/clk/clk_summary                                                                                                                         
                                 enable  prepare  protect                                duty  hardware                            connection                                          
   clock                          count    count    count        rate   accuracy phase  cycle    enable   consumer                         id                                          
---------------------------------------------------------------------------------------------------------------------------------------------                                          
 dummy                               0       0        0        0           0          0     50000      Y   deviceless                      no_connection_id                            
 sys_clkin1                          0       0        0        25000000    0          0     50000      Y   clocks@0x3108d000               sys_clkin1                                  
                                                                                                           deviceless                      no_connection_id                            
 sys_clkin0                          2       2        0        25000000    0          0     50000      Y   clocks@0x3108d000               sys_clkin0                                  
                                                                                                           deviceless                      no_connection_id                            
    cgu0_df                          1       1        0        25000000    0          0     50000      Y      deviceless                      no_connection_id                         
       cgu0_pllclk                   4       4        0        450000000   0          0     50000      Y         deviceless                      no_connection_id                      
          cgu0_odiv                  1       1        0        150000000   0          0     50000      Y            deviceless                      no_connection_id                   
             oclk_0                  1       1        0        150000000   0          0     50000      Y               deviceless                      no_connection_id                
                spdif_sel            0       0        0        150000000   0          0     50000      Y                  deviceless                      no_connection_id             
                   spdif             0       0        0        150000000   0          0     50000      N                     deviceless                      no_connection_id          
                can_sel              0       0        0        150000000   0          0     50000      Y                  deviceless                      no_connection_id             
                   can               0       0        0        150000000   0          0     50000      N                     deviceless                      no_connection_id          
                oclk_0_half          1       1        0        75000000    0          0     50000      Y                  deviceless                      no_connection_id             
                   sdio_sel          1       1        0        75000000    0          0     50000      Y                     deviceless                      no_connection_id          
                      sdio           1       1        0        75000000    0          0     50000      Y                        31010000.mmc                    ciu                    
                                                                                                                                deviceless                      no_connection_id       
          cgu0_ddiv                  1       1        0        225000000   0          0     50000      Y            deviceless                      no_connection_id                   
             dclk_0                  1       1        0        225000000   0          0     50000      Y               deviceless                      no_connection_id                
                cdu_ddr_sel          1       1        0        225000000   0          0     50000      Y                  deviceless                      no_connection_id             
                   cdu_ddr           1       1        0        225000000   0          0     50000      Y                     deviceless                                                
                 no_connection_id                                                                                                                                                      
          sysclk_0                   2       2        0        225000000   0          0     50000      Y            deviceless                      no_connection_id                   
             cgu0_s1seldiv           1       1        0        112500000   0          0     50000      Y               deviceless                      no_connection_id                
                sclk1_0              2       2        0        112500000   0          0     50000      Y                  31044000.spi                    spi                          
                                                                                                                          3102e000.spi                    spi                          
                                                                                                                          deviceless                      no_connection_id             
             cgu0_s0seldiv           1       1        0        112500000   0          0     50000      Y               deviceless                      no_connection_id                
                sclk0_0              7       7        0        112500000   0          0     50000      Y                  31002000.i2s                    sclk                         
                                                                                                                          31010000.mmc                    biu                          
                                                                                                                          31008000.watchdog               adi-watchdog                 
                                                                                                                          31003000.uart                   sclk0                        
                                                                                                                          31001600.twi                    sclk0                        
                                                                                                                          31001500.twi                    sclk0                        
                                                                                                                          31001400.twi                    sclk0                        
                                                                                                                          gptimers@0x31018000             no_connection_id             
                                                                                                                          deviceless                      no_connection_id             
          cgu0_cdiv                  2       2        0        450000000   0          0     50000      Y            deviceless                      no_connection_id                   
             cclk1_0                 1       1        0        450000000   0          0     50000      N               deviceless                      no_connection_id                
                arm_sel              1       1        0        450000000   0          0     50000      Y                  deviceless                      no_connection_id             
                   arm               1       1        0        450000000   0          0     50000      Y                     deviceless                      no_connection_id          
             cclk0_0                 2       2        0        450000000   0          0     50000      Y               deviceless                      no_connection_id                
                sharc1_sel           1       1        0        450000000   0          0     50000      Y                  deviceless                      no_connection_id             
                   sharc1            1       1        0        450000000   0          0     50000      Y                     deviceless                      no_connection_id          
                sharc0_sel           1       1        0        450000000   0          0                                                                                                
    50000      Y                  deviceless                      no_connection_id                                                                                                     
                   sharc0            1       1        0        450000000   0          0     50000      Y                     deviceless                      no_connection_id          
    cgu1_in_sel                      1       1        0        25000000    0          0     50000      Y      deviceless                      no_connection_id                         
       cgu1_df                       1       1        0        25000000    0          0     50000      Y         deviceless                      no_connection_id                      
          cgu1_pllclk                1       1        0        125000000   0          0     50000      Y            deviceless                      no_connection_id                   
             cgu1_odiv               0       0        0        41666667    0          0     50000      Y               deviceless                      no_connection_id                
                oclk_1               0       0        0        41666667    0          0     50000      N                  deviceless                      no_connection_id             
             cgu1_ddiv               0       0        0        62500000    0          0     50000      Y               deviceless                      no_connection_id                
                dclk_1               0       0        0        62500000    0          0     50000      N                  deviceless                      no_connection_id             
             sysclk_1                0       0        0        62500000    0          0     50000      Y               deviceless                      no_connection_id                
                cgu1_s1seldiv        0       0        0        31250000    0          0     50000      Y                  deviceless                      no_connection_id             
                   sclk1_1           0       0        0        31250000    0          0     50000      N                     deviceless                      no_connection_id          
                cgu1_s0seldiv        0       0        0        31250000    0          0     50000      Y                  deviceless                      no_connection_id             
                   sclk0_1           0       0        0        31250000    0          0     50000      N                     deviceless                      no_connection_id          
             cgu1_cdiv               1       1        0        125000000   0          0     50000      Y               deviceless                      no_connection_id                
                cclk1_1              0       0        0        125000000   0          0     50000      N                  deviceless                      no_connection_id             
                   cclk1_1_half      0       0        0        62500000    0          0     50000      Y                     deviceless                      no_connection_id          
                cclk0_1              1       1        0        125000000   0          0     50000      Y                  deviceless                      no_connection_id             
                   gige_sel          1       1        0        125000000   0          0     50000      Y                     deviceless                      no_connection_id          
                      gige           1       1        0        125000000   0          0     50000      Y                        3100c000.ethernet               stmmaceth              
                                                                                                                                deviceless                      no_connection_id       
                                                                                                                                                                                       
root@adsp-sc573-ezkit:~#                                                                                                                                                               
root@adsp-sc573-ezkit:~#                                                                                                                                                               

POST

root@adsp-sc594-som-ezkit:~# cat /sys/kernel/debug/clk/clk_summary                                                                                                                               
                                 enable  prepare  protect                                duty  hardware                            connection                                                    
   clock                          count    count    count        rate   accuracy phase  cycle    enable   consumer                         id                                                    
---------------------------------------------------------------------------------------------------------------------------------------------                                                    
 dummy                               0       0        0        0           0          0     50000      Y   deviceless                      no_connection_id                                      
 sys_clkin1                          0       0        0        25000000    0          0     50000      Y   clocks@3108d000                 sys_clkin1                                            
                                                                                                           deviceless                      no_connection_id                                      
 sys_clkin0                          2       2        0        25000000    0          0     50000      Y   clocks@3108d000                 sys_clkin0                                            
                                                                                                           deviceless                      no_connection_id                                      
    cdu_clkinsel                     1       1        0        25000000    0          0     50000      Y      deviceless                      no_connection_id                                   
       cgu1_df                       1       1        0        25000000    0          0     50000      Y         deviceless                      no_connection_id                                
          cgu1_vco                   1       1        0        1600000000  0          0     50000      Y            deviceless                      no_connection_id                             
             cgu1_pllclk             1       1        0        1600000000  0          0     50000      Y               deviceless                      no_connection_id                          
                cgu1_s1selexdiv      0       0        0        50000000    0          0     50000      Y                  deviceless                      no_connection_id                       
                cgu1_odiv            0       0        0        100000000   0          0     50000      Y                  deviceless                      no_connection_id                       
                   oclk_1            0       0        0        100000000   0          0     50000      N                     deviceless                      no_connection_id                    
                      cdu_can        0       0        0        100000000   0          0     50000      N                        deviceless                      no_connection_id                 
                cgu1_ddiv            1       1        0        800000000   0          0     50000      Y                  deviceless                      no_connection_id                       
                   dclk_1            1       1        0        800000000   0          0     50000      Y                     deviceless                      no_connection_id                    
                      cdu_ddr        1       1        0        800000000   0          0     50000      Y                        deviceless                      no_connection_id                 
                sysclk_1             0       0        0        400000000   0          0     50000      Y                  deviceless                      no_connection_id                       
                   cgu1_s1seldiv     0       0        0        200000000   0          0     50000      Y                     deviceless                      no_connection_id                    
                      cgu1_sclk1sel  0       0        0        200000000   0          0     50000      Y                        deviceless                      no_connection_id                 
                         sclk1_1     0       0        0        200000000   0          0     50000      N                           deviceless                      no_connection_id              
                   cgu1_s0seldiv     0       0        0        100000000   0          0     50000      Y                                                                                         
         deviceless                      no_connection_id                                                                                                                                        
                      sclk0_1        0       0        0        100000000   0          0     50000      N                        deviceless                      no_connection_id                 
                cgu1_cdiv            0       0        0        800000000   0          0     50000      Y                  deviceless                      no_connection_id                       
                   cclk1_1           0       0        0        800000000   0          0     50000      N                     deviceless                      no_connection_id                    
                   cclk0_1           0       0        0        800000000   0          0     50000      N                     deviceless                      no_connection_id                    
    cgu0_df                          1       1        0        25000000    0          0     50000      Y      deviceless                      no_connection_id                                   
       cgu0_vco                      1       1        0        2000000000  0          0     50000      Y         deviceless                      no_connection_id                                
          cgu0_pllclk                2       2        0        2000000000  0          0     50000      Y            deviceless                      no_connection_id                             
             cgu0_s1selexdiv         0       0        0        333333334   0          0     50000      Y               deviceless                      no_connection_id                          
                cgu0_sclk1sel        0       0        0        333333334   0          0     50000      Y                  deviceless                      no_connection_id                       
                   sclk1_0           0       0        0        333333334   0          0     50000      N                     deviceless                      no_connection_id                    
                      cdu_spdif      0       0        0        333333334   0          0     50000      N                        deviceless                      no_connection_id                 
             cgu0_odiv               0       0        0        125000000   0          0     50000      Y               deviceless                      no_connection_id                          
                oclk_0               0       0        0        125000000   0          0     50000      N                  deviceless                      no_connection_id                       
                   cdu_lpddr         0       0        0        125000000   0          0     50000      N                     deviceless                      no_connection_id                    
             cgu0_ddiv               0       0        0        1000000000  0          0     50000      Y               deviceless                      no_connection_id                          
                dclk_0               0       0        0        1000000000  0          0     50000      N                  deviceless                      no_connection_id                       
             sysclk_0                1       1        0        500000000   0          0     50000      Y               deviceless                      no_connection_id                          
                cdu_ospi_refclk      0       0        0        500000000   0          0     50000      N                  deviceless                      no_connection_id                       
                cgu0_s1seldiv        0       0        0        250000000   0          0     50000      Y                  deviceless                      no_connection_id                       
                cgu0_s0seldiv        1       1        0        125000000   0          0     50000      Y                  deviceless                      no_connection_id                       
                   sclk0_0           6       6        0        125000000   0          0     50000      Y                     31002400.i2s                    sclk                                
                                                                                                                             31008000.watchdog               sclk0                               
                                                                                                                                                                                                 
                                                                      31003000.uart                   sclk0                                                                                      
                                                                                                                             31001600.twi                    sclk0                               
                                                                                                                             gptimers@31018000               no_connection_id                    
                                                                                                                             deviceless                      no_connection_id                    
                      cdu_trace      0       0        0        125000000   0          0     50000      N                        deviceless                      no_connection_id                 
                      cdu_lp         0       0        0        125000000   0          0     50000      N                        deviceless                      no_connection_id                 
                      cdu_spi        1       1        0        125000000   0          0     50000      Y                        31030000.spi                    spi                              
                                                                                                                                deviceless                      no_connection_id                 
                      cdu_gige       1       1        0        125000000   0          0     50000      Y                        31040000.ethernet               stmmaceth                        
                                                                                                                                deviceless                      no_connection_id                 
             cgu0_cdiv               2       2        0        1000000000  0          0     50000      Y               deviceless                      no_connection_id                          
                cclk1_0              1       1        0        1000000000  0          0     50000      N                  deviceless                      no_connection_id                       
                   cdu_arm           1       1        0        1000000000  0          0     50000      Y                     deviceless                      no_connection_id                    
                cclk0_0              2       2        0        1000000000  0          0     50000      Y                  deviceless                      no_connection_id                       
                   cdu_sharc1        1       1        0        1000000000  0          0     50000      Y                     deviceless                      no_connection_id                    
                   cdu_sharc0        1       1        0        1000000000  0          0     50000      Y                     deviceless                      no_connection_id                    
                                                                                                                                                                                                 
root@adsp-sc594-som-ezkit:~#                                                                                                                                                                                                                                                                                                                         
root@adsp-sc598-som-ezkit:~# cat /sys/kernel/debug/clk/clk_summary                                                                                                                                          
                                 enable  prepare  protect                                duty  hardware                            connection                                                               
   clock                          count    count    count        rate   accuracy phase  cycle    enable   consumer                         id                                                               
---------------------------------------------------------------------------------------------------------------------------------------------                                                               
 emac1_clkin                         0       0        0        50000000    0          0     50000      Y   deviceless                      no_connection_id                                                 
 dummy                               0       0        0        0           0          0     50000      Y   deviceless                      no_connection_id                                                 
 sys_clkin1                          0       0        0        25000000    0          0     50000      Y   clocks@3108d000                 sys_clkin1                                                       
                                                                                                           deviceless                      no_connection_id                                                 
 sys_clkin0                          2       2        0        25000000    0          0     50000      Y   clocks@3108d000                 sys_clkin0                                                       
                                                                                                           deviceless                      no_connection_id                                                 
    cdu_clkinsel                     2       2        0        25000000    0          0     50000      Y      deviceless                      no_connection_id                                              
       cgu1_df                       1       1        0        25000000    0          0     50000      Y         deviceless                      no_connection_id                                           
          cgu1_vco                   2       2        0        3600000000  0          0     50000      Y            deviceless                      no_connection_id                                        
             cclk2_1                 1       1        0        1200000000  0          0     50000      Y               deviceless                      no_connection_id                                     
                cdu_arm              1       1        0        1200000000  0          0     50000      Y                  deviceless                      no_connection_id                                  
             cgu1_pllclk             1       1        0        1800000000  0          0     50000      Y               deviceless                      no_connection_id                                     
                cgu1_s1selexdiv      0       0        0        20000000    0          0     50000      Y                  deviceless                      no_connection_id                                  
                   cgu1_sclk1sel     0       0        0        20000000    0          0     50000      Y                     deviceless                      no_connection_id                               
                      sclk1_1        0       0        0        20000000    0          0     50000      N                        deviceless                      no_connection_id                            
                         sclk1_1_half 0       0        0        10000000    0          0     50000      Y                           deviceless                      no_connection_id                        
                            cdu_emmc_timer 0       0        0        10000000    0          0     50000      N                              deviceless                      no_connection_id                
                cgu1_s0selexdiv      1       1        0        50000000    0          0     50000      Y                  deviceless                      no_connection_id                                  
                   cgu1_sclk0sel     1       1        0        50000000    0          0     50000      Y                     deviceless                      no_connection_id                               
                      sclk0_1        1       1        0        50000000    0          0     50000      Y                        deviceless                      no_connection_id                            
                         cdu_emmc    1       1        0        50000000    0          0     50000      Y                           310c7000.mmc                    core                                     
                                                                                                                                   deviceless                      no_connection_id                         
                cgu1_odiv            0       0        0        112500000   0          0     50000      Y                  deviceless                      no_connection_id                                  
                   oclk_1            0       0        0        112500000   0          0     50000      N                     deviceless                      no_connection_id                               
                      cdu_can        0       0        0        112500000   0          0     50000      N                        deviceless                      no_connection_id                            
                cgu1_ddiv            0       0        0        100000000   0          0     50000      Y                  deviceless                      no_connection_id                                  
                   dclk_1            0       0        0        100000000   0          0     50000      N                     deviceless                      no_connection_id                               
                      dclk_1_half    0       0        0        50000000    0          0     50000      Y                        deviceless                      no_connection_id                            
                sysclk_1             0       0        0        225000000   0          0     50000      Y                  deviceless                      no_connection_id                                  
                   cgu1_s1seldiv     0       0        0        112500000   0          0     50000      Y                     deviceless                      no_connection_id                               
                   cgu1_s0seldiv     0       0        0        56250000    0          0     50000      Y                     deviceless                      no_connection_id                               
                cgu1_cdiv            0       0        0        112500000   0          0     50000      Y                  deviceless                      no_connection_id                                  
                   cclk0_1           0       0        0        112500000   0          0     50000      N                     deviceless                      no_connection_id                               
       3pll_df                       1       1        0        25000000    0          0     50000      Y         deviceless                      no_connection_id                                           
          3pll_vco                   1       1        0        3200000000  0          0     50000      Y            deviceless                      no_connection_id                                        
             3pll_pllclk             1       1        0        1600000000  0          0     50000      Y               deviceless                      no_connection_id                                     
                3pll_ddiv            1       1        0        800000000   0          0     50000      Y                  deviceless                      no_connection_id                                  
                   ddr               1       1        0        800000000   0          0     50000      Y                     deviceless                      no_connection_id                               
    cgu0_df                          1       1        0        25000000    0          0     50000      Y      deviceless                      no_connection_id                                              
       cgu0_vco                      1       1        0        4000000000  0          0     50000      Y         deviceless                      no_connection_id                                           
          cclk2_0                    0       0        0        1333333333  0          0     50000      Y            deviceless                      no_connection_id                                        
          cgu0_pllclk                3       3        0        2000000000  0          0     50000      Y            deviceless                      no_connection_id                                        
             cgu0_s1selexdiv         1       1        0        333333334   0          0     50000      Y               deviceless                      no_connection_id                                     
                cgu0_sclk1sel        1       1        0        333333334   0          0     50000      Y                  deviceless                      no_connection_id                                  
                   sclk1_0           1       1        0        333333334   0          0     50000      Y                     31002400.i2s                    sclk                                           
                                                                                                                             deviceless                      no_connection_id                               
                      cdu_spdif      0       0        0        333333334   0          0     50000      N                        deviceless                      no_connection_id                            
             cgu0_odiv               0       0        0        250000000   0          0     50000      Y               deviceless                      no_connection_id                                     
                oclk_0               0       0        0        250000000   0          0     50000      N                  deviceless                      no_connection_id                                  
                   cdu_lpddr         0       0        0        250000000   0          0     50000      N                     deviceless                      no_connection_id                               
             cgu0_ddiv               0       0        0        666666667   0          0     50000      Y               deviceless                      no_connection_id                                     
                dclk_0               0       0        0        666666667   0          0     50000      N                  deviceless                      no_connection_id                                  
                   cdu_ddr           0       0        0        666666667   0          0     50000      N                     deviceless                      no_connection_id                               
                   dclk_0_half       0       0        0        333333333   0          0     50000      Y                     deviceless                      no_connection_id                               
             sysclk_0                1       1        0        500000000   0          0     50000      Y               deviceless                      no_connection_id                                     
                cdu_ospi_refclk      0       0        0        500000000   0          0     50000      N                  deviceless                      no_connection_id                                  
                cgu0_s1seldiv        0       0        0        250000000   0          0     50000      Y                  deviceless                      no_connection_id                                  
                cgu0_s0seldiv        1       1        0        125000000   0          0     50000      Y                  deviceless                      no_connection_id                                  
                   sclk0_0           6       6        0        125000000   0          0     50000      Y                     31008000.watchdog               sclk0                                          
                                                                                                                             31003000.uart                   sclk0                                          
                                                                                                                             31001600.twi                    sclk0                                          
                                                                                                                             31001400.twi                    sclk0                                          
                                                                                                                             gptimers@31018000               no_connection_id                               
                                                                                                                             deviceless                      no_connection_id                               
                      cdu_trace      0       0        0        125000000   0          0     50000      N                        deviceless                      no_connection_id                            
                      cdu_lp         0       0        0        125000000   0          0     50000      N                        deviceless                      no_connection_id                            
                      cdu_spi        1       1        0        125000000   0          0     50000      Y                        31030000.spi                    spi                                         
                                                                                                                                deviceless                      no_connection_id                            
                      cdu_gige       1       1        0        125000000   0          0     50000      Y                        31040000.ethernet               stmmaceth                                   
                                                                                                                                deviceless                      no_connection_id                            
             cgu0_cdiv               1       1        0        1000000000  0          0     50000      Y               deviceless                      no_connection_id                                     
                cclk0_0              2       2        0        1000000000  0          0     50000      Y                  deviceless                      no_connection_id                                  
                   cdu_sharc1        1       1        0        1000000000  0          0     50000      Y                     deviceless                      no_connection_id                               
                   cdu_sharc0        1       1        0        1000000000  0          0     50000      Y                     deviceless                      no_connection_id                               
                                                                                                                                                                                                            
root@adsp-sc598-som-ezkit:~#                                                                                                                                                                 

reserved sel parents in original is wrong, mine fixes:

root@adsp-sc589-mini:~# cat /sys/kernel/debug/clk/clk_summary                                                                                                                     
                                 enable  prepare  protect                                duty  hardware                            connection                                     
   clock                          count    count    count        rate   accuracy phase  cycle    enable   consumer                         id                                     
---------------------------------------------------------------------------------------------------------------------------------------------                                     
 dummy                               0       0        0        0           0          0     50000      Y   deviceless                      no_connection_id                       
 sys_clkin1                          0       0        0        25000000    0          0     50000      Y   clocks@3108d000                 sys_clkin1                             
                                                                                                           deviceless                      no_connection_id                       
 sys_clkin0                          2       2        0        25000000    0          0     50000      Y   clocks@3108d000                 sys_clkin0                             
                                                                                                           deviceless                      no_connection_id                       
    cdu_clkinsel                     1       1        0        25000000    0          0     50000      Y      deviceless                      no_connection_id                    
       cgu1_df                       1       1        0        25000000    0          0     50000      Y         deviceless                      no_connection_id                 
          cgu1_vco                   1       1        0        125000000   0          0     50000      Y            deviceless                      no_connection_id              
             cgu1_pllclk             1       1        0        125000000   0          0     50000      Y               deviceless                      no_connection_id           
                cgu1_odiv            0       0        0        41666667    0          0     50000      Y                  deviceless                      no_connection_id        
                   oclk_1            0       0        0        41666667    0          0     50000      N                     deviceless                      no_connection_id     
                cgu1_ddiv            0       0        0        62500000    0          0     50000      Y                  deviceless                      no_connection_id        
                   dclk_1            0       0        0        62500000    0          0     50000      N                     deviceless                      no_connection_id     
                sysclk_1             0       0        0        62500000    0          0     50000      Y                  deviceless                      no_connection_id        
                   cgu1_s1seldiv     0       0        0        31250000    0          0     50000      Y                     deviceless                      no_connection_id     
                      sclk1_1        0       0        0        31250000    0          0     50000      N                        deviceless                      no_connection_id  
                   cgu1_s0seldiv     0       0        0        31250000    0          0     50000      Y                     deviceless                      no_connection_id     
                      sclk0_1        0       0        0        31250000    0          0     50000      N                        deviceless                      no_connection_id  
                cgu1_cdiv            1       1        0        125000000   0          0     50000      Y                  deviceless                      no_connection_id        
                   cclk1_1           0       0        0        125000000   0          0     50000      N                     deviceless                      no_connection_id     
                      cclk1_1_half   0       0        0        62500000    0          0     50000      Y                        deviceless                      no_connection_id  
                   cclk0_1           1       1        0        125000000   0          0     50000      Y                     deviceless                      no_connection_id     
                      cdu_gige       1       1        0        125000000   0          0     50000      Y                        3100c000.ethernet               stmmaceth         
                                                                                                                                deviceless                      no_connection_id  
    cgu0_df                          1       1        0        25000000    0          0     50000      Y      deviceless                      no_connection_id                    
       cgu0_vco                      1       1        0        450000000   0          0     50000      Y         deviceless                      no_connection_id                 
          cgu0_pllclk                4       4        0        450000000   0          0     50000      Y            deviceless                      no_connection_id              
             cgu0_odiv               1       1        0        150000000   0          0     50000      Y               deviceless                      no_connection_id           
                oclk_0               1       1        0        150000000   0          0     50000      Y                  deviceless                      no_connection_id        
                   cdu_reserved      0       0        0        150000000   0          0     50000      N                     deviceless                      no_connection_id     
                   cdu_spdif         0       0        0        150000000   0          0     50000      N                     deviceless                      no_connection_id     
                   cdu_can           0       0        0        150000000   0          0     50000      N                     deviceless                      no_connection_id     
                   oclk_0_half       1       1        0        75000000    0          0     50000      Y                     deviceless                      no_connection_id     
                      cdu_sdio       1       1        0        75000000    0          0     50000      Y                        31010000.mmc                    ciu               
                                                                                                                                deviceless                      no_connection_id  
             cgu0_ddiv               1       1        0        450000000   0          0     50000      Y               deviceless                      no_connection_id           
                dclk_0               1       1        0        450000000   0          0     50000      Y                  deviceless                      no_connection_id        
                   cdu_ddr           1       1        0        450000000   0          0     50000      Y                     deviceless                      no_connection_id     
             sysclk_0                2       2        0        225000000   0          0     50000      Y               deviceless                      no_connection_id           
                cgu0_s1seldiv        1       1        0        112500000   0          0     50000      Y                  deviceless                      no_connection_id        
                   sclk1_0           2       2        0        112500000   0          0     50000      Y                     31002000.i2s-sport0             sclk                 
                                                                                                                             31042000.spi                    spi                  
                                                                                                                             deviceless                      no_connection_id     
                cgu0_s0seldiv        1       1        0        112500000   0          0     50000      Y                  deviceless                      no_connection_id        
                   sclk0_0           7       7        0        112500000   0          0     50000      Y                     31010000.mmc                    biu                  
                                                                                                                             31008000.watchdog               sclk0                
                                                                                                                             31044000.spi                    spi                  
                                                                                                                             31003000.uart                   sclk0                
                                                                                                                             31001600.twi                    sclk0                
                                                                                                                             31001500.twi                    sclk0                
                                                                                                                             31001400.twi                    sclk0                
                                                                                                                             gptimers@31001000               no_connection_id     
                                                                                                                             deviceless                      no_connection_id     
                      cdu_lp         0       0        0        112500000   0          0     50000      N                        deviceless                      no_connection_id  
             cgu0_cdiv               2       2        0        450000000   0          0     50000      Y               deviceless                      no_connection_id           
                cclk1_0              1       1        0        450000000   0          0     50000      N                  deviceless                      no_connection_id        
                   cdu_arm           1       1        0        450000000   0          0     50000      Y                     deviceless                      no_connection_id     
                cclk0_0              2       2        0        450000000   0          0     50000      Y                  deviceless                      no_connection_id        
                   cdu_sharc1        1       1        0        450000000   0          0     50000      Y                     deviceless                      no_connection_id     
                   cdu_sharc0        1       1        0        450000000   0          0     50000      Y                     deviceless                      no_connection_id     
root@adsp-sc589-mini:~#                                                                                                                                                           
root@adsp-sc573-ezkit:~# cat /sys/kernel/debug/clk/clk_summary                                                                                                                            
                                 enable  prepare  protect                                duty  hardware                            connection                                             
   clock                          count    count    count        rate   accuracy phase  cycle    enable   consumer                         id                                             
---------------------------------------------------------------------------------------------------------------------------------------------                                             
 dummy                               0       0        0        0           0          0     50000      Y   deviceless                      no_connection_id                               
 sys_clkin1                          0       0        0        25000000    0          0     50000      Y   clocks@3108d000                 sys_clkin1                                     
                                                                                                           deviceless                      no_connection_id                               
 sys_clkin0                          2       2        0        25000000    0          0     50000      Y   clocks@3108d000                 sys_clkin0                                     
                                                                                                           deviceless                      no_connection_id                               
    cdu_clkinsel                     1       1        0        25000000    0          0     50000      Y      deviceless                      no_connection_id                            
       cgu1_df                       1       1        0        25000000    0          0     50000      Y         deviceless                      no_connection_id                         
          cgu1_pllclk                1       1        0        125000000   0          0     50000      Y            deviceless                      no_connection_id                      
             cgu1_odiv               0       0        0        41666667    0          0     50000      Y               deviceless                      no_connection_id                   
                oclk_1               0       0        0        41666667    0          0     50000      N                  deviceless                      no_connection_id                
             cgu1_ddiv               0       0        0        62500000    0          0     50000      Y               deviceless                      no_connection_id                   
                dclk_1               0       0        0        62500000    0          0     50000      N                  deviceless                      no_connection_id                
             sysclk_1                0       0        0        62500000    0          0     50000      Y               deviceless                      no_connection_id                   
                cgu1_s1seldiv        0       0        0        31250000    0          0     50000      Y                  deviceless                      no_connection_id                
                   sclk1_1           0       0        0        31250000    0          0     50000      N                     deviceless                      no_connection_id             
                cgu1_s0seldiv        0       0        0        31250000    0          0     50000      Y                  deviceless                      no_connection_id                
                   sclk0_1           0       0        0        31250000    0          0     50000      N                     deviceless                      no_connection_id             
             cgu1_cdiv               1       1        0        125000000   0          0     50000      Y               deviceless                      no_connection_id                   
                cclk1_1              0       0        0        125000000   0          0     50000      N                  deviceless                      no_connection_id                
                   cclk1_1_half      0       0        0        62500000    0          0     50000      Y                     deviceless                      no_connection_id             
                cclk0_1              1       1        0        125000000   0          0     50000      Y                  deviceless                                                      
  no_connection_id                                                                                                                                                                        
                   cdu_gige          1       1        0        125000000   0          0     50000      Y                     3100c000.ethernet               stmmaceth                    
                                                                                                                             deviceless                      no_connection_id             
    cgu0_df                          1       1        0        25000000    0          0     50000      Y      deviceless                      no_connection_id                            
       cgu0_pllclk                   4       4        0        450000000   0          0     50000      Y         deviceless                      no_connection_id                         
          cgu0_odiv                  1       1        0        150000000   0          0     50000      Y            deviceless                      no_connection_id                      
             oclk_0                  1       1        0        150000000   0          0     50000      Y               deviceless                      no_connection_id                   
                cdu_spdif            0       0        0        150000000   0          0     50000      N                  deviceless                      no_connection_id                
                cdu_can              0       0        0        150000000   0          0     50000      N                  deviceless                      no_connection_id                
                oclk_0_half          1       1        0        75000000    0          0     50000      Y                  deviceless                      no_connection_id                
                   cdu_sdio          1       1        0        75000000    0          0     50000      Y                     31010000.mmc                    ciu                          
                                                                                                                             deviceless                      no_connection_id             
          cgu0_ddiv                  1       1        0        225000000   0          0     50000      Y            deviceless                      no_connection_id                      
             dclk_0                  1       1        0        225000000   0          0     50000      Y               deviceless                      no_connection_id                   
                cdu_ddr              1       1        0        225000000   0          0     50000      Y                  deviceless                      no_connection_id                
          sysclk_0                   2       2        0        225000000   0          0     50000      Y            deviceless                      no_connection_id                      
             cgu0_s1seldiv           1       1        0        112500000   0          0     50000      Y               deviceless                      no_connection_id                   
                sclk1_0              2       2        0        112500000   0          0     50000      Y                  31044000.spi                    spi                             
                                                                                                                          3102e000.spi                    spi                             
                                                                                                                          deviceless                      no_connection_id                
             cgu0_s0seldiv           1       1        0        112500000   0          0     50000      Y               deviceless                      no_connection_id                   
                sclk0_0              7       7        0        112500000   0          0     50000      Y                  31002000.i2s                    sclk                            
                                                                                                                          31010000.mmc                    biu                             
                                                                                                                          31                                                              
008000.watchdog               sclk0                                                                                                                                                       
                                                                                                                          31003000.uart                   sclk0                           
                                                                                                                          31001600.twi                    sclk0                           
                                                                                                                          31001500.twi                    sclk0                           
                                                                                                                          31001400.twi                    sclk0                           
                                                                                                                          gptimers@31018000               no_connection_id                
                                                                                                                          deviceless                      no_connection_id                
          cgu0_cdiv                  2       2        0        450000000   0          0     50000      Y            deviceless                      no_connection_id                      
             cclk1_0                 1       1        0        450000000   0          0     50000      N               deviceless                      no_connection_id                   
                cdu_arm              1       1        0        450000000   0          0     50000      Y                  deviceless                      no_connection_id                
             cclk0_0                 2       2        0        450000000   0          0     50000      Y               deviceless                      no_connection_id                   
                cdu_sharc1           1       1        0        450000000   0          0     50000      Y                  deviceless                      no_connection_id                
                cdu_sharc0           1       1        0        450000000   0          0     50000      Y                  deviceless                      no_connection_id                
                                                                                                                                                                                          

@pamolloy

Copy link
Copy Markdown
Collaborator

@ukleinek just so you're aware of this since it is a big change and may impact your work

@pamolloy

Copy link
Copy Markdown
Collaborator

@qasim-ijaz Check https://github.com/analogdevicesinc/linux/actions/runs/29926080863/job/88943461564?pr=3456#step:9:72 for checkpatch, cocci, etc

@pamolloy pamolloy added the llm review Request a review from a LLM Reviewer label Jul 22, 2026
@pamolloy

Copy link
Copy Markdown
Collaborator

Not sure if checkpatch can check for it, but it looks like the commit descriptions are wrapped at 50 characters.

@analogdevicesinc analogdevicesinc deleted a comment from github-actions Bot Jul 22, 2026
@analogdevicesinc analogdevicesinc deleted a comment from github-actions Bot Jul 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

LLM review

This series adds a shared ADSP SoC CDU (Clock Distribution Unit) clock
driver (drivers/clk/adi/clk-adi-cdu.c), its dt-binding
(adi,sc5xx-cdu.yaml), and per-SoC device tree nodes/consumers for
SC573, SC589, SC594, and SC598, replacing the previous CGU/CDU/PLL
"single controller" modelling and removing now-unused dummy clock
registrations.

run: 29930235555

7ddf1a0a85 - Introduce ADSP SoC CDU clock driver

checkpatch warnings reproduced locally: 6x "space before tabs" in
the CDU block-diagram comment and several PDATA() alignment lines,
plus a macro precedence issue in CCDU()
(CLK_IS_CRITICAL | _flags should be CLK_IS_CRITICAL | (_flags)).
Fixup patch attached.

Latent probe robustness issue (not fixed, informational):
adsp_cdu_register() returns -EINVAL for any clock whose cdu_clko
is set in the SoC's rsvd_mask, but adsp_cdu_probe() treats that
identically to any other registration failure and aborts the entire
provider (return PTR_ERR(hw)) instead of skipping just that one
output. Checked all four static tables
(sc598_cdu_info/sc594_cdu_info rsvd BIT(11), sc573_cdu_info
rsvd BIT(6)|BIT(8), sc589_cdu_info rsvd 0): none currently list a
clock hitting their own rsvd_mask, so this is dead code today, but a
future/typo'd table entry would silently kill clock registration for
the whole SoC instead of just that one output.

fa72bf43de - add ADSP CDU binding

The new Documentation/devicetree/bindings/clock/adi,sc5xx-cdu.yaml
file isn't covered by MAINTAINERS (only the sibling
adi,sc5xx-clocks.yaml is listed explicitly). checkpatch's "added,
moved or deleted file(s), does MAINTAINERS need updating?" warning is
legitimate here. Fixup patch attached.

CI warnings

The checkpatch job failures match what's reproduced above. The
build_gcc_arm dtbs_check-style warnings on sc573-ezlite.dts and
sc57x.dtsi (simple_bus_reg, unique_unit_address,
unit_address_vs_reg) are pre-existing and unrelated to this series:
sc573-ezlite.dts isn't touched by any commit in this range, and the
warned sc57x.dtsi lines fall outside the CDU-node diff hunks (just
shifted in line number by the new node).

Verification data

  • Built drivers/clk/adi/ for ARM 32-bit (gcc_arm,
    multi_v7_defconfig + COMMON_CLK_ADI_SC57X/SC58X/SC594/CDU/PLL)
    and for arm64 (gcc_aarch64, defconfig +
    ARCH_SC59X_64/COMMON_CLK_ADI_SC598/CDU/PLL, the only path
    exercising SC598) — both clean, no warnings.
  • Built sc573-ezlite.dtb, sc589-mini.dtb, sc594-som-ezkit.dtb.
  • Diffed adi,sc5xx-cdu.yaml's per-compatible clocks/clock-names
    arrays against the actual cdu nodes in sc57x.dtsi, sc58x.dtsi,
    sc59x.dtsi, sc59x-64.dtsi — all match exactly.
  • Cross-checked the PR-comment clk_summary dump note ("reserved sel
    parents in original is wrong, mine fixes") against
    sc589_cdu_reserved_parents (ADSP_SC58X_CLK_CDU_RESERVED,
    CDU_CLKO6) in the final driver — the fix described is already
    present, no outstanding issue.
  • Full review notes in llm-summary.e8a.md (includes a diagram of the
    probe-abort issue).

Suggested patches

Apply the suggested patches with:

cd path/to/repository
export GITHUB_TOKEN=ghp_***
apply-patches --repo=analogdevicesinc/linux 29930235555
Install instructions

The following one-liner installs the script if not present already:

curl -fSsL "https://raw.githubusercontent.com/analogdevicesinc/doctools/refs/heads/main/ci/scripts/apply-patches.sh"      -o ~/.local/bin/apply-patches.sh &&   grep -q "/apply-patches.sh" ~/.bashrc || echo "source ~/.local/bin/apply-patches.sh" >> $_ ; . $_

More information at AI Usage.

Comment thread drivers/clk/adi/clk-adi-cdu.c Outdated
Comment thread drivers/clk/adi/clk-adi-cdu.c Outdated
@qasim-ijaz
qasim-ijaz force-pushed the cdu branch 2 times, most recently from 79662d5 to 55209e3 Compare July 23, 2026 13:16
@artursartamonovsadi

Copy link
Copy Markdown

tested with RevE+RevD boots, and clock tree in clk_summary looks ok

@qasim-ijaz
qasim-ijaz force-pushed the cdu branch 2 times, most recently from b546642 to 3080660 Compare July 23, 2026 14:55
@qasim-ijaz

qasim-ijaz commented Jul 23, 2026

Copy link
Copy Markdown
Author

@qasim-ijaz Check https://github.com/analogdevicesinc/linux/actions/runs/29926080863/job/88943461564?pr=3456#step:9:72 for checkpatch, cocci, etc

Fixed most of the checkpatch issues:

  • a bunch of warnings about spacing before tabs
  • a warning about the global spinlock not having a comment explaining how its used
  • parenthesis warning in my CCDU macro
  • turn GPL v2 -> GPL

As for the rest they seem to be about 1) line lengths of 101/102/103 exceeding the 100 line max, i think this should be fine since its only 1-2 chars extra (if i was to change this i'd probably have to make the names shorter or something so I think readability > worrying about 1-2 extra chars, also it seems other clock drivers also exceed this limit upstream) 2) parenthesis alignment, once again i think this is fine since this is a style employed by other upstream clock drivers (https://github.com/torvalds/linux/blob/master/drivers/clk/rockchip/clk-rk3588.c for example) and i think the current styling looks quite clean.

@pamolloy

Copy link
Copy Markdown
Collaborator

The wrapping of the commit descriptions should be made consistent.

The description of clk: adi: Introduce ADSP SoC CDU clock driver contains a lot of text. The paragraphs probably don't need the bullet points. Perhaps look at other similar commits. For example, kernel doc probably doesn't need to be mentioned. Although some commits will get squashed that one should eventually find its way upstream.

@sipraga sipraga left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Overall great job and the structure is very sound! I am looking forward to the CGU driver getting the same loving treatment - things should look much cleaner after!

I have left quite a lot of comments but they are a mix of subjective opinions (mostly in the interest of naming consistency, as we've discussed before), general code improvements, and only a few fundamental issues. Take your time and feel free to call me on teams if you think it's easier to chat than take it here.

I got a bit tired of reviewing, so this is a bit of a partial review. But hopefully enough for you to work with for now. Of course push back on my comments if I got something wrong or you disagree - sometimes I'm just thinking out loud :-D

Comment thread include/dt-bindings/clock/adi-sc5xx-clock.h Outdated
Comment thread include/dt-bindings/clock/adi-sc5xx-clock.h Outdated
Comment thread drivers/clk/adi/clk.h Outdated
Comment thread include/dt-bindings/clock/adi-sc5xx-clock.h Outdated
Comment thread arch/arm64/boot/dts/adi/sc59x-64.dtsi
Comment thread Documentation/devicetree/bindings/clock/adi,sc5xx-cdu.yaml Outdated
Comment thread Documentation/devicetree/bindings/clock/adi,sc5xx-cdu.yaml Outdated
Comment thread Documentation/devicetree/bindings/clock/adi,sc5xx-cdu.yaml Outdated
#clock-cells = <1>;

clocks = <&sys_clkin0>,
<&sys_clkin1>,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

make sure to run dt_binding_check. it can take an eternity to check the whole tree, so you can specify a specific bindings file to check:

make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/clock/adi,sc5xx-cdu.yaml

@qasim-ijaz qasim-ijaz Aug 30, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I ran the dt_binding_check on Documentation/devicetree/bindings/clock/adi,adsp-cdu.yaml it passes cleanly with no errors.

Comment thread Documentation/devicetree/bindings/clock/adi,adsp-cdu.yaml
* This header defines the clocks that the ADSP-SC573
* CDU clock controller provides.
*
* Author: Qasim Ijaz <qasim.ijaz@analog.com>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think just drop author here and elsewhere, since copyright is usually where it goes but that's attributed to ADI. we also have git-blame

just my 2c

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

should be fixed


// Extra half rate clocks generated in the CDU
clks[ADSP_SC57X_CLK_OCLK0_HALF] = clk_register_fixed_factor(NULL, "oclk_0_half",
clks[ADSP_SC57X_CLK_CGU0_OCLK_HALF] = clk_register_fixed_factor(NULL, "oclk_0_half",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

for this commit's message, restrict to 72 columns

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

and same for a few of the other commit mesages

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I went over all the commits and wrapped them, so they don't exceed 72 chars.

clk->cdu_clko, clk->parent_data,
clk->mux_table, clk->num_parents,
clk->clock_flags, &cdu_lock,
cdu_match_data->reserved_mask);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

wouldn't it make more sense to just pass a struct adsp_cdu_clks pointer to adsp_cdu_register() rather than unpacking it all here?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

should be fixed now

Comment thread drivers/clk/adi/clk-adsp-cdu.c Outdated
return !!(reg & ADSP_CDU_CFG_EN);
}

#ifdef CONFIG_DEBUG_FS

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think you can just stick it at the top without the ifdef guard as most ppl do

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

dropped this and move the headers to the top.

Comment thread drivers/clk/adi/clk-adsp-cdu.c Outdated
.is_enabled = adsp_cdu_is_enabled,
#ifdef CONFIG_DEBUG_FS
.debug_init = adsp_cdu_debug_init,
#endif

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

seems most drivers forego the ifdef guard here too

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

^^ dropped

Comment thread drivers/clk/adi/clk-adsp-cdu.c Outdated

spin_lock_irqsave(cdu->lock, flags);
reg = adsp_cdu_readl(cdu, adsp_cdu_cfg(cdu));
spin_unlock_irqrestore(cdu->lock, flags);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

as discussed already, I'm skeptical you need much, if any, locking in this driver. get_parent and set_parent are serialized in the clock core, no?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

refer to my comment here: #3456 (comment)

Comment thread drivers/clk/adi/Kconfig
select COMMON_CLK_ADI_CDU
help
This enables the ADI SC594 clock driver. The driver provides
This enables the ADI SC598 clock driver. The driver provides

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You write

clk: adi: enable common CDU driver for SC598
Select COMMON_CLK_ADI_CDU from COMMON_CLK_ADI_SC598 so the common Clock Distribution Unit
driver is built with SC598 clock support.

but doesn't the CDU driver always support sc598?

in the end (didn't get there yet) I suppose we just want the Kconfig.platforms entry to select COMMON_CLK_ADI_ADSP_CDU

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

oh yeah, also, should the kconfig entry be called COMMON_CLK_ADI_ADSP_CDU (note the _ADSP) for consistency?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Good suggestion, I have renamed it to COMMON_CLK_ADI_ADSP_CDU and reworded the commits to be a little clearer. In terms of the Kconfig.platforms change, yes I think that would be ideal but I think it would be better to do with the other Kconfig changes (after this is done/merged) we discussed earlier (depends on ARCH_ADSP, etc.)

Comment thread arch/arm64/boot/dts/adi/sc59x-64.dtsi Outdated
<&clk ADSP_SC598_CLK_CGU0_DCLK>,
<&clk ADSP_SC598_CLK_CGU0_DCLK_HALF>,
<&clk ADSP_SC598_CLK_CGU0_OCLK>,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

spurious newlines

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I have dropped all newlines in the CDU clock controller DT nodes.

@sipraga

sipraga commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

resolved all my fixed/stale comments

Add separate CDU clock binding headers for the ADSP-SC573, ADSP-SC589,
ADSP-SC594, and ADSP-SC598 SoCs. Define the clock IDs exported by
each SoC's CDU controller in its corresponding header.

Signed-off-by: Qasim Ijaz <Qasim.Ijaz@analog.com>
The half rate clock IDs do not consistently identify which CGU provides
the source clock, unlike the other CGU clock IDs.

Rename the half rate clock IDs to include the corresponding CGU index
and update the ADSP clock drivers to use the new names. Keep the
existing numeric clock IDs unchanged.

Signed-off-by: Qasim Ijaz <Qasim.Ijaz@analog.com>
The SC598 clock driver does not currently register the CCLK1_0 clock
from CGU0.

Add a clock ID for CGU0 CCLK1_0 and register the clock as a gate
from the CGU0 CDIV output. This makes CCLK1_0 available as an
input clock to the SC598 CDU clock controller.

Signed-off-by: Qasim Ijaz <Qasim.Ijaz@analog.com>
Add a binding for the CDU on the ADSP-SC573, ADSP-SC589, ADSP-SC594,
and ADSP-SC598 SoCs. Describe the register region, input clocks, and
clock outputs provided by the CDU.

Add the new binding file to the MAINTAINERS entry for the ADI
SC5xx platform.

Signed-off-by: Qasim Ijaz <Qasim.Ijaz@analog.com>
The SC5xx clock controller binding currently describes the Clock
Generation Units and Clock Distribution Unit as a single
provider. The CDU is now described as a separate clock
controller with its own register region and binding.

Update the existing binding to describe only the CGU and PLL
register blocks. Remove the CDU register region from the
examples and adjust the allowed register count for the
SC57x, SC58x, SC594, and SC598 clock controllers.

Signed-off-by: Qasim Ijaz <Qasim.Ijaz@analog.com>
Introduce the ADSP CDU (Clock Distribution Unit) clock driver. The
current clock drivers model the core hardware blocks (CGUs/CDU/PLLs)
as a single clock controller even though each block has separate
register blocks, separate functionality and uses.

This driver improves on and introduces various changes:

- The current ADSP clock drivers incorrectly models each CDU output by
using the generic clk_register_mux() implementation. However, this is
not suitable for the ADSP CDU because the generic kernel mux
implementation does not account for hardware specific requirements
such as polling and waiting for the corresponding CLKOn bit or
checking whether the LOCK bit is set. Furthermore, the generic mux
set_parent operation performs the register update and returns success
without waiting for CDU configuration completion, checking the LOCK
bit, or verifying the  selector readback. As a result, hardware
timeouts, locked registers, and failed selector updates cannot be
detected or reported to CCF.

- The current driver registers every CDU mux and gate clock as
an early clock, this is not needed because there are no early mux
clock consumers. Generally we should limit the number of early clocks
we register since the core driver model (and all the benefits which
come with it) is not available at early clock registration time, the
idiomatic thing to do is convert this to a platform driver, taking
advantage of modern kernel APIs and limiting which clocks are
registered early.

- Rate requests on CDU output clocks may need to propagate to their
upstream PLL and divider clocks. During development this was
observed to have side effects on the ADSP-SC598, where changing the
TRACE CDU clock rate also affected other clocks sharing the same
upstream parent and caused the system to become unusable.

Retain CLK_SET_RATE_PARENT so consumers can propagate rate requests
to the programmable upstream clock tree. Also add the
CLK_OPS_PARENT_ENABLE flag to keep the relevant parent clocks enabled
while parent operations are performed.

- Register the CDU CLKINSEL mux as a writable clock with its own
clk_ops so Linux can select the reference clock supplied to CGU1.

- Another useful addition is adding a debugfs interface to dump CDU
related registers, such as EN, SEL, LOCK, LWERR, etc. This can be
useful for general clock related debugging. Furthermore the CDU
revision IDs are printed during probe, before these were
simply ignored.

- The current clock driver models the grounded input clocks ("N/A")
as dummy clocks however this is not needed because the SoC docs
state "Unused input clocks are grounded internally and never
selected". Adding them is not needed because they are not used
or selected, a cleaner design is to simply expose the input clocks
which can be selected. Furthermore introduce MUX_TABLES which map
parent clocks to CLKOn input SELs, this nicely fits into what the
CCF mux APIs already expose and expect.

- The old driver utilises string based parents which is the "legacy"
way to define and let CCF know about clock parents, it has various
issues and can be brittle. The modern and more preferred way (especially
when the parent clock is owned by an external clock controller as in
our case) is to use struct clk_parent_data.fw_name which introduces
a closer coupling with the device tree where clocks are resolved
directly through DT phandles to clock controllers instead of relying
on globally unique internal clock names.

Signed-off-by: Qasim Ijaz <Qasim.Ijaz@analog.com>
Select COMMON_CLK_ADI_ADSP_CDU from COMMON_CLK_ADI_SC598 so
the common Clock Distribution Unit driver is built for the ADSP-SC598.

Also correct the SC598 help text, which incorrectly referred to the
SC594 clock driver.

Signed-off-by: Qasim Ijaz <Qasim.Ijaz@analog.com>
The SC598 clock driver currently maps the CDU register block alongside
CGU0, CGU1, and the third PLL. It also registers the CDU CLKINSEL mux
and the mux and gate clocks for the CDU outputs.

These clocks are now registered by the common ADSP CDU driver.

Update the SC598 clock driver to:

- remove the third MMIO resource mapping for the CDU, since the common
  CDU driver now owns that register block

- update the third PLL resource index after removing the CDU resource

- keep a private lock for the remaining SC598 CGU and PLL clock
  registrations

- change the parents of the CGU1 and third PLL input dividers from the
  locally registered "cgu1_in_sel" clock to the "cdu_clkinsel" clock
  registered by the common CDU driver

- remove the CDU CLKINSEL registration since this is registered by
  the common CDU driver

- remove the SC598 CDU output mux and gate clock registrations since
  these are now registered by the common CDU driver

- remove the parent arrays used by the legacy CDU mux registrations

After this change, clk-adi-sc598 registers the SC598 CGU0, CGU1, and
third PLL clocks, while the common ADSP CDU driver owns the CDU
register block, CLKINSEL mux, and CDU output clocks.

Signed-off-by: Qasim Ijaz <Qasim.Ijaz@analog.com>
The SC598 clock controller node currently describes both the Clock
Generation Units and the Clock Distribution Unit as a single controller.
The CGUs and CDU are distinct hardware blocks with separate register
regions and functions.

Describe the CDU as a separate clock controller so it can be managed by
the common ADSP CDU driver.

Remove the CDU register range from the existing CGU clock node and add a
standalone CDU node with its required input clocks, including CCLK1_0.

Update the CPU, SPI, OSPI, Ethernet, and eMMC consumers to use the new
CDU clock provider.

Signed-off-by: Qasim Ijaz <Qasim.Ijaz@analog.com>
The SC598 clock ID namespace currently represents each CDU output as
two separate clocks: a _SEL clock for the input mux and a second clock
for the output gate.

The common ADSP CDU driver models the mux and gate as a single CCF
clock and exports the CDU outputs through the SC598-specific CDU clock
provider.

Remove the legacy SC598 CDU mux and gate IDs from the main SC598 clock
namespace. Renumber the remaining PLL3 and DDR clock IDs, place the
new CGU0 CCLK1 clock after them, and update ADSP_SC598_CLK_END
accordingly.

Signed-off-by: Qasim Ijaz <Qasim.Ijaz@analog.com>
Select COMMON_CLK_ADI_ADSP_CDU from COMMON_CLK_ADI_SC594 so the
common Clock Distribution Unit driver is built for the ADSP-SC594.

Signed-off-by: Qasim Ijaz <Qasim.Ijaz@analog.com>
The SC594 clock driver currently maps the CDU register block alongside
CGU0 and CGU1. It also registers the CDU CLKINSEL mux and the mux and
gate clocks for the CDU outputs.

These clocks are now registered by the common ADSP CDU driver.

Update the SC594 clock driver to:

- remove the third MMIO resource mapping for the CDU, since the common
  CDU driver now owns that register block

- change the parent of the CGU1 DF divider from the locally registered
  "cgu1_in_sel" clock to the "cdu_clkinsel" clock registered by the
  common CDU driver

- remove the local CDU CLKINSEL registration

- remove the SC594 CDU output mux and gate clock registrations

- remove the parent arrays used by the old CDU output mux
  registrations

After this change, clk-adi-sc594 registers the SC594 CGU clocks, while
the CDU driver owns the CDU register block, CLKINSEL mux, and CDU output
clocks.

Signed-off-by: Qasim Ijaz <Qasim.Ijaz@analog.com>
The SC594 clock controller node currently describes both the Clock
Generation Units and the Clock Distribution Unit as a single
controller. This does not reflect the hardware layout because the
CGUs and CDU are distinct hardware blocks with separate register
blocks and different functions.

Describe the CDU as a separate clock controller so that it can be
managed by the common ADSP CDU driver shared across the ADSP
SoC family.

Remove the CDU register range from the existing clock node, add a
standalone CDU node with its required CGU input clocks, and update the
CPU, SPI, OSPI, and Ethernet nodes to consume clocks from the new
CDU provider.

Signed-off-by: Qasim Ijaz <Qasim.Ijaz@analog.com>
The SC594 clock ID namespace currently represents each CDU output as
two separate clocks: a _SEL clock for the input mux and a second
clock for the output gate.

A CDU output is controlled by a single CDU_CFG register, with the SEL
field selecting its parent and the EN field controlling the output
gate. The common ADSP CDU driver therefore models each output as a
single CCF clock.

Remove the legacy SC594 CDU mux and gate IDs from the main SC594
clock namespace and update ADSP_SC594_CLK_END accordingly.

Signed-off-by: Qasim Ijaz <Qasim.Ijaz@analog.com>
Select COMMON_CLK_ADI_ADSP_CDU from COMMON_CLK_ADI_SC58X so the
common Clock Distribution Unit driver is built for the ADSP-SC589.

Signed-off-by: Qasim Ijaz <Qasim.Ijaz@analog.com>
The SC589 clock driver currently maps the CDU register block alongside
CGU0 and CGU1. It also registers the CDU CLKINSEL mux and the mux and
gate clocks for the CDU outputs. These clocks are now registered by
the common ADSP CDU driver.

Update the SC589 clock driver to:

- remove the third MMIO resource mapping for the CDU, since the
common CDU driver now owns that register block

- change the parent of the CGU1 DF divider from the locally
registered "cgu1_in_sel" clock to the "cdu_clkinsel" clock
registered by the common CDU driver

- remove the local CDU CLKINSEL mux registration

- remove the SC589 CDU output mux and gate clock registrations
since these are now registered by the common CDU driver

- remove the parent arrays used by the old CDU output mux
registrations, since these are no longer needed and are handled
by the common CDU driver

After this change, clk-adi-sc58x registers the SC589 CGU clocks,
while the CDU driver owns the CDU register block, CLKINSEL mux,
and CDU output clocks.

Signed-off-by: Qasim Ijaz <Qasim.Ijaz@analog.com>
The SC589 clock controller node currently describes both the Clock
Generation Units and the Clock Distribution Unit as a single
controller. This does not reflect the hardware layout because the
CGUs and CDU are distinct hardware blocks with separate register
blocks and functions.

Describe the CDU as a separate clock controller so that it can be
managed by the common ADSP CDU driver shared across the ADSP
SoC family.

Remove the CDU register range from the existing clock node and add a
standalone CDU node with the required SYS_CLKIN and CGU input clocks.

Update the CPU, Ethernet, and MMC nodes to consume their CDU output
clocks from the new provider.

Signed-off-by: Qasim Ijaz <Qasim.Ijaz@analog.com>
The SC58X clock ID namespace currently represents each CDU output as
two separate clocks: a _SEL clock for the input mux and a second
clock for the output gate.

A CDU output is controlled by a single CDU_CFG register, with the SEL
field selecting its parent and the EN field controlling the output gate.
The common ADSP CDU driver therefore models each output as a single
CCF clock.

Remove the legacy SC58X CDU mux and gate IDs from the main SC58X clock
namespace and update ADSP_SC58X_CLK_END accordingly.

The CDU outputs are instead exported by the dedicated SC589 CDU provider
using the IDs defined in adi,adsp-sc589-cdu.h.

Signed-off-by: Qasim Ijaz <Qasim.Ijaz@analog.com>
Select COMMON_CLK_ADI_ADSP_CDU from COMMON_CLK_ADI_SC57X so the
common Clock Distribution Unit driver is built for the ADSP-SC573.

Signed-off-by: Qasim Ijaz <Qasim.Ijaz@analog.com>
The SC57X clock driver currently maps the CDU register block alongside
CGU0 and CGU1. It also registers the CDU CLKINSEL mux and the mux and
gate clocks for the CDU outputs.

These clocks are now registered by the common ADSP CDU driver.

Update the SC57X clock driver to:

- remove the third MMIO resource mapping for the CDU, since the common
CDU driver now owns that register block

- change the parent of the CGU1 DF divider from the locally registered
"cgu1_in_sel" clock to the "cdu_clkinsel" clock registered by the
common CDU driver

- remove the local CDU CLKINSEL mux registration

- remove the SC57X CDU output mux and gate clock registrations since
these are now handled by the common CDU driver

- remove the parent arrays used by the old CDU output
mux registrations

After this change, clk-adi-sc57x registers the SC57X CGU clocks,
while the CDU driver owns the CDU register block, CLKINSEL mux,
and CDU output clocks.

Signed-off-by: Qasim Ijaz <Qasim.Ijaz@analog.com>
The legacy ADI clock drivers previously used common CDU
register offsets and helper functions to register the CDU mux
and gate clocks.

The common ADSP CDU driver now owns those clocks and calculates
the CDU_CFG register address from the CDU output index, so the
legacy definitions and helpers are no longer needed.

Remove the obsolete CDU_CFG register offsets, CDU CLKINSEL and mux
definitions, and the unused cdu_mux() and cdu_gate() helpers from
the common ADI clock header.

Signed-off-by: Qasim Ijaz <Qasim.Ijaz@analog.com>
The SC573 clock controller node currently describes both the Clock
Generation Units and the Clock Distribution Unit as a single controller.
The CGUs and CDU are distinct hardware blocks with separate register
regions and functions.

Describe the CDU as a separate clock controller so it can be managed
by the common ADSP CDU driver.

Remove the CDU register range from the existing clock node and add a
standalone CDU node with the required SYS_CLKIN and CGU input clocks.

Update the CPU, Ethernet, and MMC nodes to consume their CDU output
clocks from the new provider.

Signed-off-by: Qasim Ijaz <Qasim.Ijaz@analog.com>
The SC57X clock ID namespace currently represents each CDU output
as two separate clocks: a _SEL clock for the input mux and a second
clock for the output gate.

A CDU output is controlled by a single CDU_CFG register, with the
SEL field selecting its parent and the EN field controlling the
output gate. The common ADSP CDU driver therefore models each output
as a single CCF clock.

Remove the legacy SC57X CDU mux and gate IDs from the main SC57X clock
namespace and update ADSP_SC57X_CLK_END accordingly.

The CDU outputs are instead exported by the dedicated SC573 CDU
provider using the IDs defined in adi,adsp-sc573-cdu.h.

Signed-off-by: Qasim Ijaz <Qasim.Ijaz@analog.com>
The legacy CDU mux clock registration used a zero rate dummy clock for
grounded ("N/A") mux input clocks.

The common ADSP CDU driver represents only valid parent clocks and no
longer requires the dummy clock.

Remove the unused dummy fixed rate clock registrations from the SC573,
SC589, SC594, and SC598 clock drivers. Keep the existing clock binding
IDs unchanged for now.

Signed-off-by: Qasim Ijaz <Qasim.Ijaz@analog.com>
@qasim-ijaz

qasim-ijaz commented Aug 30, 2026

Copy link
Copy Markdown
Author

v2:

  • clean up checkpatch errors
  • add comments/document CDU LOCK + LWERR bits (ran some experiments to see what they do since HRM doesn't cover them much)

v3:

  • Make commit message wrapping consistent
  • Add per SoC CDU DT binding headers (include/dt-bindings/clock/adi,adsp-sc573-cdu.h, include/dt-bindings/clock/adi,adsp-sc589-cdu.h, etc.)
  • Add the missing ADSP-SC598 CGU0 CCLK1_0 clock
  • Add the "CGUx" to the half rate DT binding clock IDs to make their naming consistent with the other CGU clock IDs
  • Squash the CDU driver Kconfig entry, Makefile entry and driver introduction into a single commit
  • Rename the CDU driver from clk-adi-cdu.c to clk-adsp-cdu.c, following the ADSP SoC naming convention set out by @sipraga
  • Restore private locks in the existing SoC clock drivers and use a separate private lock for the CDU driver
  • Remove the author line from the driver header, leaving the author information in MODULE_AUTHOR
  • Clean up the CDU driver header comments and wrapping
  • Replace "multiplexors" with "multiplexers"
  • Remove the newlines between the DT binding #include's and the remaining #include's in the CDU driver
  • Remove the obsolete CDU helper functions, register definitions and macros from clk.h
  • Sort the CDU OF match table: SC573, SC589, SC594, SC598
  • Change the CDU revision message to dev_dbg() and move the revision read into probe
  • Rename the CDU driver private data from cdu_clk to cdu
  • Replace enum adsp_cdu_en_state with a bool
  • Remove soc_name from the CDU match data
  • Reorder the CDU parent tables to follow the HRM target table ordering and
    group the SoCs in SC573, SC589, SC594, SC598 order
  • Rename rsvd_mask to reserved_mask
  • Rename the binding from adi,sc5xx-cdu.yaml to adi,adsp-cdu.yaml
  • Place the binding changes before the common CDU driver introduction
  • Clean up unnecessary blank lines in the YAML DT example
  • Rename the CDU compatibles to:
    • adi,adsp-sc573-cdu
    • adi,adsp-sc589-cdu
    • adi,adsp-sc594-cdu
    • adi,adsp-sc598-cdu

v4:

  • remove newlines from CDU clock controller DT nodes
  • rename COMMON_CLK_ADI_CDU to COMMON_CLK_ADI_ADSP_CDU
  • reword the SC598 CDU enable commit message
  • remove CONFIG_DEBUG_FS ifdef guards
  • pass struct adsp_cdu_clks directly to adsp_cdu_register()
  • wrap commit messages to 72 chars
  • drop author lines from CDU clock ID headers
  • run dt_binding_check and ensure no errors
  • replace clock-names min/max with true
  • drop CCDU() and use the clock flags argument directly
  • make CLKINSEL writable and register it with its own clk_ops
  • add per CDU_CFG[n] locking + drop locking from get_parent()/is_enabled()
  • restore CLK_SET_RATE_PARENT (until I have got the rate changing support added)
  • add CLK_OPS_PARENT_ENABLE (it seems we don't need this from HW tests but let's be conservative and follow HRM wording)
  • rename the platform driver from clk-adsp-cdu to adsp-cdu
  • generalise adsp_cdu_check_unlocked() since both CDU_CFG[n] and CLKINSEL have a LOCK bit

@qasim-ijaz

Copy link
Copy Markdown
Author

Looks like I need to add SC846 support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

llm review Request a review from a LLM Reviewer

Projects

Status: In Development

Development

Successfully merging this pull request may close these issues.

4 participants