at91rm9200ek.c 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*
  2. * (C) Copyright 2002
  3. * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
  4. * Marius Groeger <mgroeger@sysgo.de>
  5. *
  6. * See file CREDITS for list of people who contributed to this
  7. * project.
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License as
  11. * published by the Free Software Foundation; either version 2 of
  12. * the License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  22. * MA 02111-1307 USA
  23. */
  24. #include <common.h>
  25. #include <exports.h>
  26. #include <netdev.h>
  27. #include <asm/arch/AT91RM9200.h>
  28. #include <asm/io.h>
  29. #if defined(CONFIG_DRIVER_ETHER)
  30. #include <at91rm9200_net.h>
  31. #include <dm9161.h>
  32. #endif
  33. DECLARE_GLOBAL_DATA_PTR;
  34. /* ------------------------------------------------------------------------- */
  35. /*
  36. * Miscelaneous platform dependent initialisations
  37. */
  38. int board_init (void)
  39. {
  40. /* Enable Ctrlc */
  41. console_init_f ();
  42. /*
  43. * Correct IRDA resistor problem
  44. * Set PA23_TXD in Output
  45. */
  46. writel(AT91C_PA23_TXD2, ((AT91PS_PIO) AT91C_BASE_PIOA)->PIO_OER);
  47. /*
  48. * memory and cpu-speed are setup before relocation
  49. * so we do _nothing_ here
  50. */
  51. /* arch number of AT91RM9200EK-Board */
  52. gd->bd->bi_arch_number = MACH_TYPE_AT91RM9200EK;
  53. /* adress of boot parameters */
  54. gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
  55. return 0;
  56. }
  57. int dram_init (void)
  58. {
  59. gd->bd->bi_dram[0].start = PHYS_SDRAM;
  60. gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE;
  61. return 0;
  62. }
  63. #if defined(CONFIG_DRIVER_ETHER) && defined(CONFIG_CMD_NET)
  64. /*
  65. * Name:
  66. * at91rm9200_GetPhyInterface
  67. * Description:
  68. * Initialise the interface functions to the PHY
  69. * Arguments:
  70. * None
  71. * Return value:
  72. * None
  73. */
  74. void at91rm9200_GetPhyInterface(AT91PS_PhyOps p_phyops)
  75. {
  76. p_phyops->Init = dm9161_InitPhy;
  77. p_phyops->IsPhyConnected = dm9161_IsPhyConnected;
  78. p_phyops->GetLinkSpeed = dm9161_GetLinkSpeed;
  79. p_phyops->AutoNegotiate = dm9161_AutoNegotiate;
  80. }
  81. #endif
  82. #ifdef CONFIG_DRIVER_AT91EMAC
  83. int board_eth_init(bd_t *bis)
  84. {
  85. int rc = 0;
  86. rc = at91emac_register(bis, 0);
  87. return rc;
  88. }
  89. #endif