cl-som-am57x.c 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * Board functions for CompuLab cl_som_am57x board
  3. *
  4. * (C) Copyright 2016 CompuLab, Ltd. http://compulab.co.il/
  5. *
  6. * Author: Dmitry Lifshitz <lifshitz@compulab.co.il>
  7. *
  8. * SPDX-License-Identifier: GPL-2.0+
  9. */
  10. #include <common.h>
  11. #include <palmas.h>
  12. #include <usb.h>
  13. #include <asm/gpio.h>
  14. #include <asm/arch/mmc_host_def.h>
  15. #include <asm/arch/sys_proto.h>
  16. #include "../common/common.h"
  17. #include "../common/eeprom.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_GENERIC_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_GENERIC_MMC */
  44. #ifdef CONFIG_USB_XHCI_OMAP
  45. int board_usb_init(int index, enum usb_init_type init)
  46. {
  47. setbits_le32((*prcm)->cm_l3init_usb_otg_ss1_clkctrl,
  48. OTG_SS_CLKCTRL_MODULEMODE_HW | OPTFCLKEN_REFCLK960M);
  49. return 0;
  50. }
  51. #endif /* CONFIG_USB_XHCI_OMAP */
  52. int misc_init_r(void)
  53. {
  54. cl_print_pcb_info();
  55. return 0;
  56. }
  57. u32 get_board_rev(void)
  58. {
  59. return cl_eeprom_get_board_rev(CONFIG_SYS_I2C_EEPROM_BUS);
  60. }