mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-08-15 00:47:02 +02:00
This patch adds 'fdtw_read_bytes' and 'fdtw_write_inplace_bytes' functions for read/write array of bytes from/to a given property. It also adds 'fdt_setprop_inplace_namelen_partial' to jmptbl.i files for builds with USE_ROMLIB=1 option. Change-Id: Ied7b5c8b38a0e21d508aa7bcf5893e656028b14d Signed-off-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
29 lines
1001 B
C
29 lines
1001 B
C
/*
|
|
* Copyright (c) 2018-2020, ARM Limited and Contributors. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
/* Helper functions to offer easier navigation of Device Tree Blob */
|
|
|
|
#ifndef FDT_WRAPPERS_H
|
|
#define FDT_WRAPPERS_H
|
|
|
|
/* Number of cells, given total length in bytes. Each cell is 4 bytes long */
|
|
#define NCELLS(len) ((len) / 4U)
|
|
|
|
int fdtw_read_cells(const void *dtb, int node, const char *prop,
|
|
unsigned int cells, void *value);
|
|
int fdtw_read_array(const void *dtb, int node, const char *prop,
|
|
unsigned int cells, void *value);
|
|
int fdtw_read_string(const void *dtb, int node, const char *prop,
|
|
char *str, size_t size);
|
|
int fdtw_write_inplace_cells(void *dtb, int node, const char *prop,
|
|
unsigned int cells, void *value);
|
|
int fdtw_read_bytes(const void *dtb, int node, const char *prop,
|
|
unsigned int length, void *value);
|
|
int fdtw_write_inplace_bytes(void *dtb, int node, const char *prop,
|
|
unsigned int length, const void *data);
|
|
|
|
#endif /* FDT_WRAPPERS_H */
|