prom.h 2.2 KB

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