bluestone.c 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /*
  2. * Bluestone board support
  3. *
  4. * Copyright (c) 2010, Applied Micro Circuits Corporation
  5. * Author: Tirumala R Marri <tmarri@apm.com>
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License as
  9. * published by the Free Software Foundation; either version 2 of
  10. * the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  20. * MA 02111-1307 USA
  21. */
  22. #include <common.h>
  23. #include <asm/apm821xx.h>
  24. #include <libfdt.h>
  25. #include <fdt_support.h>
  26. #include <i2c.h>
  27. #include <asm/processor.h>
  28. #include <asm/io.h>
  29. #include <asm/mmu.h>
  30. #include <asm/ppc4xx-gpio.h>
  31. int board_early_init_f(void)
  32. {
  33. /*
  34. * Setup the interrupt controller polarities, triggers, etc.
  35. */
  36. mtdcr(UIC0SR, 0xffffffff); /* clear all */
  37. mtdcr(UIC0ER, 0x00000000); /* disable all */
  38. mtdcr(UIC0CR, 0x00000005); /* ATI & UIC1 crit are critical */
  39. mtdcr(UIC0PR, 0xffffffff); /* per ref-board manual */
  40. mtdcr(UIC0TR, 0x00000000); /* per ref-board manual */
  41. mtdcr(UIC0VR, 0x00000000); /* int31 highest, base=0x000 */
  42. mtdcr(UIC0SR, 0xffffffff); /* clear all */
  43. mtdcr(UIC1SR, 0xffffffff); /* clear all */
  44. mtdcr(UIC1ER, 0x00000000); /* disable all */
  45. mtdcr(UIC1CR, 0x00000000); /* all non-critical */
  46. mtdcr(UIC1PR, 0xffffffff); /* per ref-board manual */
  47. mtdcr(UIC1TR, 0x00000000); /* per ref-board manual */
  48. mtdcr(UIC1VR, 0x00000000); /* int31 highest, base=0x000 */
  49. mtdcr(UIC1SR, 0xffffffff); /* clear all */
  50. mtdcr(UIC2SR, 0xffffffff); /* clear all */
  51. mtdcr(UIC2ER, 0x00000000); /* disable all */
  52. mtdcr(UIC2CR, 0x00000000); /* all non-critical */
  53. mtdcr(UIC2PR, 0xffffffff); /* per ref-board manual */
  54. mtdcr(UIC2TR, 0x00000000); /* per ref-board manual */
  55. mtdcr(UIC2VR, 0x00000000); /* int31 highest, base=0x000 */
  56. mtdcr(UIC2SR, 0xffffffff); /* clear all */
  57. mtdcr(UIC3SR, 0xffffffff); /* clear all */
  58. mtdcr(UIC3ER, 0x00000000); /* disable all */
  59. mtdcr(UIC3CR, 0x00000000); /* all non-critical */
  60. mtdcr(UIC3PR, 0xffffffff); /* per ref-board manual */
  61. mtdcr(UIC3TR, 0x00000000); /* per ref-board manual */
  62. mtdcr(UIC3VR, 0x00000000); /* int31 highest, base=0x000 */
  63. mtdcr(UIC3SR, 0xffffffff); /* clear all */
  64. /*
  65. * Configure PFC (Pin Function Control) registers
  66. * UART0: 2 pins
  67. */
  68. mtsdr(SDR0_PFC1, 0x0000000);
  69. return 0;
  70. }
  71. int checkboard(void)
  72. {
  73. char buf[64];
  74. int i = getenv_f("serial#", buf, sizeof(buf));
  75. puts("Board: Bluestone Evaluation Board");
  76. if (i > 0) {
  77. puts(", serial# ");
  78. puts(buf);
  79. }
  80. putc('\n');
  81. return 0;
  82. }
  83. int misc_init_r(void)
  84. {
  85. u32 sdr0_srst1 = 0;
  86. /* Setup PLB4-AHB bridge based on the system address map */
  87. mtdcr(AHB_TOP, 0x8000004B);
  88. mtdcr(AHB_BOT, 0x8000004B);
  89. /*
  90. * The AHB Bridge core is held in reset after power-on or reset
  91. * so enable it now
  92. */
  93. mfsdr(SDR0_SRST1, sdr0_srst1);
  94. sdr0_srst1 &= ~SDR0_SRST1_AHB;
  95. mtsdr(SDR0_SRST1, sdr0_srst1);
  96. return 0;
  97. }