bios.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. #ifndef _ASM_X86_UV_BIOS_H
  2. #define _ASM_X86_UV_BIOS_H
  3. /*
  4. * UV BIOS layer definitions.
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  19. *
  20. * Copyright (c) 2008-2009 Silicon Graphics, Inc. All Rights Reserved.
  21. * Copyright (c) Russ Anderson <rja@sgi.com>
  22. */
  23. #include <linux/rtc.h>
  24. /*
  25. * Values for the BIOS calls. It is passed as the first * argument in the
  26. * BIOS call. Passing any other value in the first argument will result
  27. * in a BIOS_STATUS_UNIMPLEMENTED return status.
  28. */
  29. enum uv_bios_cmd {
  30. UV_BIOS_COMMON,
  31. UV_BIOS_GET_SN_INFO,
  32. UV_BIOS_FREQ_BASE,
  33. UV_BIOS_WATCHLIST_ALLOC,
  34. UV_BIOS_WATCHLIST_FREE,
  35. UV_BIOS_MEMPROTECT,
  36. UV_BIOS_GET_PARTITION_ADDR,
  37. UV_BIOS_SET_LEGACY_VGA_TARGET
  38. };
  39. /*
  40. * Status values returned from a BIOS call.
  41. */
  42. enum {
  43. BIOS_STATUS_MORE_PASSES = 1,
  44. BIOS_STATUS_SUCCESS = 0,
  45. BIOS_STATUS_UNIMPLEMENTED = -ENOSYS,
  46. BIOS_STATUS_EINVAL = -EINVAL,
  47. BIOS_STATUS_UNAVAIL = -EBUSY
  48. };
  49. /*
  50. * The UV system table describes specific firmware
  51. * capabilities available to the Linux kernel at runtime.
  52. */
  53. struct uv_systab {
  54. char signature[4]; /* must be "UVST" */
  55. u32 revision; /* distinguish different firmware revs */
  56. u64 function; /* BIOS runtime callback function ptr */
  57. };
  58. enum {
  59. BIOS_FREQ_BASE_PLATFORM = 0,
  60. BIOS_FREQ_BASE_INTERVAL_TIMER = 1,
  61. BIOS_FREQ_BASE_REALTIME_CLOCK = 2
  62. };
  63. union partition_info_u {
  64. u64 val;
  65. struct {
  66. u64 hub_version : 8,
  67. partition_id : 16,
  68. coherence_id : 16,
  69. region_size : 24;
  70. };
  71. };
  72. enum uv_memprotect {
  73. UV_MEMPROT_RESTRICT_ACCESS,
  74. UV_MEMPROT_ALLOW_AMO,
  75. UV_MEMPROT_ALLOW_RW
  76. };
  77. /*
  78. * bios calls have 6 parameters
  79. */
  80. extern s64 uv_bios_call(enum uv_bios_cmd, u64, u64, u64, u64, u64);
  81. extern s64 uv_bios_call_irqsave(enum uv_bios_cmd, u64, u64, u64, u64, u64);
  82. extern s64 uv_bios_call_reentrant(enum uv_bios_cmd, u64, u64, u64, u64, u64);
  83. extern s64 uv_bios_get_sn_info(int, int *, long *, long *, long *, long *);
  84. extern s64 uv_bios_freq_base(u64, u64 *);
  85. extern int uv_bios_mq_watchlist_alloc(unsigned long, unsigned int,
  86. unsigned long *);
  87. extern int uv_bios_mq_watchlist_free(int, int);
  88. extern s64 uv_bios_change_memprotect(u64, u64, enum uv_memprotect);
  89. extern s64 uv_bios_reserved_page_pa(u64, u64 *, u64 *, u64 *);
  90. extern int uv_bios_set_legacy_vga_target(bool decode, int domain, int bus);
  91. extern void uv_bios_init(void);
  92. extern unsigned long sn_rtc_cycles_per_second;
  93. extern int uv_type;
  94. extern long sn_partition_id;
  95. extern long sn_coherency_id;
  96. extern long sn_region_size;
  97. extern long system_serial_number;
  98. #define partition_coherence_id() (sn_coherency_id)
  99. extern struct kobject *sgi_uv_kobj; /* /sys/firmware/sgi_uv */
  100. #endif /* _ASM_X86_UV_BIOS_H */