kb9202.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. /*
  25. * Adapted for KwikByte KB920x board from at91rm9200dk.c: 22APR2005
  26. */
  27. #include <common.h>
  28. #include <asm/arch/AT91RM9200.h>
  29. #include <asm/io.h>
  30. #include <netdev.h>
  31. #if defined(CONFIG_DRIVER_ETHER)
  32. #include <at91rm9200_net.h>
  33. #include <lxt971a.h>
  34. #endif
  35. DECLARE_GLOBAL_DATA_PTR;
  36. /*
  37. * Miscelaneous platform dependent initialisations
  38. */
  39. void lowlevel_init(void) {
  40. /* Required by assembly functions - do nothing */
  41. }
  42. int board_init (void)
  43. {
  44. /* Enable Ctrlc */
  45. console_init_f ();
  46. /* memory and cpu-speed are setup before relocation */
  47. /* so we do _nothing_ here */
  48. gd->bd->bi_arch_number = MACH_TYPE_KB9200;
  49. /* adress of boot parameters */
  50. gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
  51. return 0;
  52. }
  53. int dram_init (void)
  54. {
  55. gd->bd->bi_dram[0].start = PHYS_SDRAM;
  56. gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE;
  57. return 0;
  58. }
  59. #ifdef CONFIG_DRIVER_ETHER
  60. #if defined(CONFIG_CMD_NET)
  61. unsigned int lxt972_IsPhyConnected (AT91PS_EMAC p_mac);
  62. UCHAR lxt972_GetLinkSpeed (AT91PS_EMAC p_mac);
  63. UCHAR lxt972_InitPhy (AT91PS_EMAC p_mac);
  64. UCHAR lxt972_AutoNegotiate (AT91PS_EMAC p_mac, int *status);
  65. /*
  66. * Name:
  67. * at91rm9200_GetPhyInterface
  68. * Description:
  69. * Initialise the interface functions to the PHY
  70. * Arguments:
  71. * None
  72. * Return value:
  73. * None
  74. */
  75. void at91rm9200_GetPhyInterface(AT91PS_PhyOps p_phyops)
  76. {
  77. p_phyops->Init = lxt972_InitPhy;
  78. p_phyops->IsPhyConnected = lxt972_IsPhyConnected;
  79. p_phyops->GetLinkSpeed = lxt972_GetLinkSpeed;
  80. p_phyops->AutoNegotiate = lxt972_AutoNegotiate;
  81. }
  82. #endif
  83. #endif /* CONFIG_DRIVER_ETHER */
  84. #ifdef CONFIG_DRIVER_AT91EMAC
  85. int board_eth_init(bd_t *bis)
  86. {
  87. int rc = 0;
  88. rc = at91emac_register(bis, 0);
  89. return rc;
  90. }
  91. #endif