prom.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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 property {
  24. char *name;
  25. int length;
  26. void *value;
  27. struct property *next;
  28. unsigned long _flags;
  29. unsigned int unique_id;
  30. };
  31. struct of_irq_controller;
  32. struct device_node {
  33. const char *name;
  34. const char *type;
  35. phandle node;
  36. char *path_component_name;
  37. char *full_name;
  38. struct property *properties;
  39. struct property *deadprops; /* removed properties */
  40. struct device_node *parent;
  41. struct device_node *child;
  42. struct device_node *sibling;
  43. struct device_node *next; /* next device of same type */
  44. struct device_node *allnext; /* next in list of all nodes */
  45. struct proc_dir_entry *pde; /* this node's proc directory */
  46. struct kref kref;
  47. unsigned long _flags;
  48. void *data;
  49. unsigned int unique_id;
  50. struct of_irq_controller *irq_trans;
  51. };
  52. struct of_irq_controller {
  53. unsigned int (*irq_build)(struct device_node *, unsigned int, void *);
  54. void *data;
  55. };
  56. #define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags)
  57. #define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags)
  58. extern struct device_node *of_find_node_by_cpuid(int cpuid);
  59. extern int of_set_property(struct device_node *node, const char *name, void *val, int len);
  60. extern int of_getintprop_default(struct device_node *np,
  61. const char *name,
  62. int def);
  63. extern void prom_build_devicetree(void);
  64. /*
  65. * NB: This is here while we transition from using asm/prom.h
  66. * to linux/of.h
  67. */
  68. #include <linux/of.h>
  69. #endif /* __KERNEL__ */
  70. #endif /* _SPARC64_PROM_H */