18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */ 28c2ecf20Sopenharmony_ci#include <linux/of.h> /* linux/of.h gets to determine #include ordering */ 38c2ecf20Sopenharmony_ci#ifndef _SPARC_PROM_H 48c2ecf20Sopenharmony_ci#define _SPARC_PROM_H 58c2ecf20Sopenharmony_ci#ifdef __KERNEL__ 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ci/* 88c2ecf20Sopenharmony_ci * Definitions for talking to the Open Firmware PROM on 98c2ecf20Sopenharmony_ci * Power Macintosh computers. 108c2ecf20Sopenharmony_ci * 118c2ecf20Sopenharmony_ci * Copyright (C) 1996-2005 Paul Mackerras. 128c2ecf20Sopenharmony_ci * 138c2ecf20Sopenharmony_ci * Updates for PPC64 by Peter Bergner & David Engebretsen, IBM Corp. 148c2ecf20Sopenharmony_ci * Updates for SPARC by David S. Miller 158c2ecf20Sopenharmony_ci */ 168c2ecf20Sopenharmony_ci#include <linux/types.h> 178c2ecf20Sopenharmony_ci#include <linux/of_pdt.h> 188c2ecf20Sopenharmony_ci#include <linux/proc_fs.h> 198c2ecf20Sopenharmony_ci#include <linux/mutex.h> 208c2ecf20Sopenharmony_ci#include <linux/atomic.h> 218c2ecf20Sopenharmony_ci#include <linux/irqdomain.h> 228c2ecf20Sopenharmony_ci 238c2ecf20Sopenharmony_ci#define of_compat_cmp(s1, s2, l) strncmp((s1), (s2), (l)) 248c2ecf20Sopenharmony_ci#define of_prop_cmp(s1, s2) strcasecmp((s1), (s2)) 258c2ecf20Sopenharmony_ci#define of_node_cmp(s1, s2) strcmp((s1), (s2)) 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_cistruct of_irq_controller { 288c2ecf20Sopenharmony_ci unsigned int (*irq_build)(struct device_node *, unsigned int, void *); 298c2ecf20Sopenharmony_ci void *data; 308c2ecf20Sopenharmony_ci}; 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_cistruct device_node *of_find_node_by_cpuid(int cpuid); 338c2ecf20Sopenharmony_ciint of_set_property(struct device_node *node, const char *name, void *val, int len); 348c2ecf20Sopenharmony_ciextern struct mutex of_set_property_mutex; 358c2ecf20Sopenharmony_ciint of_getintprop_default(struct device_node *np, 368c2ecf20Sopenharmony_ci const char *name, 378c2ecf20Sopenharmony_ci int def); 388c2ecf20Sopenharmony_ciint of_find_in_proplist(const char *list, const char *match, int len); 398c2ecf20Sopenharmony_ci 408c2ecf20Sopenharmony_civoid prom_build_devicetree(void); 418c2ecf20Sopenharmony_civoid of_populate_present_mask(void); 428c2ecf20Sopenharmony_civoid of_fill_in_cpu_data(void); 438c2ecf20Sopenharmony_ci 448c2ecf20Sopenharmony_cistruct resource; 458c2ecf20Sopenharmony_civoid __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name); 468c2ecf20Sopenharmony_civoid of_iounmap(struct resource *res, void __iomem *base, unsigned long size); 478c2ecf20Sopenharmony_ci 488c2ecf20Sopenharmony_ciextern struct device_node *of_console_device; 498c2ecf20Sopenharmony_ciextern char *of_console_path; 508c2ecf20Sopenharmony_ciextern char *of_console_options; 518c2ecf20Sopenharmony_ci 528c2ecf20Sopenharmony_civoid irq_trans_init(struct device_node *dp); 538c2ecf20Sopenharmony_cichar *build_path_component(struct device_node *dp); 548c2ecf20Sopenharmony_ci 558c2ecf20Sopenharmony_ci#endif /* __KERNEL__ */ 568c2ecf20Sopenharmony_ci#endif /* _SPARC_PROM_H */ 57