0301-xrx200-add-gphy-clk-src-device-tree-binding.patch 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. From 5502ef9d40ab20b2ac683660d1565a7c4968bcc8 Mon Sep 17 00:00:00 2001
  2. From: Mathias Kresin <[email protected]>
  3. Date: Mon, 2 May 2016 18:50:00 +0000
  4. Subject: [PATCH] xrx200: add gphy clk src device tree binding
  5. Signed-off-by: Mathias Kresin <[email protected]>
  6. ---
  7. arch/mips/lantiq/xway/sysctrl.c | 16 ++++++++++++++++
  8. 1 file changed, 16 insertions(+)
  9. --- a/arch/mips/lantiq/xway/sysctrl.c
  10. +++ b/arch/mips/lantiq/xway/sysctrl.c
  11. @@ -440,6 +440,20 @@ static void clkdev_add_clkout(void)
  12. }
  13. }
  14. +static void set_phy_clock_source(struct device_node *np_cgu)
  15. +{
  16. + u32 phy_clk_src, ifcc;
  17. +
  18. + if (!np_cgu)
  19. + return;
  20. +
  21. + if (of_property_read_u32(np_cgu, "lantiq,phy-clk-src", &phy_clk_src))
  22. + return;
  23. +
  24. + ifcc = ltq_cgu_r32(ifccr) & ~(0x1c);
  25. + ltq_cgu_w32(ifcc | (phy_clk_src << 2), ifccr);
  26. +}
  27. +
  28. /* bring up all register ranges that we need for basic system control */
  29. void __init ltq_soc_init(void)
  30. {
  31. @@ -605,4 +619,6 @@ void __init ltq_soc_init(void)
  32. clkdev_add_pmu("1e100400.serial", NULL, 1, 0, PMU_ASC0);
  33. }
  34. usb_set_clock();
  35. +
  36. + set_phy_clock_source(np_cgu);
  37. }