clk-uniphier-peri.c 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * Copyright (C) 2016 Socionext Inc.
  3. * Author: Masahiro Yamada <yamada.masahiro@socionext.com>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. */
  15. #include "clk-uniphier.h"
  16. #define UNIPHIER_PERI_CLK_UART(idx, ch) \
  17. UNIPHIER_CLK_GATE("uart" #ch, (idx), "uart", 0x24, 19 + (ch))
  18. #define UNIPHIER_PERI_CLK_I2C_COMMON \
  19. UNIPHIER_CLK_GATE("i2c-common", -1, "i2c", 0x20, 1)
  20. #define UNIPHIER_PERI_CLK_I2C(idx, ch) \
  21. UNIPHIER_CLK_GATE("i2c" #ch, (idx), "i2c-common", 0x24, 5 + (ch))
  22. #define UNIPHIER_PERI_CLK_FI2C(idx, ch) \
  23. UNIPHIER_CLK_GATE("i2c" #ch, (idx), "i2c", 0x24, 24 + (ch))
  24. const struct uniphier_clk_data uniphier_ld4_peri_clk_data[] = {
  25. UNIPHIER_PERI_CLK_UART(0, 0),
  26. UNIPHIER_PERI_CLK_UART(1, 1),
  27. UNIPHIER_PERI_CLK_UART(2, 2),
  28. UNIPHIER_PERI_CLK_UART(3, 3),
  29. UNIPHIER_PERI_CLK_I2C_COMMON,
  30. UNIPHIER_PERI_CLK_I2C(4, 0),
  31. UNIPHIER_PERI_CLK_I2C(5, 1),
  32. UNIPHIER_PERI_CLK_I2C(6, 2),
  33. UNIPHIER_PERI_CLK_I2C(7, 3),
  34. UNIPHIER_PERI_CLK_I2C(8, 4),
  35. { /* sentinel */ }
  36. };
  37. const struct uniphier_clk_data uniphier_pro4_peri_clk_data[] = {
  38. UNIPHIER_PERI_CLK_UART(0, 0),
  39. UNIPHIER_PERI_CLK_UART(1, 1),
  40. UNIPHIER_PERI_CLK_UART(2, 2),
  41. UNIPHIER_PERI_CLK_UART(3, 3),
  42. UNIPHIER_PERI_CLK_FI2C(4, 0),
  43. UNIPHIER_PERI_CLK_FI2C(5, 1),
  44. UNIPHIER_PERI_CLK_FI2C(6, 2),
  45. UNIPHIER_PERI_CLK_FI2C(7, 3),
  46. UNIPHIER_PERI_CLK_FI2C(8, 4),
  47. UNIPHIER_PERI_CLK_FI2C(9, 5),
  48. UNIPHIER_PERI_CLK_FI2C(10, 6),
  49. { /* sentinel */ }
  50. };