board-km_kirkwood.c 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * Copyright 2012 2012 KEYMILE AG, CH-3097 Bern
  3. * Valentin Longchamp <valentin.longchamp@keymile.com>
  4. *
  5. * arch/arm/mach-kirkwood/board-km_kirkwood.c
  6. *
  7. * Keymile km_kirkwood Reference Desing Init for drivers not converted to
  8. * flattened device tree yet.
  9. *
  10. * This file is licensed under the terms of the GNU General Public
  11. * License version 2. This program is licensed "as is" without any
  12. * warranty of any kind, whether express or implied.
  13. */
  14. #include <linux/kernel.h>
  15. #include <linux/init.h>
  16. #include <linux/mv643xx_eth.h>
  17. #include <linux/clk.h>
  18. #include <linux/clk-private.h>
  19. #include "common.h"
  20. #include "mpp.h"
  21. static struct mv643xx_eth_platform_data km_kirkwood_ge00_data = {
  22. .phy_addr = MV643XX_ETH_PHY_ADDR(0),
  23. };
  24. static unsigned int km_kirkwood_mpp_config[] __initdata = {
  25. MPP8_GPIO, /* I2C SDA */
  26. MPP9_GPIO, /* I2C SCL */
  27. 0
  28. };
  29. void __init km_kirkwood_init(void)
  30. {
  31. struct clk *sata_clk;
  32. /*
  33. * Basic setup. Needs to be called early.
  34. */
  35. kirkwood_mpp_conf(km_kirkwood_mpp_config);
  36. /*
  37. * Our variant of kirkwood (integrated in the Bobcat) hangs on accessing
  38. * SATA bits (14-15) of the Clock Gating Control Register. Since these
  39. * devices are also not present in this variant, their clocks get
  40. * disabled because unused when clk_disable_unused() gets called.
  41. * That's why we change the flags to these clocks to CLK_IGNORE_UNUSED
  42. */
  43. sata_clk = clk_get_sys("sata_mv.0", "0");
  44. if (!IS_ERR(sata_clk))
  45. sata_clk->flags |= CLK_IGNORE_UNUSED;
  46. sata_clk = clk_get_sys("sata_mv.0", "1");
  47. if (!IS_ERR(sata_clk))
  48. sata_clk->flags |= CLK_IGNORE_UNUSED;
  49. kirkwood_ehci_init();
  50. kirkwood_ge00_init(&km_kirkwood_ge00_data);
  51. }