firmware.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * include/asm-ppc64/firmware.h
  3. *
  4. * Extracted from include/asm-ppc64/cputable.h
  5. *
  6. * Copyright (C) 2001 Ben. Herrenschmidt (benh@kernel.crashing.org)
  7. *
  8. * Modifications for ppc64:
  9. * Copyright (C) 2003 Dave Engebretsen <engebret@us.ibm.com>
  10. *
  11. * This program is free software; you can redistribute it and/or
  12. * modify it under the terms of the GNU General Public License
  13. * as published by the Free Software Foundation; either version
  14. * 2 of the License, or (at your option) any later version.
  15. */
  16. #ifndef __ASM_PPC_FIRMWARE_H
  17. #define __ASM_PPC_FIRMWARE_H
  18. #ifdef __KERNEL__
  19. #ifndef __ASSEMBLY__
  20. /* firmware feature bitmask values */
  21. #define FIRMWARE_MAX_FEATURES 63
  22. #define FW_FEATURE_PFT (1UL<<0)
  23. #define FW_FEATURE_TCE (1UL<<1)
  24. #define FW_FEATURE_SPRG0 (1UL<<2)
  25. #define FW_FEATURE_DABR (1UL<<3)
  26. #define FW_FEATURE_COPY (1UL<<4)
  27. #define FW_FEATURE_ASR (1UL<<5)
  28. #define FW_FEATURE_DEBUG (1UL<<6)
  29. #define FW_FEATURE_TERM (1UL<<7)
  30. #define FW_FEATURE_PERF (1UL<<8)
  31. #define FW_FEATURE_DUMP (1UL<<9)
  32. #define FW_FEATURE_INTERRUPT (1UL<<10)
  33. #define FW_FEATURE_MIGRATE (1UL<<11)
  34. #define FW_FEATURE_PERFMON (1UL<<12)
  35. #define FW_FEATURE_CRQ (1UL<<13)
  36. #define FW_FEATURE_VIO (1UL<<14)
  37. #define FW_FEATURE_RDMA (1UL<<15)
  38. #define FW_FEATURE_LLAN (1UL<<16)
  39. #define FW_FEATURE_BULK (1UL<<17)
  40. #define FW_FEATURE_XDABR (1UL<<18)
  41. #define FW_FEATURE_MULTITCE (1UL<<19)
  42. #define FW_FEATURE_SPLPAR (1UL<<20)
  43. enum {
  44. FW_FEATURE_PSERIES = FW_FEATURE_PFT | FW_FEATURE_TCE |
  45. FW_FEATURE_SPRG0 | FW_FEATURE_DABR | FW_FEATURE_COPY |
  46. FW_FEATURE_ASR | FW_FEATURE_DEBUG | FW_FEATURE_TERM |
  47. FW_FEATURE_PERF | FW_FEATURE_DUMP | FW_FEATURE_INTERRUPT |
  48. FW_FEATURE_MIGRATE | FW_FEATURE_PERFMON | FW_FEATURE_CRQ |
  49. FW_FEATURE_VIO | FW_FEATURE_RDMA | FW_FEATURE_LLAN |
  50. FW_FEATURE_BULK | FW_FEATURE_XDABR | FW_FEATURE_MULTITCE |
  51. FW_FEATURE_SPLPAR,
  52. FW_FEATURE_POSSIBLE =
  53. #ifdef CONFIG_PPC_PSERIES
  54. FW_FEATURE_PSERIES |
  55. #endif
  56. 0,
  57. };
  58. /* This is used to identify firmware features which are available
  59. * to the kernel.
  60. */
  61. extern unsigned long ppc64_firmware_features;
  62. static inline unsigned long firmware_has_feature(unsigned long feature)
  63. {
  64. return ppc64_firmware_features & feature & FW_FEATURE_POSSIBLE;
  65. }
  66. #ifdef CONFIG_PPC_PSERIES
  67. typedef struct {
  68. unsigned long val;
  69. char * name;
  70. } firmware_feature_t;
  71. extern firmware_feature_t firmware_features_table[];
  72. #endif
  73. #endif /* __ASSEMBLY__ */
  74. #endif /* __KERNEL__ */
  75. #endif /* __ASM_PPC_FIRMWARE_H */