cl-som-am57x.c 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Board functions for CompuLab cl_som_am57x board
  4. *
  5. * (C) Copyright 2016 CompuLab, Ltd. http://compulab.co.il/
  6. *
  7. * Author: Dmitry Lifshitz <lifshitz@compulab.co.il>
  8. */
  9. #include <common.h>
  10. #include <palmas.h>
  11. #include <usb.h>
  12. #include <asm/gpio.h>
  13. #include <asm/arch/mmc_host_def.h>
  14. #include <asm/arch/sys_proto.h>
  15. #include "../common/common.h"
  16. #include "../common/eeprom.h"
  17. #include <asm/omap_common.h>
  18. DECLARE_GLOBAL_DATA_PTR;
  19. const struct omap_sysinfo sysinfo = {
  20. "Board: CL-SOM-AM57x\n"
  21. };
  22. int board_init(void)
  23. {
  24. /* Disable PMIC Powerhold feature, DEV_CTRL.DEV_ON = 1 */
  25. palmas_i2c_write_u8(TPS65903X_CHIP_P1, 0xA0, 0x1);
  26. gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
  27. return 0;
  28. }
  29. #ifdef CONFIG_MMC
  30. #define SB_SOM_CD_GPIO 187
  31. #define SB_SOM_WP_GPIO 188
  32. int board_mmc_init(bd_t *bis)
  33. {
  34. int ret0, ret1;
  35. ret0 = omap_mmc_init(0, 0, 0, SB_SOM_CD_GPIO, SB_SOM_WP_GPIO);
  36. if (ret0)
  37. printf("cl-som-am57x: failed to initialize mmc0\n");
  38. ret1 = omap_mmc_init(1, 0, 0, -1, -1);
  39. if (ret1)
  40. printf("cl-som-am57x: failed to initialize mmc1\n");
  41. return ret0 && ret1;
  42. }
  43. #endif /* CONFIG_MMC */
  44. int misc_init_r(void)
  45. {
  46. cl_print_pcb_info();
  47. return 0;
  48. }
  49. u32 get_board_rev(void)
  50. {
  51. return cl_eeprom_get_board_rev(CONFIG_SYS_I2C_EEPROM_BUS);
  52. }
  53. int board_usb_init(int index, enum usb_init_type init)
  54. {
  55. enable_usb_clocks(index);
  56. return 0;
  57. }
  58. int board_usb_cleanup(int index, enum usb_init_type init)
  59. {
  60. disable_usb_clocks(index);
  61. return 0;
  62. }