at91rm9200ek.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * (C) Copyright 2010 Andreas Bießmann <andreas@biessmann.org>
  4. *
  5. * derived from previous work
  6. *
  7. * (C) Copyright 2002
  8. * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
  9. * Marius Groeger <mgroeger@sysgo.de>
  10. */
  11. #include <common.h>
  12. #include <init.h>
  13. #include <net.h>
  14. #include <netdev.h>
  15. #include <asm/mach-types.h>
  16. #include <asm/arch/hardware.h>
  17. #include <asm/arch/at91_pio.h>
  18. #include <asm/arch/at91_common.h>
  19. #include <asm/io.h>
  20. DECLARE_GLOBAL_DATA_PTR;
  21. /* ------------------------------------------------------------------------- */
  22. int board_init(void)
  23. {
  24. at91_pio_t *pio = (at91_pio_t *)AT91_PIO_BASE;
  25. /*
  26. * Correct IRDA resistor problem
  27. * Set PA23_TXD in Output
  28. */
  29. writel(ATMEL_PMX_AA_TXD2, &pio->pioa.oer);
  30. /* arch number of AT91RM9200EK-Board */
  31. gd->bd->bi_arch_number = MACH_TYPE_AT91RM9200EK;
  32. /* adress of boot parameters */
  33. gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
  34. return 0;
  35. }
  36. int board_early_init_f(void)
  37. {
  38. at91_seriald_hw_init();
  39. return 0;
  40. }
  41. int dram_init (void)
  42. {
  43. /* dram_init must store complete ramsize in gd->ram_size */
  44. gd->ram_size = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE,
  45. CONFIG_SYS_SDRAM_SIZE);
  46. return 0;
  47. }
  48. #ifdef CONFIG_DRIVER_AT91EMAC
  49. int board_eth_init(struct bd_info *bis)
  50. {
  51. return at91emac_register(bis, (u32) ATMEL_BASE_EMAC);
  52. }
  53. #endif