board.c 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * board.c
  3. *
  4. * Common board functions for AM33XX based boards
  5. *
  6. * Copyright (C) 2011, Texas Instruments, Incorporated - http://www.ti.com/
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR /PURPOSE. See the
  16. * GNU General Public License for more details.
  17. */
  18. #include <common.h>
  19. #include <errno.h>
  20. #include <spl.h>
  21. #include <asm/arch/cpu.h>
  22. #include <asm/arch/hardware.h>
  23. #include <asm/arch/omap.h>
  24. #include <asm/arch/ddr_defs.h>
  25. #include <asm/arch/clock.h>
  26. #include <asm/arch/gpio.h>
  27. #include <asm/arch/mem.h>
  28. #include <asm/arch/mmc_host_def.h>
  29. #include <asm/arch/sys_proto.h>
  30. #include <asm/io.h>
  31. #include <asm/emif.h>
  32. #include <asm/gpio.h>
  33. #include <i2c.h>
  34. #include <miiphy.h>
  35. #include <cpsw.h>
  36. DECLARE_GLOBAL_DATA_PTR;
  37. static const struct gpio_bank gpio_bank_am33xx[4] = {
  38. { (void *)AM33XX_GPIO0_BASE, METHOD_GPIO_24XX },
  39. { (void *)AM33XX_GPIO1_BASE, METHOD_GPIO_24XX },
  40. { (void *)AM33XX_GPIO2_BASE, METHOD_GPIO_24XX },
  41. { (void *)AM33XX_GPIO3_BASE, METHOD_GPIO_24XX },
  42. };
  43. const struct gpio_bank *const omap_gpio_bank = gpio_bank_am33xx;
  44. #if defined(CONFIG_OMAP_HSMMC) && !defined(CONFIG_SPL_BUILD)
  45. int cpu_mmc_init(bd_t *bis)
  46. {
  47. int ret;
  48. ret = omap_mmc_init(0, 0, 0);
  49. if (ret)
  50. return ret;
  51. return omap_mmc_init(1, 0, 0);
  52. }
  53. #endif
  54. void setup_clocks_for_console(void)
  55. {
  56. /* Not yet implemented */
  57. return;
  58. }