board.c 1.3 KB

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