common.c 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * arch/arm/mach-tegra/board-harmony.c
  3. *
  4. * Copyright (C) 2010 Google, Inc.
  5. *
  6. * Author:
  7. * Colin Cross <ccross@android.com>
  8. *
  9. * This software is licensed under the terms of the GNU General Public
  10. * License version 2, as published by the Free Software Foundation, and
  11. * may be copied, distributed, and modified under those terms.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. */
  19. #include <linux/init.h>
  20. #include <linux/io.h>
  21. #include <linux/clk.h>
  22. #include <linux/delay.h>
  23. #include <asm/hardware/cache-l2x0.h>
  24. #include <mach/iomap.h>
  25. #include <mach/dma.h>
  26. #include "board.h"
  27. #include "clock.h"
  28. #include "fuse.h"
  29. static __initdata struct tegra_clk_init_table common_clk_init_table[] = {
  30. /* name parent rate enabled */
  31. { "clk_m", NULL, 0, true },
  32. { "pll_p", "clk_m", 216000000, true },
  33. { "pll_p_out1", "pll_p", 28800000, true },
  34. { "pll_p_out2", "pll_p", 48000000, true },
  35. { "pll_p_out3", "pll_p", 72000000, true },
  36. { "pll_p_out4", "pll_p", 108000000, true },
  37. { "sclk", "pll_p_out4", 108000000, true },
  38. { "hclk", "sclk", 108000000, true },
  39. { "pclk", "hclk", 54000000, true },
  40. { NULL, NULL, 0, 0},
  41. };
  42. void __init tegra_init_cache(void)
  43. {
  44. #ifdef CONFIG_CACHE_L2X0
  45. void __iomem *p = IO_ADDRESS(TEGRA_ARM_PERIF_BASE) + 0x3000;
  46. writel(0x331, p + L2X0_TAG_LATENCY_CTRL);
  47. writel(0x441, p + L2X0_DATA_LATENCY_CTRL);
  48. l2x0_init(p, 0x6C080001, 0x8200c3fe);
  49. #endif
  50. }
  51. void __init tegra_common_init(void)
  52. {
  53. tegra_init_fuse();
  54. tegra_init_clock();
  55. tegra_clk_init_from_table(common_clk_init_table);
  56. tegra_init_cache();
  57. #ifdef CONFIG_TEGRA_SYSTEM_DMA
  58. tegra_dma_init();
  59. #endif
  60. }