icore_mx8mp.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (C) 2016 Engicam S.r.l.
  4. * Copyright (C) 2022 Amarula Solutions(India)
  5. *
  6. * Authors:
  7. * Manoj Sai <abbaraju.manojsai@amarulasolutions.com>
  8. * Jagan Teki <jagan@amarulasolutions.com>
  9. */
  10. #include <common.h>
  11. #include <env.h>
  12. #include <errno.h>
  13. #include <init.h>
  14. #include <miiphy.h>
  15. #include <netdev.h>
  16. #include <linux/delay.h>
  17. #include <asm/global_data.h>
  18. #include <asm/mach-imx/iomux-v3.h>
  19. #include <asm-generic/gpio.h>
  20. #include <asm/arch/imx8mp_pins.h>
  21. #include <asm/arch/clock.h>
  22. #include <asm/arch/sys_proto.h>
  23. #include <asm/mach-imx/gpio.h>
  24. DECLARE_GLOBAL_DATA_PTR;
  25. static void setup_fec(void)
  26. {
  27. struct iomuxc_gpr_base_regs *gpr =
  28. (struct iomuxc_gpr_base_regs *)IOMUXC_GPR_BASE_ADDR;
  29. /* Enable RGMII TX clk output */
  30. setbits_le32(&gpr->gpr[1], BIT(22));
  31. }
  32. #if CONFIG_IS_ENABLED(NET)
  33. int board_phy_config(struct phy_device *phydev)
  34. {
  35. if (phydev->drv->config)
  36. phydev->drv->config(phydev);
  37. return 0;
  38. }
  39. #endif
  40. int board_init(void)
  41. {
  42. if (IS_ENABLED(CONFIG_FEC_MXC))
  43. setup_fec();
  44. return 0;
  45. }
  46. int board_late_init(void)
  47. {
  48. return 0;
  49. }