mirror of
https://github.com/riscv-software-src/opensbi
synced 2025-11-01 12:38:26 +00:00
Since we can get the PLMT base address and timer frequency from
device tree, move plmt timer device to fdt timer framework.
dts example (Quad-core AX45MP):
cpus {
...
timebase-frequency = <0x3938700>;
...
}
soc {
...
plmt0@e6000000 {
compatible = "andestech,plmt0";
reg = <0x00 0xe6000000 0x00 0x100000>;
interrupts-extended = <&cpu0_intc 0x07
&cpu1_intc 0x07
&cpu2_intc 0x07
&cpu3_intc 0x07>;
};
...
}
Signed-off-by: Yu Chien Peter Lin <peterlin@andestech.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
30 lines
635 B
C
30 lines
635 B
C
/*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*
|
|
* Copyright (c) 2022 Andes Technology Corporation
|
|
*
|
|
* Authors:
|
|
* Zong Li <zong@andestech.com>
|
|
* Nylon Chen <nylon7@andestech.com>
|
|
* Yu Chien Peter Lin <peterlin@andestech.com>
|
|
*/
|
|
|
|
#ifndef __TIMER_ANDES_PLMT_H__
|
|
#define __TIMER_ANDES_PLMT_H__
|
|
|
|
#define DEFAULT_AE350_PLMT_FREQ 60000000
|
|
#define PLMT_REGION_ALIGN 0x1000
|
|
|
|
struct plmt_data {
|
|
u32 hart_count;
|
|
unsigned long size;
|
|
unsigned long timer_freq;
|
|
volatile u64 *time_val;
|
|
volatile u64 *time_cmp;
|
|
};
|
|
|
|
int plmt_cold_timer_init(struct plmt_data *plmt);
|
|
int plmt_warm_timer_init(void);
|
|
|
|
#endif /* __TIMER_ANDES_PLMT_H__ */
|