conxs.c 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. /*
  2. * (C) Copyright 2007
  3. * Stefano Babic, DENX Gmbh, sbabic@denx.de
  4. *
  5. * (C) Copyright 2004
  6. * Robert Whaley, Applied Data Systems, Inc. rwhaley@applieddata.net
  7. *
  8. * (C) Copyright 2002
  9. * Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net
  10. *
  11. * (C) Copyright 2002
  12. * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
  13. * Marius Groeger <mgroeger@sysgo.de>
  14. *
  15. * See file CREDITS for list of people who contributed to this
  16. * project.
  17. *
  18. * This program is free software; you can redistribute it and/or
  19. * modify it under the terms of the GNU General Public License as
  20. * published by the Free Software Foundation; either version 2 of
  21. * the License, or (at your option) any later version.
  22. *
  23. * This program is distributed in the hope that it will be useful,
  24. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  25. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  26. * GNU General Public License for more details.
  27. *
  28. * You should have received a copy of the GNU General Public License
  29. * along with this program; if not, write to the Free Software
  30. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  31. * MA 02111-1307 USA
  32. */
  33. #include <common.h>
  34. #include <asm/arch/pxa-regs.h>
  35. DECLARE_GLOBAL_DATA_PTR;
  36. #define RH_A_PSM (1 << 8) /* power switching mode */
  37. #define RH_A_NPS (1 << 9) /* no power switching */
  38. extern struct serial_device serial_ffuart_device;
  39. extern struct serial_device serial_btuart_device;
  40. extern struct serial_device serial_stuart_device;
  41. /* ------------------------------------------------------------------------- */
  42. /*
  43. * Miscelaneous platform dependent initialisations
  44. */
  45. void usb_board_init(void)
  46. {
  47. UHCHR = (UHCHR | UHCHR_PCPL | UHCHR_PSPL) &
  48. ~(UHCHR_SSEP0 | UHCHR_SSEP1 | UHCHR_SSEP2 | UHCHR_SSE);
  49. UHCHR |= UHCHR_FSBIR;
  50. while (UHCHR & UHCHR_FSBIR);
  51. UHCHR &= ~UHCHR_SSE;
  52. UHCHIE = (UHCHIE_UPRIE | UHCHIE_RWIE);
  53. /* Clear any OTG Pin Hold */
  54. if (PSSR & PSSR_OTGPH)
  55. PSSR |= PSSR_OTGPH;
  56. UHCRHDA &= ~(RH_A_NPS);
  57. UHCRHDA |= RH_A_PSM;
  58. /* Set port power control mask bits, only 3 ports. */
  59. UHCRHDB |= (0x7<<17);
  60. }
  61. void usb_board_init_fail(void)
  62. {
  63. return;
  64. }
  65. void usb_board_stop(void)
  66. {
  67. UHCHR |= UHCHR_FHR;
  68. udelay(11);
  69. UHCHR &= ~UHCHR_FHR;
  70. UHCCOMS |= 1;
  71. udelay(10);
  72. CKEN &= ~CKEN10_USBHOST;
  73. puts("Called USB STOP\n");
  74. return;
  75. }
  76. int board_init (void)
  77. {
  78. /* memory and cpu-speed are setup before relocation */
  79. /* so we do _nothing_ here */
  80. /* arch number of ConXS Board */
  81. gd->bd->bi_arch_number = 776;
  82. /* adress of boot parameters */
  83. gd->bd->bi_boot_params = 0xa000003c;
  84. return 0;
  85. }
  86. int board_late_init(void)
  87. {
  88. #if defined(CONFIG_SERIAL_MULTI)
  89. char *console=getenv("boot_console");
  90. if ((strcmp(console,"serial_btuart") == 0) ||
  91. (strcmp(console,"serial_stuart") == 0) ||
  92. (strcmp(console,"serial_ffuart") == 0)) {
  93. setenv("stdout",console);
  94. setenv("stdin", console);
  95. setenv("stderr",console);
  96. } else {
  97. setenv("stdout", "serial");
  98. setenv("stdin", "serial");
  99. setenv("stderr", "serial");
  100. }
  101. #endif
  102. return 0;
  103. }
  104. struct serial_device *default_serial_console (void)
  105. {
  106. return &serial_ffuart_device;
  107. }
  108. int dram_init (void)
  109. {
  110. gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
  111. gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
  112. gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
  113. gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
  114. gd->bd->bi_dram[2].start = PHYS_SDRAM_3;
  115. gd->bd->bi_dram[2].size = PHYS_SDRAM_3_SIZE;
  116. gd->bd->bi_dram[3].start = PHYS_SDRAM_4;
  117. gd->bd->bi_dram[3].size = PHYS_SDRAM_4_SIZE;
  118. return 0;
  119. }