forked from Mirrors/opensbi
lib: utils/fdt: Constify FDT parsing functions
Distinguish between functions which modify the devicetree and those which only extract information from it. Other than the iterators in fdt_domain.c, this is a mechanical conversion. Signed-off-by: Samuel Holland <samuel.holland@sifive.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:

committed by
Anup Patel

parent
f229a32828
commit
33ba4e0567
@@ -70,12 +70,12 @@ void fdt_domain_fixup(void *fdt);
|
||||
*
|
||||
* @return 0 on success and negative error code on failure
|
||||
*/
|
||||
int fdt_domains_populate(void *fdt);
|
||||
int fdt_domains_populate(const void *fdt);
|
||||
|
||||
#else
|
||||
|
||||
static inline void fdt_domain_fixup(void *fdt) { }
|
||||
static inline int fdt_domains_populate(void *fdt) { return 0; }
|
||||
static inline int fdt_domains_populate(const void *fdt) { return 0; }
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -34,84 +34,84 @@ struct platform_uart_data {
|
||||
unsigned long reg_offset;
|
||||
};
|
||||
|
||||
const struct fdt_match *fdt_match_node(void *fdt, int nodeoff,
|
||||
const struct fdt_match *fdt_match_node(const void *fdt, int nodeoff,
|
||||
const struct fdt_match *match_table);
|
||||
|
||||
int fdt_find_match(void *fdt, int startoff,
|
||||
int fdt_find_match(const void *fdt, int startoff,
|
||||
const struct fdt_match *match_table,
|
||||
const struct fdt_match **out_match);
|
||||
|
||||
int fdt_parse_phandle_with_args(void *fdt, int nodeoff,
|
||||
int fdt_parse_phandle_with_args(const void *fdt, int nodeoff,
|
||||
const char *prop, const char *cells_prop,
|
||||
int index, struct fdt_phandle_args *out_args);
|
||||
|
||||
int fdt_get_node_addr_size(void *fdt, int node, int index,
|
||||
int fdt_get_node_addr_size(const void *fdt, int node, int index,
|
||||
uint64_t *addr, uint64_t *size);
|
||||
|
||||
int fdt_get_node_addr_size_by_name(void *fdt, int node, const char *name,
|
||||
int fdt_get_node_addr_size_by_name(const void *fdt, int node, const char *name,
|
||||
uint64_t *addr, uint64_t *size);
|
||||
|
||||
bool fdt_node_is_enabled(void *fdt, int nodeoff);
|
||||
bool fdt_node_is_enabled(const void *fdt, int nodeoff);
|
||||
|
||||
int fdt_parse_hart_id(void *fdt, int cpu_offset, u32 *hartid);
|
||||
int fdt_parse_hart_id(const void *fdt, int cpu_offset, u32 *hartid);
|
||||
|
||||
int fdt_parse_max_enabled_hart_id(void *fdt, u32 *max_hartid);
|
||||
int fdt_parse_max_enabled_hart_id(const void *fdt, u32 *max_hartid);
|
||||
|
||||
int fdt_parse_timebase_frequency(void *fdt, unsigned long *freq);
|
||||
int fdt_parse_timebase_frequency(const void *fdt, unsigned long *freq);
|
||||
|
||||
int fdt_parse_isa_extensions(void *fdt, unsigned int hard_id,
|
||||
int fdt_parse_isa_extensions(const void *fdt, unsigned int hard_id,
|
||||
unsigned long *extensions);
|
||||
|
||||
int fdt_parse_gaisler_uart_node(void *fdt, int nodeoffset,
|
||||
int fdt_parse_gaisler_uart_node(const void *fdt, int nodeoffset,
|
||||
struct platform_uart_data *uart);
|
||||
|
||||
int fdt_parse_renesas_scif_node(void *fdt, int nodeoffset,
|
||||
int fdt_parse_renesas_scif_node(const void *fdt, int nodeoffset,
|
||||
struct platform_uart_data *uart);
|
||||
|
||||
int fdt_parse_shakti_uart_node(void *fdt, int nodeoffset,
|
||||
int fdt_parse_shakti_uart_node(const void *fdt, int nodeoffset,
|
||||
struct platform_uart_data *uart);
|
||||
|
||||
int fdt_parse_sifive_uart_node(void *fdt, int nodeoffset,
|
||||
int fdt_parse_sifive_uart_node(const void *fdt, int nodeoffset,
|
||||
struct platform_uart_data *uart);
|
||||
|
||||
int fdt_parse_uart_node(void *fdt, int nodeoffset,
|
||||
int fdt_parse_uart_node(const void *fdt, int nodeoffset,
|
||||
struct platform_uart_data *uart);
|
||||
|
||||
int fdt_parse_uart8250(void *fdt, struct platform_uart_data *uart,
|
||||
int fdt_parse_uart8250(const void *fdt, struct platform_uart_data *uart,
|
||||
const char *compatible);
|
||||
|
||||
int fdt_parse_xlnx_uartlite_node(void *fdt, int nodeoffset,
|
||||
int fdt_parse_xlnx_uartlite_node(const void *fdt, int nodeoffset,
|
||||
struct platform_uart_data *uart);
|
||||
|
||||
struct aplic_data;
|
||||
|
||||
int fdt_parse_aplic_node(void *fdt, int nodeoff, struct aplic_data *aplic);
|
||||
int fdt_parse_aplic_node(const void *fdt, int nodeoff, struct aplic_data *aplic);
|
||||
|
||||
struct imsic_data;
|
||||
|
||||
bool fdt_check_imsic_mlevel(void *fdt);
|
||||
bool fdt_check_imsic_mlevel(const void *fdt);
|
||||
|
||||
int fdt_parse_imsic_node(void *fdt, int nodeoff, struct imsic_data *imsic);
|
||||
int fdt_parse_imsic_node(const void *fdt, int nodeoff, struct imsic_data *imsic);
|
||||
|
||||
struct plic_data;
|
||||
|
||||
int fdt_parse_plic_node(void *fdt, int nodeoffset, struct plic_data *plic);
|
||||
int fdt_parse_plic_node(const void *fdt, int nodeoffset, struct plic_data *plic);
|
||||
|
||||
int fdt_parse_plic(void *fdt, struct plic_data *plic, const char *compat);
|
||||
int fdt_parse_plic(const void *fdt, struct plic_data *plic, const char *compat);
|
||||
|
||||
int fdt_parse_aclint_node(void *fdt, int nodeoffset,
|
||||
int fdt_parse_aclint_node(const void *fdt, int nodeoffset,
|
||||
bool for_timer, bool allow_regname,
|
||||
unsigned long *out_addr1, unsigned long *out_size1,
|
||||
unsigned long *out_addr2, unsigned long *out_size2,
|
||||
u32 *out_first_hartid, u32 *out_hart_count);
|
||||
|
||||
int fdt_parse_plmt_node(void *fdt, int nodeoffset, unsigned long *plmt_base,
|
||||
unsigned long *plmt_size, u32 *hart_count);
|
||||
int fdt_parse_plmt_node(const void *fdt, int nodeoffset, unsigned long *plmt_base,
|
||||
unsigned long *plmt_size, u32 *hart_count);
|
||||
|
||||
int fdt_parse_plicsw_node(void *fdt, int nodeoffset, unsigned long *plicsw_base,
|
||||
int fdt_parse_plicsw_node(const void *fdt, int nodeoffset, unsigned long *plicsw_base,
|
||||
unsigned long *size, u32 *hart_count);
|
||||
|
||||
int fdt_parse_compat_addr(void *fdt, uint64_t *addr,
|
||||
int fdt_parse_compat_addr(const void *fdt, uint64_t *addr,
|
||||
const char *compatible);
|
||||
|
||||
static inline void *fdt_get_address(void)
|
||||
|
@@ -52,7 +52,7 @@ int fdt_pmu_fixup(void *fdt);
|
||||
*
|
||||
* @return 0 on success and negative error code on failure
|
||||
*/
|
||||
int fdt_pmu_setup(void *fdt);
|
||||
int fdt_pmu_setup(const void *fdt);
|
||||
|
||||
/**
|
||||
* Get the mhpmevent select value read from DT for a given event
|
||||
@@ -70,7 +70,7 @@ extern uint32_t hw_event_count;
|
||||
#else
|
||||
|
||||
static inline void fdt_pmu_fixup(void *fdt) { }
|
||||
static inline int fdt_pmu_setup(void *fdt) { return 0; }
|
||||
static inline int fdt_pmu_setup(const void *fdt) { return 0; }
|
||||
static inline uint64_t fdt_pmu_get_select_value(uint32_t event_idx) { return 0; }
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user