blob: e4dbe42649057789e7db42f115b9b13cf798bc49 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Scott Branden5a5cb002014-08-11 13:58:25 -07002/*
3 * Copyright 2014 Broadcom Corporation.
Scott Branden5a5cb002014-08-11 13:58:25 -07004 */
5
6#include <common.h>
Simon Glass370382c2019-11-14 12:57:35 -07007#include <cpu_func.h>
Simon Glass8e16b1e2019-12-28 10:45:05 -07008#include <init.h>
Scott Branden5a5cb002014-08-11 13:58:25 -07009#include <asm/io.h>
10#include <config.h>
Jiandong Zheng19b6b692015-07-15 16:28:14 -070011#include <netdev.h>
Scott Branden5a5cb002014-08-11 13:58:25 -070012#include <asm/system.h>
13#include <asm/iproc-common/armpll.h>
14
15DECLARE_GLOBAL_DATA_PTR;
16
17/*
18 * board_init - early hardware init
19 */
20int board_init(void)
21{
22 /*
23 * Address of boot parameters passed to kernel
24 * Use default offset 0x100
25 */
26 gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
27
28 return 0;
29}
30
31/*
32 * dram_init - sets u-boot's idea of sdram size
33 */
34int dram_init(void)
35{
36 gd->ram_size = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE,
37 CONFIG_SYS_SDRAM_SIZE);
38 return 0;
39}
40
Simon Glass2f949c32017-03-31 08:40:32 -060041int dram_init_banksize(void)
Scott Branden5a5cb002014-08-11 13:58:25 -070042{
43 gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
44 gd->bd->bi_dram[0].size = gd->ram_size;
Simon Glass2f949c32017-03-31 08:40:32 -060045
46 return 0;
Scott Branden5a5cb002014-08-11 13:58:25 -070047}
48
49int board_early_init_f(void)
50{
51 uint32_t status = 0;
52
53 /* Setup PLL if required */
54#if defined(CONFIG_ARMCLK)
55 armpll_config(CONFIG_ARMCLK);
56#endif
57
58 return status;
59}
Steve Rae1c5f31c2014-11-11 11:32:18 -080060
Jan Kiszkaac31b5a2015-04-21 07:18:24 +020061#ifdef CONFIG_ARMV7_NONSEC
Steve Rae1c5f31c2014-11-11 11:32:18 -080062void smp_set_core_boot_addr(unsigned long addr, int corenr)
63{
64}
65
66void smp_kick_all_cpus(void)
67{
68}
69
70void smp_waitloop(unsigned previous_address)
71{
72}
73#endif
Jiandong Zheng19b6b692015-07-15 16:28:14 -070074
75#ifdef CONFIG_BCM_SF2_ETH
76int board_eth_init(bd_t *bis)
77{
78 int rc = -1;
79 printf("Registering BCM sf2 eth\n");
80 rc = bcm_sf2_eth_register(bis, 0);
81 return rc;
82}
83#endif