sandybridge.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (c) 2014 Google, Inc
  4. *
  5. * From Coreboot file of the same name
  6. *
  7. * Copyright (C) 2007-2008 coresystems GmbH
  8. * Copyright (C) 2011 Google Inc.
  9. */
  10. #ifndef _ACH_ASM_SANDYBRIDGE_H
  11. #define _ACH_ASM_SANDYBRIDGE_H
  12. /* Chipset types */
  13. #define SANDYBRIDGE_MOBILE 0
  14. #define SANDYBRIDGE_DESKTOP 1
  15. #define SANDYBRIDGE_SERVER 2
  16. /* Device ID for SandyBridge and IvyBridge */
  17. #define BASE_REV_SNB 0x00
  18. #define BASE_REV_IVB 0x50
  19. #define BASE_REV_MASK 0x50
  20. /* SandyBridge CPU stepping */
  21. #define SNB_STEP_D0 (BASE_REV_SNB + 5) /* Also J0 */
  22. #define SNB_STEP_D1 (BASE_REV_SNB + 6)
  23. #define SNB_STEP_D2 (BASE_REV_SNB + 7) /* Also J1/Q0 */
  24. /* IvyBridge CPU stepping */
  25. #define IVB_STEP_A0 (BASE_REV_IVB + 0)
  26. #define IVB_STEP_B0 (BASE_REV_IVB + 2)
  27. #define IVB_STEP_C0 (BASE_REV_IVB + 4)
  28. #define IVB_STEP_K0 (BASE_REV_IVB + 5)
  29. #define IVB_STEP_D0 (BASE_REV_IVB + 6)
  30. /* Intel Enhanced Debug region must be 4MB */
  31. #define IED_SIZE 0x400000
  32. /* Northbridge BARs */
  33. #define DEFAULT_DMIBAR 0xfed18000 /* 4 KB */
  34. #define DEFAULT_EPBAR 0xfed19000 /* 4 KB */
  35. #define DEFAULT_RCBABASE 0xfed1c000
  36. /* 4 KB per PCIe device */
  37. #define DEFAULT_PCIEXBAR CONFIG_PCIE_ECAM_BASE
  38. /* Device 0:0.0 PCI configuration space (Host Bridge) */
  39. #define EPBAR 0x40
  40. #define MCHBAR 0x48
  41. #define PCIEXBAR 0x60
  42. #define DMIBAR 0x68
  43. #define X60BAR 0x60
  44. #define GGC 0x50 /* GMCH Graphics Control */
  45. #define DEVEN 0x54 /* Device Enable */
  46. #define DEVEN_PEG60 (1 << 13)
  47. #define DEVEN_IGD (1 << 4)
  48. #define DEVEN_PEG10 (1 << 3)
  49. #define DEVEN_PEG11 (1 << 2)
  50. #define DEVEN_PEG12 (1 << 1)
  51. #define DEVEN_HOST (1 << 0)
  52. #define PAM0 0x80
  53. #define PAM1 0x81
  54. #define PAM2 0x82
  55. #define PAM3 0x83
  56. #define PAM4 0x84
  57. #define PAM5 0x85
  58. #define PAM6 0x86
  59. #define LAC 0x87 /* Legacy Access Control */
  60. #define SMRAM 0x88 /* System Management RAM Control */
  61. #define D_OPEN (1 << 6)
  62. #define D_CLS (1 << 5)
  63. #define D_LCK (1 << 4)
  64. #define G_SMRAME (1 << 3)
  65. #define C_BASE_SEG ((0 << 2) | (1 << 1) | (0 << 0))
  66. #define TOM 0xa0
  67. #define TOUUD 0xa8 /* Top of Upper Usable DRAM */
  68. #define TSEG 0xb8 /* TSEG base */
  69. #define TOLUD 0xbc /* Top of Low Used Memory */
  70. #define SKPAD 0xdc /* Scratchpad Data */
  71. /* Device 0:1.0 PCI configuration space (PCI Express) */
  72. #define BCTRL1 0x3e /* 16bit */
  73. /* Device 0:2.0 PCI configuration space (Graphics Device) */
  74. #define MSAC 0x62 /* Multi Size Aperture Control */
  75. #define SWSCI 0xe8 /* SWSCI enable */
  76. #define ASLS 0xfc /* OpRegion Base */
  77. /*
  78. * MCHBAR
  79. */
  80. #define SSKPD 0x5d14 /* 16bit (scratchpad) */
  81. #define BIOS_RESET_CPL 0x5da8 /* 8bit */
  82. /*
  83. * DMIBAR
  84. */
  85. #define DMIBAR_REG(x) (DEFAULT_DMIBAR + x)
  86. /**
  87. * bridge_silicon_revision() - Get the Northbridge revision
  88. *
  89. * @dev: Northbridge device
  90. * @return revision ID (bits 3:0) and bridge ID (bits 7:4)
  91. */
  92. int bridge_silicon_revision(struct udevice *dev);
  93. #endif