prom.h 1.9 KB

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