forked from u-boot/u-boot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Fixes 7e249bc: ("riscv: Move all SMP related SBI calls to SBI_v01") Move sbi_probe_extension() out of CONFIG_SBI_V01. - SiFive FU540 support SPL.
- Loading branch information
Showing
35 changed files
with
3,037 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# SPDX-License-Identifier: GPL-2.0+ | ||
# | ||
# Copyright (C) 2018, Bin Meng <[email protected]> | ||
|
||
config SIFIVE_FU540 | ||
bool | ||
select ARCH_EARLY_INIT_R | ||
imply CPU | ||
imply CPU_RISCV | ||
imply RISCV_TIMER | ||
imply SIFIVE_CLINT if (RISCV_MMODE || SPL_RISCV_MMODE) | ||
imply CMD_CPU | ||
imply SPL_CPU_SUPPORT | ||
imply SPL_OPENSBI | ||
imply SPL_LOAD_FIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# SPDX-License-Identifier: GPL-2.0+ | ||
# | ||
# Copyright (C) 2020 SiFive, Inc | ||
# Pragnesh Patel <[email protected]> | ||
|
||
ifeq ($(CONFIG_SPL_BUILD),y) | ||
obj-y += spl.o | ||
else | ||
obj-y += dram.o | ||
obj-y += cpu.o | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// SPDX-License-Identifier: GPL-2.0+ | ||
/* | ||
* Copyright (C) 2018, Bin Meng <[email protected]> | ||
*/ | ||
|
||
#include <irq_func.h> | ||
#include <asm/cache.h> | ||
|
||
/* | ||
* cleanup_before_linux() is called just before we call linux | ||
* it prepares the processor for linux | ||
* | ||
* we disable interrupt and caches. | ||
*/ | ||
int cleanup_before_linux(void) | ||
{ | ||
disable_interrupts(); | ||
|
||
cache_flush(); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// SPDX-License-Identifier: GPL-2.0+ | ||
/* | ||
* Copyright (C) 2018, Bin Meng <[email protected]> | ||
*/ | ||
|
||
#include <common.h> | ||
#include <fdtdec.h> | ||
#include <init.h> | ||
#include <linux/sizes.h> | ||
|
||
DECLARE_GLOBAL_DATA_PTR; | ||
|
||
int dram_init(void) | ||
{ | ||
return fdtdec_setup_mem_size_base(); | ||
} | ||
|
||
int dram_init_banksize(void) | ||
{ | ||
return fdtdec_setup_memory_banksize(); | ||
} | ||
|
||
ulong board_get_usable_ram_top(ulong total_size) | ||
{ | ||
#ifdef CONFIG_64BIT | ||
/* | ||
* Ensure that we run from first 4GB so that all | ||
* addresses used by U-Boot are 32bit addresses. | ||
* | ||
* This in-turn ensures that 32bit DMA capable | ||
* devices work fine because DMA mapping APIs will | ||
* provide 32bit DMA addresses only. | ||
*/ | ||
if (gd->ram_top > SZ_4G) | ||
return SZ_4G; | ||
#endif | ||
return gd->ram_top; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// SPDX-License-Identifier: GPL-2.0+ | ||
/* | ||
* Copyright (C) 2020 SiFive, Inc | ||
* Pragnesh Patel <[email protected]> | ||
*/ | ||
|
||
#include <dm.h> | ||
#include <log.h> | ||
|
||
int soc_spl_init(void) | ||
{ | ||
int ret; | ||
struct udevice *dev; | ||
|
||
/* DDR init */ | ||
ret = uclass_get_device(UCLASS_RAM, 0, &dev); | ||
if (ret) { | ||
debug("DRAM init failed: %d\n", ret); | ||
return ret; | ||
} | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,6 +72,7 @@ SECTIONS | |
. = ALIGN(4); | ||
|
||
_end = .; | ||
_image_binary_end = .; | ||
|
||
.bss : { | ||
__bss_start = .; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
// SPDX-License-Identifier: (GPL-2.0 OR MIT) | ||
/* | ||
* (C) Copyright 2019 SiFive, Inc | ||
*/ | ||
|
||
/ { | ||
cpus { | ||
assigned-clocks = <&prci PRCI_CLK_COREPLL>; | ||
assigned-clock-rates = <1000000000>; | ||
u-boot,dm-spl; | ||
cpu0: cpu@0 { | ||
clocks = <&prci PRCI_CLK_COREPLL>; | ||
u-boot,dm-spl; | ||
status = "okay"; | ||
cpu0_intc: interrupt-controller { | ||
u-boot,dm-spl; | ||
}; | ||
}; | ||
cpu1: cpu@1 { | ||
clocks = <&prci PRCI_CLK_COREPLL>; | ||
u-boot,dm-spl; | ||
cpu1_intc: interrupt-controller { | ||
u-boot,dm-spl; | ||
}; | ||
}; | ||
cpu2: cpu@2 { | ||
clocks = <&prci PRCI_CLK_COREPLL>; | ||
u-boot,dm-spl; | ||
cpu2_intc: interrupt-controller { | ||
u-boot,dm-spl; | ||
}; | ||
}; | ||
cpu3: cpu@3 { | ||
clocks = <&prci PRCI_CLK_COREPLL>; | ||
u-boot,dm-spl; | ||
cpu3_intc: interrupt-controller { | ||
u-boot,dm-spl; | ||
}; | ||
}; | ||
cpu4: cpu@4 { | ||
clocks = <&prci PRCI_CLK_COREPLL>; | ||
u-boot,dm-spl; | ||
cpu4_intc: interrupt-controller { | ||
u-boot,dm-spl; | ||
}; | ||
}; | ||
}; | ||
|
||
soc { | ||
u-boot,dm-spl; | ||
otp: otp@10070000 { | ||
compatible = "sifive,fu540-c000-otp"; | ||
reg = <0x0 0x10070000 0x0 0x0FFF>; | ||
fuse-count = <0x1000>; | ||
}; | ||
clint@2000000 { | ||
compatible = "riscv,clint0"; | ||
interrupts-extended = <&cpu0_intc 3 &cpu0_intc 7 &cpu1_intc 3 &cpu1_intc 7 &cpu2_intc 3 &cpu2_intc 7 &cpu3_intc 3 &cpu3_intc 7 &cpu4_intc 3 &cpu4_intc 7>; | ||
reg = <0x0 0x2000000 0x0 0xc0000>; | ||
u-boot,dm-spl; | ||
}; | ||
dmc: dmc@100b0000 { | ||
compatible = "sifive,fu540-c000-ddr"; | ||
reg = <0x0 0x100b0000 0x0 0x0800 | ||
0x0 0x100b2000 0x0 0x2000 | ||
0x0 0x100b8000 0x0 0x0fff>; | ||
clocks = <&prci PRCI_CLK_DDRPLL>; | ||
clock-frequency = <933333324>; | ||
u-boot,dm-spl; | ||
}; | ||
}; | ||
}; | ||
|
||
&prci { | ||
u-boot,dm-spl; | ||
}; | ||
|
||
&uart0 { | ||
u-boot,dm-spl; | ||
}; | ||
|
||
&qspi2 { | ||
u-boot,dm-spl; | ||
}; | ||
|
||
ð0 { | ||
assigned-clocks = <&prci PRCI_CLK_GEMGXLPLL>; | ||
assigned-clock-rates = <125000000>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.