Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Scott Branden | 5a5cb00 | 2014-08-11 13:58:25 -0700 | [diff] [blame] | 2 | /* |
| 3 | * Copyright 2014 Broadcom Corporation. |
Scott Branden | 5a5cb00 | 2014-08-11 13:58:25 -0700 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #include <common.h> |
Simon Glass | 370382c | 2019-11-14 12:57:35 -0700 | [diff] [blame^] | 7 | #include <cpu_func.h> |
Scott Branden | 5a5cb00 | 2014-08-11 13:58:25 -0700 | [diff] [blame] | 8 | #include <asm/io.h> |
| 9 | #include <config.h> |
Jiandong Zheng | 19b6b69 | 2015-07-15 16:28:14 -0700 | [diff] [blame] | 10 | #include <netdev.h> |
Scott Branden | 5a5cb00 | 2014-08-11 13:58:25 -0700 | [diff] [blame] | 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 | |
Simon Glass | 2f949c3 | 2017-03-31 08:40:32 -0600 | [diff] [blame] | 40 | int dram_init_banksize(void) |
Scott Branden | 5a5cb00 | 2014-08-11 13:58:25 -0700 | [diff] [blame] | 41 | { |
| 42 | gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE; |
| 43 | gd->bd->bi_dram[0].size = gd->ram_size; |
Simon Glass | 2f949c3 | 2017-03-31 08:40:32 -0600 | [diff] [blame] | 44 | |
| 45 | return 0; |
Scott Branden | 5a5cb00 | 2014-08-11 13:58:25 -0700 | [diff] [blame] | 46 | } |
| 47 | |
| 48 | int board_early_init_f(void) |
| 49 | { |
| 50 | uint32_t status = 0; |
| 51 | |
| 52 | /* Setup PLL if required */ |
| 53 | #if defined(CONFIG_ARMCLK) |
| 54 | armpll_config(CONFIG_ARMCLK); |
| 55 | #endif |
| 56 | |
| 57 | return status; |
| 58 | } |
Steve Rae | 1c5f31c | 2014-11-11 11:32:18 -0800 | [diff] [blame] | 59 | |
Jan Kiszka | ac31b5a | 2015-04-21 07:18:24 +0200 | [diff] [blame] | 60 | #ifdef CONFIG_ARMV7_NONSEC |
Steve Rae | 1c5f31c | 2014-11-11 11:32:18 -0800 | [diff] [blame] | 61 | void smp_set_core_boot_addr(unsigned long addr, int corenr) |
| 62 | { |
| 63 | } |
| 64 | |
| 65 | void smp_kick_all_cpus(void) |
| 66 | { |
| 67 | } |
| 68 | |
| 69 | void smp_waitloop(unsigned previous_address) |
| 70 | { |
| 71 | } |
| 72 | #endif |
Jiandong Zheng | 19b6b69 | 2015-07-15 16:28:14 -0700 | [diff] [blame] | 73 | |
| 74 | #ifdef CONFIG_BCM_SF2_ETH |
| 75 | int board_eth_init(bd_t *bis) |
| 76 | { |
| 77 | int rc = -1; |
| 78 | printf("Registering BCM sf2 eth\n"); |
| 79 | rc = bcm_sf2_eth_register(bis, 0); |
| 80 | return rc; |
| 81 | } |
| 82 | #endif |