diff options
author | Angelos Mouzakitis <a.mouzakitis@virtualopensystems.com> | 2023-10-10 14:33:42 +0000 |
---|---|---|
committer | Angelos Mouzakitis <a.mouzakitis@virtualopensystems.com> | 2023-10-10 14:33:42 +0000 |
commit | af1a266670d040d2f4083ff309d732d648afba2a (patch) | |
tree | 2fc46203448ddcc6f81546d379abfaeb323575e9 /roms/opensbi/platform/kendryte/k210/platform.h | |
parent | e02cda008591317b1625707ff8e115a4841aa889 (diff) |
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'roms/opensbi/platform/kendryte/k210/platform.h')
-rw-r--r-- | roms/opensbi/platform/kendryte/k210/platform.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/roms/opensbi/platform/kendryte/k210/platform.h b/roms/opensbi/platform/kendryte/k210/platform.h new file mode 100644 index 000000000..5269bc4fd --- /dev/null +++ b/roms/opensbi/platform/kendryte/k210/platform.h @@ -0,0 +1,36 @@ +/* + * 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_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_PLIC_BASE_ADDR 0x0C000000ULL + +/* Registers */ +#define K210_PLL0 0x08 +#define K210_CLKSEL0 0x20 + +static inline u32 k210_read_sysreg(u32 reg) +{ + return readl((volatile void *)(K210_SYSCTL_BASE_ADDR + reg)); +} + +#endif /* _K210_PLATFORM_H_ */ |