wpcm450 icon indicating copy to clipboard operation
wpcm450 copied to clipboard

Clock/reset driver

Open neuschaefer opened this issue 4 years ago • 4 comments

Write a driver for the clock controller, which also handles resets.

~~The wiki page also needs a bit more substance.~~


Current issues

  • [x] regression?: a few clocks (such as adcdiv) aren't correctly parented anymore, thus freq=0
    • clk_hw_register_divider_table_parent_data doesn't pass np to __clk_hw_register_divider, but it would be useless anyway, np isn't used there.
    • the pre-platform version of clk-wpcm450 doesn't pass dev to clk_hw_register_divider_table_parent_data etc. because there is not device. That's why fw_name doesn't work.
  • [x] validate platform device conversion
    • clk_parent_data::index doesn't work like I expected, at all

neuschaefer avatar May 13 '21 17:05 neuschaefer

Currently under review on the mailing lists.

neuschaefer avatar Apr 30 '22 07:04 neuschaefer

Did you have a feedback ?

I need it for the mmc0: sdhci@b0007000.

StidOfficial avatar Feb 25 '24 13:02 StidOfficial

I haven't checked back with the mailing lists in a while, sorry. Not sure when I'll get around to it again

Edit (2024-03-10): I've sent another version of the patchset today

neuschaefer avatar Feb 27 '24 23:02 neuschaefer

clk_summary output at https://github.com/neuschaefer/linux/commit/788637d83ef8c8afecfba2f8dad9dfe07627a0a2
                                 enable  prepare  protect                                duty  hardware                            connection
   clock                          count    count    count        rate   accuracy phase  cycle    enable   consumer                         id
---------------------------------------------------------------------------------------------------------------------------------------------
 clock-48mhz                         1       1        0        48000000    0          0     50000      Y   deviceless                      no_connection_id
    pll1                             0       0        0        60000000    0          0     50000      N      deviceless                      no_connection_id
       usbphy                        0       0        0        60000000    0          0     50000      Y         deviceless                      no_connection_id
    pll0                             1       1        0        400000000   0          0     50000      Y      deviceless                      no_connection_id
       cpusel                        2       2        0        400000000   0          0     50000      Y         deviceless                      no_connection_id
          cpu                        2       2        0        200000000   0          0     50000      Y            deviceless                      no_connection_id
             ahb                     1       1        0        100000000   0          0     50000      Y               deviceless                      no_connection_id
                sdio                 0       0        0        100000000   0          0     50000      Y                  deviceless                      no_connection_id
                usb0                 0       0        0        100000000   0          0     50000      N                  deviceless                      no_connection_id
                emc1                 0       0        0        100000000   0          0     50000      N                  deviceless                      no_connection_id
                emc0                 0       0        0        100000000   0          0     50000      N                  deviceless                      no_connection_id
                usb1                 0       0        0        100000000   0          0     50000      N                  deviceless                      no_connection_id
                ahb3                 1       1        0        12500000    0          0     50000      Y                  deviceless                      no_connection_id
                   shm               0       0        0        12500000    0          0     50000      N                     deviceless                      no_connection_id
                   xbus              0       0        0        12500000    0          0     50000      N                     deviceless                      no_connection_id
                   fiu               1       1        0        12500000    0          0     50000      Y                     c8000000.spi-controller         no_connection_id
                                                                                                                             deviceless                      no_connection_id
                apb                  0       0        0        50000000    0          0     50000      Y                  deviceless                      no_connection_id
                   smb1              0       0        0        50000000    0          0     50000      Y                     deviceless                      no_connection_id
                   smb0              0       0        0        50000000    0          0     50000      Y                     deviceless                      no_connection_id
                   sspi              0       0        0        50000000    0          0     50000      Y                     deviceless                      no_connection_id
                   mft1              0       0        0        50000000    0          0     50000      N                     deviceless                      no_connection_id
                   mft0              0       0        0        50000000    0          0     50000      N                     deviceless                      no_connection_id
                   pwm               0       0        0        50000000    0          0     50000      N                     deviceless                      no_connection_id
                   smb5              0       0        0        50000000    0          0     50000      N                     deviceless                      no_connection_id
                   smb4              0       0        0        50000000    0          0     50000      N                     deviceless                      no_connection_id
                   smb3              0       0        0        50000000    0          0     50000      N                     deviceless                      no_connection_id
                   smb2              0       0        0        50000000    0          0     50000      N                     deviceless                      no_connection_id
                   aes               0       0        0        50000000    0          0     50000      N                     deviceless                      no_connection_id
                   peci              0       0        0        50000000    0          0     50000      N                     deviceless                      no_connection_id
                   kcs               0       0        0        50000000    0          0     50000      N                     deviceless                      no_connection_id
 clock-24mhz                         3       3        0        24000000    0          0     50000      Y   b8000100.serial                 no_connection_id
                                                                                                           b8000000.serial                 no_connection_id
                                                                                                           timer@b8001000                  no_connection_id
                                                                                                           deviceless                      no_connection_id
 adcdiv                              0       0        0        0           0          0     50000      Y   deviceless                      no_connection_id
    adc                              0       0        0        0           0          0     50000      Y      deviceless                      no_connection_id
 uartsel                             0       0        0        0           0          0     50000      Y   deviceless                      no_connection_id
    uart                             0       0        0        0           0          0     50000      Y      deviceless                      no_connection_id
       uart1                         0       0        0        0           0          0     50000      Y         deviceless                      no_connection_id
       uart0                         0       0        0        0           0          0     50000      Y         deviceless                      no_connection_id
 clkout                              0       0        0        0           0          0     50000      Y   deviceless                      no_connection_id
 refdiv2                             0       0        0        0           0          0     50000      Y   deviceless                      no_connection_id
    wdt                              0       0        0        0           0          0     50000      Y      deviceless                      no_connection_id
    timer4                           0       0        0        0           0          0     50000      N      deviceless                      no_connection_id
    timer3                           0       0        0        0           0          0     50000      N      deviceless                      no_connection_id
    timer2                           0       0        0        0           0          0     50000      N      deviceless                      no_connection_id
    timer1                           0       0        0        0           0          0     50000      Y      deviceless                      no_connection_id
    timer0                           0       0        0        0           0          0     50000      Y      deviceless                      no_connection_id
    huartsel                         0       0        0        0           0          0     50000      Y      deviceless                      no_connection_id
       huart                         0       0        0        0           0          0     50000      N         deviceless                      no_connection_id

neuschaefer avatar Apr 22 '24 22:04 neuschaefer