Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 #include <linux/of.h>   /* linux/of.h gets to determine #include ordering */
0003 #ifndef _SPARC_PROM_H
0004 #define _SPARC_PROM_H
0005 #ifdef __KERNEL__
0006 
0007 /*
0008  * Definitions for talking to the Open Firmware PROM on
0009  * Power Macintosh computers.
0010  *
0011  * Copyright (C) 1996-2005 Paul Mackerras.
0012  *
0013  * Updates for PPC64 by Peter Bergner & David Engebretsen, IBM Corp.
0014  * Updates for SPARC by David S. Miller
0015  */
0016 #include <linux/types.h>
0017 #include <linux/of_pdt.h>
0018 #include <linux/proc_fs.h>
0019 #include <linux/mutex.h>
0020 #include <linux/atomic.h>
0021 #include <linux/irqdomain.h>
0022 
0023 #define of_compat_cmp(s1, s2, l)    strncmp((s1), (s2), (l))
0024 #define of_prop_cmp(s1, s2)     strcasecmp((s1), (s2))
0025 #define of_node_cmp(s1, s2)     strcmp((s1), (s2))
0026 
0027 struct of_irq_controller {
0028     unsigned int    (*irq_build)(struct device_node *, unsigned int, void *);
0029     void        *data;
0030 };
0031 
0032 struct device_node *of_find_node_by_cpuid(int cpuid);
0033 int of_set_property(struct device_node *node, const char *name, void *val, int len);
0034 extern struct mutex of_set_property_mutex;
0035 int of_getintprop_default(struct device_node *np,
0036               const char *name,
0037                  int def);
0038 int of_find_in_proplist(const char *list, const char *match, int len);
0039 
0040 void prom_build_devicetree(void);
0041 void of_populate_present_mask(void);
0042 void of_fill_in_cpu_data(void);
0043 
0044 struct resource;
0045 void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name);
0046 void of_iounmap(struct resource *res, void __iomem *base, unsigned long size);
0047 
0048 extern struct device_node *of_console_device;
0049 extern char *of_console_path;
0050 extern char *of_console_options;
0051 
0052 void irq_trans_init(struct device_node *dp);
0053 char *build_path_component(struct device_node *dp);
0054 
0055 #endif /* __KERNEL__ */
0056 #endif /* _SPARC_PROM_H */