Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame^] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Scott Branden | da1f5ac | 2014-08-11 13:58:25 -0700 | [diff] [blame] | 2 | /* |
| 3 | * Copyright 2014 Broadcom Corporation. |
Scott Branden | da1f5ac | 2014-08-11 13:58:25 -0700 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #include <common.h> |
| 7 | #include <asm/io.h> |
| 8 | #include <config.h> |
Jiandong Zheng | 39d0ce0 | 2015-07-15 16:28:14 -0700 | [diff] [blame] | 9 | #include <netdev.h> |
Scott Branden | da1f5ac | 2014-08-11 13:58:25 -0700 | [diff] [blame] | 10 | #include <asm/system.h> |
| 11 | #include <asm/iproc-common/armpll.h> |
| 12 | |
| 13 | DECLARE_GLOBAL_DATA_PTR; |
| 14 | |
| 15 | /* |
| 16 | * board_init - early hardware init |
| 17 | */ |
| 18 | int board_init(void) |
| 19 | { |
| 20 | /* |
| 21 | * Address of boot parameters passed to kernel |
| 22 | * Use default offset 0x100 |
| 23 | */ |
| 24 | gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; |
| 25 | |
| 26 | return 0; |
| 27 | } |
| 28 | |
| 29 | /* |
| 30 | * dram_init - sets u-boot's idea of sdram size |
| 31 | */ |
| 32 | int dram_init(void) |
| 33 | { |
| 34 | gd->ram_size = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE, |
| 35 | CONFIG_SYS_SDRAM_SIZE); |
| 36 | return 0; |
| 37 | } |
| 38 | |
Simon Glass | 76b00ac | 2017-03-31 08:40:32 -0600 | [diff] [blame] | 39 | int dram_init_banksize(void) |
Scott Branden | da1f5ac | 2014-08-11 13:58:25 -0700 | [diff] [blame] | 40 | { |
| 41 | gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE; |
| 42 | gd->bd->bi_dram[0].size = gd->ram_size; |
Simon Glass | 76b00ac | 2017-03-31 08:40:32 -0600 | [diff] [blame] | 43 | |
| 44 | return 0; |
Scott Branden | da1f5ac | 2014-08-11 13:58:25 -0700 | [diff] [blame] | 45 | } |
| 46 | |
| 47 | int board_early_init_f(void) |
| 48 | { |
| 49 | uint32_t status = 0; |
| 50 | |
| 51 | /* Setup PLL if required */ |
| 52 | #if defined(CONFIG_ARMCLK) |
| 53 | armpll_config(CONFIG_ARMCLK); |
| 54 | #endif |
| 55 | |
| 56 | return status; |
| 57 | } |
Steve Rae | abb1678 | 2014-11-11 11:32:18 -0800 | [diff] [blame] | 58 | |
Jan Kiszka | 104d6fb | 2015-04-21 07:18:24 +0200 | [diff] [blame] | 59 | #ifdef CONFIG_ARMV7_NONSEC |
Steve Rae | abb1678 | 2014-11-11 11:32:18 -0800 | [diff] [blame] | 60 | void smp_set_core_boot_addr(unsigned long addr, int corenr) |
| 61 | { |
| 62 | } |
| 63 | |
| 64 | void smp_kick_all_cpus(void) |
| 65 | { |
| 66 | } |
| 67 | |
| 68 | void smp_waitloop(unsigned previous_address) |
| 69 | { |
| 70 | } |
| 71 | #endif |
Jiandong Zheng | 39d0ce0 | 2015-07-15 16:28:14 -0700 | [diff] [blame] | 72 | |
| 73 | #ifdef CONFIG_BCM_SF2_ETH |
| 74 | int board_eth_init(bd_t *bis) |
| 75 | { |
| 76 | int rc = -1; |
| 77 | printf("Registering BCM sf2 eth\n"); |
| 78 | rc = bcm_sf2_eth_register(bis, 0); |
| 79 | return rc; |
| 80 | } |
| 81 | #endif |