board.c 1.3 KB

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