0038-mb-dell-Add-Latitude-E5420-Sandy-Bridge.patch 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775
  1. From 7dd58c8b301404a8bafee25a1e97a8a5d614b3d6 Mon Sep 17 00:00:00 2001
  2. From: Nicholas Chin <nic.c3.14@gmail.com>
  3. Date: Mon, 4 Mar 2024 18:05:43 -0700
  4. Subject: [PATCH] mb/dell: Add Latitude E5420 (Sandy Bridge)
  5. ---
  6. src/mainboard/dell/e5420/Kconfig | 37 ++++
  7. src/mainboard/dell/e5420/Kconfig.name | 2 +
  8. src/mainboard/dell/e5420/Makefile.mk | 5 +
  9. src/mainboard/dell/e5420/acpi/ec.asl | 9 +
  10. src/mainboard/dell/e5420/acpi/platform.asl | 12 ++
  11. src/mainboard/dell/e5420/acpi/superio.asl | 3 +
  12. src/mainboard/dell/e5420/acpi_tables.c | 16 ++
  13. src/mainboard/dell/e5420/board_info.txt | 6 +
  14. src/mainboard/dell/e5420/cmos.default | 9 +
  15. src/mainboard/dell/e5420/cmos.layout | 88 ++++++++++
  16. src/mainboard/dell/e5420/data.vbt | Bin 0 -> 6144 bytes
  17. src/mainboard/dell/e5420/devicetree.cb | 66 +++++++
  18. src/mainboard/dell/e5420/dsdt.asl | 30 ++++
  19. src/mainboard/dell/e5420/early_init.c | 32 ++++
  20. src/mainboard/dell/e5420/gma-mainboard.ads | 20 +++
  21. src/mainboard/dell/e5420/gpio.c | 195 +++++++++++++++++++++
  22. src/mainboard/dell/e5420/hda_verb.c | 33 ++++
  23. src/mainboard/dell/e5420/mainboard.c | 21 +++
  24. 18 files changed, 584 insertions(+)
  25. create mode 100644 src/mainboard/dell/e5420/Kconfig
  26. create mode 100644 src/mainboard/dell/e5420/Kconfig.name
  27. create mode 100644 src/mainboard/dell/e5420/Makefile.mk
  28. create mode 100644 src/mainboard/dell/e5420/acpi/ec.asl
  29. create mode 100644 src/mainboard/dell/e5420/acpi/platform.asl
  30. create mode 100644 src/mainboard/dell/e5420/acpi/superio.asl
  31. create mode 100644 src/mainboard/dell/e5420/acpi_tables.c
  32. create mode 100644 src/mainboard/dell/e5420/board_info.txt
  33. create mode 100644 src/mainboard/dell/e5420/cmos.default
  34. create mode 100644 src/mainboard/dell/e5420/cmos.layout
  35. create mode 100755 src/mainboard/dell/e5420/data.vbt
  36. create mode 100644 src/mainboard/dell/e5420/devicetree.cb
  37. create mode 100644 src/mainboard/dell/e5420/dsdt.asl
  38. create mode 100644 src/mainboard/dell/e5420/early_init.c
  39. create mode 100644 src/mainboard/dell/e5420/gma-mainboard.ads
  40. create mode 100644 src/mainboard/dell/e5420/gpio.c
  41. create mode 100644 src/mainboard/dell/e5420/hda_verb.c
  42. create mode 100644 src/mainboard/dell/e5420/mainboard.c
  43. diff --git a/src/mainboard/dell/e5420/Kconfig b/src/mainboard/dell/e5420/Kconfig
  44. new file mode 100644
  45. index 0000000000..f4385045ae
  46. --- /dev/null
  47. +++ b/src/mainboard/dell/e5420/Kconfig
  48. @@ -0,0 +1,37 @@
  49. +if BOARD_DELL_LATITUDE_E5420
  50. +
  51. +config BOARD_SPECIFIC_OPTIONS
  52. + def_bool y
  53. + select BOARD_ROMSIZE_KB_6144
  54. + select EC_ACPI
  55. + select EC_DELL_MEC5035
  56. + select GFX_GMA_PANEL_1_ON_LVDS
  57. + select HAVE_ACPI_RESUME
  58. + select HAVE_ACPI_TABLES
  59. + select HAVE_CMOS_DEFAULT
  60. + select HAVE_OPTION_TABLE
  61. + select INTEL_GMA_HAVE_VBT
  62. + select INTEL_INT15
  63. + select MAINBOARD_HAS_LIBGFXINIT
  64. + select NORTHBRIDGE_INTEL_SANDYBRIDGE
  65. + select SERIRQ_CONTINUOUS_MODE
  66. + select SOUTHBRIDGE_INTEL_BD82X6X
  67. + select SYSTEM_TYPE_LAPTOP
  68. + select USE_NATIVE_RAMINIT
  69. +
  70. +config DRAM_RESET_GATE_GPIO
  71. + default 60
  72. +
  73. +config MAINBOARD_DIR
  74. + default "dell/e5420"
  75. +
  76. +config MAINBOARD_PART_NUMBER
  77. + default "Latitude E5420"
  78. +
  79. +config USBDEBUG_HCD_INDEX
  80. + default 2
  81. +
  82. +config VGA_BIOS_ID
  83. + default "8086,0116"
  84. +
  85. +endif # BOARD_DELL_LATITUDE_E5420
  86. diff --git a/src/mainboard/dell/e5420/Kconfig.name b/src/mainboard/dell/e5420/Kconfig.name
  87. new file mode 100644
  88. index 0000000000..eb495fb705
  89. --- /dev/null
  90. +++ b/src/mainboard/dell/e5420/Kconfig.name
  91. @@ -0,0 +1,2 @@
  92. +config BOARD_DELL_LATITUDE_E5420
  93. + bool "Latitude E5420"
  94. diff --git a/src/mainboard/dell/e5420/Makefile.mk b/src/mainboard/dell/e5420/Makefile.mk
  95. new file mode 100644
  96. index 0000000000..18391d8b18
  97. --- /dev/null
  98. +++ b/src/mainboard/dell/e5420/Makefile.mk
  99. @@ -0,0 +1,5 @@
  100. +bootblock-y += early_init.c
  101. +bootblock-y += gpio.c
  102. +romstage-y += early_init.c
  103. +romstage-y += gpio.c
  104. +ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += gma-mainboard.ads
  105. diff --git a/src/mainboard/dell/e5420/acpi/ec.asl b/src/mainboard/dell/e5420/acpi/ec.asl
  106. new file mode 100644
  107. index 0000000000..0d429410a9
  108. --- /dev/null
  109. +++ b/src/mainboard/dell/e5420/acpi/ec.asl
  110. @@ -0,0 +1,9 @@
  111. +/* SPDX-License-Identifier: GPL-2.0-only */
  112. +
  113. +Device(EC)
  114. +{
  115. + Name (_HID, EISAID("PNP0C09"))
  116. + Name (_UID, 0)
  117. + Name (_GPE, 16)
  118. +/* FIXME: EC support */
  119. +}
  120. diff --git a/src/mainboard/dell/e5420/acpi/platform.asl b/src/mainboard/dell/e5420/acpi/platform.asl
  121. new file mode 100644
  122. index 0000000000..2d24bbd9b9
  123. --- /dev/null
  124. +++ b/src/mainboard/dell/e5420/acpi/platform.asl
  125. @@ -0,0 +1,12 @@
  126. +/* SPDX-License-Identifier: GPL-2.0-only */
  127. +
  128. +Method(_WAK, 1)
  129. +{
  130. + /* FIXME: EC support */
  131. + Return(Package() {0, 0})
  132. +}
  133. +
  134. +Method(_PTS,1)
  135. +{
  136. + /* FIXME: EC support */
  137. +}
  138. diff --git a/src/mainboard/dell/e5420/acpi/superio.asl b/src/mainboard/dell/e5420/acpi/superio.asl
  139. new file mode 100644
  140. index 0000000000..55b1db5b11
  141. --- /dev/null
  142. +++ b/src/mainboard/dell/e5420/acpi/superio.asl
  143. @@ -0,0 +1,3 @@
  144. +/* SPDX-License-Identifier: GPL-2.0-only */
  145. +
  146. +#include <drivers/pc80/pc/ps2_controller.asl>
  147. diff --git a/src/mainboard/dell/e5420/acpi_tables.c b/src/mainboard/dell/e5420/acpi_tables.c
  148. new file mode 100644
  149. index 0000000000..e2759659bf
  150. --- /dev/null
  151. +++ b/src/mainboard/dell/e5420/acpi_tables.c
  152. @@ -0,0 +1,16 @@
  153. +/* SPDX-License-Identifier: GPL-2.0-only */
  154. +
  155. +#include <acpi/acpi_gnvs.h>
  156. +#include <soc/nvs.h>
  157. +
  158. +/* FIXME: check this function. */
  159. +void mainboard_fill_gnvs(struct global_nvs *gnvs)
  160. +{
  161. + /* The lid is open by default. */
  162. + gnvs->lids = 1;
  163. +
  164. + /* Temperature at which OS will shutdown */
  165. + gnvs->tcrt = 100;
  166. + /* Temperature at which OS will throttle CPU */
  167. + gnvs->tpsv = 90;
  168. +}
  169. diff --git a/src/mainboard/dell/e5420/board_info.txt b/src/mainboard/dell/e5420/board_info.txt
  170. new file mode 100644
  171. index 0000000000..34d5ad9e0b
  172. --- /dev/null
  173. +++ b/src/mainboard/dell/e5420/board_info.txt
  174. @@ -0,0 +1,6 @@
  175. +Category: laptop
  176. +ROM package: SOIC-8
  177. +ROM protocol: SPI
  178. +ROM socketed: n
  179. +Flashrom support: y
  180. +Release year: 2011
  181. diff --git a/src/mainboard/dell/e5420/cmos.default b/src/mainboard/dell/e5420/cmos.default
  182. new file mode 100644
  183. index 0000000000..279415dfd1
  184. --- /dev/null
  185. +++ b/src/mainboard/dell/e5420/cmos.default
  186. @@ -0,0 +1,9 @@
  187. +boot_option=Fallback
  188. +debug_level=Debug
  189. +power_on_after_fail=Disable
  190. +nmi=Enable
  191. +bluetooth=Enable
  192. +wwan=Enable
  193. +wlan=Enable
  194. +sata_mode=AHCI
  195. +me_state=Disabled
  196. diff --git a/src/mainboard/dell/e5420/cmos.layout b/src/mainboard/dell/e5420/cmos.layout
  197. new file mode 100644
  198. index 0000000000..1aa7e77bce
  199. --- /dev/null
  200. +++ b/src/mainboard/dell/e5420/cmos.layout
  201. @@ -0,0 +1,88 @@
  202. +## SPDX-License-Identifier: GPL-2.0-only
  203. +
  204. +# -----------------------------------------------------------------
  205. +entries
  206. +
  207. +# -----------------------------------------------------------------
  208. +0 120 r 0 reserved_memory
  209. +
  210. +# -----------------------------------------------------------------
  211. +# RTC_BOOT_BYTE (coreboot hardcoded)
  212. +384 1 e 4 boot_option
  213. +388 4 h 0 reboot_counter
  214. +
  215. +# -----------------------------------------------------------------
  216. +# coreboot config options: console
  217. +395 4 e 6 debug_level
  218. +
  219. +#400 8 r 0 reserved for century byte
  220. +
  221. +# coreboot config options: southbridge
  222. +408 1 e 1 nmi
  223. +409 2 e 7 power_on_after_fail
  224. +411 1 e 9 sata_mode
  225. +
  226. +# coreboot config options: EC
  227. +412 1 e 1 bluetooth
  228. +413 1 e 1 wwan
  229. +414 1 e 1 wlan
  230. +
  231. +# coreboot config options: ME
  232. +424 1 e 14 me_state
  233. +425 2 h 0 me_state_prev
  234. +
  235. +# coreboot config options: northbridge
  236. +432 3 e 11 gfx_uma_size
  237. +435 2 e 12 hybrid_graphics_mode
  238. +440 8 h 0 volume
  239. +
  240. +# VBOOT
  241. +448 128 r 0 vbnv
  242. +
  243. +# SandyBridge MRC Scrambler Seed values
  244. +896 32 r 0 mrc_scrambler_seed
  245. +928 32 r 0 mrc_scrambler_seed_s3
  246. +960 16 r 0 mrc_scrambler_seed_chk
  247. +
  248. +# coreboot config options: check sums
  249. +984 16 h 0 check_sum
  250. +
  251. +# -----------------------------------------------------------------
  252. +
  253. +enumerations
  254. +
  255. +#ID value text
  256. +1 0 Disable
  257. +1 1 Enable
  258. +2 0 Enable
  259. +2 1 Disable
  260. +4 0 Fallback
  261. +4 1 Normal
  262. +6 0 Emergency
  263. +6 1 Alert
  264. +6 2 Critical
  265. +6 3 Error
  266. +6 4 Warning
  267. +6 5 Notice
  268. +6 6 Info
  269. +6 7 Debug
  270. +6 8 Spew
  271. +7 0 Disable
  272. +7 1 Enable
  273. +7 2 Keep
  274. +9 0 AHCI
  275. +9 1 Compatible
  276. +11 0 32M
  277. +11 1 64M
  278. +11 2 96M
  279. +11 3 128M
  280. +11 4 160M
  281. +11 5 192M
  282. +11 6 224M
  283. +14 0 Normal
  284. +14 1 Disabled
  285. +
  286. +# -----------------------------------------------------------------
  287. +checksums
  288. +
  289. +checksum 392 447 984
  290. diff --git a/src/mainboard/dell/e5420/data.vbt b/src/mainboard/dell/e5420/data.vbt
  291. new file mode 100755
  292. index 0000000000000000000000000000000000000000..98b82fe6110fd295b5749041ec7f8c084ace5f57
  293. GIT binary patch
  294. literal 6144
  295. zcmeHKeQZ-z6hE);wSBvNZ!2$ObQ^;MgV6zl*Rhp}BXnCCMZU^_r7jRwT!kfLo8?3H
  296. zk9)u(7?cb(hChhTM57@QFfmbMB!G!dNsO6BW5OSp5EGF^jHnTTdhUBI+h`e+1ft1q
  297. z^SfW?+;h)4_uO+|XEfEV$91)<gOArWE)OnSTD}Ug6?8a~vz+SmQn!4~y3N7b^|hPp
  298. zR<5aEfv-b8M00Lk251!oO|8(YA6XaeXzkt-Z)@Ee!_{@z#Fro^?DqN4SGjRIu8KYp
  299. zZEufuU@5MM@7jv%h;75FS}ezKv?JDzCH}d%tE)A-GuDb*+B%}~w%88r>}c;!*XQ5O
  300. z)OU7u$J@4U+lk)#GSW%c%c)v`%R6?`w)LIyu6bD7-j0o&X9qUMcEsYlW3BU4rZRvt
  301. zqAUpjf*qXuLCCsU0YM2I5@gB1WKd)f1+Yt?%HWd0DZxYumP(K<LxTif8A39+!KMl}
  302. z31FHG)7?qk5g>e?=ER{f^&}W<0k@mxff(?6+Stw+s6y%k1mM$cLk#^FWWI*9bE1GY
  303. z&VY9?WC1u#23^3^UYw5?H0x2S2gN`x18Fko6_x(#MKyuCU_<D!mEp$qO_An}#@>DV
  304. zdkf*li41yW3p$*0Oo3+63kO6S91*KwP#l2i4jnc)JkUirL^$k}VbH0;CBh#BS=OLf
  305. zW-yE3BRon75gG{_2~QIC5cUzCC%i)FCmbidM>tIwAPf>N5Pl?FC0r*+Sq!oXj!keQ
  306. zVKcyK>TL+gc7oLco$28+FpeeXkEP}_Sea=mk#IWUR^m$!BogvszLPu83FJm0k6K<l
  307. z$#$~YiXtY*GpHp#@FvHJ1UnBD*H%d+{_j24XE4nmBa*?5mOWiold28s3}>*}<HaeO
  308. z+1|-8g2)FCfkDZIdb-Ub);z0#;XEbPfGe?A72!{DAUg|$m+Z~(i@h9j4gtm611ni(
  309. z#u>ACcP}M4exU`*MKVwl5+t6JBpTkmm}xWflKUe~7}`!#%z#gAo{NxUrpDAndYktu
  310. zI0}VLU`J7^xmF1AFiz5S^uzp*DPI$%$qq!(ikh0kP+(GKzF|@N?Y%_#Vp@M+xHr$F
  311. z=%+18z`-fT%z)9-TS$~Dh@2yeN7!UIt0h`fWxUu`JvA_ra*8P48l%7KR0&c1;0R75
  312. z4f0oz(xQ3MWqz5>qW5M4tZWExHs8<H(e1G@4km@5wEzOOP^x<l`YmA|eKs6j3wl8B
  313. z%C%;uygh%<#kGZ{fymL+OlV0!-*T!V5IB>X@p!@CBU=7e{5^Jl{s7by`po-AJqM2l
  314. znk(=^0bHkF0rUw7)^7j;$=_UIs8`6P6b-;vPDZ#U9L)W1_PAYRDP9k~;5$stt5ZiV
  315. zD0>;i-?OlYY2}P9WVnfGos4xee2r=EGWHR}ADH$VV>cO=xU?!4TjIi)OMBYI_PX#b
  316. zm-eBHed5BOT-x6*W>;{IqAga~G6lCQT93k>Q}CpsomJR*1%FjEkv?fuT%c-8RklXO
  317. zU8;6KWk*zeU)4TW+1D!mrE0EhHZfbBeN{4S7X@Pig%};A99QTdA~wZruL*8y?K!jP
  318. zG5R*k=);S}Zn<T;W!Mxt`(!+z7_r@3LVpf|FESauM&4}+wqzXfba-zG>A}on(uzNF
  319. zyu>BcjA})C@bg%<;+Eh2;Sz4heFFCbZ@C{FrXMIbYzu>?Bi-|vZ}JSFU%JA>7$7et
  320. z0Yo%CnOVZm#ZA}4kWZOn15};h5*#OM3b+6vHzgruMP>=5MNJK1y42{YgveP-!j%#(
  321. z0rGe@8t%!=66Ti%K4|Gx=o7gFp83wQ;+s3H7+r^SKlpp3KKcr!3@|n;NCH_=qL=3T
  322. zq3WH?en`b+W-HR-fnrhw*9aZ%M}lHX7@H?E>!6wv_&YQFEHdA$%Z1R--yub>=c@p?
  323. z6@7Fc$&>sAxwiz{BE$1kb$K9Co=ozlA973y^i(^BM|EZ$$^y`0KyHiMJ%O*XbfEX1
  324. ziZaH>W(1pWL0bo|T!x__N$^$DpmxI=bL6WUK3JGyn?rw-qC4ZA$yGjIB}N(=ldD2O
  325. zAJ@bxp<qR-3lIv<!P~SE8r*#_Ckl?$0|1fZ>2>n}u*mUIYFd>}O_wuwBD^r9<#=!0
  326. X1LGbT_rSOZ#yv3ZfpHH!G!Og(1Xg~J
  327. literal 0
  328. HcmV?d00001
  329. diff --git a/src/mainboard/dell/e5420/devicetree.cb b/src/mainboard/dell/e5420/devicetree.cb
  330. new file mode 100644
  331. index 0000000000..f26413557d
  332. --- /dev/null
  333. +++ b/src/mainboard/dell/e5420/devicetree.cb
  334. @@ -0,0 +1,66 @@
  335. +chip northbridge/intel/sandybridge # FIXME: GPU registers may not always apply.
  336. + register "gfx" = "GMA_STATIC_DISPLAYS(1)"
  337. + register "gpu_cpu_backlight" = "0x00000c31"
  338. + register "gpu_dp_b_hotplug" = "4"
  339. + register "gpu_dp_c_hotplug" = "4"
  340. + register "gpu_dp_d_hotplug" = "4"
  341. + register "gpu_panel_port_select" = "0"
  342. + register "gpu_panel_power_backlight_off_delay" = "2300"
  343. + register "gpu_panel_power_backlight_on_delay" = "2300"
  344. + register "gpu_panel_power_cycle_delay" = "6"
  345. + register "gpu_panel_power_down_delay" = "400"
  346. + register "gpu_panel_power_up_delay" = "400"
  347. + register "gpu_pch_backlight" = "0x13121312"
  348. +
  349. + register "spd_addresses" = "{0x50, 0, 0x52, 0}"
  350. +
  351. + device domain 0x0 on
  352. + subsystemid 0x1028 0x049b inherit
  353. +
  354. + device ref host_bridge on end # Host bridge
  355. + device ref peg10 on end # PEG
  356. + device ref igd on end # iGPU
  357. +
  358. + chip southbridge/intel/bd82x6x # Intel Series 6 Cougar Point PCH
  359. + register "docking_supported" = "1"
  360. + register "gen1_dec" = "0x007c0681"
  361. + register "gen2_dec" = "0x007c0901"
  362. + register "gen3_dec" = "0x003c07e1"
  363. + register "gen4_dec" = "0x001c0901"
  364. + register "gpi0_routing" = "2"
  365. + register "pcie_hotplug_map" = "{ 0, 0, 1, 0, 0, 0, 1, 0 }"
  366. + register "pcie_port_coalesce" = "1"
  367. + register "sata_interface_speed_support" = "0x3"
  368. + register "sata_port_map" = "0x3b"
  369. + register "spi_lvscc" = "0x2005"
  370. + register "spi_uvscc" = "0x2005"
  371. +
  372. + device ref mei1 off end
  373. + device ref mei2 off end
  374. + device ref me_ide_r off end
  375. + device ref me_kt off end
  376. + device ref gbe off end
  377. + device ref ehci2 on end
  378. + device ref hda on end
  379. + device ref pcie_rp1 on end
  380. + device ref pcie_rp2 on end
  381. + device ref pcie_rp3 on end
  382. + device ref pcie_rp4 off end
  383. + device ref pcie_rp5 on end
  384. + device ref pcie_rp6 on end
  385. + device ref pcie_rp7 on end
  386. + device ref pcie_rp8 off end
  387. + device ref ehci1 on end
  388. + device ref pci_bridge off end
  389. + device ref lpc on
  390. + chip ec/dell/mec5035
  391. + device pnp ff.0 on end
  392. + end
  393. + end
  394. + device ref sata1 on end
  395. + device ref smbus on end
  396. + device ref sata2 off end
  397. + device ref thermal off end
  398. + end
  399. + end
  400. +end
  401. diff --git a/src/mainboard/dell/e5420/dsdt.asl b/src/mainboard/dell/e5420/dsdt.asl
  402. new file mode 100644
  403. index 0000000000..7d13c55b08
  404. --- /dev/null
  405. +++ b/src/mainboard/dell/e5420/dsdt.asl
  406. @@ -0,0 +1,30 @@
  407. +#define BRIGHTNESS_UP \_SB.PCI0.GFX0.INCB
  408. +#define BRIGHTNESS_DOWN \_SB.PCI0.GFX0.DECB
  409. +/* SPDX-License-Identifier: GPL-2.0-only */
  410. +
  411. +
  412. +#include <acpi/acpi.h>
  413. +
  414. +DefinitionBlock(
  415. + "dsdt.aml",
  416. + "DSDT",
  417. + ACPI_DSDT_REV_2,
  418. + OEM_ID,
  419. + ACPI_TABLE_CREATOR,
  420. + 0x20141018 /* OEM revision */
  421. +)
  422. +{
  423. + #include <acpi/dsdt_top.asl>
  424. + #include "acpi/platform.asl"
  425. + #include <cpu/intel/common/acpi/cpu.asl>
  426. + #include <southbridge/intel/common/acpi/platform.asl>
  427. + #include <southbridge/intel/bd82x6x/acpi/globalnvs.asl>
  428. + #include <southbridge/intel/common/acpi/sleepstates.asl>
  429. +
  430. + Device (\_SB.PCI0)
  431. + {
  432. + #include <northbridge/intel/sandybridge/acpi/sandybridge.asl>
  433. + #include <drivers/intel/gma/acpi/default_brightness_levels.asl>
  434. + #include <southbridge/intel/bd82x6x/acpi/pch.asl>
  435. + }
  436. +}
  437. diff --git a/src/mainboard/dell/e5420/early_init.c b/src/mainboard/dell/e5420/early_init.c
  438. new file mode 100644
  439. index 0000000000..7297921546
  440. --- /dev/null
  441. +++ b/src/mainboard/dell/e5420/early_init.c
  442. @@ -0,0 +1,32 @@
  443. +/* SPDX-License-Identifier: GPL-2.0-only */
  444. +
  445. +
  446. +#include <bootblock_common.h>
  447. +#include <device/pci_ops.h>
  448. +#include <ec/dell/mec5035/mec5035.h>
  449. +#include <southbridge/intel/bd82x6x/pch.h>
  450. +
  451. +const struct southbridge_usb_port mainboard_usb_ports[] = {
  452. + { 1, 1, 0 },
  453. + { 1, 1, 0 },
  454. + { 1, 1, 1 },
  455. + { 1, 1, 1 },
  456. + { 1, 1, 2 },
  457. + { 1, 1, 2 },
  458. + { 1, 1, 3 },
  459. + { 1, 1, 3 },
  460. + { 1, 1, 5 },
  461. + { 1, 1, 5 },
  462. + { 1, 1, 7 },
  463. + { 1, 1, 6 },
  464. + { 1, 1, 6 },
  465. + { 1, 1, 7 },
  466. +};
  467. +
  468. +void bootblock_mainboard_early_init(void)
  469. +{
  470. + pci_write_config16(PCH_LPC_DEV, LPC_EN, CNF1_LPC_EN | MC_LPC_EN
  471. + | KBC_LPC_EN | FDD_LPC_EN | LPT_LPC_EN
  472. + | COMB_LPC_EN | COMA_LPC_EN);
  473. + mec5035_early_init();
  474. +}
  475. diff --git a/src/mainboard/dell/e5420/gma-mainboard.ads b/src/mainboard/dell/e5420/gma-mainboard.ads
  476. new file mode 100644
  477. index 0000000000..2a16f44360
  478. --- /dev/null
  479. +++ b/src/mainboard/dell/e5420/gma-mainboard.ads
  480. @@ -0,0 +1,20 @@
  481. +-- SPDX-License-Identifier: GPL-2.0-or-later
  482. +
  483. +with HW.GFX.GMA;
  484. +with HW.GFX.GMA.Display_Probing;
  485. +
  486. +use HW.GFX.GMA;
  487. +use HW.GFX.GMA.Display_Probing;
  488. +
  489. +private package GMA.Mainboard is
  490. +
  491. + ports : constant Port_List :=
  492. + (
  493. + HDMI1, -- mainboard HDMI
  494. + DP2, -- dock DP
  495. + DP3, -- dock DP
  496. + Analog, -- mainboard VGA
  497. + LVDS,
  498. + others => Disabled);
  499. +
  500. +end GMA.Mainboard;
  501. diff --git a/src/mainboard/dell/e5420/gpio.c b/src/mainboard/dell/e5420/gpio.c
  502. new file mode 100644
  503. index 0000000000..f76b93d9f0
  504. --- /dev/null
  505. +++ b/src/mainboard/dell/e5420/gpio.c
  506. @@ -0,0 +1,195 @@
  507. +/* SPDX-License-Identifier: GPL-2.0-only */
  508. +
  509. +#include <southbridge/intel/common/gpio.h>
  510. +
  511. +static const struct pch_gpio_set1 pch_gpio_set1_mode = {
  512. + .gpio0 = GPIO_MODE_GPIO,
  513. + .gpio1 = GPIO_MODE_NATIVE,
  514. + .gpio2 = GPIO_MODE_GPIO,
  515. + .gpio3 = GPIO_MODE_GPIO,
  516. + .gpio4 = GPIO_MODE_GPIO,
  517. + .gpio5 = GPIO_MODE_NATIVE,
  518. + .gpio6 = GPIO_MODE_GPIO,
  519. + .gpio7 = GPIO_MODE_GPIO,
  520. + .gpio8 = GPIO_MODE_GPIO,
  521. + .gpio9 = GPIO_MODE_NATIVE,
  522. + .gpio10 = GPIO_MODE_NATIVE,
  523. + .gpio11 = GPIO_MODE_NATIVE,
  524. + .gpio12 = GPIO_MODE_GPIO,
  525. + .gpio13 = GPIO_MODE_GPIO,
  526. + .gpio14 = GPIO_MODE_GPIO,
  527. + .gpio15 = GPIO_MODE_GPIO,
  528. + .gpio16 = GPIO_MODE_NATIVE,
  529. + .gpio17 = GPIO_MODE_GPIO,
  530. + .gpio18 = GPIO_MODE_NATIVE,
  531. + .gpio19 = GPIO_MODE_GPIO,
  532. + .gpio20 = GPIO_MODE_NATIVE,
  533. + .gpio21 = GPIO_MODE_GPIO,
  534. + .gpio22 = GPIO_MODE_GPIO,
  535. + .gpio23 = GPIO_MODE_NATIVE,
  536. + .gpio24 = GPIO_MODE_GPIO,
  537. + .gpio25 = GPIO_MODE_NATIVE,
  538. + .gpio26 = GPIO_MODE_NATIVE,
  539. + .gpio27 = GPIO_MODE_GPIO,
  540. + .gpio28 = GPIO_MODE_GPIO,
  541. + .gpio29 = GPIO_MODE_GPIO,
  542. + .gpio30 = GPIO_MODE_GPIO,
  543. + .gpio31 = GPIO_MODE_NATIVE,
  544. +};
  545. +
  546. +static const struct pch_gpio_set1 pch_gpio_set1_direction = {
  547. + .gpio0 = GPIO_DIR_INPUT,
  548. + .gpio2 = GPIO_DIR_INPUT,
  549. + .gpio3 = GPIO_DIR_INPUT,
  550. + .gpio4 = GPIO_DIR_INPUT,
  551. + .gpio6 = GPIO_DIR_INPUT,
  552. + .gpio7 = GPIO_DIR_INPUT,
  553. + .gpio8 = GPIO_DIR_INPUT,
  554. + .gpio12 = GPIO_DIR_OUTPUT,
  555. + .gpio13 = GPIO_DIR_INPUT,
  556. + .gpio14 = GPIO_DIR_INPUT,
  557. + .gpio15 = GPIO_DIR_INPUT,
  558. + .gpio17 = GPIO_DIR_INPUT,
  559. + .gpio19 = GPIO_DIR_INPUT,
  560. + .gpio21 = GPIO_DIR_INPUT,
  561. + .gpio22 = GPIO_DIR_INPUT,
  562. + .gpio24 = GPIO_DIR_INPUT,
  563. + .gpio27 = GPIO_DIR_INPUT,
  564. + .gpio28 = GPIO_DIR_INPUT,
  565. + .gpio29 = GPIO_DIR_INPUT,
  566. + .gpio30 = GPIO_DIR_OUTPUT,
  567. +};
  568. +
  569. +static const struct pch_gpio_set1 pch_gpio_set1_level = {
  570. + .gpio12 = GPIO_LEVEL_HIGH,
  571. + .gpio30 = GPIO_LEVEL_HIGH,
  572. +};
  573. +
  574. +static const struct pch_gpio_set1 pch_gpio_set1_reset = {
  575. +};
  576. +
  577. +static const struct pch_gpio_set1 pch_gpio_set1_invert = {
  578. + .gpio0 = GPIO_INVERT,
  579. + .gpio8 = GPIO_INVERT,
  580. + .gpio14 = GPIO_INVERT,
  581. +};
  582. +
  583. +static const struct pch_gpio_set1 pch_gpio_set1_blink = {
  584. +};
  585. +
  586. +static const struct pch_gpio_set2 pch_gpio_set2_mode = {
  587. + .gpio32 = GPIO_MODE_NATIVE,
  588. + .gpio33 = GPIO_MODE_GPIO,
  589. + .gpio34 = GPIO_MODE_GPIO,
  590. + .gpio35 = GPIO_MODE_GPIO,
  591. + .gpio36 = GPIO_MODE_GPIO,
  592. + .gpio37 = GPIO_MODE_GPIO,
  593. + .gpio38 = GPIO_MODE_GPIO,
  594. + .gpio39 = GPIO_MODE_GPIO,
  595. + .gpio40 = GPIO_MODE_NATIVE,
  596. + .gpio41 = GPIO_MODE_NATIVE,
  597. + .gpio42 = GPIO_MODE_NATIVE,
  598. + .gpio43 = GPIO_MODE_NATIVE,
  599. + .gpio44 = GPIO_MODE_NATIVE,
  600. + .gpio45 = GPIO_MODE_NATIVE,
  601. + .gpio46 = GPIO_MODE_GPIO,
  602. + .gpio47 = GPIO_MODE_NATIVE,
  603. + .gpio48 = GPIO_MODE_GPIO,
  604. + .gpio49 = GPIO_MODE_NATIVE,
  605. + .gpio50 = GPIO_MODE_GPIO,
  606. + .gpio51 = GPIO_MODE_GPIO,
  607. + .gpio52 = GPIO_MODE_GPIO,
  608. + .gpio53 = GPIO_MODE_GPIO,
  609. + .gpio54 = GPIO_MODE_GPIO,
  610. + .gpio55 = GPIO_MODE_GPIO,
  611. + .gpio56 = GPIO_MODE_GPIO,
  612. + .gpio57 = GPIO_MODE_GPIO,
  613. + .gpio58 = GPIO_MODE_NATIVE,
  614. + .gpio59 = GPIO_MODE_NATIVE,
  615. + .gpio60 = GPIO_MODE_GPIO,
  616. + .gpio61 = GPIO_MODE_NATIVE,
  617. + .gpio62 = GPIO_MODE_NATIVE,
  618. + .gpio63 = GPIO_MODE_NATIVE,
  619. +};
  620. +
  621. +static const struct pch_gpio_set2 pch_gpio_set2_direction = {
  622. + .gpio33 = GPIO_DIR_INPUT,
  623. + .gpio34 = GPIO_DIR_OUTPUT,
  624. + .gpio35 = GPIO_DIR_INPUT,
  625. + .gpio36 = GPIO_DIR_INPUT,
  626. + .gpio37 = GPIO_DIR_OUTPUT,
  627. + .gpio38 = GPIO_DIR_INPUT,
  628. + .gpio39 = GPIO_DIR_INPUT,
  629. + .gpio46 = GPIO_DIR_OUTPUT,
  630. + .gpio48 = GPIO_DIR_INPUT,
  631. + .gpio50 = GPIO_DIR_OUTPUT,
  632. + .gpio51 = GPIO_DIR_OUTPUT,
  633. + .gpio52 = GPIO_DIR_INPUT,
  634. + .gpio53 = GPIO_DIR_INPUT,
  635. + .gpio54 = GPIO_DIR_INPUT,
  636. + .gpio55 = GPIO_DIR_OUTPUT,
  637. + .gpio56 = GPIO_DIR_INPUT,
  638. + .gpio57 = GPIO_DIR_INPUT,
  639. + .gpio60 = GPIO_DIR_OUTPUT,
  640. +};
  641. +
  642. +static const struct pch_gpio_set2 pch_gpio_set2_level = {
  643. + .gpio34 = GPIO_LEVEL_LOW,
  644. + .gpio37 = GPIO_LEVEL_LOW,
  645. + .gpio46 = GPIO_LEVEL_HIGH,
  646. + .gpio50 = GPIO_LEVEL_HIGH,
  647. + .gpio51 = GPIO_LEVEL_LOW,
  648. + .gpio55 = GPIO_LEVEL_LOW,
  649. + .gpio60 = GPIO_LEVEL_HIGH,
  650. +};
  651. +
  652. +static const struct pch_gpio_set2 pch_gpio_set2_reset = {
  653. +};
  654. +
  655. +static const struct pch_gpio_set3 pch_gpio_set3_mode = {
  656. + .gpio64 = GPIO_MODE_NATIVE,
  657. + .gpio65 = GPIO_MODE_NATIVE,
  658. + .gpio66 = GPIO_MODE_NATIVE,
  659. + .gpio67 = GPIO_MODE_NATIVE,
  660. + .gpio68 = GPIO_MODE_NATIVE,
  661. + .gpio69 = GPIO_MODE_NATIVE,
  662. + .gpio70 = GPIO_MODE_NATIVE,
  663. + .gpio71 = GPIO_MODE_NATIVE,
  664. + .gpio72 = GPIO_MODE_NATIVE,
  665. + .gpio73 = GPIO_MODE_NATIVE,
  666. + .gpio74 = GPIO_MODE_GPIO,
  667. + .gpio75 = GPIO_MODE_NATIVE,
  668. +};
  669. +
  670. +static const struct pch_gpio_set3 pch_gpio_set3_direction = {
  671. + .gpio74 = GPIO_DIR_INPUT,
  672. +};
  673. +
  674. +static const struct pch_gpio_set3 pch_gpio_set3_level = {
  675. +};
  676. +
  677. +static const struct pch_gpio_set3 pch_gpio_set3_reset = {
  678. +};
  679. +
  680. +const struct pch_gpio_map mainboard_gpio_map = {
  681. + .set1 = {
  682. + .mode = &pch_gpio_set1_mode,
  683. + .direction = &pch_gpio_set1_direction,
  684. + .level = &pch_gpio_set1_level,
  685. + .blink = &pch_gpio_set1_blink,
  686. + .invert = &pch_gpio_set1_invert,
  687. + .reset = &pch_gpio_set1_reset,
  688. + },
  689. + .set2 = {
  690. + .mode = &pch_gpio_set2_mode,
  691. + .direction = &pch_gpio_set2_direction,
  692. + .level = &pch_gpio_set2_level,
  693. + .reset = &pch_gpio_set2_reset,
  694. + },
  695. + .set3 = {
  696. + .mode = &pch_gpio_set3_mode,
  697. + .direction = &pch_gpio_set3_direction,
  698. + .level = &pch_gpio_set3_level,
  699. + .reset = &pch_gpio_set3_reset,
  700. + },
  701. +};
  702. diff --git a/src/mainboard/dell/e5420/hda_verb.c b/src/mainboard/dell/e5420/hda_verb.c
  703. new file mode 100644
  704. index 0000000000..70e7c2e79a
  705. --- /dev/null
  706. +++ b/src/mainboard/dell/e5420/hda_verb.c
  707. @@ -0,0 +1,33 @@
  708. +/* SPDX-License-Identifier: GPL-2.0-only */
  709. +
  710. +#include <device/azalia_device.h>
  711. +
  712. +const u32 cim_verb_data[] = {
  713. + 0x111d76e7, /* Codec Vendor / Device ID: IDT */
  714. + 0x1028049b, /* Subsystem ID */
  715. + 11, /* Number of 4 dword sets */
  716. + AZALIA_SUBVENDOR(0, 0x1028049b),
  717. + AZALIA_PIN_CFG(0, 0x0a, 0x04a11020),
  718. + AZALIA_PIN_CFG(0, 0x0b, 0x0421101f),
  719. + AZALIA_PIN_CFG(0, 0x0c, 0x400000f0),
  720. + AZALIA_PIN_CFG(0, 0x0d, 0x90170110),
  721. + AZALIA_PIN_CFG(0, 0x0e, 0x23011050),
  722. + AZALIA_PIN_CFG(0, 0x0f, 0x23a1102e),
  723. + AZALIA_PIN_CFG(0, 0x10, 0x400000f3),
  724. + AZALIA_PIN_CFG(0, 0x11, 0x400000f0),
  725. + AZALIA_PIN_CFG(0, 0x1f, 0x400000f0),
  726. + AZALIA_PIN_CFG(0, 0x20, 0xd5a30130),
  727. +
  728. + 0x80862805, /* Codec Vendor / Device ID: Intel */
  729. + 0x80860101, /* Subsystem ID */
  730. + 4, /* Number of 4 dword sets */
  731. + AZALIA_SUBVENDOR(3, 0x80860101),
  732. + AZALIA_PIN_CFG(3, 0x05, 0x18560010),
  733. + AZALIA_PIN_CFG(3, 0x06, 0x18560020),
  734. + AZALIA_PIN_CFG(3, 0x07, 0x18560030),
  735. +
  736. +};
  737. +
  738. +const u32 pc_beep_verbs[0] = {};
  739. +
  740. +AZALIA_ARRAY_SIZES;
  741. diff --git a/src/mainboard/dell/e5420/mainboard.c b/src/mainboard/dell/e5420/mainboard.c
  742. new file mode 100644
  743. index 0000000000..31e49802fc
  744. --- /dev/null
  745. +++ b/src/mainboard/dell/e5420/mainboard.c
  746. @@ -0,0 +1,21 @@
  747. +/* SPDX-License-Identifier: GPL-2.0-only */
  748. +
  749. +#include <device/device.h>
  750. +#include <drivers/intel/gma/int15.h>
  751. +#include <southbridge/intel/bd82x6x/pch.h>
  752. +#include <ec/acpi/ec.h>
  753. +#include <console/console.h>
  754. +#include <pc80/keyboard.h>
  755. +
  756. +static void mainboard_enable(struct device *dev)
  757. +{
  758. +
  759. + /* FIXME: fix these values. */
  760. + install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS,
  761. + GMA_INT15_PANEL_FIT_DEFAULT,
  762. + GMA_INT15_BOOT_DISPLAY_DEFAULT, 0);
  763. +}
  764. +
  765. +struct chip_operations mainboard_ops = {
  766. + .enable_dev = mainboard_enable,
  767. +};
  768. --
  769. 2.44.0