emac.c 588 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. *
  3. * DaVinci EMAC initialization.
  4. *
  5. * (C) Copyright 2011, Ilya Yanok, Emcraft Systems
  6. *
  7. * SPDX-License-Identifier: GPL-2.0+
  8. */
  9. #include <common.h>
  10. #include <netdev.h>
  11. #include <asm/io.h>
  12. #include <asm/arch/am35x_def.h>
  13. /*
  14. * Initializes on-chip ethernet controllers.
  15. * to override, implement board_eth_init()
  16. */
  17. int cpu_eth_init(bd_t *bis)
  18. {
  19. u32 reset;
  20. /* ensure that the module is out of reset */
  21. reset = readl(&am35x_scm_general_regs->ip_sw_reset);
  22. reset &= ~CPGMACSS_SW_RST;
  23. writel(reset, &am35x_scm_general_regs->ip_sw_reset);
  24. return davinci_emac_initialize();
  25. }