forked from Mirrors/opensbi

The serial driver subsystem does not need any extra data, so it can use `struct fdt_driver` directly. The generic fdt_serial_init() first attempts to match the chosen stdout device, and upon failure matches the first available serial device in the DT. It is a fatal error if no such device is found. This matches the behavior of fdt_driver_init_one(). Signed-off-by: Samuel Holland <samuel.holland@sifive.com> Reviewed-by: Anup Patel <anup@brainfault.org>
27 lines
443 B
C
27 lines
443 B
C
/*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*
|
|
* Copyright (c) 2020 Western Digital Corporation or its affiliates.
|
|
*
|
|
* Authors:
|
|
* Anup Patel <anup.patel@wdc.com>
|
|
*/
|
|
|
|
#ifndef __FDT_SERIAL_H__
|
|
#define __FDT_SERIAL_H__
|
|
|
|
#include <sbi/sbi_types.h>
|
|
#include <sbi_utils/fdt/fdt_driver.h>
|
|
|
|
#ifdef CONFIG_FDT_SERIAL
|
|
|
|
int fdt_serial_init(const void *fdt);
|
|
|
|
#else
|
|
|
|
static inline int fdt_serial_init(const void *fdt) { return 0; }
|
|
|
|
#endif
|
|
|
|
#endif
|