board.c 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright 2014 Broadcom Corporation.
  4. */
  5. #include <common.h>
  6. #include <cpu_func.h>
  7. #include <init.h>
  8. #include <net.h>
  9. #include <asm/cache.h>
  10. #include <asm/io.h>
  11. #include <config.h>
  12. #include <netdev.h>
  13. #include <asm/system.h>
  14. #include <asm/iproc-common/armpll.h>
  15. DECLARE_GLOBAL_DATA_PTR;
  16. /*
  17. * board_init - early hardware init
  18. */
  19. int board_init(void)
  20. {
  21. /*
  22. * Address of boot parameters passed to kernel
  23. * Use default offset 0x100
  24. */
  25. gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
  26. return 0;
  27. }
  28. /*
  29. * dram_init - sets u-boot's idea of sdram size
  30. */
  31. int dram_init(void)
  32. {
  33. gd->ram_size = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE,
  34. CONFIG_SYS_SDRAM_SIZE);
  35. return 0;
  36. }
  37. int dram_init_banksize(void)
  38. {
  39. gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
  40. gd->bd->bi_dram[0].size = gd->ram_size;
  41. return 0;
  42. }
  43. int board_early_init_f(void)
  44. {
  45. uint32_t status = 0;
  46. /* Setup PLL if required */
  47. #if defined(CONFIG_ARMCLK)
  48. armpll_config(CONFIG_ARMCLK);
  49. #endif
  50. return status;
  51. }
  52. #ifdef CONFIG_ARMV7_NONSEC
  53. void smp_set_core_boot_addr(unsigned long addr, int corenr)
  54. {
  55. }
  56. void smp_kick_all_cpus(void)
  57. {
  58. }
  59. void smp_waitloop(unsigned previous_address)
  60. {
  61. }
  62. #endif
  63. #ifdef CONFIG_BCM_SF2_ETH
  64. int board_eth_init(struct bd_info *bis)
  65. {
  66. int rc = -1;
  67. printf("Registering BCM sf2 eth\n");
  68. rc = bcm_sf2_eth_register(bis, 0);
  69. return rc;
  70. }
  71. #endif