misc.c 969 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * Copyright (C) 2012 Altera Corporation <www.altera.com>
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #include <common.h>
  7. #include <asm/io.h>
  8. #include <miiphy.h>
  9. #include <netdev.h>
  10. DECLARE_GLOBAL_DATA_PTR;
  11. int dram_init(void)
  12. {
  13. gd->ram_size = get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE);
  14. return 0;
  15. }
  16. #if defined(CONFIG_DISPLAY_CPUINFO)
  17. /*
  18. * Print CPU information
  19. */
  20. int print_cpuinfo(void)
  21. {
  22. puts("CPU : Altera SOCFPGA Platform\n");
  23. return 0;
  24. }
  25. #endif
  26. #if defined(CONFIG_SYS_CONSOLE_IS_IN_ENV) && \
  27. defined(CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE)
  28. int overwrite_console(void)
  29. {
  30. return 0;
  31. }
  32. #endif
  33. int misc_init_r(void)
  34. {
  35. return 0;
  36. }
  37. /*
  38. * DesignWare Ethernet initialization
  39. */
  40. int cpu_eth_init(bd_t *bis)
  41. {
  42. #if !defined(CONFIG_SOCFPGA_VIRTUAL_TARGET) && !defined(CONFIG_SPL_BUILD)
  43. /* initialize and register the emac */
  44. return designware_initialize(CONFIG_EMAC_BASE,
  45. CONFIG_PHY_INTERFACE_MODE);
  46. #else
  47. return 0;
  48. #endif
  49. }