bios.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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 Silicon Graphics, Inc. All Rights Reserved.
  21. * Copyright (c) Russ Anderson
  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. };
  34. /*
  35. * Status values returned from a BIOS call.
  36. */
  37. enum {
  38. BIOS_STATUS_SUCCESS = 0,
  39. BIOS_STATUS_UNIMPLEMENTED = -ENOSYS,
  40. BIOS_STATUS_EINVAL = -EINVAL,
  41. BIOS_STATUS_UNAVAIL = -EBUSY
  42. };
  43. /*
  44. * The UV system table describes specific firmware
  45. * capabilities available to the Linux kernel at runtime.
  46. */
  47. struct uv_systab {
  48. char signature[4]; /* must be "UVST" */
  49. u32 revision; /* distinguish different firmware revs */
  50. u64 function; /* BIOS runtime callback function ptr */
  51. };
  52. enum {
  53. BIOS_FREQ_BASE_PLATFORM = 0,
  54. BIOS_FREQ_BASE_INTERVAL_TIMER = 1,
  55. BIOS_FREQ_BASE_REALTIME_CLOCK = 2
  56. };
  57. union partition_info_u {
  58. u64 val;
  59. struct {
  60. u64 hub_version : 8,
  61. partition_id : 16,
  62. coherence_id : 16,
  63. region_size : 24;
  64. };
  65. };
  66. /*
  67. * bios calls have 6 parameters
  68. */
  69. extern s64 uv_bios_call(enum uv_bios_cmd, u64, u64, u64, u64, u64);
  70. extern s64 uv_bios_call_irqsave(enum uv_bios_cmd, u64, u64, u64, u64, u64);
  71. extern s64 uv_bios_call_reentrant(enum uv_bios_cmd, u64, u64, u64, u64, u64);
  72. extern s64 uv_bios_get_sn_info(int, int *, long *, long *, long *);
  73. extern s64 uv_bios_freq_base(u64, u64 *);
  74. extern void uv_bios_init(void);
  75. extern int uv_type;
  76. extern long sn_partition_id;
  77. extern long uv_coherency_id;
  78. extern long uv_region_size;
  79. #define partition_coherence_id() (uv_coherency_id)
  80. extern struct kobject *sgi_uv_kobj; /* /sys/firmware/sgi_uv */
  81. #endif /* _ASM_X86_UV_BIOS_H */