netstar.c 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. * (C) Copyright 2005 2N TELEKOMUNIKACE, Ladislav Michl
  3. *
  4. * See file CREDITS for list of people who contributed to this
  5. * project.
  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 <i2c.h>
  24. #include <flash.h>
  25. DECLARE_GLOBAL_DATA_PTR;
  26. int board_init(void)
  27. {
  28. /* arch number of NetStar board */
  29. gd->bd->bi_arch_number = MACH_TYPE_NETSTAR;
  30. /* adress of boot parameters */
  31. gd->bd->bi_boot_params = 0x10000100;
  32. return 0;
  33. }
  34. int dram_init(void)
  35. {
  36. gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
  37. gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
  38. /* Take the Ethernet controller out of reset and wait
  39. * for the EEPROM load to complete. */
  40. *((volatile unsigned short *) GPIO_DATA_OUTPUT_REG) |= 0x80;
  41. udelay(10); /* doesn't work before interrupt_init call */
  42. *((volatile unsigned short *) GPIO_DATA_OUTPUT_REG) &= ~0x80;
  43. udelay(500);
  44. return 0;
  45. }
  46. int misc_init_r(void)
  47. {
  48. #if defined(CONFIG_RTC_DS1307)
  49. /* enable trickle charge */
  50. i2c_reg_write(CONFIG_SYS_I2C_RTC_ADDR, 0x10, 0xaa);
  51. #endif
  52. return 0;
  53. }
  54. int board_late_init(void)
  55. {
  56. return 0;
  57. }
  58. #if defined(CONFIG_CMD_FLASH)
  59. ulong board_flash_get_legacy(ulong base, int banknum, flash_info_t * info)
  60. {
  61. if (banknum == 0) { /* AM29LV800 boot flash */
  62. info->portwidth = FLASH_CFI_16BIT;
  63. info->chipwidth = FLASH_CFI_BY16;
  64. info->interface = FLASH_CFI_X16;
  65. return 1;
  66. }
  67. return 0;
  68. }
  69. #endif