mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2026-05-23 14:21:32 +01:00
platform: Remove kendryte/k210 platform
The kendryte/k210 platform does not have MMU support in S-mode hence only NOMMU kernel which runs in M-mode can be used on this platform. As of now, there is no clear use-case of supporting OpenSBI for kendryte/k210 platform. Signed-off-by: Anup Patel <anup.patel@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260409045310.2045739-1-anup.patel@oss.qualcomm.com Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
@@ -402,6 +402,5 @@ make I=<install_directory> install_docs
|
|||||||
[Firmware Documentation]: docs/firmware/fw.md
|
[Firmware Documentation]: docs/firmware/fw.md
|
||||||
[Domain Support]: docs/domain_support.md
|
[Domain Support]: docs/domain_support.md
|
||||||
[Doxygen manual]: http://www.doxygen.nl/manual/index.html
|
[Doxygen manual]: http://www.doxygen.nl/manual/index.html
|
||||||
[Kendryte standalone SDK]: https://github.com/kendryte/kendryte-standalone-sdk
|
|
||||||
[third party notices]: ThirdPartyNotices.md
|
[third party notices]: ThirdPartyNotices.md
|
||||||
[reproducible builds]: https://reproducible-builds.org
|
[reproducible builds]: https://reproducible-builds.org
|
||||||
|
|||||||
@@ -18,9 +18,6 @@ OpenSBI currently supports the following virtual and hardware platforms:
|
|||||||
machine. More details on this platform can be found in the file
|
machine. More details on this platform can be found in the file
|
||||||
*[sifive_fu540.md]*.
|
*[sifive_fu540.md]*.
|
||||||
|
|
||||||
* **Kendryte K210 SoC**: Platform support for the Kendryte K210 SoC used on
|
|
||||||
boards such as the Kendryte KD233 or the Sipeed MAIX Dock.
|
|
||||||
|
|
||||||
* **Andes AE350 SoC**: Platform support for the Andes's SoC (AE350). More
|
* **Andes AE350 SoC**: Platform support for the Andes's SoC (AE350). More
|
||||||
details on this platform can be found in the file *[andes-ae350.md]*.
|
details on this platform can be found in the file *[andes-ae350.md]*.
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
# SPDX-License-Identifier: BSD-2-Clause
|
|
||||||
|
|
||||||
config PLATFORM_KENDRYTE_K210
|
|
||||||
bool
|
|
||||||
select FDT
|
|
||||||
select IPI_MSWI
|
|
||||||
select IRQCHIP_PLIC
|
|
||||||
select SERIAL_SIFIVE
|
|
||||||
select TIMER_MTIMER
|
|
||||||
default y
|
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
/*
|
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
|
||||||
*
|
|
||||||
* Copyright (c) 2019 Western Digital Corporation or its affiliates.
|
|
||||||
*
|
|
||||||
* Authors:
|
|
||||||
* Damien Le Moal <damien.lemoal@wdc.com>
|
|
||||||
*/
|
|
||||||
|
|
||||||
/dts-v1/;
|
|
||||||
/ {
|
|
||||||
#address-cells = <2>;
|
|
||||||
#size-cells = <2>;
|
|
||||||
compatible = "kendryte,k210";
|
|
||||||
|
|
||||||
chosen {
|
|
||||||
bootargs = "console=hvc0 earlycon=sbi";
|
|
||||||
};
|
|
||||||
|
|
||||||
cpus {
|
|
||||||
#address-cells = <1>;
|
|
||||||
#size-cells = <0>;
|
|
||||||
cpu0: cpu@0 {
|
|
||||||
device_type = "cpu";
|
|
||||||
clock-frequency = <390000000>;
|
|
||||||
i-cache-size = <32768>;
|
|
||||||
d-cache-size = <32768>;
|
|
||||||
mmu-type = "none";
|
|
||||||
reg = <0>;
|
|
||||||
riscv,isa = "rv64imafdc";
|
|
||||||
status = "okay";
|
|
||||||
cpu0_intc: interrupt-controller {
|
|
||||||
#interrupt-cells = <1>;
|
|
||||||
compatible = "riscv,cpu-intc";
|
|
||||||
interrupt-controller;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
cpu1: cpu@1 {
|
|
||||||
device_type = "cpu";
|
|
||||||
clock-frequency = <390000000>;
|
|
||||||
d-cache-size = <32768>;
|
|
||||||
i-cache-size = <32768>;
|
|
||||||
mmu-type = "none";
|
|
||||||
reg = <1>;
|
|
||||||
riscv,isa = "rv64imafdc";
|
|
||||||
status = "okay";
|
|
||||||
cpu1_intc: interrupt-controller {
|
|
||||||
#interrupt-cells = <1>;
|
|
||||||
compatible = "riscv,cpu-intc";
|
|
||||||
interrupt-controller;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
memory@80000000 {
|
|
||||||
/* Bank 0: 4 MB, Bank 1: 2 MB, AI chip SRAM: 2MB */
|
|
||||||
device_type = "memory";
|
|
||||||
reg = <0x00000000 0x80000000 0x00000000 0x00800000>;
|
|
||||||
};
|
|
||||||
|
|
||||||
plic0: interrupt-controller@C000000 {
|
|
||||||
#interrupt-cells = <1>;
|
|
||||||
compatible = "riscv,plic0";
|
|
||||||
interrupt-controller;
|
|
||||||
interrupts-extended =
|
|
||||||
<&cpu0_intc 11 &cpu0_intc 9
|
|
||||||
&cpu1_intc 11 &cpu1_intc 9>;
|
|
||||||
reg = <0x0 0xc000000 0x0 0x4000000>;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
#
|
|
||||||
# SPDX-License-Identifier: BSD-2-Clause
|
|
||||||
#
|
|
||||||
# Copyright (c) 2019 Western Digital Corporation or its affiliates.
|
|
||||||
#
|
|
||||||
# Authors:
|
|
||||||
# Damien Le Moal <damien.lemoal@wdc.com>
|
|
||||||
#
|
|
||||||
|
|
||||||
# Compiler flags
|
|
||||||
platform-cppflags-y =
|
|
||||||
platform-cflags-y =
|
|
||||||
platform-asflags-y =
|
|
||||||
platform-ldflags-y =
|
|
||||||
|
|
||||||
# Objects to build
|
|
||||||
platform-objs-y += platform.o
|
|
||||||
|
|
||||||
platform-objs-y += k210.o
|
|
||||||
platform-varprefix-k210.o = dt_k210
|
|
||||||
platform-padding-k210.o = 2048
|
|
||||||
|
|
||||||
# Blobs to build
|
|
||||||
FW_PAYLOAD=y
|
|
||||||
FW_PAYLOAD_ALIGN=0x1000
|
|
||||||
@@ -1,176 +0,0 @@
|
|||||||
/*
|
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
|
||||||
*
|
|
||||||
* Copyright (c) 2019 Western Digital Corporation or its affiliates.
|
|
||||||
*
|
|
||||||
* Authors:
|
|
||||||
* Damien Le Moal <damien.lemoal@wdc.com>
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <sbi/riscv_asm.h>
|
|
||||||
#include <sbi/riscv_encoding.h>
|
|
||||||
#include <sbi/sbi_const.h>
|
|
||||||
#include <sbi/sbi_platform.h>
|
|
||||||
#include <sbi/sbi_system.h>
|
|
||||||
#include <sbi_utils/fdt/fdt_helper.h>
|
|
||||||
#include <sbi_utils/fdt/fdt_fixup.h>
|
|
||||||
#include <sbi_utils/ipi/aclint_mswi.h>
|
|
||||||
#include <sbi_utils/irqchip/plic.h>
|
|
||||||
#include <sbi_utils/serial/sifive-uart.h>
|
|
||||||
#include <sbi_utils/timer/aclint_mtimer.h>
|
|
||||||
#include "platform.h"
|
|
||||||
|
|
||||||
extern const char dt_k210_start[];
|
|
||||||
|
|
||||||
unsigned long fw_platform_init(unsigned long arg0, unsigned long arg1,
|
|
||||||
unsigned long arg2, unsigned long arg3,
|
|
||||||
unsigned long arg4)
|
|
||||||
{
|
|
||||||
return (unsigned long)&dt_k210_start[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct plic_data plic = {
|
|
||||||
.unique_id = 0,
|
|
||||||
.addr = K210_PLIC_BASE_ADDR,
|
|
||||||
.size = K210_PLIC_BASE_SIZE,
|
|
||||||
.num_src = K210_PLIC_NUM_SOURCES,
|
|
||||||
.context_map = {
|
|
||||||
[0] = { 0, 1 },
|
|
||||||
[1] = { 2, 3 },
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
static struct aclint_mswi_data mswi = {
|
|
||||||
.addr = K210_ACLINT_MSWI_ADDR,
|
|
||||||
.size = ACLINT_MSWI_SIZE,
|
|
||||||
.first_hartid = 0,
|
|
||||||
.hart_count = K210_HART_COUNT,
|
|
||||||
};
|
|
||||||
|
|
||||||
static struct aclint_mtimer_data mtimer = {
|
|
||||||
.mtime_freq = K210_ACLINT_MTIMER_FREQ,
|
|
||||||
.mtime_addr = K210_ACLINT_MTIMER_ADDR +
|
|
||||||
ACLINT_DEFAULT_MTIME_OFFSET,
|
|
||||||
.mtime_size = ACLINT_DEFAULT_MTIME_SIZE,
|
|
||||||
.mtimecmp_addr = K210_ACLINT_MTIMER_ADDR +
|
|
||||||
ACLINT_DEFAULT_MTIMECMP_OFFSET,
|
|
||||||
.mtimecmp_size = ACLINT_DEFAULT_MTIMECMP_SIZE,
|
|
||||||
.first_hartid = 0,
|
|
||||||
.hart_count = K210_HART_COUNT,
|
|
||||||
.has_64bit_mmio = true,
|
|
||||||
};
|
|
||||||
|
|
||||||
static u32 k210_get_clk_freq(void)
|
|
||||||
{
|
|
||||||
u32 clksel0, pll0;
|
|
||||||
u64 pll0_freq, clkr0, clkf0, clkod0, div;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* If the clock selector is not set, use the base frequency.
|
|
||||||
* Otherwise, use PLL0 frequency with a frequency divisor.
|
|
||||||
*/
|
|
||||||
clksel0 = k210_read_sysreg(K210_CLKSEL0);
|
|
||||||
if (!(clksel0 & 0x1))
|
|
||||||
return K210_CLK0_FREQ;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Get PLL0 frequency:
|
|
||||||
* freq = base frequency * clkf0 / (clkr0 * clkod0)
|
|
||||||
*/
|
|
||||||
pll0 = k210_read_sysreg(K210_PLL0);
|
|
||||||
clkr0 = 1 + (pll0 & 0x0000000f);
|
|
||||||
clkf0 = 1 + ((pll0 & 0x000003f0) >> 4);
|
|
||||||
clkod0 = 1 + ((pll0 & 0x00003c00) >> 10);
|
|
||||||
pll0_freq = clkf0 * K210_CLK0_FREQ / (clkr0 * clkod0);
|
|
||||||
|
|
||||||
/* Get the frequency divisor from the clock selector */
|
|
||||||
div = 2ULL << ((clksel0 & 0x00000006) >> 1);
|
|
||||||
|
|
||||||
return pll0_freq / div;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int k210_system_reset_check(u32 type, u32 reason)
|
|
||||||
{
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void k210_system_reset(u32 type, u32 reason)
|
|
||||||
{
|
|
||||||
u32 val;
|
|
||||||
|
|
||||||
val = k210_read_sysreg(K210_RESET);
|
|
||||||
val |= K210_RESET_MASK;
|
|
||||||
k210_write_sysreg(val, K210_RESET);
|
|
||||||
|
|
||||||
while (1);
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct sbi_system_reset_device k210_reset = {
|
|
||||||
.name = "kendryte_k210_reset",
|
|
||||||
.system_reset_check = k210_system_reset_check,
|
|
||||||
.system_reset = k210_system_reset
|
|
||||||
};
|
|
||||||
|
|
||||||
static int k210_early_init(bool cold_boot)
|
|
||||||
{
|
|
||||||
int rc;
|
|
||||||
|
|
||||||
if (!cold_boot)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
sbi_system_reset_add_device(&k210_reset);
|
|
||||||
|
|
||||||
rc = sifive_uart_init(K210_UART_BASE_ADDR, k210_get_clk_freq(),
|
|
||||||
K210_UART_BAUDRATE);
|
|
||||||
if (rc)
|
|
||||||
return rc;
|
|
||||||
|
|
||||||
return aclint_mswi_cold_init(&mswi);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int k210_final_init(bool cold_boot)
|
|
||||||
{
|
|
||||||
void *fdt;
|
|
||||||
|
|
||||||
if (!cold_boot)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
fdt = fdt_get_address_rw();
|
|
||||||
|
|
||||||
fdt_cpu_fixup(fdt);
|
|
||||||
fdt_fixups(fdt);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int k210_irqchip_init(void)
|
|
||||||
{
|
|
||||||
return plic_cold_irqchip_init(&plic);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int k210_timer_init(void)
|
|
||||||
{
|
|
||||||
return aclint_mtimer_cold_init(&mtimer, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
const struct sbi_platform_operations platform_ops = {
|
|
||||||
.early_init = k210_early_init,
|
|
||||||
|
|
||||||
.final_init = k210_final_init,
|
|
||||||
|
|
||||||
.irqchip_init = k210_irqchip_init,
|
|
||||||
|
|
||||||
.timer_init = k210_timer_init,
|
|
||||||
};
|
|
||||||
|
|
||||||
const struct sbi_platform platform = {
|
|
||||||
.opensbi_version = OPENSBI_VERSION,
|
|
||||||
.platform_version = SBI_PLATFORM_VERSION(0x0, 0x01),
|
|
||||||
.name = "Kendryte K210",
|
|
||||||
.features = 0,
|
|
||||||
.hart_count = K210_HART_COUNT,
|
|
||||||
.hart_stack_size = SBI_PLATFORM_DEFAULT_HART_STACK_SIZE,
|
|
||||||
.heap_size =
|
|
||||||
SBI_PLATFORM_DEFAULT_HEAP_SIZE(K210_HART_COUNT),
|
|
||||||
.platform_ops_addr = (unsigned long)&platform_ops
|
|
||||||
};
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
/*
|
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
|
||||||
*
|
|
||||||
* Copyright (c) 2019 Western Digital Corporation or its affiliates.
|
|
||||||
*
|
|
||||||
* Authors:
|
|
||||||
* Damien Le Moal <damien.lemoal@wdc.com>
|
|
||||||
*/
|
|
||||||
#ifndef _K210_PLATFORM_H_
|
|
||||||
#define _K210_PLATFORM_H_
|
|
||||||
|
|
||||||
#include <sbi/riscv_io.h>
|
|
||||||
|
|
||||||
#define K210_HART_COUNT 2
|
|
||||||
|
|
||||||
#define K210_UART_BAUDRATE 115200
|
|
||||||
#define K210_ACLINT_MTIMER_FREQ 7800000
|
|
||||||
#define K210_CLK0_FREQ 26000000UL
|
|
||||||
#define K210_PLIC_NUM_SOURCES 65
|
|
||||||
|
|
||||||
/* Registers base address */
|
|
||||||
#define K210_SYSCTL_BASE_ADDR 0x50440000ULL
|
|
||||||
#define K210_UART_BASE_ADDR 0x38000000ULL
|
|
||||||
#define K210_CLINT_BASE_ADDR 0x02000000ULL
|
|
||||||
#define K210_ACLINT_MSWI_ADDR \
|
|
||||||
(K210_CLINT_BASE_ADDR + CLINT_MSWI_OFFSET)
|
|
||||||
#define K210_ACLINT_MTIMER_ADDR \
|
|
||||||
(K210_CLINT_BASE_ADDR + CLINT_MTIMER_OFFSET)
|
|
||||||
#define K210_PLIC_BASE_ADDR 0x0C000000ULL
|
|
||||||
#define K210_PLIC_BASE_SIZE (0x200000ULL + (K210_HART_COUNT * 0x1000))
|
|
||||||
|
|
||||||
/* Registers */
|
|
||||||
#define K210_PLL0 0x08
|
|
||||||
#define K210_CLKSEL0 0x20
|
|
||||||
#define K210_RESET 0x30
|
|
||||||
|
|
||||||
/* Register bit masks */
|
|
||||||
#define K210_RESET_MASK 0x01
|
|
||||||
|
|
||||||
static inline u32 k210_read_sysreg(u32 reg)
|
|
||||||
{
|
|
||||||
return readl((volatile void *)(K210_SYSCTL_BASE_ADDR + reg));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void k210_write_sysreg(u32 val, u32 reg)
|
|
||||||
{
|
|
||||||
writel(val, (volatile void *)(K210_SYSCTL_BASE_ADDR + reg));
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* _K210_PLATFORM_H_ */
|
|
||||||
@@ -100,7 +100,6 @@ build_opensbi() {
|
|||||||
64)
|
64)
|
||||||
# Setup 64-bit platform list
|
# Setup 64-bit platform list
|
||||||
BUILD_PLATFORM_SUBDIR+=("nuclei/ux600")
|
BUILD_PLATFORM_SUBDIR+=("nuclei/ux600")
|
||||||
BUILD_PLATFORM_SUBDIR+=("kendryte/k210")
|
|
||||||
BUILD_PLATFORM_SUBDIR+=("generic")
|
BUILD_PLATFORM_SUBDIR+=("generic")
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|||||||
Reference in New Issue
Block a user