pxa_idp.c 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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 <netdev.h>
  34. #include <command.h>
  35. #include <asm/io.h>
  36. DECLARE_GLOBAL_DATA_PTR;
  37. /*
  38. * Miscelaneous platform dependent initialisations
  39. */
  40. int board_init (void)
  41. {
  42. /* memory and cpu-speed are setup before relocation */
  43. /* so we do _nothing_ here */
  44. /* arch number of Lubbock-Board */
  45. gd->bd->bi_arch_number = MACH_TYPE_PXA_IDP;
  46. /* adress of boot parameters */
  47. gd->bd->bi_boot_params = 0xa0000100;
  48. /* turn on serial ports */
  49. *(volatile unsigned int *)(PXA_CS5_PHYS + 0x03C0002c) = 0x13;
  50. /* set PWM for LCD */
  51. /* a value that works is 60Hz, 77% duty cycle */
  52. writel(readl(CKEN) | CKEN0_PWM0, CKEN);
  53. writel(0x3f, PWM_CTRL0);
  54. writel(0x3ff, PWM_PERVAL0);
  55. writel(792, PWM_PWDUTY0);
  56. /* clear reset to AC97 codec */
  57. writel(readl(CKEN) | CKEN2_AC97, CKEN);
  58. writel(GCR_COLD_RST, GCR);
  59. /* enable LCD backlight */
  60. /* *(volatile unsigned int *)(PXA_CS5_PHYS + 0x03C00030) = 0x7; */
  61. /* test display */
  62. /* lcd_puts("This is a test\nTest #2\n"); */
  63. return 0;
  64. }
  65. int board_late_init(void)
  66. {
  67. setenv("stdout", "serial");
  68. setenv("stderr", "serial");
  69. return 0;
  70. }
  71. int dram_init (void)
  72. {
  73. gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
  74. gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
  75. gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
  76. gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
  77. gd->bd->bi_dram[2].start = PHYS_SDRAM_3;
  78. gd->bd->bi_dram[2].size = PHYS_SDRAM_3_SIZE;
  79. gd->bd->bi_dram[3].start = PHYS_SDRAM_4;
  80. gd->bd->bi_dram[3].size = PHYS_SDRAM_4_SIZE;
  81. return 0;
  82. }
  83. #ifdef DEBUG_BLINKC_ENABLE
  84. void delay_c(void)
  85. {
  86. /* reset OSCR to 0 */
  87. writel(0, OSCR);
  88. while (readl(OSCR) > 0x10000)
  89. ;
  90. while (readl(OSCR) < 0xd4000)
  91. ;
  92. }
  93. void blink_c(void)
  94. {
  95. int led_bit = (1<<10);
  96. writel(led_bit, GPDR0);
  97. writel(led_bit, GPCR0);
  98. delay_c();
  99. writel(led_bit, GPSR0);
  100. delay_c();
  101. writel(led_bit, GPCR0);
  102. }
  103. int do_idpcmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
  104. {
  105. printf("IDPCMD started\n");
  106. return 0;
  107. }
  108. U_BOOT_CMD(idpcmd, CONFIG_SYS_MAXARGS, 0, do_idpcmd,
  109. "custom IDP command",
  110. "no args at this time"
  111. );
  112. #endif
  113. #ifdef CONFIG_CMD_NET
  114. int board_eth_init(bd_t *bis)
  115. {
  116. int rc = 0;
  117. #ifdef CONFIG_SMC91111
  118. rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
  119. #endif
  120. return rc;
  121. }
  122. #endif