pxa_idp.c 3.2 KB

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