1 /* 2 * Copyright 2014 Broadcom Corporation. 3 * 4 * SPDX-License-Identifier: GPL-2.0+ 5 */ 6 7 #include <common.h> 8 #include <asm/io.h> 9 #include <config.h> 10 #include <netdev.h> 11 #include <asm/system.h> 12 #include <asm/iproc-common/armpll.h> 13 14 DECLARE_GLOBAL_DATA_PTR; 15 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 27 return 0; 28 } 29 30 /* 31 * dram_init - sets u-boot's idea of sdram size 32 */ 33 int dram_init(void) 34 { 35 gd->ram_size = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE, 36 CONFIG_SYS_SDRAM_SIZE); 37 return 0; 38 } 39 40 void dram_init_banksize(void) 41 { 42 gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE; 43 gd->bd->bi_dram[0].size = gd->ram_size; 44 } 45 46 int board_early_init_f(void) 47 { 48 uint32_t status = 0; 49 50 /* Setup PLL if required */ 51 #if defined(CONFIG_ARMCLK) 52 armpll_config(CONFIG_ARMCLK); 53 #endif 54 55 return status; 56 } 57 58 #ifdef CONFIG_ARMV7_NONSEC 59 void smp_set_core_boot_addr(unsigned long addr, int corenr) 60 { 61 } 62 63 void smp_kick_all_cpus(void) 64 { 65 } 66 67 void smp_waitloop(unsigned previous_address) 68 { 69 } 70 #endif 71 72 #ifdef CONFIG_BCM_SF2_ETH 73 int board_eth_init(bd_t *bis) 74 { 75 int rc = -1; 76 printf("Registering BCM sf2 eth\n"); 77 rc = bcm_sf2_eth_register(bis, 0); 78 return rc; 79 } 80 #endif 81