board.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. void 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. }
  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