forked from Mirrors/opensbi

Now that we have a dedicated fdt_helper.c file for DT releated helper routines, move plic_fdt_fixup() codes from plic.c to fdt_helper.c and rename it to fdt_plic_fixup() at the same time, to keep name consistency in the same file. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
39 lines
1.1 KiB
C
39 lines
1.1 KiB
C
// SPDX-License-Identifier: BSD-2-Clause
|
|
/*
|
|
* fdt_helper.h - Flat Device Tree manipulation helper routines
|
|
* Implement helper routines on top of libfdt for OpenSBI usage
|
|
*
|
|
* Copyright (C) 2020 Bin Meng <bmeng.cn@gmail.com>
|
|
*/
|
|
|
|
#ifndef __FDT_HELPER_H__
|
|
#define __FDT_HELPER_H__
|
|
|
|
/**
|
|
* Fix up the PLIC node in the device tree
|
|
*
|
|
* This routine updates the "interrupt-extended" property of the PLIC node in
|
|
* the device tree to hide the M-mode external interrupt from CPUs.
|
|
*
|
|
* It is recommended that platform codes call this helper in their final_init()
|
|
*
|
|
* @param fdt: device tree blob
|
|
* @param compat: PLIC node compatible string
|
|
*/
|
|
void fdt_plic_fixup(void *fdt, const char *compat);
|
|
|
|
/**
|
|
* Fix up the reserved memory node in the device tree
|
|
*
|
|
* This routine inserts a child node of the reserved memory node in the device
|
|
* tree that describes the protected memory region done by OpenSBI via PMP.
|
|
*
|
|
* It is recommended that platform codes call this helper in their final_init()
|
|
*
|
|
* @param fdt: device tree blob
|
|
* @return zero on success and -ve on failure
|
|
*/
|
|
int fdt_reserved_memory_fixup(void *fdt);
|
|
|
|
#endif /* __FDT_HELPER_H__ */
|