diff options
| author | Anup Patel <anup.patel@oss.qualcomm.com> | 2026-04-09 10:23:10 +0530 |
|---|---|---|
| committer | Anup Patel <anup@brainfault.org> | 2026-05-09 13:05:51 +0530 |
| commit | f34cf05347325515527ea9fdb658cf8063354aea (patch) | |
| tree | 45160a20f4f4fc42904b84e99ce5ed3fa5b33614 /platform | |
| parent | 2d211fe6f9d511cdcce344f1c9c422fe33b5a957 (diff) | |
| download | opensbi-f34cf05347325515527ea9fdb658cf8063354aea.tar.gz opensbi-f34cf05347325515527ea9fdb658cf8063354aea.zip | |
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>
Diffstat (limited to 'platform')
| -rw-r--r-- | platform/kendryte/k210/Kconfig | 10 | ||||
| -rw-r--r-- | platform/kendryte/k210/configs/defconfig | 0 | ||||
| -rw-r--r-- | platform/kendryte/k210/k210.dts | 70 | ||||
| -rw-r--r-- | platform/kendryte/k210/objects.mk | 25 | ||||
| -rw-r--r-- | platform/kendryte/k210/platform.c | 176 | ||||
| -rw-r--r-- | platform/kendryte/k210/platform.h | 50 |
6 files changed, 0 insertions, 331 deletions
diff --git a/platform/kendryte/k210/Kconfig b/platform/kendryte/k210/Kconfig deleted file mode 100644 index 5bf59731..00000000 --- a/platform/kendryte/k210/Kconfig +++ /dev/null @@ -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 diff --git a/platform/kendryte/k210/configs/defconfig b/platform/kendryte/k210/configs/defconfig deleted file mode 100644 index e69de29b..00000000 --- a/platform/kendryte/k210/configs/defconfig +++ /dev/null diff --git a/platform/kendryte/k210/k210.dts b/platform/kendryte/k210/k210.dts deleted file mode 100644 index bcd075bf..00000000 --- a/platform/kendryte/k210/k210.dts +++ /dev/null @@ -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>; - }; -}; diff --git a/platform/kendryte/k210/objects.mk b/platform/kendryte/k210/objects.mk deleted file mode 100644 index efac3d2f..00000000 --- a/platform/kendryte/k210/objects.mk +++ /dev/null @@ -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 diff --git a/platform/kendryte/k210/platform.c b/platform/kendryte/k210/platform.c deleted file mode 100644 index 0b76104c..00000000 --- a/platform/kendryte/k210/platform.c +++ /dev/null @@ -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 -}; diff --git a/platform/kendryte/k210/platform.h b/platform/kendryte/k210/platform.h deleted file mode 100644 index 9417403d..00000000 --- a/platform/kendryte/k210/platform.h +++ /dev/null @@ -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_ */ |
