0001-mb-dell-Add-Optiplex-780-MT-x4x-ICH10.patch 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709
  1. From c2324188f20d0d4d76cce6c54cd665a1aeaa2875 Mon Sep 17 00:00:00 2001
  2. From: Nicholas Chin <nic.c3.14@gmail.com>
  3. Date: Mon, 30 Sep 2024 20:44:38 -0400
  4. Subject: [PATCH 1/9] mb/dell: Add Optiplex 780 MT (x4x/ICH10)
  5. Change-Id: Idb45737ce95bfd26e978323c650de7d308b5079c
  6. Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com>
  7. ---
  8. src/mainboard/dell/optiplex_780/Kconfig | 40 ++++
  9. src/mainboard/dell/optiplex_780/Kconfig.name | 4 +
  10. src/mainboard/dell/optiplex_780/Makefile.mk | 10 +
  11. src/mainboard/dell/optiplex_780/acpi/ec.asl | 5 +
  12. .../dell/optiplex_780/acpi/ich10_pci_irqs.asl | 32 ++++
  13. .../dell/optiplex_780/acpi/superio.asl | 18 ++
  14. .../dell/optiplex_780/board_info.txt | 6 +
  15. src/mainboard/dell/optiplex_780/cmos.default | 8 +
  16. src/mainboard/dell/optiplex_780/cmos.layout | 72 ++++++++
  17. src/mainboard/dell/optiplex_780/cstates.c | 8 +
  18. src/mainboard/dell/optiplex_780/devicetree.cb | 63 +++++++
  19. src/mainboard/dell/optiplex_780/dsdt.asl | 26 +++
  20. .../dell/optiplex_780/gma-mainboard.ads | 16 ++
  21. .../optiplex_780/variants/780_mt/data.vbt | Bin 0 -> 1917 bytes
  22. .../optiplex_780/variants/780_mt/early_init.c | 12 ++
  23. .../dell/optiplex_780/variants/780_mt/gpio.c | 174 ++++++++++++++++++
  24. .../optiplex_780/variants/780_mt/hda_verb.c | 26 +++
  25. .../variants/780_mt/overridetree.cb | 10 +
  26. 18 files changed, 530 insertions(+)
  27. create mode 100644 src/mainboard/dell/optiplex_780/Kconfig
  28. create mode 100644 src/mainboard/dell/optiplex_780/Kconfig.name
  29. create mode 100644 src/mainboard/dell/optiplex_780/Makefile.mk
  30. create mode 100644 src/mainboard/dell/optiplex_780/acpi/ec.asl
  31. create mode 100644 src/mainboard/dell/optiplex_780/acpi/ich10_pci_irqs.asl
  32. create mode 100644 src/mainboard/dell/optiplex_780/acpi/superio.asl
  33. create mode 100644 src/mainboard/dell/optiplex_780/board_info.txt
  34. create mode 100644 src/mainboard/dell/optiplex_780/cmos.default
  35. create mode 100644 src/mainboard/dell/optiplex_780/cmos.layout
  36. create mode 100644 src/mainboard/dell/optiplex_780/cstates.c
  37. create mode 100644 src/mainboard/dell/optiplex_780/devicetree.cb
  38. create mode 100644 src/mainboard/dell/optiplex_780/dsdt.asl
  39. create mode 100644 src/mainboard/dell/optiplex_780/gma-mainboard.ads
  40. create mode 100644 src/mainboard/dell/optiplex_780/variants/780_mt/data.vbt
  41. create mode 100644 src/mainboard/dell/optiplex_780/variants/780_mt/early_init.c
  42. create mode 100644 src/mainboard/dell/optiplex_780/variants/780_mt/gpio.c
  43. create mode 100644 src/mainboard/dell/optiplex_780/variants/780_mt/hda_verb.c
  44. create mode 100644 src/mainboard/dell/optiplex_780/variants/780_mt/overridetree.cb
  45. diff --git a/src/mainboard/dell/optiplex_780/Kconfig b/src/mainboard/dell/optiplex_780/Kconfig
  46. new file mode 100644
  47. index 0000000000..2d06c75c9a
  48. --- /dev/null
  49. +++ b/src/mainboard/dell/optiplex_780/Kconfig
  50. @@ -0,0 +1,40 @@
  51. +## SPDX-License-Identifier: GPL-2.0-only
  52. +
  53. +config BOARD_DELL_OPTIPLEX_780_COMMON
  54. + def_bool n
  55. + select BOARD_ROMSIZE_KB_8192
  56. + select CPU_INTEL_SOCKET_LGA775
  57. + select DRIVERS_I2C_CK505
  58. + select HAVE_ACPI_RESUME
  59. + select HAVE_ACPI_TABLES
  60. + select HAVE_CMOS_DEFAULT
  61. + select HAVE_OPTION_TABLE
  62. + select INTEL_GMA_HAVE_VBT
  63. + select MAINBOARD_HAS_LIBGFXINIT
  64. + select MAINBOARD_USES_IFD_GBE_REGION
  65. + select NORTHBRIDGE_INTEL_X4X
  66. + select PCIEXP_ASPM
  67. + select PCIEXP_CLK_PM
  68. + select SOUTHBRIDGE_INTEL_I82801JX
  69. +
  70. +config BOARD_DELL_OPTIPLEX_780_MT
  71. + select BOARD_DELL_OPTIPLEX_780_COMMON
  72. +
  73. +if BOARD_DELL_OPTIPLEX_780_COMMON
  74. +
  75. +config VGA_BIOS_ID
  76. + default "8086,2e22"
  77. +
  78. +config MAINBOARD_DIR
  79. + default "dell/optiplex_780"
  80. +
  81. +config MAINBOARD_PART_NUMBER
  82. + default "OptiPlex 780 MT" if BOARD_DELL_OPTIPLEX_780_MT
  83. +
  84. +config OVERRIDE_DEVICETREE
  85. + default "variants/\$(CONFIG_VARIANT_DIR)/overridetree.cb"
  86. +
  87. +config VARIANT_DIR
  88. + default "780_mt" if BOARD_DELL_OPTIPLEX_780_MT
  89. +
  90. +endif # BOARD_DELL_OPTIPLEX_780_COMMON
  91. diff --git a/src/mainboard/dell/optiplex_780/Kconfig.name b/src/mainboard/dell/optiplex_780/Kconfig.name
  92. new file mode 100644
  93. index 0000000000..db7f2e8fe3
  94. --- /dev/null
  95. +++ b/src/mainboard/dell/optiplex_780/Kconfig.name
  96. @@ -0,0 +1,4 @@
  97. +## SPDX-License-Identifier: GPL-2.0-only
  98. +
  99. +config BOARD_DELL_OPTIPLEX_780_MT
  100. + bool "OptiPlex 780 MT"
  101. diff --git a/src/mainboard/dell/optiplex_780/Makefile.mk b/src/mainboard/dell/optiplex_780/Makefile.mk
  102. new file mode 100644
  103. index 0000000000..d462995d75
  104. --- /dev/null
  105. +++ b/src/mainboard/dell/optiplex_780/Makefile.mk
  106. @@ -0,0 +1,10 @@
  107. +# SPDX-License-Identifier: GPL-2.0-only
  108. +
  109. +ramstage-y += cstates.c
  110. +romstage-y += variants/$(VARIANT_DIR)/gpio.c
  111. +
  112. +bootblock-y += variants/$(VARIANT_DIR)/early_init.c
  113. +romstage-y += variants/$(VARIANT_DIR)/early_init.c
  114. +
  115. +ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += gma-mainboard.ads
  116. +ramstage-y += variants/$(VARIANT_DIR)/hda_verb.c
  117. diff --git a/src/mainboard/dell/optiplex_780/acpi/ec.asl b/src/mainboard/dell/optiplex_780/acpi/ec.asl
  118. new file mode 100644
  119. index 0000000000..479296cb76
  120. --- /dev/null
  121. +++ b/src/mainboard/dell/optiplex_780/acpi/ec.asl
  122. @@ -0,0 +1,5 @@
  123. +/* SPDX-License-Identifier: CC-PDDC */
  124. +
  125. +/* Please update the license if adding licensable material. */
  126. +
  127. +/* dummy */
  128. diff --git a/src/mainboard/dell/optiplex_780/acpi/ich10_pci_irqs.asl b/src/mainboard/dell/optiplex_780/acpi/ich10_pci_irqs.asl
  129. new file mode 100644
  130. index 0000000000..b7588dcc41
  131. --- /dev/null
  132. +++ b/src/mainboard/dell/optiplex_780/acpi/ich10_pci_irqs.asl
  133. @@ -0,0 +1,32 @@
  134. +/* SPDX-License-Identifier: GPL-2.0-only */
  135. +
  136. +/* This is board specific information:
  137. + * IRQ routing for the 0:1e.0 PCI bridge of the ICH10
  138. + */
  139. +
  140. +If (PICM) {
  141. + Return (Package() {
  142. + /* PCI slot */
  143. + Package() { 0x0001ffff, 0, 0, 0x14},
  144. + Package() { 0x0001ffff, 1, 0, 0x15},
  145. + Package() { 0x0001ffff, 2, 0, 0x16},
  146. + Package() { 0x0001ffff, 3, 0, 0x17},
  147. +
  148. + Package() { 0x0002ffff, 0, 0, 0x15},
  149. + Package() { 0x0002ffff, 1, 0, 0x16},
  150. + Package() { 0x0002ffff, 2, 0, 0x17},
  151. + Package() { 0x0002ffff, 3, 0, 0x14},
  152. + })
  153. +} Else {
  154. + Return (Package() {
  155. + Package() { 0x0001ffff, 0, \_SB.PCI0.LPCB.LNKE, 0},
  156. + Package() { 0x0001ffff, 1, \_SB.PCI0.LPCB.LNKF, 0},
  157. + Package() { 0x0001ffff, 2, \_SB.PCI0.LPCB.LNKG, 0},
  158. + Package() { 0x0001ffff, 3, \_SB.PCI0.LPCB.LNKH, 0},
  159. +
  160. + Package() { 0x0002ffff, 0, \_SB.PCI0.LPCB.LNKF, 0},
  161. + Package() { 0x0002ffff, 1, \_SB.PCI0.LPCB.LNKG, 0},
  162. + Package() { 0x0002ffff, 2, \_SB.PCI0.LPCB.LNKH, 0},
  163. + Package() { 0x0002ffff, 3, \_SB.PCI0.LPCB.LNKE, 0},
  164. + })
  165. +}
  166. diff --git a/src/mainboard/dell/optiplex_780/acpi/superio.asl b/src/mainboard/dell/optiplex_780/acpi/superio.asl
  167. new file mode 100644
  168. index 0000000000..9f3900b86c
  169. --- /dev/null
  170. +++ b/src/mainboard/dell/optiplex_780/acpi/superio.asl
  171. @@ -0,0 +1,18 @@
  172. +/* SPDX-License-Identifier: GPL-2.0-only */
  173. +
  174. +#undef SUPERIO_DEV
  175. +#undef SUPERIO_PNP_BASE
  176. +#undef IT8720F_SHOW_SP1
  177. +#undef IT8720F_SHOW_SP2
  178. +#undef IT8720F_SHOW_EC
  179. +#undef IT8720F_SHOW_KBCK
  180. +#undef IT8720F_SHOW_KBCM
  181. +#undef IT8720F_SHOW_GPIO
  182. +#undef IT8720F_SHOW_CIR
  183. +#define SUPERIO_DEV SIO0
  184. +#define SUPERIO_PNP_BASE 0x2e
  185. +#define IT8720F_SHOW_EC 1
  186. +#define IT8720F_SHOW_KBCK 1
  187. +#define IT8720F_SHOW_KBCM 1
  188. +#define IT8720F_SHOW_GPIO 1
  189. +#include <superio/ite/it8720f/acpi/superio.asl>
  190. diff --git a/src/mainboard/dell/optiplex_780/board_info.txt b/src/mainboard/dell/optiplex_780/board_info.txt
  191. new file mode 100644
  192. index 0000000000..aaf657b583
  193. --- /dev/null
  194. +++ b/src/mainboard/dell/optiplex_780/board_info.txt
  195. @@ -0,0 +1,6 @@
  196. +Category: desktop
  197. +Board URL: https://www.acer.com/ac/en/GB/content/support-product/1137?b=1
  198. +ROM package: SOIC-8
  199. +ROM protocol: SPI
  200. +ROM socketed: n
  201. +Flashrom support: y
  202. diff --git a/src/mainboard/dell/optiplex_780/cmos.default b/src/mainboard/dell/optiplex_780/cmos.default
  203. new file mode 100644
  204. index 0000000000..23f0e55f3e
  205. --- /dev/null
  206. +++ b/src/mainboard/dell/optiplex_780/cmos.default
  207. @@ -0,0 +1,8 @@
  208. +## SPDX-License-Identifier: GPL-2.0-only
  209. +
  210. +boot_option=Fallback
  211. +debug_level=Debug
  212. +power_on_after_fail=Disable
  213. +nmi=Enable
  214. +sata_mode=AHCI
  215. +gfx_uma_size=64M
  216. diff --git a/src/mainboard/dell/optiplex_780/cmos.layout b/src/mainboard/dell/optiplex_780/cmos.layout
  217. new file mode 100644
  218. index 0000000000..9f5012adb4
  219. --- /dev/null
  220. +++ b/src/mainboard/dell/optiplex_780/cmos.layout
  221. @@ -0,0 +1,72 @@
  222. +## SPDX-License-Identifier: GPL-2.0-only
  223. +
  224. +# -----------------------------------------------------------------
  225. +entries
  226. +
  227. +# -----------------------------------------------------------------
  228. +0 120 r 0 reserved_memory
  229. +
  230. +# -----------------------------------------------------------------
  231. +# RTC_BOOT_BYTE (coreboot hardcoded)
  232. +384 1 e 4 boot_option
  233. +388 4 h 0 reboot_counter
  234. +
  235. +# -----------------------------------------------------------------
  236. +# coreboot config options: console
  237. +395 4 e 6 debug_level
  238. +
  239. +# coreboot config options: southbridge
  240. +408 1 e 10 sata_mode
  241. +409 2 e 7 power_on_after_fail
  242. +411 1 e 1 nmi
  243. +
  244. +# coreboot config options: cpu
  245. +
  246. +# coreboot config options: northbridge
  247. +432 4 e 11 gfx_uma_size
  248. +
  249. +# coreboot config options: check sums
  250. +984 16 h 0 check_sum
  251. +
  252. +# -----------------------------------------------------------------
  253. +
  254. +enumerations
  255. +
  256. +#ID value text
  257. +1 0 Disable
  258. +1 1 Enable
  259. +2 0 Enable
  260. +2 1 Disable
  261. +4 0 Fallback
  262. +4 1 Normal
  263. +6 0 Emergency
  264. +6 1 Alert
  265. +6 2 Critical
  266. +6 3 Error
  267. +6 4 Warning
  268. +6 5 Notice
  269. +6 6 Info
  270. +6 7 Debug
  271. +6 8 Spew
  272. +7 0 Disable
  273. +7 1 Enable
  274. +7 2 Keep
  275. +10 0 AHCI
  276. +10 1 Compatible
  277. +11 1 4M
  278. +11 2 8M
  279. +11 3 16M
  280. +11 4 32M
  281. +11 5 48M
  282. +11 6 64M
  283. +11 7 128M
  284. +11 8 256M
  285. +11 9 96M
  286. +11 10 160M
  287. +11 11 224M
  288. +11 12 352M
  289. +
  290. +# -----------------------------------------------------------------
  291. +checksums
  292. +
  293. +checksum 392 983 984
  294. diff --git a/src/mainboard/dell/optiplex_780/cstates.c b/src/mainboard/dell/optiplex_780/cstates.c
  295. new file mode 100644
  296. index 0000000000..4adf0edc63
  297. --- /dev/null
  298. +++ b/src/mainboard/dell/optiplex_780/cstates.c
  299. @@ -0,0 +1,8 @@
  300. +/* SPDX-License-Identifier: GPL-2.0-only */
  301. +
  302. +#include <acpi/acpigen.h>
  303. +
  304. +int get_cst_entries(const acpi_cstate_t **entries)
  305. +{
  306. + return 0;
  307. +}
  308. diff --git a/src/mainboard/dell/optiplex_780/devicetree.cb b/src/mainboard/dell/optiplex_780/devicetree.cb
  309. new file mode 100644
  310. index 0000000000..95e3bd517c
  311. --- /dev/null
  312. +++ b/src/mainboard/dell/optiplex_780/devicetree.cb
  313. @@ -0,0 +1,63 @@
  314. +# SPDX-License-Identifier: GPL-2.0-or-later
  315. +
  316. +chip northbridge/intel/x4x
  317. + device cpu_cluster 0 on ops x4x_cpu_bus_ops end # APIC cluster
  318. + device domain 0 on
  319. + ops x4x_pci_domain_ops # PCI domain
  320. + subsystemid 0x8086 0x0028 inherit
  321. + device pci 0.0 on end # Host Bridge
  322. + device pci 1.0 on end # PCIe x16 2.0 slot
  323. + device pci 2.0 on end # Integrated graphics controller
  324. + device pci 2.1 on end # Integrated graphics controller 2
  325. + device pci 3.0 off end # ME
  326. + device pci 3.1 off end # ME
  327. + chip southbridge/intel/i82801jx # ICH10
  328. + register "gpe0_en" = "0x40"
  329. +
  330. + # Set AHCI mode.
  331. + register "sata_port_map" = "0x3f"
  332. + register "sata_clock_request" = "1"
  333. +
  334. + # Enable PCIe ports 0,1 as slots.
  335. + register "pcie_slot_implemented" = "0x3"
  336. +
  337. + device pci 19.0 on end # GBE
  338. + device pci 1a.0 on end # USB
  339. + device pci 1a.1 on end # USB
  340. + device pci 1a.2 on end # USB
  341. + device pci 1a.7 on end # USB
  342. + device pci 1b.0 on end # Audio
  343. + device pci 1c.0 off end # PCIe 1
  344. + device pci 1c.1 off end # PCIe 2
  345. + device pci 1c.2 off end # PCIe 3
  346. + device pci 1c.3 off end # PCIe 4
  347. + device pci 1c.4 off end # PCIe 5
  348. + device pci 1c.5 off end # PCIe 6
  349. + device pci 1d.0 on end # USB
  350. + device pci 1d.1 on end # USB
  351. + device pci 1d.2 on end # USB
  352. + device pci 1d.7 on end # USB
  353. + device pci 1e.0 on end # PCI bridge
  354. + device pci 1f.0 on end # LPC bridge
  355. + device pci 1f.2 on end # SATA (IDE: port 0-3, AHCI/RAID: 0-5)
  356. + device pci 1f.3 on # SMBus
  357. + chip drivers/i2c/ck505 # IDT CV194
  358. + register "mask" = "{ 0xff, 0xff, 0xff, 0xff,
  359. + 0xff, 0xff, 0xff, 0xff,
  360. + 0xff, 0xff, 0xff, 0xff,
  361. + 0xff, 0xff, 0xff, 0xff,
  362. + 0xff, 0xff, 0xff }"
  363. + register "regs" = "{ 0x15, 0x82, 0xff, 0xff,
  364. + 0xff, 0x00, 0x00, 0x95,
  365. + 0x00, 0x65, 0x7d, 0x56,
  366. + 0x13, 0xc0, 0x00, 0x07,
  367. + 0x01, 0x0a, 0x64 }"
  368. + device i2c 69 on end
  369. + end
  370. + end
  371. + device pci 1f.4 off end
  372. + device pci 1f.5 off end # SATA 2 (for port 4-5 in IDE mode)
  373. + device pci 1f.6 off end # Thermal Subsystem
  374. + end
  375. + end
  376. +end
  377. diff --git a/src/mainboard/dell/optiplex_780/dsdt.asl b/src/mainboard/dell/optiplex_780/dsdt.asl
  378. new file mode 100644
  379. index 0000000000..9ad70469de
  380. --- /dev/null
  381. +++ b/src/mainboard/dell/optiplex_780/dsdt.asl
  382. @@ -0,0 +1,26 @@
  383. +/* SPDX-License-Identifier: GPL-2.0-only */
  384. +
  385. +#include <acpi/acpi.h>
  386. +DefinitionBlock(
  387. + "dsdt.aml",
  388. + "DSDT",
  389. + ACPI_DSDT_REV_2,
  390. + OEM_ID,
  391. + ACPI_TABLE_CREATOR,
  392. + 0x20090811 // OEM revision
  393. +)
  394. +{
  395. + #include <acpi/dsdt_top.asl>
  396. +
  397. + OSYS = 2002
  398. + // global NVS and variables
  399. + #include <southbridge/intel/common/acpi/platform.asl>
  400. +
  401. + Device (\_SB.PCI0)
  402. + {
  403. + #include <northbridge/intel/x4x/acpi/x4x.asl>
  404. + #include <southbridge/intel/i82801jx/acpi/ich10.asl>
  405. + }
  406. +
  407. + #include <southbridge/intel/common/acpi/sleepstates.asl>
  408. +}
  409. diff --git a/src/mainboard/dell/optiplex_780/gma-mainboard.ads b/src/mainboard/dell/optiplex_780/gma-mainboard.ads
  410. new file mode 100644
  411. index 0000000000..bc81cf4a40
  412. --- /dev/null
  413. +++ b/src/mainboard/dell/optiplex_780/gma-mainboard.ads
  414. @@ -0,0 +1,16 @@
  415. +-- SPDX-License-Identifier: GPL-2.0-or-later
  416. +
  417. +with HW.GFX.GMA;
  418. +with HW.GFX.GMA.Display_Probing;
  419. +
  420. +use HW.GFX.GMA;
  421. +use HW.GFX.GMA.Display_Probing;
  422. +
  423. +private package GMA.Mainboard is
  424. +
  425. + ports : constant Port_List :=
  426. + (DP2,
  427. + Analog,
  428. + others => Disabled);
  429. +
  430. +end GMA.Mainboard;
  431. diff --git a/src/mainboard/dell/optiplex_780/variants/780_mt/data.vbt b/src/mainboard/dell/optiplex_780/variants/780_mt/data.vbt
  432. new file mode 100644
  433. index 0000000000000000000000000000000000000000..fefda9d6f226b88ab67c5b044de30a707df22fbf
  434. GIT binary patch
  435. literal 1917
  436. zcmd6nO>7%Q6vzLwGv0Mv$FUpJ*ik4iQd_wnX*X`M0y3~p?8a$~>ZXxZMU`4dc9RGb
  437. zTXq_i1Bwd~aNr{c4i)r(goF^M-nek+sY0sMa}Sk>xFFy_FTEfX^Y+7unt+OgkeJbX
  438. zznS;`v-5V=o<pVaS;}Q53%NpOI!8{cz{K0eVfK65_|*A}SF)Me%$4!N`H5-z90%~a
  439. zvGog3fe5LjnM&o#3$<#k{6>{ZwwmnN>gY?}>{`7^JBpP$l`EBIwbi0*k&aU)n@v)E
  440. znI_A1T57efS5MG<y}m-_+CrVKE#0VADDft%nb#Y<<ao9;Mf?!XvM)_$Xla>NN5_ut
  441. zt=x`G)EjR#mlhURC^2!A3p33TcBg4-d8JyTiF&hfk}|a#&Dfe2%~V^}=4!QavNzBh
  442. z0Pae^5`gfb?<R!YN+PQ)U7<%H;73qF3iyQT71$?W2s|f{69_4sRY(x>7Q)c(LsP)8
  443. zQy)2gw<F#IP`I}U>gG1S^>aw&0D}Z+-SCcJJF;s)yXJeQ|4N{SU?$I`#$HZa<Jq(M
  444. zbA{r}Z0XY6<@U{Y-d!KWR>9dWBuxA$6X;VK;%W?Y>I;0P`|*vwAK$S(VB2JSq6g4n
  445. z>oEf8XCt;_Y-iYBWz#<re{?il1^f{S#nht`VW!62^5R*KQ6_?#8e&Qw=9%`og2x!s
  446. z&J)wlZ=a<yoJkutfwu4%aVXlu?i^8v?R77IyGvKcD|M`CFG$6FUmK8q<|o>3T9EmJ
  447. z2x?*GPeN%?=Fj3+fv~4%I(nv~XF7VOqi5RsAt%13JtW>q=<<<Gei4)FzWqGEt6P8D
  448. zA9m}s>;0IkLPSUGL%_1h)2kjaZzuV;`43yCV;I=#Jcyyw@xKE8GGX39@am|0GKhH`
  449. zawsKv^FvHqm+<DDPT)%}_kZ8^eT88YGmG-#)X3=RRB|L^Uj_{yd%JeO<1HRZVz=Fz
  450. z+aqUCWdF3_={#Q&&k)eF1i=WV`AbSlzo*bP?x?ir5BVVO`R34f89jWL{Z}or^BwmG
  451. z-E;A_iWVUUWnWQl3L|~0xA@rHJRA-;7V)Y6B5=@E8R@?(?5{Eh23RefpSOGX_F{8A
  452. z1PtU+iNng^h#C7J<vufJ9>c8*FfFsu??w)Oed@;Mg~21%rCZ%d{x!>-zmv4AyWL1E
  453. xfz+CGUnQ7Y^TD}&c_cQRYlBC+`?m?k6Nuw??s04gg4@4`<@FO{XEbO(<xf!`#Pk3F
  454. literal 0
  455. HcmV?d00001
  456. diff --git a/src/mainboard/dell/optiplex_780/variants/780_mt/early_init.c b/src/mainboard/dell/optiplex_780/variants/780_mt/early_init.c
  457. new file mode 100644
  458. index 0000000000..e2fa05cd8f
  459. --- /dev/null
  460. +++ b/src/mainboard/dell/optiplex_780/variants/780_mt/early_init.c
  461. @@ -0,0 +1,12 @@
  462. +/* SPDX-License-Identifier: GPL-2.0-or-later */
  463. +
  464. +#include <northbridge/intel/x4x/x4x.h>
  465. +
  466. +void mb_get_spd_map(u8 spd_map[4])
  467. +{
  468. + // BTX form factor
  469. + spd_map[0] = 0x53;
  470. + spd_map[1] = 0x52;
  471. + spd_map[2] = 0x51;
  472. + spd_map[3] = 0x50;
  473. +}
  474. diff --git a/src/mainboard/dell/optiplex_780/variants/780_mt/gpio.c b/src/mainboard/dell/optiplex_780/variants/780_mt/gpio.c
  475. new file mode 100644
  476. index 0000000000..9993f17c55
  477. --- /dev/null
  478. +++ b/src/mainboard/dell/optiplex_780/variants/780_mt/gpio.c
  479. @@ -0,0 +1,174 @@
  480. +/* SPDX-License-Identifier: GPL-2.0-only */
  481. +
  482. +#include <southbridge/intel/common/gpio.h>
  483. +
  484. +static const struct pch_gpio_set1 pch_gpio_set1_mode = {
  485. + .gpio0 = GPIO_MODE_NATIVE,
  486. + .gpio1 = GPIO_MODE_NATIVE,
  487. + .gpio2 = GPIO_MODE_GPIO,
  488. + .gpio3 = GPIO_MODE_GPIO,
  489. + .gpio4 = GPIO_MODE_GPIO,
  490. + .gpio5 = GPIO_MODE_GPIO,
  491. + .gpio6 = GPIO_MODE_GPIO,
  492. + .gpio7 = GPIO_MODE_NATIVE,
  493. + .gpio8 = GPIO_MODE_NATIVE,
  494. + .gpio9 = GPIO_MODE_GPIO,
  495. + .gpio10 = GPIO_MODE_GPIO,
  496. + .gpio11 = GPIO_MODE_NATIVE,
  497. + .gpio12 = GPIO_MODE_NATIVE,
  498. + .gpio13 = GPIO_MODE_GPIO,
  499. + .gpio14 = GPIO_MODE_GPIO,
  500. + .gpio15 = GPIO_MODE_NATIVE,
  501. + .gpio16 = GPIO_MODE_GPIO,
  502. + .gpio17 = GPIO_MODE_NATIVE,
  503. + .gpio18 = GPIO_MODE_GPIO,
  504. + .gpio19 = GPIO_MODE_GPIO,
  505. + .gpio20 = GPIO_MODE_GPIO,
  506. + .gpio21 = GPIO_MODE_GPIO,
  507. + .gpio22 = GPIO_MODE_GPIO,
  508. + .gpio23 = GPIO_MODE_NATIVE,
  509. + .gpio24 = GPIO_MODE_GPIO,
  510. + .gpio25 = GPIO_MODE_NATIVE,
  511. + .gpio26 = GPIO_MODE_NATIVE,
  512. + .gpio27 = GPIO_MODE_GPIO,
  513. + .gpio28 = GPIO_MODE_GPIO,
  514. + .gpio29 = GPIO_MODE_GPIO,
  515. + .gpio30 = GPIO_MODE_GPIO,
  516. + .gpio31 = GPIO_MODE_GPIO,
  517. +};
  518. +
  519. +static const struct pch_gpio_set1 pch_gpio_set1_direction = {
  520. + .gpio2 = GPIO_DIR_INPUT,
  521. + .gpio3 = GPIO_DIR_INPUT,
  522. + .gpio4 = GPIO_DIR_INPUT,
  523. + .gpio5 = GPIO_DIR_INPUT,
  524. + .gpio6 = GPIO_DIR_INPUT,
  525. + .gpio9 = GPIO_DIR_OUTPUT,
  526. + .gpio10 = GPIO_DIR_INPUT,
  527. + .gpio13 = GPIO_DIR_INPUT,
  528. + .gpio14 = GPIO_DIR_INPUT,
  529. + .gpio16 = GPIO_DIR_INPUT,
  530. + .gpio18 = GPIO_DIR_OUTPUT,
  531. + .gpio19 = GPIO_DIR_INPUT,
  532. + .gpio20 = GPIO_DIR_OUTPUT,
  533. + .gpio21 = GPIO_DIR_INPUT,
  534. + .gpio22 = GPIO_DIR_INPUT,
  535. + .gpio24 = GPIO_DIR_INPUT,
  536. + .gpio27 = GPIO_DIR_INPUT,
  537. + .gpio28 = GPIO_DIR_OUTPUT,
  538. + .gpio29 = GPIO_DIR_INPUT,
  539. + .gpio30 = GPIO_DIR_INPUT,
  540. + .gpio31 = GPIO_DIR_INPUT,
  541. +};
  542. +
  543. +static const struct pch_gpio_set1 pch_gpio_set1_level = {
  544. + .gpio9 = GPIO_LEVEL_HIGH,
  545. + .gpio18 = GPIO_LEVEL_HIGH,
  546. + .gpio20 = GPIO_LEVEL_HIGH,
  547. + .gpio28 = GPIO_LEVEL_LOW,
  548. +};
  549. +
  550. +static const struct pch_gpio_set1 pch_gpio_set1_blink = {
  551. +};
  552. +
  553. +static const struct pch_gpio_set1 pch_gpio_set1_invert = {
  554. + .gpio13 = GPIO_INVERT,
  555. +};
  556. +
  557. +static const struct pch_gpio_set2 pch_gpio_set2_mode = {
  558. + .gpio32 = GPIO_MODE_GPIO,
  559. + .gpio33 = GPIO_MODE_GPIO,
  560. + .gpio34 = GPIO_MODE_GPIO,
  561. + .gpio35 = GPIO_MODE_GPIO,
  562. + .gpio36 = GPIO_MODE_GPIO,
  563. + .gpio37 = GPIO_MODE_GPIO,
  564. + .gpio38 = GPIO_MODE_GPIO,
  565. + .gpio39 = GPIO_MODE_GPIO,
  566. + .gpio40 = GPIO_MODE_NATIVE,
  567. + .gpio41 = GPIO_MODE_NATIVE,
  568. + .gpio42 = GPIO_MODE_NATIVE,
  569. + .gpio43 = GPIO_MODE_NATIVE,
  570. + .gpio44 = GPIO_MODE_NATIVE,
  571. + .gpio45 = GPIO_MODE_NATIVE,
  572. + .gpio46 = GPIO_MODE_NATIVE,
  573. + .gpio47 = GPIO_MODE_NATIVE,
  574. + .gpio48 = GPIO_MODE_GPIO,
  575. + .gpio49 = GPIO_MODE_GPIO,
  576. + .gpio50 = GPIO_MODE_NATIVE,
  577. + .gpio51 = GPIO_MODE_NATIVE,
  578. + .gpio52 = GPIO_MODE_NATIVE,
  579. + .gpio53 = GPIO_MODE_NATIVE,
  580. + .gpio54 = GPIO_MODE_GPIO,
  581. + .gpio55 = GPIO_MODE_NATIVE,
  582. + .gpio56 = GPIO_MODE_GPIO,
  583. + .gpio57 = GPIO_MODE_GPIO,
  584. + .gpio58 = GPIO_MODE_NATIVE,
  585. + .gpio59 = GPIO_MODE_NATIVE,
  586. + .gpio60 = GPIO_MODE_GPIO,
  587. + .gpio61 = GPIO_MODE_NATIVE,
  588. + .gpio62 = GPIO_MODE_NATIVE,
  589. + .gpio63 = GPIO_MODE_NATIVE,
  590. +};
  591. +
  592. +static const struct pch_gpio_set2 pch_gpio_set2_direction = {
  593. + .gpio32 = GPIO_DIR_INPUT,
  594. + .gpio33 = GPIO_DIR_INPUT,
  595. + .gpio34 = GPIO_DIR_INPUT,
  596. + .gpio35 = GPIO_DIR_OUTPUT,
  597. + .gpio36 = GPIO_DIR_INPUT,
  598. + .gpio37 = GPIO_DIR_INPUT,
  599. + .gpio38 = GPIO_DIR_INPUT,
  600. + .gpio39 = GPIO_DIR_INPUT,
  601. + .gpio48 = GPIO_DIR_INPUT,
  602. + .gpio49 = GPIO_DIR_OUTPUT,
  603. + .gpio54 = GPIO_DIR_INPUT,
  604. + .gpio56 = GPIO_DIR_OUTPUT,
  605. + .gpio57 = GPIO_DIR_INPUT,
  606. + .gpio60 = GPIO_DIR_OUTPUT,
  607. +};
  608. +
  609. +static const struct pch_gpio_set2 pch_gpio_set2_level = {
  610. + .gpio35 = GPIO_LEVEL_LOW,
  611. + .gpio49 = GPIO_LEVEL_HIGH,
  612. + .gpio56 = GPIO_LEVEL_HIGH,
  613. + .gpio60 = GPIO_LEVEL_LOW,
  614. +};
  615. +
  616. +static const struct pch_gpio_set3 pch_gpio_set3_mode = {
  617. + .gpio64 = GPIO_MODE_NATIVE,
  618. + .gpio65 = GPIO_MODE_NATIVE,
  619. + .gpio66 = GPIO_MODE_NATIVE,
  620. + .gpio67 = GPIO_MODE_NATIVE,
  621. + .gpio68 = GPIO_MODE_NATIVE,
  622. + .gpio69 = GPIO_MODE_NATIVE,
  623. + .gpio70 = GPIO_MODE_NATIVE,
  624. + .gpio71 = GPIO_MODE_NATIVE,
  625. + .gpio72 = GPIO_MODE_GPIO,
  626. +};
  627. +
  628. +static const struct pch_gpio_set3 pch_gpio_set3_direction = {
  629. + .gpio72 = GPIO_DIR_INPUT,
  630. +};
  631. +
  632. +static const struct pch_gpio_set3 pch_gpio_set3_level = {
  633. +};
  634. +
  635. +const struct pch_gpio_map mainboard_gpio_map = {
  636. + .set1 = {
  637. + .mode = &pch_gpio_set1_mode,
  638. + .direction = &pch_gpio_set1_direction,
  639. + .level = &pch_gpio_set1_level,
  640. + .blink = &pch_gpio_set1_blink,
  641. + .invert = &pch_gpio_set1_invert,
  642. + },
  643. + .set2 = {
  644. + .mode = &pch_gpio_set2_mode,
  645. + .direction = &pch_gpio_set2_direction,
  646. + .level = &pch_gpio_set2_level,
  647. + },
  648. + .set3 = {
  649. + .mode = &pch_gpio_set3_mode,
  650. + .direction = &pch_gpio_set3_direction,
  651. + .level = &pch_gpio_set3_level,
  652. + },
  653. +};
  654. diff --git a/src/mainboard/dell/optiplex_780/variants/780_mt/hda_verb.c b/src/mainboard/dell/optiplex_780/variants/780_mt/hda_verb.c
  655. new file mode 100644
  656. index 0000000000..4158bcf899
  657. --- /dev/null
  658. +++ b/src/mainboard/dell/optiplex_780/variants/780_mt/hda_verb.c
  659. @@ -0,0 +1,26 @@
  660. +/* SPDX-License-Identifier: GPL-2.0-or-later */
  661. +
  662. +#include <device/azalia_device.h>
  663. +
  664. +const u32 cim_verb_data[] = {
  665. + /* coreboot specific header */
  666. + 0x11d4194a, /* Analog Devices AD1984A */
  667. + 0xbfd40000, /* Subsystem ID */
  668. + 10, /* Number of entries */
  669. +
  670. + /* Pin Widget Verb Table */
  671. + AZALIA_PIN_CFG(0, 0x11, 0x032140f0),
  672. + AZALIA_PIN_CFG(0, 0x12, 0x21214010),
  673. + AZALIA_PIN_CFG(0, 0x13, 0x901701f0),
  674. + AZALIA_PIN_CFG(0, 0x14, 0x03a190f0),
  675. + AZALIA_PIN_CFG(0, 0x15, 0xb7a70121),
  676. + AZALIA_PIN_CFG(0, 0x16, 0x9933012e),
  677. + AZALIA_PIN_CFG(0, 0x17, 0x97a601f0),
  678. + AZALIA_PIN_CFG(0, 0x1a, 0x90f301f0),
  679. + AZALIA_PIN_CFG(0, 0x1b, 0x014510f0),
  680. + AZALIA_PIN_CFG(0, 0x1c, 0x21a19020),
  681. +};
  682. +
  683. +const u32 pc_beep_verbs[0] = {};
  684. +
  685. +AZALIA_ARRAY_SIZES;
  686. diff --git a/src/mainboard/dell/optiplex_780/variants/780_mt/overridetree.cb b/src/mainboard/dell/optiplex_780/variants/780_mt/overridetree.cb
  687. new file mode 100644
  688. index 0000000000..555b1c1f5c
  689. --- /dev/null
  690. +++ b/src/mainboard/dell/optiplex_780/variants/780_mt/overridetree.cb
  691. @@ -0,0 +1,10 @@
  692. +## SPDX-License-Identifier: GPL-2.0-or-later
  693. +
  694. +chip northbridge/intel/x4x
  695. + device domain 0 on
  696. + chip southbridge/intel/i82801jx
  697. + device pci 1c.0 on end # PCIe 1
  698. + device pci 1c.1 on end # PCIe 2
  699. + end
  700. + end
  701. +end
  702. --
  703. 2.39.5