pxa_idp.c 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. /*
  2. * (C) Copyright 2002
  3. * Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net
  4. *
  5. * (C) Copyright 2002
  6. * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
  7. * Marius Groeger <mgroeger@sysgo.de>
  8. *
  9. * (C) Copyright 2004
  10. * BEC Systems <http://bec-systems.com>
  11. * Cliff Brake <cliff.brake@gmail.com>
  12. * Support for Accelent/Vibren PXA255 IDP
  13. *
  14. * See file CREDITS for list of people who contributed to this
  15. * project.
  16. *
  17. * This program is free software; you can redistribute it and/or
  18. * modify it under the terms of the GNU General Public License as
  19. * published by the Free Software Foundation; either version 2 of
  20. * the License, or (at your option) any later version.
  21. *
  22. * This program is distributed in the hope that it will be useful,
  23. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  24. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  25. * GNU General Public License for more details.
  26. *
  27. * You should have received a copy of the GNU General Public License
  28. * along with this program; if not, write to the Free Software
  29. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  30. * MA 02111-1307 USA
  31. */
  32. #include <common.h>
  33. #include <command.h>
  34. DECLARE_GLOBAL_DATA_PTR;
  35. /*
  36. * Miscelaneous platform dependent initialisations
  37. */
  38. int board_init (void)
  39. {
  40. /* memory and cpu-speed are setup before relocation */
  41. /* so we do _nothing_ here */
  42. /* arch number of Lubbock-Board */
  43. gd->bd->bi_arch_number = MACH_TYPE_PXA_IDP;
  44. /* adress of boot parameters */
  45. gd->bd->bi_boot_params = 0xa0000100;
  46. /* turn on serial ports */
  47. *(volatile unsigned int *)(PXA_CS5_PHYS + 0x03C0002c) = 0x13;
  48. /* set PWM for LCD */
  49. /* a value that works is 60Hz, 77% duty cycle */
  50. CKEN |= CKEN0_PWM0;
  51. PWM_CTRL0 = 0x3f;
  52. PWM_PERVAL0 = 0x3ff;
  53. PWM_PWDUTY0 = 792;
  54. /* clear reset to AC97 codec */
  55. CKEN |= CKEN2_AC97;
  56. GCR = GCR_COLD_RST;
  57. /* enable LCD backlight */
  58. /* *(volatile unsigned int *)(PXA_CS5_PHYS + 0x03C00030) = 0x7; */
  59. /* test display */
  60. /* lcd_puts("This is a test\nTest #2\n"); */
  61. return 0;
  62. }
  63. int board_late_init(void)
  64. {
  65. setenv("stdout", "serial");
  66. setenv("stderr", "serial");
  67. return 0;
  68. }
  69. int dram_init (void)
  70. {
  71. gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
  72. gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
  73. gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
  74. gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
  75. gd->bd->bi_dram[2].start = PHYS_SDRAM_3;
  76. gd->bd->bi_dram[2].size = PHYS_SDRAM_3_SIZE;
  77. gd->bd->bi_dram[3].start = PHYS_SDRAM_4;
  78. gd->bd->bi_dram[3].size = PHYS_SDRAM_4_SIZE;
  79. return 0;
  80. }
  81. #ifdef DEBUG_BLINKC_ENABLE
  82. void delay_c(void)
  83. {
  84. /* reset OSCR to 0 */
  85. OSCR = 0;
  86. while(OSCR > 0x10000)
  87. ;
  88. while(OSCR < 0xd4000)
  89. ;
  90. }
  91. void blink_c(void)
  92. {
  93. int led_bit = (1<<10);
  94. GPDR0 = led_bit;
  95. GPCR0 = led_bit;
  96. delay_c();
  97. GPSR0 = led_bit;
  98. delay_c();
  99. GPCR0 = led_bit;
  100. }
  101. int do_idpcmd(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
  102. {
  103. printf("IDPCMD started\n");
  104. return 0;
  105. }
  106. U_BOOT_CMD(idpcmd, CONFIG_SYS_MAXARGS, 0, do_idpcmd,
  107. "custom IDP command",
  108. "no args at this time\n"
  109. );
  110. #endif