at91rm9200ek.c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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/global_data.h>
  16. #include <asm/mach-types.h>
  17. #include <asm/arch/hardware.h>
  18. #include <asm/arch/at91_pio.h>
  19. #include <asm/arch/at91_common.h>
  20. #include <asm/io.h>
  21. DECLARE_GLOBAL_DATA_PTR;
  22. /* ------------------------------------------------------------------------- */
  23. int board_init(void)
  24. {
  25. at91_pio_t *pio = (at91_pio_t *)AT91_PIO_BASE;
  26. /*
  27. * Correct IRDA resistor problem
  28. * Set PA23_TXD in Output
  29. */
  30. writel(ATMEL_PMX_AA_TXD2, &pio->pioa.oer);
  31. /* arch number of AT91RM9200EK-Board */
  32. gd->bd->bi_arch_number = MACH_TYPE_AT91RM9200EK;
  33. /* adress of boot parameters */
  34. gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
  35. return 0;
  36. }
  37. int board_early_init_f(void)
  38. {
  39. at91_seriald_hw_init();
  40. return 0;
  41. }
  42. int dram_init (void)
  43. {
  44. /* dram_init must store complete ramsize in gd->ram_size */
  45. gd->ram_size = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE,
  46. CONFIG_SYS_SDRAM_SIZE);
  47. return 0;
  48. }
  49. #ifdef CONFIG_DRIVER_AT91EMAC
  50. int board_eth_init(struct bd_info *bis)
  51. {
  52. return at91emac_register(bis, (u32) ATMEL_BASE_EMAC);
  53. }
  54. #endif