-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
simple description of the riscv softcore DE10Pro setup
- Loading branch information
0 parents
commit c950a88
Showing
4 changed files
with
140 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#LD = riscv64-unknown-elf-ld | ||
LD = ld.lld | ||
LDSCRIPT = script.ld | ||
|
||
all: devicetree.wrapped.elf | ||
|
||
%.dtb: %.dts | ||
dtc $< -O dtb > $@ | ||
|
||
%.wrapped.elf: %.dtb script.ld | ||
$(LD) -o $@ -b binary -m elf64lriscv -T $(LDSCRIPT) $< | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -f *.dtb | ||
rm -f *.wrapped.elf |
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,63 @@ | ||
/dts-v1/; | ||
|
||
/ { | ||
#address-cells = <1>; | ||
#size-cells = <1>; | ||
compatible = "unknown,unknown"; | ||
model = "unknown,unknown"; | ||
chosen { | ||
stdout-path = &ns16550; | ||
}; | ||
cpus { | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
timebase-frequency = <500000>; | ||
CPU0: cpu@0 { | ||
device_type = "cpu"; | ||
reg = <0>; | ||
status = "okay"; | ||
compatible = "riscv"; | ||
riscv,isa = "rv64imafdc"; | ||
mmu-type = "riscv,sv39"; | ||
clock-frequency = <50000000>; | ||
CPU0_intc: interrupt-controller { | ||
#interrupt-cells = <1>; | ||
interrupt-controller; | ||
compatible = "riscv,cpu-intc"; | ||
}; | ||
}; | ||
}; | ||
memory@C0000000 { | ||
device_type = "memory"; | ||
reg = <0xC0000000 0x40000000>; | ||
}; | ||
soc { | ||
#address-cells = <1>; | ||
#size-cells = <1>; | ||
compatible = "simple-bus"; | ||
ranges; | ||
clint@10000000 { | ||
compatible = "riscv,clint0"; | ||
interrupts-extended = <&CPU0_intc 3 &CPU0_intc 7>; | ||
reg = <0x10000000 0x10000>; | ||
}; | ||
plic: interrupt-controller@c000000 { | ||
#interrupt-cells = <1>; | ||
compatible = "riscv,plic0"; | ||
interrupt-controller; | ||
interrupts-extended = <&CPU0_intc 11 &CPU0_intc 9>; | ||
reg = <0xc000000 0x400000>; | ||
reg-names = "control"; | ||
riscv,max-priority = <7>; | ||
riscv,ndev = <16>; | ||
}; | ||
ns16550: uart@62300000 { | ||
current-speed = <115200>; | ||
compatible = "ns16550a"; | ||
interrupts-extended = <&plic 1>; | ||
reg = <0x62300000 0x1000>; | ||
clock-frequency = <50000000>; | ||
reg-shift = <2>; | ||
}; | ||
}; | ||
}; |
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,52 @@ | ||
/dts-v1/; | ||
|
||
/ { | ||
#address-cells = <1>; | ||
#size-cells = <1>; | ||
compatible = "unknown,unknown"; | ||
model = "unknown,unknown"; | ||
cpus { | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
timebase-frequency = <500000>; | ||
CPU0: cpu@0 { | ||
device_type = "cpu"; | ||
reg = <0>; | ||
status = "okay"; | ||
compatible = "riscv"; | ||
riscv,isa = "rv64imafdc"; | ||
mmu-type = "riscv,sv39"; | ||
clock-frequency = <50000000>; | ||
CPU0_intc: interrupt-controller { | ||
#interrupt-cells = <1>; | ||
interrupt-controller; | ||
compatible = "riscv,cpu-intc"; | ||
}; | ||
}; | ||
}; | ||
memory@C0000000 { | ||
device_type = "memory"; | ||
reg = <0xC0000000 0x40000000>; | ||
}; | ||
soc { | ||
#address-cells = <1>; | ||
#size-cells = <1>; | ||
compatible = "simple-bus"; | ||
ranges; | ||
clint@10000000 { | ||
compatible = "riscv,clint0"; | ||
interrupts-extended = <&CPU0_intc 3 &CPU0_intc 7>; | ||
reg = <0x10000000 0x10000>; | ||
}; | ||
plic: interrupt-controller@c000000 { | ||
#interrupt-cells = <1>; | ||
compatible = "riscv,plic0"; | ||
interrupt-controller; | ||
interrupts-extended = <&CPU0_intc 11 &CPU0_intc 9>; | ||
reg = <0xc000000 0x400000>; | ||
reg-names = "control"; | ||
riscv,max-priority = <7>; | ||
riscv,ndev = <16>; | ||
}; | ||
}; | ||
}; |
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,9 @@ | ||
OUTPUT_ARCH( "riscv" ) | ||
/* TARGET( "binary" ) */ | ||
|
||
SECTIONS | ||
{ | ||
. = 0x80000000; | ||
_start = .; | ||
.data : { *(.data) } | ||
} |