Skip to content

Commit

Permalink
Merge tag 'meson-clk-5.2' of https://github.com/BayLibre/clk-meson in…
Browse files Browse the repository at this point in the history
…to clk-meson

Pull Amlogic Meson clk driver updates from Neil Armstrong:

 - Adds VPU and Video Decoder clocks on Meson8b
 - Finally remove the wrong ABP Meson8b clock id
 - Adds Video Decoder, PCIe PLL & CPU Clocks on G12A
 - Re-expose SAR_ADC_SEL and CTS_OSCIN on G12A AO clock controller
 - Un-expose some AXG-Audio input clocks IDs

* tag 'meson-clk-5.2' of https://github.com/BayLibre/clk-meson:
  clk: meson: meson8b: add the video decoder clock trees
  clk: meson: meson8b: add the VPU clock trees
  clk: meson: meson8b: add support for the GP_PLL clock on Meson8m2
  clk: meson: meson8b: use a separate clock table for Meson8m2
  clk: meson-g12a: add video decoder clocks
  clk: meson-g12a: add PCIE PLL clocks
  clk: meson-pll: add reduced specific clk_ops for G12A PCIe PLL
  clk: meson: g12a: add cpu clocks
  dt-bindings: clock: meson8b: export the video decoder clocks
  dt-bindings: clock: meson8b: export the VPU clock
  dt-bindings: clock: g12a-aoclk: expose CLKID_AO_CTS_OSCIN
  dt-bindings: clock: meson8b: drop the "ABP" clock definition
  dt-bindings: clk: g12a-clkc: add VDEC clock IDs
  dt-bindings: clock: axg-audio: unexpose controller inputs
  dt-bindings: clk: g12a-clkc: add PCIE PLL clock ID
  clk: g12a-aoclk: re-export CLKID_AO_SAR_ADC_SEL clock id
  clk: meson-g12a: add cpu clock bindings
  • Loading branch information
Stephen Boyd committed Apr 10, 2019
2 parents 9e98c67 + 90751f6 commit bc840f3
Showing 12 changed files with 1,479 additions and 26 deletions.
20 changes: 20 additions & 0 deletions drivers/clk/meson/axg-audio.h
Original file line number Diff line number Diff line change
@@ -60,6 +60,26 @@
#define AUD_CLKID_MST5 6
#define AUD_CLKID_MST6 7
#define AUD_CLKID_MST7 8
#define AUD_CLKID_SLV_SCLK0 9
#define AUD_CLKID_SLV_SCLK1 10
#define AUD_CLKID_SLV_SCLK2 11
#define AUD_CLKID_SLV_SCLK3 12
#define AUD_CLKID_SLV_SCLK4 13
#define AUD_CLKID_SLV_SCLK5 14
#define AUD_CLKID_SLV_SCLK6 15
#define AUD_CLKID_SLV_SCLK7 16
#define AUD_CLKID_SLV_SCLK8 17
#define AUD_CLKID_SLV_SCLK9 18
#define AUD_CLKID_SLV_LRCLK0 19
#define AUD_CLKID_SLV_LRCLK1 20
#define AUD_CLKID_SLV_LRCLK2 21
#define AUD_CLKID_SLV_LRCLK3 22
#define AUD_CLKID_SLV_LRCLK4 23
#define AUD_CLKID_SLV_LRCLK5 24
#define AUD_CLKID_SLV_LRCLK6 25
#define AUD_CLKID_SLV_LRCLK7 26
#define AUD_CLKID_SLV_LRCLK8 27
#define AUD_CLKID_SLV_LRCLK9 28
#define AUD_CLKID_MST_A_MCLK_SEL 59
#define AUD_CLKID_MST_B_MCLK_SEL 60
#define AUD_CLKID_MST_C_MCLK_SEL 61
26 changes: 26 additions & 0 deletions drivers/clk/meson/clk-pll.c
Original file line number Diff line number Diff line change
@@ -303,6 +303,16 @@ static int meson_clk_pll_is_enabled(struct clk_hw *hw)
return 1;
}

static int meson_clk_pcie_pll_enable(struct clk_hw *hw)
{
meson_clk_pll_init(hw);

if (meson_clk_pll_wait_lock(hw))
return -EIO;

return 0;
}

static int meson_clk_pll_enable(struct clk_hw *hw)
{
struct clk_regmap *clk = to_clk_regmap(hw);
@@ -387,6 +397,22 @@ static int meson_clk_pll_set_rate(struct clk_hw *hw, unsigned long rate,
return 0;
}

/*
* The Meson G12A PCIE PLL is fined tuned to deliver a very precise
* 100MHz reference clock for the PCIe Analog PHY, and thus requires
* a strict register sequence to enable the PLL.
* To simplify, re-use the _init() op to enable the PLL and keep
* the other ops except set_rate since the rate is fixed.
*/
const struct clk_ops meson_clk_pcie_pll_ops = {
.recalc_rate = meson_clk_pll_recalc_rate,
.round_rate = meson_clk_pll_round_rate,
.is_enabled = meson_clk_pll_is_enabled,
.enable = meson_clk_pcie_pll_enable,
.disable = meson_clk_pll_disable
};
EXPORT_SYMBOL_GPL(meson_clk_pcie_pll_ops);

const struct clk_ops meson_clk_pll_ops = {
.init = meson_clk_pll_init,
.recalc_rate = meson_clk_pll_recalc_rate,
1 change: 1 addition & 0 deletions drivers/clk/meson/clk-pll.h
Original file line number Diff line number Diff line change
@@ -45,5 +45,6 @@ struct meson_clk_pll_data {

extern const struct clk_ops meson_clk_pll_ro_ops;
extern const struct clk_ops meson_clk_pll_ops;
extern const struct clk_ops meson_clk_pcie_pll_ops;

#endif /* __MESON_CLK_PLL_H */
2 changes: 0 additions & 2 deletions drivers/clk/meson/g12a-aoclk.h
Original file line number Diff line number Diff line change
@@ -16,9 +16,7 @@
* to expose, such as the internal muxes and dividers of composite clocks,
* will remain defined here.
*/
#define CLKID_AO_SAR_ADC_SEL 16
#define CLKID_AO_SAR_ADC_DIV 17
#define CLKID_AO_CTS_OSCIN 19
#define CLKID_AO_32K_PRE 20
#define CLKID_AO_32K_DIV 21
#define CLKID_AO_32K_SEL 22
Loading

0 comments on commit bc840f3

Please sign in to comment.