prom.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #ifndef _SPARC64_PROM_H
  2. #define _SPARC64_PROM_H
  3. #ifdef __KERNEL__
  4. /*
  5. * Definitions for talking to the Open Firmware PROM on
  6. * Power Macintosh computers.
  7. *
  8. * Copyright (C) 1996-2005 Paul Mackerras.
  9. *
  10. * Updates for PPC64 by Peter Bergner & David Engebretsen, IBM Corp.
  11. * Updates for SPARC64 by David S. Miller
  12. *
  13. * This program is free software; you can redistribute it and/or
  14. * modify it under the terms of the GNU General Public License
  15. * as published by the Free Software Foundation; either version
  16. * 2 of the License, or (at your option) any later version.
  17. */
  18. #include <linux/types.h>
  19. #include <linux/proc_fs.h>
  20. #include <asm/atomic.h>
  21. typedef u32 phandle;
  22. typedef u32 ihandle;
  23. struct interrupt_info {
  24. int line;
  25. int sense; /* +ve/-ve logic, edge or level, etc. */
  26. };
  27. struct property {
  28. char *name;
  29. int length;
  30. void *value;
  31. struct property *next;
  32. };
  33. struct device_node {
  34. char *name;
  35. char *type;
  36. phandle node;
  37. phandle linux_phandle;
  38. int n_intrs;
  39. struct interrupt_info *intrs;
  40. char *path_component_name;
  41. char *full_name;
  42. struct property *properties;
  43. struct property *deadprops; /* removed properties */
  44. struct device_node *parent;
  45. struct device_node *child;
  46. struct device_node *sibling;
  47. struct device_node *next; /* next device of same type */
  48. struct device_node *allnext; /* next in list of all nodes */
  49. struct proc_dir_entry *pde; /* this node's proc directory */
  50. struct kref kref;
  51. unsigned long _flags;
  52. void *data;
  53. };
  54. static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de)
  55. {
  56. dn->pde = de;
  57. }
  58. extern struct device_node *of_find_node_by_path(const char *path);
  59. extern struct device_node *of_get_parent(const struct device_node *node);
  60. extern struct device_node *of_get_next_child(const struct device_node *node,
  61. struct device_node *prev);
  62. extern struct property *of_find_property(struct device_node *np,
  63. const char *name,
  64. int *lenp);
  65. extern void prom_build_devicetree(void);
  66. #endif /* __KERNEL__ */
  67. #endif /* _SPARC64_PROM_H */