-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Add support for SOPHGO SoCs and Milk-V boards #69594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
8c393e3
53cbe69
4d620e7
ae4c85c
9375f68
354af7e
b9eda39
5f0b7a7
34255cb
175cfcc
c448c20
fd967a4
2e00e82
ddc6fad
4788d88
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
/* | ||
* Copyright (c) 2024 Chen Xingyu <[email protected]> | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include <mem.h> | ||
#include <freq.h> | ||
|
||
#include <sophgo/cv18xx-c906-common.dtsi> | ||
|
||
/ { | ||
soc { | ||
compatible = "sophgo,cv181x", "simple-bus"; | ||
|
||
gpioa: gpio@3020000 { | ||
compatible = "snps,designware-gpio"; | ||
reg = <0x3020000 DT_SIZE_K(4)>; | ||
interrupts = <41 1>; | ||
gpio-controller; | ||
#gpio-cells = <2>; | ||
status = "disabled"; | ||
}; | ||
|
||
gpiob: gpio@3021000 { | ||
compatible = "snps,designware-gpio"; | ||
reg = <0x3021000 DT_SIZE_K(4)>; | ||
interrupts = <42 1>; | ||
gpio-controller; | ||
#gpio-cells = <2>; | ||
status = "disabled"; | ||
}; | ||
|
||
gpioc: gpio@3022000 { | ||
compatible = "snps,designware-gpio"; | ||
reg = <0x3022000 DT_SIZE_K(4)>; | ||
interrupts = <43 1>; | ||
gpio-controller; | ||
#gpio-cells = <2>; | ||
status = "disabled"; | ||
}; | ||
|
||
gpiod: gpio@3023000 { | ||
compatible = "snps,designware-gpio"; | ||
reg = <0x3023000 DT_SIZE_K(4)>; | ||
interrupts = <44 1>; | ||
gpio-controller; | ||
#gpio-cells = <2>; | ||
status = "disabled"; | ||
}; | ||
|
||
uart0: uart@4140000 { | ||
compatible = "ns16550"; | ||
reg = <0x4140000 DT_SIZE_K(64)>; | ||
interrupts = <30 1>; | ||
reg-shift = <2>; | ||
clock-frequency = <DT_FREQ_M(25)>; | ||
status = "disabled"; | ||
}; | ||
|
||
uart1: uart@4150000 { | ||
compatible = "ns16550"; | ||
reg = <0x4150000 DT_SIZE_K(64)>; | ||
interrupts = <31 1>; | ||
reg-shift = <2>; | ||
clock-frequency = <DT_FREQ_M(25)>; | ||
status = "disabled"; | ||
}; | ||
|
||
uart2: uart@4160000 { | ||
compatible = "ns16550"; | ||
reg = <0x4160000 DT_SIZE_K(64)>; | ||
/* interrupt is not supported */ | ||
reg-shift = <2>; | ||
clock-frequency = <DT_FREQ_M(25)>; | ||
status = "disabled"; | ||
}; | ||
|
||
uart3: uart@4170000 { | ||
compatible = "ns16550"; | ||
reg = <0x4170000 DT_SIZE_K(64)>; | ||
/* interrupt is not supported */ | ||
reg-shift = <2>; | ||
clock-frequency = <DT_FREQ_M(25)>; | ||
status = "disabled"; | ||
}; | ||
|
||
uart4: uart@41c0000 { | ||
compatible = "ns16550"; | ||
reg = <0x41c0000 DT_SIZE_K(64)>; | ||
/* interrupt is not supported */ | ||
reg-shift = <2>; | ||
clock-frequency = <DT_FREQ_M(25)>; | ||
status = "disabled"; | ||
}; | ||
|
||
pwr_gpio: gpio@5021000 { | ||
compatible = "snps,designware-gpio"; | ||
reg = <0x5021000 DT_SIZE_K(4)>; | ||
interrupts = <48 1>; | ||
gpio-controller; | ||
#gpio-cells = <2>; | ||
status = "disabled"; | ||
}; | ||
}; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/riscv/common/linker.ld CACHE INTERNAL "") |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright (c) 2024 Chen Xingyu <[email protected]> | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
config SOC_SERIES_CV181X | ||
select 64BIT | ||
select RISCV | ||
select RISCV_PRIVILEGED | ||
select RISCV_ISA_RV64I | ||
select RISCV_ISA_EXT_M | ||
select RISCV_ISA_EXT_A | ||
select RISCV_ISA_EXT_F | ||
select RISCV_ISA_EXT_D | ||
select RISCV_ISA_EXT_C | ||
select RISCV_ISA_EXT_ZICSR | ||
select RISCV_ISA_EXT_ZIFENCEI | ||
select RISCV_SOC_HAS_GP_RELATIVE_ADDRESSING | ||
select INCLUDE_RESET_VECTOR | ||
select ATOMIC_OPERATIONS_C |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Copyright (c) 2024 Chen Xingyu <[email protected]> | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
if SOC_SERIES_CV181X | ||
|
||
config SYS_CLOCK_HW_CYCLES_PER_SEC | ||
default 25000000 | ||
|
||
config NUM_IRQS | ||
int | ||
default 128 | ||
Comment on lines
+6
to
+11
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. as above There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not fixed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the comment here refers to a point above about removing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you need to be very specific, above here, at least for me is the DTS comment above. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's above that, and shows the same thing as this #69594 (comment) |
||
|
||
config RISCV_SOC_INTERRUPT_INIT | ||
default y | ||
|
||
config RISCV_HAS_PLIC | ||
default y | ||
|
||
config 2ND_LVL_INTR_00_OFFSET | ||
default 11 | ||
|
||
endif # SOC_SERIES_CV181X |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright (c) 2024 Chen Xingyu <[email protected]> | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
config SOC_SERIES_CV181X | ||
bool | ||
select SOC_FAMILY_SOPHGO | ||
|
||
config SOC_SERIES | ||
default "cv181x" if SOC_SERIES_CV181X | ||
|
||
config SOC_SG2000 | ||
bool | ||
select SOC_SERIES_CV181X | ||
|
||
config SOC_SG2002 | ||
bool | ||
select SOC_SERIES_CV181X | ||
|
||
config SOC | ||
default "sg2000" if SOC_SG2000 | ||
default "sg2002" if SOC_SG2002 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as above