This page gives an overview of the Zynq Ultrascale+ MPSoC Clock framework available at drivers/clk/zynqmp/. For CCF to work, PMUFW should be downloaded.
Table of Contents
Table of Contents |
---|
HW IP features
...
- DDR PLL (DPLL): mainly used to generate clocks for the DDR controller.
- APU PLL (APLL): mainly used to generate clocks for the APU.
- RPU PLL (RPLL): mainly used to generate clocks for the RPU.
- I/O PLL (IOPLL): mainly used to generate clocks the peripheral I/Os.
- Video PLL (VPLL): generates clocks for the video blocks used in the PS subsystem.
These PLLs can be used to generate the output clocks. It is recommended that we reserve VPLL for dp_video_ref.
Features Supported in the Driver
- Clock gating
- Clock scaling
Missing features, Known Issues, limitations
- We do not support shared peripherals. (e.g. when the same peripheral is shared between A53 and R5 etc.)
Important AR links
- Recommend to reserve VPLL for dp_video_ref if DP video is used AR - AR-69345
Kernel Configuration
...
theme | Midnight |
---|
...
This page gives an overview of the Zynq Ultrascale+ MPSoC Clock framework available at drivers/clk/zynqmp/. For CCF to work, PMUFW should be downloaded.
Table of Contents
Table of Contents |
---|
HW IP features
- DDR PLL (DPLL): mainly used to generate clocks for the DDR controller.
- APU PLL (APLL): mainly used to generate clocks for the APU.
- RPU PLL (RPLL): mainly used to generate clocks for the RPU.
- I/O PLL (IOPLL): mainly used to generate clocks the peripheral I/Os.
- Video PLL (VPLL): generates clocks for the video blocks used in the PS subsystem.
These PLLs can be used to generate the output clocks. It is recommended that we reserve VPLL for dp_video_ref.
Features Supported in the Driver
- Clock gating
- Clock scaling
Missing features, Known Issues, limitations
- We do not support shared peripherals. (e.g. when the same peripheral is shared between A53 and R5 etc.)
Important AR links
- Recommend to reserve VPLL for dp_video_ref if DP video is used AR - AR-69345
Kernel Configuration
The following config options should be enabled in order to build the ccf driver
CONFIG_COMMON_CLK_ZYNQMP
Code Block | ||
---|---|---|
| ||
Symbol: COMMON_CLK_ZYNQMP [=y] │ │ Type : boolean │ │ Type : boolean │ │ Prompt: Support for Xilinx ZynqMP Ultrascale+ clock controllers │ │ Prompt: Support for Xilinx ZynqMP Ultrascale+ clock controllers │ │ Location: │ │ Location: │ │ -> Device Drivers │ │ -> Device Drivers │ │ (1) -> Common Clock Framework │ │ (1) -> Common Clock Framework │ │ Defined at drivers/clk/zynqmp/Kconfig:1 │ │ Defined at drivers/clk/zynqmp/Kconfig:1 │ │ Depends on: COMMON_CLK [=y] &&&& OF [=y] &&&& (ARCH_ZYNQMP [=y] || COMPILE_TEST [=n]) |
Devicetree (for 2018.1 release)
For more details on clock bindings please refer "Documentation/devicetree/bindings/clock/xlnx,zynqmp-clk.txt"
Code Block | ||
---|---|---|
| ||
clk: clk { u-boot,dm-pre-reloc; #clock-cells = <1>; compatible = "xlnx,zynqmp-clk"; clocks = <&pss_ref_clk>, <&video_clk>, │<&pss_alt_ref_clk>, <&aux_ref_clk>, <>_crx_ref_clk>; │ Depends on: COMMON_CLK [=y] &&&& OF [=y] &&&& (ARCH_ZYNQMP [=y] || COMPILE_TEST [=n]) |
...
clock-names = "pss_ref_clk", "video_clk", "pss_alt_ref_clk", "aux_ref_clk", "gt_crx_ref_clk";
};
|
Devicetree (for 2017.4 and earlier releases)
For more details on clock phy bindings please refer "Documentation/devicetree/bindings/clock/xlnx,zynqmp-clkzynq_mpsoc.txt"
Code Block | ||
---|---|---|
| ||
clkclkc: clkclkc@ff5e0020 { u-boot,dm-pre-reloc; #clock-cells = <1>; compatible = "xlnx,zynqmp-clkclkc"; clocks = <&&pss_ref_clk>, <&&video_clk>, <&&pss_alt_ref_clk>, <&&aux_ref_clk>, <&>_crx_ref_clk>; clock-names = "pss_ref_clk", "video_clk", "pss_alt_ref_clk", "aux_ref_clk", "gt_crx_ref_clk"; }; |
...
" |
...
Code Block | ||
---|---|---|
| ||
clkc: clkc@ff5e0020 { #clock-cells = <1>; compatibleclock-output-names = "xlnx,zynqmp-clkc";iopll", "rpll", "apll", "dpll", clocks = <&&pss_ref_clk>, <&&video_clk>, <&&pss_alt_ref_clk>, <&&aux_ref_clk>, <&>_crx_ref_clk>; "vpll", "iopll_to_fpd", "rpll_to_fpd", "apll_to_lpd", "dpll_to_lpd", clock-names = "pssvpll_ref_clkto_lpd", "acpu", "videoacpu_clkhalf", "pss_alt_ref_clkdbf_fpd", "auxdbf_ref_clklpd", "gt_crx_ref_clk";dbg_trace", clock-output-names = "iopll "dbg_tstmp", "dp_video_ref", "rplldp_audio_ref", "aplldp_stc_ref", "dpllgdma_ref", "vplldpdma_ref", "iopllddr_to_fpdref", "rpllsata_to_fpdref", "apllpcie_to_lpdref", "dpllgpu_to_lpdref", "vpll_to_lpd", "acpu", "acpugpu_pp0_halfref", "dbfgpu_pp1_fpdref", "dbftopsw_lpdmain", "dbgtopsw_tracelsbus", "dbggtgref0_tstmpref", "dplpd_video_refswitch", "dplpd_audio_reflsbus", "dp_stc_ref", "gdmausb0_bus_ref", "dpdmausb1_bus_ref", "ddrusb3_dual_ref", "sata_refusb0", "pcie_refusb1", "gpucpu_refr5", "cpu_r5_core", "gpucsu_pp0_refspb", "gpucsu_pp1_refpll", "topsw_mainpcap", "topswiou_lsbusswitch", "gtgref0gem_tsu_ref", "lpd_switchgem_tsu", "gem0_ref", "lpdgem1_lsbusref", "usb0_busgem2_ref", "gem3_ref", "usb1_bus_refgem0_tx", "gem1_tx", "usb3_dual_refgem2_tx", "gem3_tx", "usb0qspi_ref", "usb1sdio0_ref", "cpusdio1_r5ref", "cpuuart0_r5_coreref", "csuuart1_spbref", "csuspi0_pllref", "pcap", "iou_switchspi1_ref", "gemnand_tsu_ref", "gemi2c0_tsuref", "gem0i2c1_ref", "gem1can0_ref", "gem2can1_ref", "gem3"can0", "can1", "dll_ref", "adma_ref", "timestamp_ref", "ams_ref", "gem0_txpl0", "gem1_txpl1", "gem2_txpl2", "gem3_txpl3", "qspi_ref", "sdio0_ref", "sdio1_ref", "uart0_ref", "uart1_ref", "spi0_ref", "spi1_ref", "nand_ref", "i2c0_ref", "i2c1_ref", "can0_ref", "can1_ref", "can0", "can1", "dll_ref", "adma_ref", "timestamp_ref", "ams_ref", "pl0", "pl1", "pl2", "pl3", "wdt"; }; |
Test Procedure
The following driver use cases is tested.
Mainly clock enable and disable on following drivers
- i2c
- qspi
- sd card
- nand
- uart
- gem
- gpio
- dma
- sata
- apm
...
"wdt";
}; |
Test Procedure
The following driver use cases is tested.
Mainly clock enable and disable on following drivers
- i2c
- qspi
- sd card
- nand
- uart
- gem
- gpio
- dma
- sata
- apm
Data rate change is tested with gem.
Sample expected log is below
Code Block | ||
---|---|---|
| ||
root@Xilinx-ZCU102-2016_2:~# ethtool -s eth0 speed 1000 duplex full
root@Xilinx-ZCU102-2016_2:~# [ 1168.866072] macb ff0e0000.ethernet
eth0: link down
Received IPI Mask:0x00000001
PMUFW: PmMmioRead: (NODE_APU) addr=0xFF5E005C, value=0x6050C00
Received IPI Mask:0x00000001
PMUFW: PmMmioWrite: (NODE_APU) addr=0xFF5E005C, mask=0xFFFFFFFF, value=0x6010C00
Received IPI Mask:0x00000001
PMUFW: PmMmioRead: (NODE_APU) addr=0xFF5E005C, value=0x6010C00
[ 1170.890303] macb ff0e0000.ethernet eth0: link up (1000/Full)
|
Code Block | ||
---|---|---|
| ||
root@Xilinx-ZCU102-2016_2:~# ethtool -s eth0 speed 100010 duplex full root@Xilinx-ZCU102-2016_2:~# [ 11681192.866072898072] macb ff0e0000.ethernet eth0: link down Received IPI Mask:0x00000001 PMUFW: PmMmioRead: (NODE_APU) addr=0xFF5E005C, value=0x6050C000x6010C00 Received IPI Mask:0x00000001 PMUFW: PmMmioWrite: (NODE_APU) addr=0xFF5E005C, mask=0xFFFFFFFF, value=0x6010C000x6320C00 Received IPI Mask:0x00000001 PMUFW: PmMmioRead: (NODE_APU) addr=0xFF5E005C, value=0x6010C000x6320C00 [ 11701195.890303922279] macb ff0e0000.ethernet eth0: link up (1000/Full) | ||
Code Block | ||
| ||
root@Xilinx-ZCU102-2016_2:~# ethtool -s eth0 speed 10 duplex full10/Full) root@Xilinx-ZCU102-2016_2:~# [ 1192.898072] macb ff0e0000.ethernet eth0: link down Received IPI Mask:0x00000001 PMUFW: PmMmioRead: (NODE_APU) addr=0xFF5E005C, value=0x6010C00 Received IPI Mask:0x00000001 PMUFW: PmMmioWrite: (NODE_APU) addr=0xFF5E005C, mask=0xFFFFFFFF, value=0x6320C00 Received IPI Mask:0x00000001 PMUFW: PmMmioRead: (NODE_APU) addr=0xFF5E005C, value=0x6320C00 [ 1195.922279] macb ff0e0000.ethernet eth0: link up (10/Full) root@Xilinx-ZCU102-2016_2:~# |
Debug
View the Clock configuration summary.
Code Block | ||
---|---|---|
| ||
cat /sys/kernel/debug/clk/clk_summary
|
...
Change log
2016.3
Summary:
- Adds basic clock support for zynqmp.
...
- the GEM mux shift values are corrected.
...
- The watchdog source is corrected.
- Since for dp to work it changes the parent rate. We do not support dp sharing the parent (VPLL).A warn is added to check for the same.
- Sets the set rate parent for video clocks.
- Fractional mode support is enabled.
...
- In some cases the second divisor was was getting saturated resulting in some ethernet failures.this is fixed.
...
- Fix the usb mux offset
- Some waning fixes
...
- Remove unused variables
...
- Move MMIO error to debug from warn
- Use SPDX license
- Replace clock driver with new driver which fetches clock information from firmware
...
- clk: zynqmp: Move a warn to debug
- clk: zynqmp: Use SPDX and update author
- clk: zynqmp: Use firmware APIs in clock driver
- clk: zynqmp: Fix reserved parent comparision
...
- None
2018.3
- None
...
Debug
View the Clock configuration summary.
Code Block | ||
---|---|---|
| ||
cat /sys/kernel/debug/clk/clk_summary
|
Porting to CCF
Porting to CCF
Mainline status
It is not mainlined. Has dependency on pm.c.
Change log
2016.3
Summary:
- Adds basic clock support for zynqmp.
Commits:
clk: zynqmp: Add initial ccf clkc support
clk: zynqmp: add mux changes for zynqmp
f5e303d clk: zynqmp: Add zynqmp divider support
8592671 clk: zynqmp: Add zynqmp ultrascale gate support
ea2cd726 clk: zynqmp: Add the pll driver
4d85a2c clk: zynqmp: Fix GEM mux shift values
2016.4
Summary:
- the GEM mux shift values are corrected.
Commits:
clk: zynqmp: Fix GEM mux shift values
2017.1
Summary:
- The watchdog source is corrected.
- Since for dp to work it changes the parent rate. We do not support dp sharing the parent (VPLL).A warn is added to check for the same.
- Sets the set rate parent for video clocks.
- Fractional mode support is enabled.
Commits:
clk: zynqmp: Fix the watchdog clock source
clk: zynqmp: Warn on vpll multiuser conditionally
pll: zynqmp: Add support for pll set rate
clk: zynqmp: Set the needed flags
clk: zynqmp: clkc: Enable CLK_SET_RATE_PARENT for more clocks
clk: Reset the child count
clk: zynqmp: pll: Enable the fractional mode when needed
clk: zynqmp: Prevent un-necessary rounding off
clk: zynqmp: Enhance the prints
2017.2
Summary:
- In some cases the second divisor was was getting saturated resulting in some ethernet failures.this is fixed.
Commits:
clk: zynqmp: Let the frac be decided on the frac capability
2017.3
Summary:
- Fix the usb mux offset
- Some waning fixes
Commits:
clkc: zynqmp: fix the usb mux
zynqmp: Use new firmware.h instead of pm.h
clk: zynqmp: divider: Fix the warnings
clk: zynqmp: Remove variables set but not used
2017.4
Summary:
- Remove unused variables
Commits:
clk: zynqmp: Remove a unused variable
2018.1
Summary:
- Move MMIO error to debug from warn
- Use SPDX license
- Replace clock driver with new driver which fetches clock information from firmware
Commits:
- clk: zynqmp: Move a warn to debug
- clk: zynqmp: Use SPDX and update author
- clk: zynqmp: Use firmware APIs in clock driver
- clk: zynqmp: Fix reserved parent comparision
2018.2
- None
2018.3
- None
2019.1
Summary:
- clk: zynqmp: Extend driver for versal
- clk: zynqmp: fix doc of __zynqmp_clock_get_parents
- clk: zynqmp: Add support for custom type flags
- drivers: Defer probe if firmware is not ready
Commits:
- clk: zynqmp: Extend driver for versal
- clk: zynqmp: fix doc of __zynqmp_clock_get_parents
- clk: zynqmp: Add support for custom type flags
- drivers: clk: Update clock driver to handle clock attribute
2019.2
Summary:
- clk: zynqmp: Add support for clock with CLK_DIVIDER_POWER_OF_TWO flag
- clk: zynqmp: Recalculate bestdiv for DIV2 clock
- clk: zynqmp: Warn user if clock user are more than allowed
Commits:
- clk: zynqmp: Add support for clock with CLK_DIVIDER_POWER_OF_TWO flag
- clk: zynqmp: Recalculate bestdiv for DIV2 clock
- clk: zynqmp: Warn user if clock user are more than allowed
2020.1
Summary:
- clk: zynqmp: Extend driver for versalFix CLK_FRAC bit index
- clk: zynqmp: fix doc of __zynqmp_clock_get_parentsFix missing max_div description in kernel-doc format
- clk: zynqmp: Add support for custom type flags
- drivers: Defer probe if firmware is not ready
...
- clk: zynqmp: Extend driver for versalFix divider2 calculation
- clk: zynqmp: fix memory leak in zynqmp_register_clocks
- drivers: clk: Fix invalid clock name queries
Commits:
- clk: zynqmp: fix doc of __zynqmp_clock_get_parentsFix CLK_FRAC bit index
- clk: zynqmp: Add support for custom type flags
- drivers: clk: Update clock driver to handle clock attribute
2019.2
...
- Fix missing max_div description in kernel-doc format
- clk: zynqmp: Fix divider2 calculation
- clk: zynqmp: Add support for clock with CLK_DIVIDER_POWER_OF_TWO flag
- clk: zynqmp: Recalculate bestdiv for DIV2 clock
- clk: zynqmp: Warn user if clock user are more than allowed
...
- clk: zynqmp: Add support for clock with CLK_DIVIDER_POWER_OF_TWO flag
- clk: zynqmp: Recalculate bestdiv for DIV2 clock
- clk: zynqmp: Warn user if clock user are more than allowed
2020.1
Summary:
- clk: zynqmp: Fix CLK_FRAC bit index
- clk: zynqmp: Fix missing max_div description in kernel-doc format
- clk: zynqmp: Fix divider2 calculation
- clk: zynqmp: fix memory leak in zynqmp_register_clocks
- drivers: clk: Fix invalid clock name queries
...
- clk: zynqmp: Fix CLK_FRAC bit index
- clk: zynqmp: Fix missing max_div description in kernel-doc format
- clk: zynqmp: Fix divider2 calculation
- clk: zynqmp: fix memory leak in zynqmp_register_clocks
- drivers: clk: Fix invalid clock name queries
...
2020.2
Summary:
- clk: zynqmp: Handle divider specific read only flag
- clk: zynqmp: Use firmware specific common clock flags
- clk: zynqmp: Use firmware specific mux clock flags
- clk: zynqmp: Add missing checking of eemi_ops
- clk: zynqmp: Add a check for NULL pointer
- clk: zynqmp: Make zynqmp_clk_get_max_divisor static
- clk: zynqmp: make bestdiv unsigned
Commits:
- clk: zynqmp: Handle divider specific read only flag
- clk: zynqmp: Use firmware specific common clock flags
- clk: zynqmp: Use firmware specific mux clock flags
- clk: zynqmp: Add missing checking of eemi_ops
- clk: zynqmp: Add a check for NULL pointer
- clk: zynqmp: Make zynqmp_clk_get_max_divisor static
- clk: zynqmp: make bestdiv unsigned
2021.1
- None
2021.2
Summary:
- clk: zynqmp: Handle divider specific read only flag: pll: add set_pll_mode to check condition in zynqmp_pll_enable
- clk: zynqmp: Use firmware specific common clock flagsdivider: Align max_div description with mainline
- clk: zynqmp: Use firmware specific mux clock flagsclk: zynqmp: Add missing checking of eemi_opsmove zynqmp_pll_set_mode out of round_rate callback
- clk: zynqmp: Add a check for NULL pointerpll: Remove some dead code
- clk: zynqmp: Make zynqmp_clk_get_max_divisor staticEnable the driver if ZYNQMP_FIRMWARE is selected
- clk: zynqmp: make bestdiv unsignedSync with mainline
Commits:
- clk: zynqmp: Handle divider specific read only flagclk: zynqmp: Use firmware specific common clock flagspll: add set_pll_mode to check condition in zynqmp_pll_enable
- clk: zynqmp: Use firmware specific mux clock flagsdivider: Align max_div description with mainline
- clk: zynqmp: Add missing checking of eemi_opsmove zynqmp_pll_set_mode out of round_rate callback
- clk: zynqmp: Add a check for NULL pointerpll: Remove some dead code
- clk: zynqmp: Make zynqmp_clk_get_max_divisor staticEnable the driver if ZYNQMP_FIRMWARE is selected
- clk: zynqmp: make bestdiv unsigned
2021.1
Related Links
- Linux Drivers
- DTG Common clock framework
- 2017.4 or earlier release clock DTSI
View file name zynqmp-clk.dtsi - 2018.1 DTSI
View file name zynqmp-clk-ccf.dtsi
...