0030-mb-hp-Add-Compaq-Elite-8300-CMT-port.patch 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874
  1. From 4e0b62e6f0977cf922b1947955538ddca63bb954 Mon Sep 17 00:00:00 2001
  2. From: Riku Viitanen <riku.viitanen@protonmail.com>
  3. Date: Sat, 23 Dec 2023 19:02:10 +0200
  4. Subject: [PATCH 30/30] mb/hp: Add Compaq Elite 8300 CMT port
  5. Based on autoport and Z220 SuperIO code.
  6. With SeaBIOS and Nouveau on Debian, only nomodeset works with GTX 780
  7. (must use proprietary driver instead).
  8. Tested by xilynx / spot_ on #libreboot:
  9. - i3-3220, native raminit 2x2GB, M378B5773DH0-CH9 + MT8JTF25664AZ-1G6M1
  10. - Celeron G1620, native raminit 1x4GB, MT8JTF51264AZ-1G6E1
  11. - Booting Debian with Linux 6.1.0-16-amd64 via SeaBIOS
  12. - All SATA ports
  13. - Audio: internal speaker, headphone and microphone plugs
  14. - Rebooting
  15. - S3 suspend and wake
  16. - libgfxinit: VGA, DisplayPort
  17. - Ethernet
  18. - Super I/O: fan speeds stay in control
  19. - GPU in PEG slot
  20. Untested:
  21. - EHCI debugging
  22. - Other PCI/PCIe slots
  23. - PS/2
  24. - Serial, parallel ports
  25. Change-Id: Ie6ec60d2f4ee50d5e3fa2847c19fa4cf0ab73363
  26. Signed-off-by: Riku Viitanen <riku.viitanen@protonmail.com>
  27. ---
  28. .../hp/compaq_elite_8300_cmt/Kconfig | 39 ++++
  29. .../hp/compaq_elite_8300_cmt/Kconfig.name | 2 +
  30. .../hp/compaq_elite_8300_cmt/Makefile.inc | 7 +
  31. .../hp/compaq_elite_8300_cmt/acpi/ec.asl | 1 +
  32. .../compaq_elite_8300_cmt/acpi/platform.asl | 10 +
  33. .../hp/compaq_elite_8300_cmt/acpi/superio.asl | 29 +++
  34. .../hp/compaq_elite_8300_cmt/acpi_tables.c | 12 ++
  35. .../hp/compaq_elite_8300_cmt/board_info.txt | 5 +
  36. .../hp/compaq_elite_8300_cmt/cmos.default | 7 +
  37. .../hp/compaq_elite_8300_cmt/cmos.layout | 74 +++++++
  38. .../hp/compaq_elite_8300_cmt/data.vbt | Bin 0 -> 3902 bytes
  39. .../hp/compaq_elite_8300_cmt/devicetree.cb | 161 +++++++++++++++
  40. .../hp/compaq_elite_8300_cmt/dsdt.asl | 26 +++
  41. .../hp/compaq_elite_8300_cmt/early_init.c | 31 +++
  42. .../compaq_elite_8300_cmt/gma-mainboard.ads | 17 ++
  43. src/mainboard/hp/compaq_elite_8300_cmt/gpio.c | 191 ++++++++++++++++++
  44. .../hp/compaq_elite_8300_cmt/hda_verb.c | 33 +++
  45. .../hp/compaq_elite_8300_cmt/mainboard.c | 16 ++
  46. 18 files changed, 661 insertions(+)
  47. create mode 100644 src/mainboard/hp/compaq_elite_8300_cmt/Kconfig
  48. create mode 100644 src/mainboard/hp/compaq_elite_8300_cmt/Kconfig.name
  49. create mode 100644 src/mainboard/hp/compaq_elite_8300_cmt/Makefile.inc
  50. create mode 100644 src/mainboard/hp/compaq_elite_8300_cmt/acpi/ec.asl
  51. create mode 100644 src/mainboard/hp/compaq_elite_8300_cmt/acpi/platform.asl
  52. create mode 100644 src/mainboard/hp/compaq_elite_8300_cmt/acpi/superio.asl
  53. create mode 100644 src/mainboard/hp/compaq_elite_8300_cmt/acpi_tables.c
  54. create mode 100644 src/mainboard/hp/compaq_elite_8300_cmt/board_info.txt
  55. create mode 100644 src/mainboard/hp/compaq_elite_8300_cmt/cmos.default
  56. create mode 100644 src/mainboard/hp/compaq_elite_8300_cmt/cmos.layout
  57. create mode 100644 src/mainboard/hp/compaq_elite_8300_cmt/data.vbt
  58. create mode 100644 src/mainboard/hp/compaq_elite_8300_cmt/devicetree.cb
  59. create mode 100644 src/mainboard/hp/compaq_elite_8300_cmt/dsdt.asl
  60. create mode 100644 src/mainboard/hp/compaq_elite_8300_cmt/early_init.c
  61. create mode 100644 src/mainboard/hp/compaq_elite_8300_cmt/gma-mainboard.ads
  62. create mode 100644 src/mainboard/hp/compaq_elite_8300_cmt/gpio.c
  63. create mode 100644 src/mainboard/hp/compaq_elite_8300_cmt/hda_verb.c
  64. create mode 100644 src/mainboard/hp/compaq_elite_8300_cmt/mainboard.c
  65. diff --git a/src/mainboard/hp/compaq_elite_8300_cmt/Kconfig b/src/mainboard/hp/compaq_elite_8300_cmt/Kconfig
  66. new file mode 100644
  67. index 0000000000..d2bfd35dc4
  68. --- /dev/null
  69. +++ b/src/mainboard/hp/compaq_elite_8300_cmt/Kconfig
  70. @@ -0,0 +1,39 @@
  71. +if BOARD_HP_COMPAQ_ELITE_8300_CMT
  72. +
  73. +config BOARD_SPECIFIC_OPTIONS
  74. + def_bool y
  75. + select BOARD_ROMSIZE_KB_16384
  76. + select HAVE_ACPI_RESUME
  77. + select HAVE_ACPI_TABLES
  78. + select HAVE_CMOS_DEFAULT
  79. + select HAVE_OPTION_TABLE
  80. + select INTEL_GMA_HAVE_VBT
  81. + select INTEL_INT15
  82. + select MAINBOARD_HAS_TPM1
  83. + select MAINBOARD_HAS_LIBGFXINIT
  84. + select MAINBOARD_USES_IFD_GBE_REGION
  85. + select MEMORY_MAPPED_TPM
  86. + select NORTHBRIDGE_INTEL_SANDYBRIDGE
  87. + select SERIRQ_CONTINUOUS_MODE
  88. + select SOUTHBRIDGE_INTEL_C216
  89. + select SUPERIO_NUVOTON_NPCD378
  90. + select USE_NATIVE_RAMINIT
  91. +
  92. +config CBFS_SIZE
  93. + default 0x570000
  94. +
  95. +config MAINBOARD_DIR
  96. + default "hp/compaq_elite_8300_cmt"
  97. +
  98. +config MAINBOARD_PART_NUMBER
  99. + default "HP Compaq Elite 8300 CMT"
  100. +
  101. +config VGA_BIOS_ID
  102. + default "8086,0152"
  103. +
  104. +config DRAM_RESET_GATE_GPIO
  105. + default 60
  106. +
  107. +config USBDEBUG_HCD_INDEX # FIXME: check this
  108. + default 2
  109. +endif
  110. diff --git a/src/mainboard/hp/compaq_elite_8300_cmt/Kconfig.name b/src/mainboard/hp/compaq_elite_8300_cmt/Kconfig.name
  111. new file mode 100644
  112. index 0000000000..bd399b1e76
  113. --- /dev/null
  114. +++ b/src/mainboard/hp/compaq_elite_8300_cmt/Kconfig.name
  115. @@ -0,0 +1,2 @@
  116. +config BOARD_HP_COMPAQ_ELITE_8300_CMT
  117. + bool "Compaq Elite 8300 CMT"
  118. diff --git a/src/mainboard/hp/compaq_elite_8300_cmt/Makefile.inc b/src/mainboard/hp/compaq_elite_8300_cmt/Makefile.inc
  119. new file mode 100644
  120. index 0000000000..fb492d3583
  121. --- /dev/null
  122. +++ b/src/mainboard/hp/compaq_elite_8300_cmt/Makefile.inc
  123. @@ -0,0 +1,7 @@
  124. +## SPDX-License-Identifier: GPL-2.0-only
  125. +
  126. +bootblock-y += early_init.c
  127. +bootblock-y += gpio.c
  128. +romstage-y += early_init.c
  129. +romstage-y += gpio.c
  130. +ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += gma-mainboard.ads
  131. diff --git a/src/mainboard/hp/compaq_elite_8300_cmt/acpi/ec.asl b/src/mainboard/hp/compaq_elite_8300_cmt/acpi/ec.asl
  132. new file mode 100644
  133. index 0000000000..73fa78ef14
  134. --- /dev/null
  135. +++ b/src/mainboard/hp/compaq_elite_8300_cmt/acpi/ec.asl
  136. @@ -0,0 +1 @@
  137. +/* SPDX-License-Identifier: GPL-2.0-or-later */
  138. diff --git a/src/mainboard/hp/compaq_elite_8300_cmt/acpi/platform.asl b/src/mainboard/hp/compaq_elite_8300_cmt/acpi/platform.asl
  139. new file mode 100644
  140. index 0000000000..aff432b6f4
  141. --- /dev/null
  142. +++ b/src/mainboard/hp/compaq_elite_8300_cmt/acpi/platform.asl
  143. @@ -0,0 +1,10 @@
  144. +/* SPDX-License-Identifier: GPL-2.0-only */
  145. +
  146. +Method(_WAK, 1)
  147. +{
  148. + Return(Package() {0, 0})
  149. +}
  150. +
  151. +Method(_PTS, 1)
  152. +{
  153. +}
  154. diff --git a/src/mainboard/hp/compaq_elite_8300_cmt/acpi/superio.asl b/src/mainboard/hp/compaq_elite_8300_cmt/acpi/superio.asl
  155. new file mode 100644
  156. index 0000000000..54f8e3fe95
  157. --- /dev/null
  158. +++ b/src/mainboard/hp/compaq_elite_8300_cmt/acpi/superio.asl
  159. @@ -0,0 +1,29 @@
  160. +/* SPDX-License-Identifier: GPL-2.0-only */
  161. +
  162. +/* Copied over from compaq_8200_elite_sff/acpi/superio.asl */
  163. +
  164. +#include <superio/nuvoton/npcd378/acpi/superio.asl>
  165. +
  166. +Scope (\_GPE)
  167. +{
  168. + Method (_L0D, 0, NotSerialized)
  169. + {
  170. + Notify (\_SB.PCI0.EHC1, 0x02)
  171. + Notify (\_SB.PCI0.EHC2, 0x02)
  172. + //FIXME: Add GBE device
  173. + //Notify (\_SB.PCI0.GBE, 0x02)
  174. + }
  175. +
  176. + Method (_L09, 0, NotSerialized)
  177. + {
  178. + Notify (\_SB.PCI0.RP01, 0x02)
  179. + Notify (\_SB.PCI0.RP02, 0x02)
  180. + Notify (\_SB.PCI0.RP03, 0x02)
  181. + Notify (\_SB.PCI0.RP04, 0x02)
  182. + Notify (\_SB.PCI0.RP05, 0x02)
  183. + Notify (\_SB.PCI0.RP06, 0x02)
  184. + Notify (\_SB.PCI0.RP07, 0x02)
  185. + Notify (\_SB.PCI0.RP08, 0x02)
  186. + Notify (\_SB.PCI0.PEGP, 0x02)
  187. + }
  188. +}
  189. diff --git a/src/mainboard/hp/compaq_elite_8300_cmt/acpi_tables.c b/src/mainboard/hp/compaq_elite_8300_cmt/acpi_tables.c
  190. new file mode 100644
  191. index 0000000000..8f4f83b826
  192. --- /dev/null
  193. +++ b/src/mainboard/hp/compaq_elite_8300_cmt/acpi_tables.c
  194. @@ -0,0 +1,12 @@
  195. +/* SPDX-License-Identifier: GPL-2.0-only */
  196. +
  197. +#include <acpi/acpi_gnvs.h>
  198. +#include <soc/nvs.h>
  199. +
  200. +void mainboard_fill_gnvs(struct global_nvs *gnvs)
  201. +{
  202. + /* Temperature at which OS will shutdown */
  203. + gnvs->tcrt = 100;
  204. + /* Temperature at which OS will throttle CPU */
  205. + gnvs->tpsv = 90;
  206. +}
  207. diff --git a/src/mainboard/hp/compaq_elite_8300_cmt/board_info.txt b/src/mainboard/hp/compaq_elite_8300_cmt/board_info.txt
  208. new file mode 100644
  209. index 0000000000..16c29e82d8
  210. --- /dev/null
  211. +++ b/src/mainboard/hp/compaq_elite_8300_cmt/board_info.txt
  212. @@ -0,0 +1,5 @@
  213. +Category: desktop
  214. +ROM protocol: SPI
  215. +ROM socketed: n
  216. +Flashrom support: y
  217. +Release year: 2012
  218. diff --git a/src/mainboard/hp/compaq_elite_8300_cmt/cmos.default b/src/mainboard/hp/compaq_elite_8300_cmt/cmos.default
  219. new file mode 100644
  220. index 0000000000..6d27a79c66
  221. --- /dev/null
  222. +++ b/src/mainboard/hp/compaq_elite_8300_cmt/cmos.default
  223. @@ -0,0 +1,7 @@
  224. +boot_option=Fallback
  225. +debug_level=Debug
  226. +power_on_after_fail=Enable
  227. +nmi=Enable
  228. +sata_mode=AHCI
  229. +gfx_uma_size=32M
  230. +psu_fan_lvl=3
  231. diff --git a/src/mainboard/hp/compaq_elite_8300_cmt/cmos.layout b/src/mainboard/hp/compaq_elite_8300_cmt/cmos.layout
  232. new file mode 100644
  233. index 0000000000..1fc83b1a55
  234. --- /dev/null
  235. +++ b/src/mainboard/hp/compaq_elite_8300_cmt/cmos.layout
  236. @@ -0,0 +1,74 @@
  237. +## SPDX-License-Identifier: GPL-2.0-only
  238. +
  239. +# -----------------------------------------------------------------
  240. +entries
  241. +
  242. +# -----------------------------------------------------------------
  243. +0 120 r 0 reserved_memory
  244. +
  245. +# -----------------------------------------------------------------
  246. +# RTC_BOOT_BYTE (coreboot hardcoded)
  247. +384 1 e 4 boot_option
  248. +388 4 h 0 reboot_counter
  249. +
  250. +# -----------------------------------------------------------------
  251. +# coreboot config options: console
  252. +395 4 e 6 debug_level
  253. +400 3 h 0 psu_fan_lvl
  254. +
  255. +# coreboot config options: southbridge
  256. +408 1 e 1 nmi
  257. +409 2 e 7 power_on_after_fail
  258. +
  259. +421 1 e 9 sata_mode
  260. +
  261. +# coreboot config options: northbridge
  262. +432 3 e 11 gfx_uma_size
  263. +
  264. +448 128 r 0 vbnv
  265. +
  266. +# SandyBridge MRC Scrambler Seed values
  267. +896 32 r 0 mrc_scrambler_seed
  268. +928 32 r 0 mrc_scrambler_seed_s3
  269. +960 16 r 0 mrc_scrambler_seed_chk
  270. +
  271. +# coreboot config options: check sums
  272. +984 16 h 0 check_sum
  273. +
  274. +# -----------------------------------------------------------------
  275. +
  276. +enumerations
  277. +
  278. +#ID value text
  279. +1 0 Disable
  280. +1 1 Enable
  281. +2 0 Enable
  282. +2 1 Disable
  283. +4 0 Fallback
  284. +4 1 Normal
  285. +6 0 Emergency
  286. +6 1 Alert
  287. +6 2 Critical
  288. +6 3 Error
  289. +6 4 Warning
  290. +6 5 Notice
  291. +6 6 Info
  292. +6 7 Debug
  293. +6 8 Spew
  294. +7 0 Disable
  295. +7 1 Enable
  296. +7 2 Keep
  297. +9 0 AHCI
  298. +9 1 IDE
  299. +11 0 32M
  300. +11 1 64M
  301. +11 2 96M
  302. +11 3 128M
  303. +11 4 160M
  304. +11 5 192M
  305. +11 6 224M
  306. +
  307. +# -----------------------------------------------------------------
  308. +checksums
  309. +
  310. +checksum 392 415 984
  311. diff --git a/src/mainboard/hp/compaq_elite_8300_cmt/data.vbt b/src/mainboard/hp/compaq_elite_8300_cmt/data.vbt
  312. new file mode 100644
  313. index 0000000000000000000000000000000000000000..ba627e152b65d779a80529d3811ec4d21c1b1e54
  314. GIT binary patch
  315. literal 3902
  316. zcmdT{U2GIp6h5;vvp;uc+U>N$b}h{<64)*MnJ%?9P1V_-)?HZIZFkwM#K;zQp(Lf0
  317. z<tLDc9kdaQ30aLnL^K;s2=dhMWTFo|nZ_7XjUmSPK!^{95W@p8ks#}tpO&8zIx!OQ
  318. zPQE$ko;~;Lz2}~D=XOmtlA-CLNM|A&X^#!0H)V!X1yJCH+Hrg@ZIQ%qdRr`<32%!e
  319. zhohV5IamQTwRf%o6o9FhLR}l4OH3XpP6S4SG(9$1II_L8yRfU+nK)!=G!;$I@QxkD
  320. ziDGH&K(Rp6*_Xmpr<F+L;O>b69XhyYd$H6<buRR#UELiUx+zsQbar)jhLo-lr6HwH
  321. z>Fo<WE0Nehba-<rkql=N!$Wj<l*SV2a5_D(Ig)&trbdV3iAW+d5R-_pl<3~6Bc<KD
  322. z#t+ayG>9yU(vE~()R;1j?k!Dq(D1|r9o2pI)6wGoV(Cz^&><0>;1cWR7zP*~YL5XE
  323. z{3`?=k6Yy2an&85Zl2-7jM~D`7^g}MH^6WOPE9askfBLVUBl5fj(Wi%F%Ax(<(|k=
  324. zUH4c9hXO|5?0UW22lb}G1;Fb@mzSZ8u5fTU59si@;V}EXTQ}(rl%Wn?F&a92X)&+>
  325. zPTj@>Ls7r4(ffK2={zn6t_hS-cTaC$zZ!`R#y2KYqnT`O>nqx^H{P7_!|gKQVi}A&
  326. z)G!L9*Z>@59dMlOh4owoes{Vd<dPwV$RfrOM_mMtBi==PggB45i1-TeHR314Rm63~
  327. z9|&+0AczJ;Ga`TpA^H)6h!kQgqJWr0I1j?@szU?Z5NsM_$vRVlmxGf*(9T-+vzFa+
  328. z!`K`kmJ}>$kl1)tt1cJZseb2!YSsO`J_8jQ^hAhROmRyl4au@8tDixs`{k^Dwd%=Z
  329. zH-yjQdy~%q^YKY<!Z~QsaFSLvP<_4(KebAii%moAUIzzXdbGph$OYv=h6VegT-HIX
  330. zhmBa>th;}v$r!Z-pnAN<1I)+#R``=|huU|*W1ew~tpBFsG0q;_jCFT6Ulxt*TNv8#
  331. z2{`>`$JM`Jd{F+EzpU7VIlvml?AFW1Xv$0tKyom(Ej2b-oERG0Q?%Jx8HYk6s9{*E
  332. z_)hegWIm-8PLF`1DpU2QrTKj4;VUElwQBD4f+hZ<s%)PPsp_Q#i!T5@)2taxv1ghG
  333. z<B&&<DI4jDn$!FOh>Zbggj@JDLYbjpK69X2PaAVr^Xn{6e+%<?63)ABGAHVvOwA0G
  334. zop-g`)B~42TA5y1<#p#*n`4^oSOPu_>i&oRk>LBlzUQG|c;s(9<VO#^<&i}~RuI}x
  335. z<RL<GguYJXG9hOOy+q_62>FFjhafiyq*<UbLCy*!FVMFH`LsYj73iEG|16MS1xiG@
  336. zNhE7UniS<%MKUhZlcHP^$pw+li}F>GTo<V<$!jFiA<>K^@07@tL{CZbd5K(<q}Cgp
  337. z=D5OWb(o)+1@4lFyO?u`hP=smQS!Cx@SCx8`ItCXGEp|?Se~I$OQ9>*L<3rb71Ew*
  338. zhn0l-*|a>v(n`=1+Du-&m2f&k|07qiv~u)9FuttfVcu_x;V>QXdsXjZ?db(%oNhK5
  339. zme#7yVBD-k)j4Zp4ohoWFJ0rv5wpCVNbYROUKoL9Ww31Rg%2ZHHV$2!ik&#T)={qH
  340. z{mrUEty8JFXPPS;w@^`Y*;z%PU#m>bK7$Oci}}Epjc<@x;b&~*!<k@Zeq?5~lKODv
  341. zA_EJ8u45$aFet6+Tz;mY_(sgz72qmZ5DkWZn3D#BWHRv7#wxD)p^~C26;X-mqrjL$
  342. z8S4>Op}BgEe0X$iI{Gx<zTS2<*M4^|Sg17^@EYY@zAl0)<Ta?zd%bn~D02?r)iu%P
  343. wm+F7xwtgQt<KA_UyAYqlTkT_cS089?Pr=)R7|a9^*a9j1U$>1p1;4R>1E3jwQUCw|
  344. literal 0
  345. HcmV?d00001
  346. diff --git a/src/mainboard/hp/compaq_elite_8300_cmt/devicetree.cb b/src/mainboard/hp/compaq_elite_8300_cmt/devicetree.cb
  347. new file mode 100644
  348. index 0000000000..f4efabd792
  349. --- /dev/null
  350. +++ b/src/mainboard/hp/compaq_elite_8300_cmt/devicetree.cb
  351. @@ -0,0 +1,161 @@
  352. +# SPDX-License-Identifier: GPL-2.0-only
  353. +
  354. +chip northbridge/intel/sandybridge
  355. + register "gfx.use_spread_spectrum_clock" = "0"
  356. + register "gpu_dp_b_hotplug" = "0"
  357. + register "gpu_dp_c_hotplug" = "0"
  358. + register "gpu_dp_d_hotplug" = "0"
  359. + # BTX mainboard: Reversed mapping
  360. + register "spd_addresses" = "{0x53, 0x52, 0x51, 0x50}"
  361. + device domain 0 on
  362. + subsystemid 0x103c 0x3396 inherit
  363. +
  364. + device ref host_bridge on end # Host bridge Host bridge
  365. + device ref peg10 on end # PEG
  366. + device ref igd on end # iGPU
  367. +
  368. + chip southbridge/intel/bd82x6x # Intel Series 6 Cougar Point PCH
  369. + register "docking_supported" = "0"
  370. + register "gen1_dec" = "0x00fc0a01"
  371. + register "gen2_dec" = "0x00fc0801"
  372. + register "pcie_hotplug_map" = "{ 0, 0, 0, 0, 0, 0, 0, 0 }"
  373. + register "pcie_port_coalesce" = "1"
  374. + register "sata_interface_speed_support" = "0x3"
  375. + register "sata_port_map" = "0x1f"
  376. + register "spi_lvscc" = "0x2005"
  377. + register "spi_uvscc" = "0x2005"
  378. + register "superspeed_capable_ports" = "0x0000000f"
  379. + register "xhci_overcurrent_mapping" = "0x00000c03"
  380. + register "xhci_switchable_ports" = "0x0000000f"
  381. +
  382. + device ref xhci on end # USB 3.0 Controller
  383. + device ref mei1 off end # Management Engine Interface 1
  384. + device ref mei2 off end
  385. + device ref me_ide_r off end
  386. + device ref me_kt off end
  387. + device ref gbe on end # Intel Gigabit Ethernet
  388. + device ref ehci1 on end # USB2 EHCI #1
  389. + device ref ehci2 on end # USB2 EHCI #2
  390. + device ref hda on end # High Definition Audio
  391. + device ref sata1 on end # SATA Controller 1
  392. + device ref sata2 off end # SATA Controller 2
  393. + device ref smbus on end # SMBus
  394. +
  395. + device ref pcie_rp1 on end
  396. + device ref pcie_rp2 on end
  397. + device ref pcie_rp3 on end
  398. + device ref pcie_rp4 on end
  399. + device ref pcie_rp5 on end
  400. + device ref pcie_rp5 on end
  401. + device ref pcie_rp7 on end
  402. + device ref pcie_rp8 on end
  403. +
  404. + device ref pci_bridge on end
  405. + device ref lpc on # LPC bridge
  406. + chip superio/common # copied from Z220
  407. + device pnp 2e.ff on # passes SIO base addr to SSDT gen
  408. + chip superio/nuvoton/npcd378
  409. + device pnp 2e.0 off end # Floppy
  410. + device pnp 2e.1 on # Parallel port
  411. + # global
  412. +
  413. + # serialice: Vendor writes:
  414. + irq 0x14 = 0x9c
  415. + irq 0x1c = 0xa8
  416. + irq 0x1d = 0x08
  417. + irq 0x22 = 0x3f
  418. + irq 0x1a = 0xb0
  419. + # dumped from superiotool:
  420. + irq 0x1b = 0x1e
  421. + irq 0x27 = 0x08
  422. + irq 0x2a = 0x20
  423. + irq 0x2d = 0x01
  424. + # parallel port
  425. + io 0x60 = 0x378
  426. + irq 0x70 = 0x07
  427. + drq 0x74 = 0x01
  428. + end
  429. + device pnp 2e.2 off # COM1
  430. + io 0x60 = 0x2f8
  431. + irq 0x70 = 3
  432. + end
  433. + device pnp 2e.3 on # COM2, IR
  434. + io 0x60 = 0x3f8
  435. + irq 0x70 = 4
  436. + end
  437. + device pnp 2e.4 on # LED control
  438. + io 0x60 = 0x600
  439. + # IOBASE[0h] = bit0 LED red / green
  440. + # IOBASE[0h] = bit1-4 LED PWM duty cycle
  441. + # IOBASE[1h] = bit6 SWCC
  442. +
  443. + io 0x62 = 0x610
  444. + # IOBASE [0h] = GPES
  445. + # IOBASE [1h] = GPEE
  446. + # IOBASE [4h:7h] = 32bit upcounter at 1Mhz
  447. + # IOBASE [8h:bh] = GPS
  448. + # IOBASE [ch:fh] = GPE
  449. + end
  450. + device pnp 2e.5 on # Mouse
  451. + irq 0x70 = 0xc
  452. + end
  453. + device pnp 2e.6 on # Keyboard
  454. + io 0x60 = 0x0060
  455. + io 0x62 = 0x0064
  456. + irq 0x70 = 0x01
  457. + # serialice: Vendor writes:
  458. + drq 0xf0 = 0x40
  459. + end
  460. + device pnp 2e.7 on # WDT ?
  461. + io 0x60 = 0x620
  462. + end
  463. + device pnp 2e.8 on # HWM
  464. + io 0x60 = 0x800
  465. + # IOBASE[0h:feh] HWM page
  466. + # IOBASE[ffh] bit0-bit3 page selector
  467. +
  468. + drq 0xf0 = 0x20
  469. + drq 0xf1 = 0x01
  470. + drq 0xf2 = 0x40
  471. + drq 0xf3 = 0x01
  472. +
  473. + drq 0xf4 = 0x66
  474. + drq 0xf5 = 0x67
  475. + drq 0xf6 = 0x66
  476. + drq 0xf7 = 0x01
  477. + end
  478. + device pnp 2e.f on # GPIO OD ?
  479. + drq 0xf1 = 0x97
  480. + drq 0xf2 = 0x01
  481. + drq 0xf5 = 0x08
  482. + drq 0xfe = 0x80
  483. + end
  484. + device pnp 2e.15 on # BUS ?
  485. + io 0x60 = 0x0680
  486. + io 0x62 = 0x0690
  487. + end
  488. + device pnp 2e.1c on # Suspend Control ?
  489. + io 0x60 = 0x640
  490. + # writing to IOBASE[5h]
  491. + # 0x0: Power off
  492. + # 0x9: Power off and bricked until CMOS battery removed
  493. + end
  494. + device pnp 2e.1e on # GPIO ?
  495. + io 0x60 = 0x660
  496. + drq 0xf4 = 0x01
  497. + # skip the following, as it
  498. + # looks like remapped registers
  499. + #drq 0xf5 = 0x06
  500. + #drq 0xf6 = 0x60
  501. + #drq 0xfe = 0x03
  502. + end
  503. + end
  504. + end
  505. + end
  506. + chip drivers/pc80/tpm
  507. + device pnp 4e.0 on end # TPM module
  508. + end
  509. + end
  510. + end
  511. + end
  512. +end
  513. diff --git a/src/mainboard/hp/compaq_elite_8300_cmt/dsdt.asl b/src/mainboard/hp/compaq_elite_8300_cmt/dsdt.asl
  514. new file mode 100644
  515. index 0000000000..e8e2b3a3e5
  516. --- /dev/null
  517. +++ b/src/mainboard/hp/compaq_elite_8300_cmt/dsdt.asl
  518. @@ -0,0 +1,26 @@
  519. +/* SPDX-License-Identifier: GPL-2.0-only */
  520. +
  521. +#include <acpi/acpi.h>
  522. +
  523. +DefinitionBlock(
  524. + "dsdt.aml",
  525. + "DSDT",
  526. + ACPI_DSDT_REV_2,
  527. + OEM_ID,
  528. + ACPI_TABLE_CREATOR,
  529. + 0x20141018 /* OEM revision */
  530. +)
  531. +{
  532. + #include <acpi/dsdt_top.asl>
  533. + #include "acpi/platform.asl"
  534. + #include <cpu/intel/common/acpi/cpu.asl>
  535. + #include <southbridge/intel/common/acpi/platform.asl>
  536. + #include <southbridge/intel/bd82x6x/acpi/globalnvs.asl>
  537. + #include <southbridge/intel/common/acpi/sleepstates.asl>
  538. +
  539. + Device (\_SB.PCI0)
  540. + {
  541. + #include <northbridge/intel/sandybridge/acpi/sandybridge.asl>
  542. + #include <southbridge/intel/bd82x6x/acpi/pch.asl>
  543. + }
  544. +}
  545. diff --git a/src/mainboard/hp/compaq_elite_8300_cmt/early_init.c b/src/mainboard/hp/compaq_elite_8300_cmt/early_init.c
  546. new file mode 100644
  547. index 0000000000..99b7891c70
  548. --- /dev/null
  549. +++ b/src/mainboard/hp/compaq_elite_8300_cmt/early_init.c
  550. @@ -0,0 +1,31 @@
  551. +/* SPDX-License-Identifier: GPL-2.0-only */
  552. +
  553. +#include <bootblock_common.h>
  554. +#include <superio/nuvoton/npcd378/npcd378.h>
  555. +#include <superio/nuvoton/common/nuvoton.h>
  556. +#include <southbridge/intel/bd82x6x/pch.h>
  557. +
  558. +#define SERIAL_DEV PNP_DEV(0x2e, NPCD378_SP2)
  559. +
  560. +const struct southbridge_usb_port mainboard_usb_ports[] = {
  561. + { 1, 0, 0 },
  562. + { 1, 0, 0 },
  563. + { 1, 0, 1 },
  564. + { 1, 0, 1 },
  565. + { 1, 0, 2 },
  566. + { 1, 0, 2 },
  567. + { 1, 0, 3 },
  568. + { 1, 0, 3 },
  569. + { 1, 0, 4 },
  570. + { 1, 0, 4 },
  571. + { 1, 0, 6 },
  572. + { 1, 0, 5 },
  573. + { 1, 0, 5 },
  574. + { 1, 0, 6 },
  575. +};
  576. +
  577. +void bootblock_mainboard_early_init(void)
  578. +{
  579. + if (CONFIG(CONSOLE_SERIAL))
  580. + nuvoton_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE);
  581. +}
  582. diff --git a/src/mainboard/hp/compaq_elite_8300_cmt/gma-mainboard.ads b/src/mainboard/hp/compaq_elite_8300_cmt/gma-mainboard.ads
  583. new file mode 100644
  584. index 0000000000..686f7d44db
  585. --- /dev/null
  586. +++ b/src/mainboard/hp/compaq_elite_8300_cmt/gma-mainboard.ads
  587. @@ -0,0 +1,17 @@
  588. +-- SPDX-License-Identifier: GPL-2.0-or-later
  589. +
  590. +with HW.GFX.GMA;
  591. +with HW.GFX.GMA.Display_Probing;
  592. +
  593. +use HW.GFX.GMA;
  594. +use HW.GFX.GMA.Display_Probing;
  595. +
  596. +private package GMA.Mainboard is
  597. +
  598. + ports : constant Port_List :=
  599. + (DP2,
  600. + HDMI2,
  601. + Analog,
  602. + others => Disabled);
  603. +
  604. +end GMA.Mainboard;
  605. diff --git a/src/mainboard/hp/compaq_elite_8300_cmt/gpio.c b/src/mainboard/hp/compaq_elite_8300_cmt/gpio.c
  606. new file mode 100644
  607. index 0000000000..2ae852ae51
  608. --- /dev/null
  609. +++ b/src/mainboard/hp/compaq_elite_8300_cmt/gpio.c
  610. @@ -0,0 +1,191 @@
  611. +/* SPDX-License-Identifier: GPL-2.0-only */
  612. +
  613. +#include <southbridge/intel/common/gpio.h>
  614. +
  615. +static const struct pch_gpio_set1 pch_gpio_set1_mode = {
  616. + .gpio0 = GPIO_MODE_GPIO,
  617. + .gpio1 = GPIO_MODE_GPIO,
  618. + .gpio2 = GPIO_MODE_NATIVE,
  619. + .gpio3 = GPIO_MODE_NATIVE,
  620. + .gpio4 = GPIO_MODE_NATIVE,
  621. + .gpio5 = GPIO_MODE_NATIVE,
  622. + .gpio6 = GPIO_MODE_GPIO,
  623. + .gpio7 = GPIO_MODE_GPIO,
  624. + .gpio8 = GPIO_MODE_GPIO,
  625. + .gpio9 = GPIO_MODE_NATIVE,
  626. + .gpio10 = GPIO_MODE_NATIVE,
  627. + .gpio11 = GPIO_MODE_GPIO,
  628. + .gpio12 = GPIO_MODE_NATIVE,
  629. + .gpio13 = GPIO_MODE_GPIO,
  630. + .gpio14 = GPIO_MODE_NATIVE,
  631. + .gpio15 = GPIO_MODE_GPIO,
  632. + .gpio16 = GPIO_MODE_GPIO,
  633. + .gpio17 = GPIO_MODE_GPIO,
  634. + .gpio18 = GPIO_MODE_NATIVE,
  635. + .gpio19 = GPIO_MODE_NATIVE,
  636. + .gpio20 = GPIO_MODE_NATIVE,
  637. + .gpio21 = GPIO_MODE_GPIO,
  638. + .gpio22 = GPIO_MODE_GPIO,
  639. + .gpio23 = GPIO_MODE_NATIVE,
  640. + .gpio24 = GPIO_MODE_GPIO,
  641. + .gpio25 = GPIO_MODE_NATIVE,
  642. + .gpio26 = GPIO_MODE_NATIVE,
  643. + .gpio27 = GPIO_MODE_GPIO,
  644. + .gpio28 = GPIO_MODE_GPIO,
  645. + .gpio29 = GPIO_MODE_GPIO,
  646. + .gpio30 = GPIO_MODE_NATIVE,
  647. + .gpio31 = GPIO_MODE_GPIO,
  648. +};
  649. +
  650. +static const struct pch_gpio_set1 pch_gpio_set1_direction = {
  651. + .gpio0 = GPIO_DIR_INPUT,
  652. + .gpio1 = GPIO_DIR_INPUT,
  653. + .gpio6 = GPIO_DIR_INPUT,
  654. + .gpio7 = GPIO_DIR_INPUT,
  655. + .gpio8 = GPIO_DIR_INPUT,
  656. + .gpio11 = GPIO_DIR_INPUT,
  657. + .gpio13 = GPIO_DIR_INPUT,
  658. + .gpio15 = GPIO_DIR_OUTPUT,
  659. + .gpio16 = GPIO_DIR_INPUT,
  660. + .gpio17 = GPIO_DIR_OUTPUT,
  661. + .gpio21 = GPIO_DIR_INPUT,
  662. + .gpio22 = GPIO_DIR_INPUT,
  663. + .gpio24 = GPIO_DIR_INPUT,
  664. + .gpio27 = GPIO_DIR_INPUT,
  665. + .gpio28 = GPIO_DIR_OUTPUT,
  666. + .gpio29 = GPIO_DIR_OUTPUT,
  667. + .gpio31 = GPIO_DIR_INPUT,
  668. +};
  669. +
  670. +static const struct pch_gpio_set1 pch_gpio_set1_level = {
  671. + .gpio15 = GPIO_LEVEL_LOW,
  672. + .gpio17 = GPIO_LEVEL_LOW,
  673. + .gpio28 = GPIO_LEVEL_LOW,
  674. + .gpio29 = GPIO_LEVEL_HIGH,
  675. +};
  676. +
  677. +static const struct pch_gpio_set1 pch_gpio_set1_reset = {
  678. +};
  679. +
  680. +static const struct pch_gpio_set1 pch_gpio_set1_invert = {
  681. + .gpio0 = GPIO_INVERT,
  682. + .gpio1 = GPIO_INVERT,
  683. + .gpio6 = GPIO_INVERT,
  684. + .gpio11 = GPIO_INVERT,
  685. + .gpio13 = GPIO_INVERT,
  686. +};
  687. +
  688. +static const struct pch_gpio_set1 pch_gpio_set1_blink = {
  689. +};
  690. +
  691. +static const struct pch_gpio_set2 pch_gpio_set2_mode = {
  692. + .gpio32 = GPIO_MODE_GPIO,
  693. + .gpio33 = GPIO_MODE_GPIO,
  694. + .gpio34 = GPIO_MODE_GPIO,
  695. + .gpio35 = GPIO_MODE_GPIO,
  696. + .gpio36 = GPIO_MODE_GPIO,
  697. + .gpio37 = GPIO_MODE_GPIO,
  698. + .gpio38 = GPIO_MODE_GPIO,
  699. + .gpio39 = GPIO_MODE_GPIO,
  700. + .gpio40 = GPIO_MODE_NATIVE,
  701. + .gpio41 = GPIO_MODE_NATIVE,
  702. + .gpio42 = GPIO_MODE_NATIVE,
  703. + .gpio43 = GPIO_MODE_GPIO,
  704. + .gpio44 = GPIO_MODE_NATIVE,
  705. + .gpio45 = GPIO_MODE_NATIVE,
  706. + .gpio46 = GPIO_MODE_GPIO,
  707. + .gpio47 = GPIO_MODE_NATIVE,
  708. + .gpio48 = GPIO_MODE_GPIO,
  709. + .gpio49 = GPIO_MODE_GPIO,
  710. + .gpio50 = GPIO_MODE_NATIVE,
  711. + .gpio51 = GPIO_MODE_NATIVE,
  712. + .gpio52 = GPIO_MODE_NATIVE,
  713. + .gpio53 = GPIO_MODE_NATIVE,
  714. + .gpio54 = GPIO_MODE_GPIO,
  715. + .gpio55 = GPIO_MODE_NATIVE,
  716. + .gpio56 = GPIO_MODE_NATIVE,
  717. + .gpio57 = GPIO_MODE_GPIO,
  718. + .gpio58 = GPIO_MODE_NATIVE,
  719. + .gpio59 = GPIO_MODE_NATIVE,
  720. + .gpio60 = GPIO_MODE_NATIVE,
  721. + .gpio61 = GPIO_MODE_GPIO,
  722. + .gpio62 = GPIO_MODE_NATIVE,
  723. + .gpio63 = GPIO_MODE_NATIVE,
  724. +};
  725. +
  726. +static const struct pch_gpio_set2 pch_gpio_set2_direction = {
  727. + .gpio32 = GPIO_DIR_INPUT,
  728. + .gpio33 = GPIO_DIR_INPUT,
  729. + .gpio34 = GPIO_DIR_INPUT,
  730. + .gpio35 = GPIO_DIR_INPUT,
  731. + .gpio36 = GPIO_DIR_INPUT,
  732. + .gpio37 = GPIO_DIR_INPUT,
  733. + .gpio38 = GPIO_DIR_INPUT,
  734. + .gpio39 = GPIO_DIR_INPUT,
  735. + .gpio43 = GPIO_DIR_INPUT,
  736. + .gpio46 = GPIO_DIR_INPUT,
  737. + .gpio48 = GPIO_DIR_INPUT,
  738. + .gpio49 = GPIO_DIR_INPUT,
  739. + .gpio54 = GPIO_DIR_INPUT,
  740. + .gpio57 = GPIO_DIR_INPUT,
  741. + .gpio61 = GPIO_DIR_INPUT,
  742. +};
  743. +
  744. +static const struct pch_gpio_set2 pch_gpio_set2_level = {
  745. +};
  746. +
  747. +static const struct pch_gpio_set2 pch_gpio_set2_reset = {
  748. +};
  749. +
  750. +static const struct pch_gpio_set3 pch_gpio_set3_mode = {
  751. + .gpio64 = GPIO_MODE_NATIVE,
  752. + .gpio65 = GPIO_MODE_NATIVE,
  753. + .gpio66 = GPIO_MODE_NATIVE,
  754. + .gpio67 = GPIO_MODE_NATIVE,
  755. + .gpio68 = GPIO_MODE_GPIO,
  756. + .gpio69 = GPIO_MODE_GPIO,
  757. + .gpio70 = GPIO_MODE_GPIO,
  758. + .gpio71 = GPIO_MODE_GPIO,
  759. + .gpio72 = GPIO_MODE_GPIO,
  760. + .gpio73 = GPIO_MODE_NATIVE,
  761. + .gpio74 = GPIO_MODE_NATIVE,
  762. + .gpio75 = GPIO_MODE_NATIVE,
  763. +};
  764. +
  765. +static const struct pch_gpio_set3 pch_gpio_set3_direction = {
  766. + .gpio68 = GPIO_DIR_INPUT,
  767. + .gpio69 = GPIO_DIR_INPUT,
  768. + .gpio70 = GPIO_DIR_INPUT,
  769. + .gpio71 = GPIO_DIR_OUTPUT,
  770. + .gpio72 = GPIO_DIR_INPUT,
  771. +};
  772. +
  773. +static const struct pch_gpio_set3 pch_gpio_set3_level = {
  774. + .gpio71 = GPIO_LEVEL_LOW,
  775. +};
  776. +
  777. +static const struct pch_gpio_set3 pch_gpio_set3_reset = {
  778. +};
  779. +
  780. +const struct pch_gpio_map mainboard_gpio_map = {
  781. + .set1 = {
  782. + .mode = &pch_gpio_set1_mode,
  783. + .direction = &pch_gpio_set1_direction,
  784. + .level = &pch_gpio_set1_level,
  785. + .blink = &pch_gpio_set1_blink,
  786. + .invert = &pch_gpio_set1_invert,
  787. + .reset = &pch_gpio_set1_reset,
  788. + },
  789. + .set2 = {
  790. + .mode = &pch_gpio_set2_mode,
  791. + .direction = &pch_gpio_set2_direction,
  792. + .level = &pch_gpio_set2_level,
  793. + .reset = &pch_gpio_set2_reset,
  794. + },
  795. + .set3 = {
  796. + .mode = &pch_gpio_set3_mode,
  797. + .direction = &pch_gpio_set3_direction,
  798. + .level = &pch_gpio_set3_level,
  799. + .reset = &pch_gpio_set3_reset,
  800. + },
  801. +};
  802. diff --git a/src/mainboard/hp/compaq_elite_8300_cmt/hda_verb.c b/src/mainboard/hp/compaq_elite_8300_cmt/hda_verb.c
  803. new file mode 100644
  804. index 0000000000..a1eafcda68
  805. --- /dev/null
  806. +++ b/src/mainboard/hp/compaq_elite_8300_cmt/hda_verb.c
  807. @@ -0,0 +1,33 @@
  808. +/* SPDX-License-Identifier: GPL-2.0-only */
  809. +
  810. +#include <device/azalia_device.h>
  811. +
  812. +const u32 cim_verb_data[] = {
  813. + 0x10ec0221, /* Codec Vendor / Device ID: Realtek */
  814. + 0x103c3396, /* Subsystem ID */
  815. + 11, /* Number of 4 dword sets */
  816. + AZALIA_SUBVENDOR(0, 0x103c3396),
  817. + AZALIA_PIN_CFG(0, 0x12, 0x411111f0),
  818. + AZALIA_PIN_CFG(0, 0x14, 0x01014020),
  819. + AZALIA_PIN_CFG(0, 0x17, 0x90170110),
  820. + AZALIA_PIN_CFG(0, 0x18, 0x411111f0),
  821. + AZALIA_PIN_CFG(0, 0x19, 0x411111f0),
  822. + AZALIA_PIN_CFG(0, 0x1a, 0x02a11c3f),
  823. + AZALIA_PIN_CFG(0, 0x1b, 0x01813c30),
  824. + AZALIA_PIN_CFG(0, 0x1d, 0x415901f0),
  825. + AZALIA_PIN_CFG(0, 0x1e, 0x411111f0),
  826. + AZALIA_PIN_CFG(0, 0x21, 0x0221102f),
  827. +
  828. + 0x80862806, /* Codec Vendor / Device ID: Intel */
  829. + 0x80860101, /* Subsystem ID */
  830. + 4, /* Number of 4 dword sets */
  831. + AZALIA_SUBVENDOR(3, 0x80860101),
  832. + AZALIA_PIN_CFG(3, 0x05, 0x58560010),
  833. + AZALIA_PIN_CFG(3, 0x06, 0x18560020),
  834. + AZALIA_PIN_CFG(3, 0x07, 0x58560030),
  835. +
  836. +};
  837. +
  838. +const u32 pc_beep_verbs[0] = {};
  839. +
  840. +AZALIA_ARRAY_SIZES;
  841. diff --git a/src/mainboard/hp/compaq_elite_8300_cmt/mainboard.c b/src/mainboard/hp/compaq_elite_8300_cmt/mainboard.c
  842. new file mode 100644
  843. index 0000000000..8dbd95ef96
  844. --- /dev/null
  845. +++ b/src/mainboard/hp/compaq_elite_8300_cmt/mainboard.c
  846. @@ -0,0 +1,16 @@
  847. +/* SPDX-License-Identifier: GPL-2.0-only */
  848. +
  849. +#include <device/device.h>
  850. +#include <drivers/intel/gma/int15.h>
  851. +#include <southbridge/intel/bd82x6x/pch.h>
  852. +
  853. +static void mainboard_enable(struct device *dev)
  854. +{
  855. + install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_NONE,
  856. + GMA_INT15_PANEL_FIT_DEFAULT,
  857. + GMA_INT15_BOOT_DISPLAY_DEFAULT, 0);
  858. +}
  859. +
  860. +struct chip_operations mainboard_ops = {
  861. + .enable_dev = mainboard_enable,
  862. +};
  863. --
  864. 2.39.2