Commit 0865805d authored by Quentin Schulz's avatar Quentin Schulz Committed by Stephen Boyd

clk: at91: add audio pll clock drivers

This new clock driver set allows to have a fractional divided clock that
would generate a precise clock particularly suitable for audio
applications.

The main audio pll clock has two children clocks: one that is connected
to the PMC, the other that can directly drive a pad. As these two routes
have different enable bits and different dividers and divider formulas,
they are handled by two different drivers. Each of them could modify the
rate of the main audio pll parent.

The main audio pll clock can output 620MHz to 700MHz.
Signed-off-by: default avatarNicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: default avatarQuentin Schulz <quentin.schulz@free-electrons.com>
Acked-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
parent 33202fa3
...@@ -26,6 +26,7 @@ config SOC_SAMA5D2 ...@@ -26,6 +26,7 @@ config SOC_SAMA5D2
select HAVE_AT91_USB_CLK select HAVE_AT91_USB_CLK
select HAVE_AT91_H32MX select HAVE_AT91_H32MX
select HAVE_AT91_GENERATED_CLK select HAVE_AT91_GENERATED_CLK
select HAVE_AT91_AUDIO_PLL
select PINCTRL_AT91PIO4 select PINCTRL_AT91PIO4
help help
Select this if ou are using one of Atmel's SAMA5D2 family SoC. Select this if ou are using one of Atmel's SAMA5D2 family SoC.
...@@ -125,6 +126,9 @@ config HAVE_AT91_H32MX ...@@ -125,6 +126,9 @@ config HAVE_AT91_H32MX
config HAVE_AT91_GENERATED_CLK config HAVE_AT91_GENERATED_CLK
bool bool
config HAVE_AT91_AUDIO_PLL
bool
config SOC_SAM_V4_V5 config SOC_SAM_V4_V5
bool bool
......
...@@ -6,6 +6,7 @@ obj-y += pmc.o sckc.o ...@@ -6,6 +6,7 @@ obj-y += pmc.o sckc.o
obj-y += clk-slow.o clk-main.o clk-pll.o clk-plldiv.o clk-master.o obj-y += clk-slow.o clk-main.o clk-pll.o clk-plldiv.o clk-master.o
obj-y += clk-system.o clk-peripheral.o clk-programmable.o obj-y += clk-system.o clk-peripheral.o clk-programmable.o
obj-$(CONFIG_HAVE_AT91_AUDIO_PLL) += clk-audio-pll.o
obj-$(CONFIG_HAVE_AT91_UTMI) += clk-utmi.o obj-$(CONFIG_HAVE_AT91_UTMI) += clk-utmi.o
obj-$(CONFIG_HAVE_AT91_USB_CLK) += clk-usb.o obj-$(CONFIG_HAVE_AT91_USB_CLK) += clk-usb.o
obj-$(CONFIG_HAVE_AT91_SMD) += clk-smd.o obj-$(CONFIG_HAVE_AT91_SMD) += clk-smd.o
......
This diff is collapsed.
...@@ -185,4 +185,29 @@ ...@@ -185,4 +185,29 @@
#define AT91_PMC_PCR_EN (0x1 << 28) /* Enable */ #define AT91_PMC_PCR_EN (0x1 << 28) /* Enable */
#define AT91_PMC_PCR_GCKEN (0x1 << 29) /* GCK Enable */ #define AT91_PMC_PCR_GCKEN (0x1 << 29) /* GCK Enable */
#define AT91_PMC_AUDIO_PLL0 0x14c
#define AT91_PMC_AUDIO_PLL_PLLEN (1 << 0)
#define AT91_PMC_AUDIO_PLL_PADEN (1 << 1)
#define AT91_PMC_AUDIO_PLL_PMCEN (1 << 2)
#define AT91_PMC_AUDIO_PLL_RESETN (1 << 3)
#define AT91_PMC_AUDIO_PLL_ND_OFFSET 8
#define AT91_PMC_AUDIO_PLL_ND_MASK (0x7f << AT91_PMC_AUDIO_PLL_ND_OFFSET)
#define AT91_PMC_AUDIO_PLL_ND(n) ((n) << AT91_PMC_AUDIO_PLL_ND_OFFSET)
#define AT91_PMC_AUDIO_PLL_QDPMC_OFFSET 16
#define AT91_PMC_AUDIO_PLL_QDPMC_MASK (0x7f << AT91_PMC_AUDIO_PLL_QDPMC_OFFSET)
#define AT91_PMC_AUDIO_PLL_QDPMC(n) ((n) << AT91_PMC_AUDIO_PLL_QDPMC_OFFSET)
#define AT91_PMC_AUDIO_PLL1 0x150
#define AT91_PMC_AUDIO_PLL_FRACR_MASK 0x3fffff
#define AT91_PMC_AUDIO_PLL_QDPAD_OFFSET 24
#define AT91_PMC_AUDIO_PLL_QDPAD_MASK (0x7f << AT91_PMC_AUDIO_PLL_QDPAD_OFFSET)
#define AT91_PMC_AUDIO_PLL_QDPAD(n) ((n) << AT91_PMC_AUDIO_PLL_QDPAD_OFFSET)
#define AT91_PMC_AUDIO_PLL_QDPAD_DIV_OFFSET AT91_PMC_AUDIO_PLL_QDPAD_OFFSET
#define AT91_PMC_AUDIO_PLL_QDPAD_DIV_MASK (0x3 << AT91_PMC_AUDIO_PLL_QDPAD_DIV_OFFSET)
#define AT91_PMC_AUDIO_PLL_QDPAD_DIV(n) ((n) << AT91_PMC_AUDIO_PLL_QDPAD_DIV_OFFSET)
#define AT91_PMC_AUDIO_PLL_QDPAD_EXTDIV_OFFSET 26
#define AT91_PMC_AUDIO_PLL_QDPAD_EXTDIV_MAX 0x1f
#define AT91_PMC_AUDIO_PLL_QDPAD_EXTDIV_MASK (AT91_PMC_AUDIO_PLL_QDPAD_EXTDIV_MAX << AT91_PMC_AUDIO_PLL_QDPAD_EXTDIV_OFFSET)
#define AT91_PMC_AUDIO_PLL_QDPAD_EXTDIV(n) ((n) << AT91_PMC_AUDIO_PLL_QDPAD_EXTDIV_OFFSET)
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment