mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-24 23:41:23 +01:00

The timer driver subsystem does not need any extra data, so it can use `struct fdt_driver` directly. The generic fdt_timer_init() performs a best-effort initialization of all matching DT nodes. Signed-off-by: Samuel Holland <samuel.holland@sifive.com> Reviewed-by: Anup Patel <anup@brainfault.org>
26 lines
645 B
C
26 lines
645 B
C
/*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*
|
|
* Copyright (c) 2020 Western Digital Corporation or its affiliates.
|
|
*
|
|
* Authors:
|
|
* Anup Patel <anup.patel@wdc.com>
|
|
*/
|
|
|
|
#include <sbi/sbi_error.h>
|
|
#include <sbi/sbi_scratch.h>
|
|
#include <sbi_utils/fdt/fdt_helper.h>
|
|
#include <sbi_utils/timer/fdt_timer.h>
|
|
|
|
/* List of FDT timer drivers generated at compile time */
|
|
extern const struct fdt_driver *const fdt_timer_drivers[];
|
|
|
|
int fdt_timer_init(void)
|
|
{
|
|
/*
|
|
* Systems with Sstc might not provide any node in the FDT,
|
|
* so do not return a failure if no device is found.
|
|
*/
|
|
return fdt_driver_init_all(fdt_get_address(), fdt_timer_drivers);
|
|
}
|