0035-mb-dell-Add-Latitude-E5520-Sandybridge.patch 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776
  1. From 7c7ce2087e1ff5f0eedb65793254163d01be3056 Mon Sep 17 00:00:00 2001
  2. From: Nicholas Chin <nic.c3.14@gmail.com>
  3. Date: Wed, 7 Feb 2024 10:23:38 -0700
  4. Subject: [PATCH] mb/dell: Add Latitude E5520 (Sandybridge)
  5. Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com>
  6. ---
  7. src/mainboard/dell/e5520/Kconfig | 37 ++++
  8. src/mainboard/dell/e5520/Kconfig.name | 2 +
  9. src/mainboard/dell/e5520/Makefile.inc | 5 +
  10. src/mainboard/dell/e5520/acpi/ec.asl | 9 +
  11. src/mainboard/dell/e5520/acpi/platform.asl | 12 ++
  12. src/mainboard/dell/e5520/acpi/superio.asl | 3 +
  13. src/mainboard/dell/e5520/acpi_tables.c | 16 ++
  14. src/mainboard/dell/e5520/board_info.txt | 6 +
  15. src/mainboard/dell/e5520/cmos.default | 9 +
  16. src/mainboard/dell/e5520/cmos.layout | 88 ++++++++++
  17. src/mainboard/dell/e5520/data.vbt | Bin 0 -> 6144 bytes
  18. src/mainboard/dell/e5520/devicetree.cb | 66 +++++++
  19. src/mainboard/dell/e5520/dsdt.asl | 30 ++++
  20. src/mainboard/dell/e5520/early_init.c | 32 ++++
  21. src/mainboard/dell/e5520/gma-mainboard.ads | 20 +++
  22. src/mainboard/dell/e5520/gpio.c | 195 +++++++++++++++++++++
  23. src/mainboard/dell/e5520/hda_verb.c | 33 ++++
  24. src/mainboard/dell/e5520/mainboard.c | 21 +++
  25. 18 files changed, 584 insertions(+)
  26. create mode 100644 src/mainboard/dell/e5520/Kconfig
  27. create mode 100644 src/mainboard/dell/e5520/Kconfig.name
  28. create mode 100644 src/mainboard/dell/e5520/Makefile.inc
  29. create mode 100644 src/mainboard/dell/e5520/acpi/ec.asl
  30. create mode 100644 src/mainboard/dell/e5520/acpi/platform.asl
  31. create mode 100644 src/mainboard/dell/e5520/acpi/superio.asl
  32. create mode 100644 src/mainboard/dell/e5520/acpi_tables.c
  33. create mode 100644 src/mainboard/dell/e5520/board_info.txt
  34. create mode 100644 src/mainboard/dell/e5520/cmos.default
  35. create mode 100644 src/mainboard/dell/e5520/cmos.layout
  36. create mode 100644 src/mainboard/dell/e5520/data.vbt
  37. create mode 100644 src/mainboard/dell/e5520/devicetree.cb
  38. create mode 100644 src/mainboard/dell/e5520/dsdt.asl
  39. create mode 100644 src/mainboard/dell/e5520/early_init.c
  40. create mode 100644 src/mainboard/dell/e5520/gma-mainboard.ads
  41. create mode 100644 src/mainboard/dell/e5520/gpio.c
  42. create mode 100644 src/mainboard/dell/e5520/hda_verb.c
  43. create mode 100644 src/mainboard/dell/e5520/mainboard.c
  44. diff --git a/src/mainboard/dell/e5520/Kconfig b/src/mainboard/dell/e5520/Kconfig
  45. new file mode 100644
  46. index 0000000000..213c54cf5c
  47. --- /dev/null
  48. +++ b/src/mainboard/dell/e5520/Kconfig
  49. @@ -0,0 +1,37 @@
  50. +if BOARD_DELL_LATITUDE_E5520
  51. +
  52. +config BOARD_SPECIFIC_OPTIONS
  53. + def_bool y
  54. + select BOARD_ROMSIZE_KB_6144
  55. + select EC_ACPI
  56. + select EC_DELL_MEC5035
  57. + select GFX_GMA_PANEL_1_ON_LVDS
  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 INTEL_INT15
  64. + select MAINBOARD_HAS_LIBGFXINIT
  65. + select NORTHBRIDGE_INTEL_SANDYBRIDGE
  66. + select SERIRQ_CONTINUOUS_MODE
  67. + select SOUTHBRIDGE_INTEL_BD82X6X
  68. + select SYSTEM_TYPE_LAPTOP
  69. + select USE_NATIVE_RAMINIT
  70. +
  71. +config DRAM_RESET_GATE_GPIO
  72. + default 60
  73. +
  74. +config MAINBOARD_DIR
  75. + default "dell/e5520"
  76. +
  77. +config MAINBOARD_PART_NUMBER
  78. + default "Latitude E5520"
  79. +
  80. +config USBDEBUG_HCD_INDEX
  81. + default 2
  82. +
  83. +config VGA_BIOS_ID
  84. + default "8086,0126"
  85. +
  86. +endif # BOARD_DELL_LATITUDE_E5520
  87. diff --git a/src/mainboard/dell/e5520/Kconfig.name b/src/mainboard/dell/e5520/Kconfig.name
  88. new file mode 100644
  89. index 0000000000..c88913e8b3
  90. --- /dev/null
  91. +++ b/src/mainboard/dell/e5520/Kconfig.name
  92. @@ -0,0 +1,2 @@
  93. +config BOARD_DELL_LATITUDE_E5520
  94. + bool "Latitude E5520"
  95. diff --git a/src/mainboard/dell/e5520/Makefile.inc b/src/mainboard/dell/e5520/Makefile.inc
  96. new file mode 100644
  97. index 0000000000..18391d8b18
  98. --- /dev/null
  99. +++ b/src/mainboard/dell/e5520/Makefile.inc
  100. @@ -0,0 +1,5 @@
  101. +bootblock-y += early_init.c
  102. +bootblock-y += gpio.c
  103. +romstage-y += early_init.c
  104. +romstage-y += gpio.c
  105. +ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += gma-mainboard.ads
  106. diff --git a/src/mainboard/dell/e5520/acpi/ec.asl b/src/mainboard/dell/e5520/acpi/ec.asl
  107. new file mode 100644
  108. index 0000000000..0d429410a9
  109. --- /dev/null
  110. +++ b/src/mainboard/dell/e5520/acpi/ec.asl
  111. @@ -0,0 +1,9 @@
  112. +/* SPDX-License-Identifier: GPL-2.0-only */
  113. +
  114. +Device(EC)
  115. +{
  116. + Name (_HID, EISAID("PNP0C09"))
  117. + Name (_UID, 0)
  118. + Name (_GPE, 16)
  119. +/* FIXME: EC support */
  120. +}
  121. diff --git a/src/mainboard/dell/e5520/acpi/platform.asl b/src/mainboard/dell/e5520/acpi/platform.asl
  122. new file mode 100644
  123. index 0000000000..2d24bbd9b9
  124. --- /dev/null
  125. +++ b/src/mainboard/dell/e5520/acpi/platform.asl
  126. @@ -0,0 +1,12 @@
  127. +/* SPDX-License-Identifier: GPL-2.0-only */
  128. +
  129. +Method(_WAK, 1)
  130. +{
  131. + /* FIXME: EC support */
  132. + Return(Package() {0, 0})
  133. +}
  134. +
  135. +Method(_PTS,1)
  136. +{
  137. + /* FIXME: EC support */
  138. +}
  139. diff --git a/src/mainboard/dell/e5520/acpi/superio.asl b/src/mainboard/dell/e5520/acpi/superio.asl
  140. new file mode 100644
  141. index 0000000000..55b1db5b11
  142. --- /dev/null
  143. +++ b/src/mainboard/dell/e5520/acpi/superio.asl
  144. @@ -0,0 +1,3 @@
  145. +/* SPDX-License-Identifier: GPL-2.0-only */
  146. +
  147. +#include <drivers/pc80/pc/ps2_controller.asl>
  148. diff --git a/src/mainboard/dell/e5520/acpi_tables.c b/src/mainboard/dell/e5520/acpi_tables.c
  149. new file mode 100644
  150. index 0000000000..e2759659bf
  151. --- /dev/null
  152. +++ b/src/mainboard/dell/e5520/acpi_tables.c
  153. @@ -0,0 +1,16 @@
  154. +/* SPDX-License-Identifier: GPL-2.0-only */
  155. +
  156. +#include <acpi/acpi_gnvs.h>
  157. +#include <soc/nvs.h>
  158. +
  159. +/* FIXME: check this function. */
  160. +void mainboard_fill_gnvs(struct global_nvs *gnvs)
  161. +{
  162. + /* The lid is open by default. */
  163. + gnvs->lids = 1;
  164. +
  165. + /* Temperature at which OS will shutdown */
  166. + gnvs->tcrt = 100;
  167. + /* Temperature at which OS will throttle CPU */
  168. + gnvs->tpsv = 90;
  169. +}
  170. diff --git a/src/mainboard/dell/e5520/board_info.txt b/src/mainboard/dell/e5520/board_info.txt
  171. new file mode 100644
  172. index 0000000000..34d5ad9e0b
  173. --- /dev/null
  174. +++ b/src/mainboard/dell/e5520/board_info.txt
  175. @@ -0,0 +1,6 @@
  176. +Category: laptop
  177. +ROM package: SOIC-8
  178. +ROM protocol: SPI
  179. +ROM socketed: n
  180. +Flashrom support: y
  181. +Release year: 2011
  182. diff --git a/src/mainboard/dell/e5520/cmos.default b/src/mainboard/dell/e5520/cmos.default
  183. new file mode 100644
  184. index 0000000000..279415dfd1
  185. --- /dev/null
  186. +++ b/src/mainboard/dell/e5520/cmos.default
  187. @@ -0,0 +1,9 @@
  188. +boot_option=Fallback
  189. +debug_level=Debug
  190. +power_on_after_fail=Disable
  191. +nmi=Enable
  192. +bluetooth=Enable
  193. +wwan=Enable
  194. +wlan=Enable
  195. +sata_mode=AHCI
  196. +me_state=Disabled
  197. diff --git a/src/mainboard/dell/e5520/cmos.layout b/src/mainboard/dell/e5520/cmos.layout
  198. new file mode 100644
  199. index 0000000000..1aa7e77bce
  200. --- /dev/null
  201. +++ b/src/mainboard/dell/e5520/cmos.layout
  202. @@ -0,0 +1,88 @@
  203. +## SPDX-License-Identifier: GPL-2.0-only
  204. +
  205. +# -----------------------------------------------------------------
  206. +entries
  207. +
  208. +# -----------------------------------------------------------------
  209. +0 120 r 0 reserved_memory
  210. +
  211. +# -----------------------------------------------------------------
  212. +# RTC_BOOT_BYTE (coreboot hardcoded)
  213. +384 1 e 4 boot_option
  214. +388 4 h 0 reboot_counter
  215. +
  216. +# -----------------------------------------------------------------
  217. +# coreboot config options: console
  218. +395 4 e 6 debug_level
  219. +
  220. +#400 8 r 0 reserved for century byte
  221. +
  222. +# coreboot config options: southbridge
  223. +408 1 e 1 nmi
  224. +409 2 e 7 power_on_after_fail
  225. +411 1 e 9 sata_mode
  226. +
  227. +# coreboot config options: EC
  228. +412 1 e 1 bluetooth
  229. +413 1 e 1 wwan
  230. +414 1 e 1 wlan
  231. +
  232. +# coreboot config options: ME
  233. +424 1 e 14 me_state
  234. +425 2 h 0 me_state_prev
  235. +
  236. +# coreboot config options: northbridge
  237. +432 3 e 11 gfx_uma_size
  238. +435 2 e 12 hybrid_graphics_mode
  239. +440 8 h 0 volume
  240. +
  241. +# VBOOT
  242. +448 128 r 0 vbnv
  243. +
  244. +# SandyBridge MRC Scrambler Seed values
  245. +896 32 r 0 mrc_scrambler_seed
  246. +928 32 r 0 mrc_scrambler_seed_s3
  247. +960 16 r 0 mrc_scrambler_seed_chk
  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. +9 0 AHCI
  276. +9 1 Compatible
  277. +11 0 32M
  278. +11 1 64M
  279. +11 2 96M
  280. +11 3 128M
  281. +11 4 160M
  282. +11 5 192M
  283. +11 6 224M
  284. +14 0 Normal
  285. +14 1 Disabled
  286. +
  287. +# -----------------------------------------------------------------
  288. +checksums
  289. +
  290. +checksum 392 447 984
  291. diff --git a/src/mainboard/dell/e5520/data.vbt b/src/mainboard/dell/e5520/data.vbt
  292. new file mode 100644
  293. index 0000000000000000000000000000000000000000..b511e75262e37fa123d674e9a7b21a8dfe427729
  294. GIT binary patch
  295. literal 6144
  296. zcmeHKZ){Ul6hE);wSBvNZ|mL$bmQOM2BTvXUI!}^N9ejTij1vnu+)Wx6<c9(Y_%K6
  297. zzOV-@f<ehpWB5RHBpMBgG7}RuMuM2=l*E{6G$wq&gqTQ3#E2RZsOP@dvW*rP7>Fjj
  298. z&F`Lj?>YC}bI(2Z+}C+6zKyiGrosQXuW7A+&1%<rN+Y1ck(}dLrx)Ma#^x>lnvFGE
  299. zeD#gB>*#Tq4&j^|7Xcz1r^pp*)g#T}u1Me3ct>Pgls5Qi3!6e2W0%`a-Ic|3efWuR
  300. zXJ@#}wJyGMTXTcY<%@TBKh@(3hP$Gjv}E}rx-%9D_eLXhYe!c&-VyDg-Cdo1>Biji
  301. zNNsnlFW#|jdoOj?mZ43m>cVO%UE9@*E7x|%V~c4`XD4l9GCi~@+7pfMibfX8L?!^I
  302. zc~Rg1I5SxH1DAEZ0{jA41jrJBh#-l;b6^%g7QrThRe)&%tQH_!ggOD7A_PRRgGuI0
  303. z0zi=n#rCB66d-sO$M~^6wgeb$2fH1|0R`v}xUiWCU`4SF;Dyh&j|mK&6WJWJ&Pq9I
  304. zVgmFQfh+)vE}(KWwHA|Oh3fSkss|;2E(2i}s1?gRRV%8!K7U={vHD=s#+Fd)W^M1j
  305. z{R4$??VSvEWpgT=vCM&1-U$bI6CB~IV3Z$$Vv7o!EDnev4j~R(MHsazZ~^fLLKGF4
  306. zEfQFOa3dZ?1Q1P#&4?!vyAk^k&m&$z3?WV+-b0*1j37o4=MX<3E+eiYge(Ht2umAW
  307. zOPDmU>UL{flI9u|@JtVvfp#o8ek?VfVV9YP5(%pnZX~{PKq4WoWGmV8t$=Ri@{zLQ
  308. zNYYt4<$0Ry&qIoG;7s-t333)Nu8opN{NG!)&!I@eO(cVx8vBVEBvotJ7%yNl$7iQ_
  309. zI=xk30+V$ff`F6<wRoF(TK%j9nsr#H23umU%)_7jNOl%*FPU567qbg;4gtp711nj2
  310. z#+kHw`v4|5cA+`UMIvAl;slnH1nl0v=xH<al>1}ljxDE1dcda^&!do|r^eJkI?aC-
  311. zEQMSfm?<w*Unzumkj_w5>VYL6W4=aCiy4rk%xq~5LV?bi|GL2$G7li<%c7yd;6T34
  312. zQBN5huZ3~6`ChGkpb$Bg5ITb#2iK-qs|1`=sl6Dhn(Lj&8Agt?S{sTDmmtRj7Jm_1
  313. zFnt{w&FdFkWS3bl>OeL?eO+*i{)9G!cSI-InGt|U0eEYmRCOHm7|I;#LO8ksRIeJ#
  314. zGe+jTwPg4C4TYuN(9zULV3k+hI$YuPo=%N8oZ#u_4S!3Xelt6N0BmuC`hCNeg+&97
  315. z6*!>)uHvr%2004GZv?!_-y&|TRmil=9D%Q`1aXBsnD^gov3*UZI34&1_vn(B=T4kZ
  316. z_A>ClXVIBNaS^hd&^DrU6VgZMYeadMkdFxcktn|ra-Gl;n^I{bt86rCQ=YMry*B!$
  317. zP5ID9KDE)GZOY#^VwPyRq^y+48j0?ZlzxdkC()CV@`*&wO7vGr;qjA3rb}gIwM-gi
  318. zx>HsT$mEDj-<OpyWb%zn|B@A3Hkp<!FT5;hrt_SZiy?*wDaIu{h>%Ir=@rh7)SR;b
  319. zAEWQGv_X1)wq0y5Ha0c~&psIsln<Hiu3;#Lf;%*eI<@?p8cfMJV(IYi8q$NA#iS8`
  320. z_~|4t4b^wtMSAeFST^F8-Tm<zu8D&j^8=&I4;I}Im>aeSK~X8*^Z9SE44_`P#KIUL
  321. zf6^N2f>5HCPWM3N+f0MyWOV^kz~!-wVc4MRXOY>4Jsxd1RyBKEMzNf{RKhesKFdbq
  322. zJ(*d<l2Y#n?E?~iBA39P?~Pr2d#}5=#Sfl-VGzGUF$4U2KcqCIVlwkC(&7PQk_X!a
  323. z8}3Jgq-&U*Co|h1>l)ZQGyW_x->i#;FvQ*=Nv&nG0N5@D@jjv_Q}K}6MP?1A6`JGe
  324. zDwj9pN+x;T4>`I9e5x(uqdK#OGB31ikk@Xv=dxLb4fx(;ktX@rOb~M~?dYQQYiPia
  325. z8r;jUQ?sd2@3||-cb2Eb%JFYfxHsONoaJ^eqoKN{<g9?-%`7oWz+aJS0tEc!^d@hD
  326. z1-I{%hr!Y?0uVZpUbl__37xn@jkD6Z>3SATgBQlEoN7&ZV9Eni9+>jLln16fFy(=V
  327. H=7E0zE^L4Z
  328. literal 0
  329. HcmV?d00001
  330. diff --git a/src/mainboard/dell/e5520/devicetree.cb b/src/mainboard/dell/e5520/devicetree.cb
  331. new file mode 100644
  332. index 0000000000..bef96ac14c
  333. --- /dev/null
  334. +++ b/src/mainboard/dell/e5520/devicetree.cb
  335. @@ -0,0 +1,66 @@
  336. +chip northbridge/intel/sandybridge # FIXME: GPU registers may not always apply.
  337. + register "gfx" = "GMA_STATIC_DISPLAYS(1)"
  338. + register "gpu_cpu_backlight" = "0x00000218"
  339. + register "gpu_dp_b_hotplug" = "4"
  340. + register "gpu_dp_c_hotplug" = "4"
  341. + register "gpu_dp_d_hotplug" = "4"
  342. + register "gpu_panel_port_select" = "0"
  343. + register "gpu_panel_power_backlight_off_delay" = "2300"
  344. + register "gpu_panel_power_backlight_on_delay" = "2300"
  345. + register "gpu_panel_power_cycle_delay" = "6"
  346. + register "gpu_panel_power_down_delay" = "400"
  347. + register "gpu_panel_power_up_delay" = "400"
  348. + register "gpu_pch_backlight" = "0x13121312"
  349. +
  350. + register "spd_addresses" = "{0x50, 0, 0x52, 0}"
  351. +
  352. + device domain 0x0 on
  353. + subsystemid 0x1028 0x049a inherit
  354. +
  355. + device ref host_bridge on end # Host bridge
  356. + device ref peg10 on end # PEG
  357. + device ref igd on end # iGPU
  358. +
  359. + chip southbridge/intel/bd82x6x # Intel Series 6 Cougar Point PCH
  360. + register "docking_supported" = "1"
  361. + register "gen1_dec" = "0x007c0681"
  362. + register "gen2_dec" = "0x007c0901"
  363. + register "gen3_dec" = "0x003c07e1"
  364. + register "gen4_dec" = "0x001c0901"
  365. + register "gpi0_routing" = "2"
  366. + register "pcie_hotplug_map" = "{ 0, 0, 1, 0, 0, 0, 1, 0 }"
  367. + register "pcie_port_coalesce" = "1"
  368. + register "sata_interface_speed_support" = "0x3"
  369. + register "sata_port_map" = "0x3b"
  370. + register "spi_lvscc" = "0x2005"
  371. + register "spi_uvscc" = "0x2005"
  372. +
  373. + device ref mei1 off end
  374. + device ref mei2 off end
  375. + device ref me_ide_r off end
  376. + device ref me_kt off end
  377. + device ref gbe off end
  378. + device ref ehci2 on end
  379. + device ref hda on end
  380. + device ref pcie_rp1 on end
  381. + device ref pcie_rp2 on end
  382. + device ref pcie_rp3 on end
  383. + device ref pcie_rp4 off end
  384. + device ref pcie_rp5 on end
  385. + device ref pcie_rp6 on end
  386. + device ref pcie_rp7 on end
  387. + device ref pcie_rp8 off end
  388. + device ref ehci1 on end
  389. + device ref pci_bridge off end
  390. + device ref lpc on
  391. + chip ec/dell/mec5035
  392. + device pnp ff.0 on end
  393. + end
  394. + end
  395. + device ref sata1 on end
  396. + device ref smbus on end
  397. + device ref sata2 off end
  398. + device ref thermal off end
  399. + end
  400. + end
  401. +end
  402. diff --git a/src/mainboard/dell/e5520/dsdt.asl b/src/mainboard/dell/e5520/dsdt.asl
  403. new file mode 100644
  404. index 0000000000..7d13c55b08
  405. --- /dev/null
  406. +++ b/src/mainboard/dell/e5520/dsdt.asl
  407. @@ -0,0 +1,30 @@
  408. +#define BRIGHTNESS_UP \_SB.PCI0.GFX0.INCB
  409. +#define BRIGHTNESS_DOWN \_SB.PCI0.GFX0.DECB
  410. +/* SPDX-License-Identifier: GPL-2.0-only */
  411. +
  412. +
  413. +#include <acpi/acpi.h>
  414. +
  415. +DefinitionBlock(
  416. + "dsdt.aml",
  417. + "DSDT",
  418. + ACPI_DSDT_REV_2,
  419. + OEM_ID,
  420. + ACPI_TABLE_CREATOR,
  421. + 0x20141018 /* OEM revision */
  422. +)
  423. +{
  424. + #include <acpi/dsdt_top.asl>
  425. + #include "acpi/platform.asl"
  426. + #include <cpu/intel/common/acpi/cpu.asl>
  427. + #include <southbridge/intel/common/acpi/platform.asl>
  428. + #include <southbridge/intel/bd82x6x/acpi/globalnvs.asl>
  429. + #include <southbridge/intel/common/acpi/sleepstates.asl>
  430. +
  431. + Device (\_SB.PCI0)
  432. + {
  433. + #include <northbridge/intel/sandybridge/acpi/sandybridge.asl>
  434. + #include <drivers/intel/gma/acpi/default_brightness_levels.asl>
  435. + #include <southbridge/intel/bd82x6x/acpi/pch.asl>
  436. + }
  437. +}
  438. diff --git a/src/mainboard/dell/e5520/early_init.c b/src/mainboard/dell/e5520/early_init.c
  439. new file mode 100644
  440. index 0000000000..7297921546
  441. --- /dev/null
  442. +++ b/src/mainboard/dell/e5520/early_init.c
  443. @@ -0,0 +1,32 @@
  444. +/* SPDX-License-Identifier: GPL-2.0-only */
  445. +
  446. +
  447. +#include <bootblock_common.h>
  448. +#include <device/pci_ops.h>
  449. +#include <ec/dell/mec5035/mec5035.h>
  450. +#include <southbridge/intel/bd82x6x/pch.h>
  451. +
  452. +const struct southbridge_usb_port mainboard_usb_ports[] = {
  453. + { 1, 1, 0 },
  454. + { 1, 1, 0 },
  455. + { 1, 1, 1 },
  456. + { 1, 1, 1 },
  457. + { 1, 1, 2 },
  458. + { 1, 1, 2 },
  459. + { 1, 1, 3 },
  460. + { 1, 1, 3 },
  461. + { 1, 1, 5 },
  462. + { 1, 1, 5 },
  463. + { 1, 1, 7 },
  464. + { 1, 1, 6 },
  465. + { 1, 1, 6 },
  466. + { 1, 1, 7 },
  467. +};
  468. +
  469. +void bootblock_mainboard_early_init(void)
  470. +{
  471. + pci_write_config16(PCH_LPC_DEV, LPC_EN, CNF1_LPC_EN | MC_LPC_EN
  472. + | KBC_LPC_EN | FDD_LPC_EN | LPT_LPC_EN
  473. + | COMB_LPC_EN | COMA_LPC_EN);
  474. + mec5035_early_init();
  475. +}
  476. diff --git a/src/mainboard/dell/e5520/gma-mainboard.ads b/src/mainboard/dell/e5520/gma-mainboard.ads
  477. new file mode 100644
  478. index 0000000000..2a16f44360
  479. --- /dev/null
  480. +++ b/src/mainboard/dell/e5520/gma-mainboard.ads
  481. @@ -0,0 +1,20 @@
  482. +-- SPDX-License-Identifier: GPL-2.0-or-later
  483. +
  484. +with HW.GFX.GMA;
  485. +with HW.GFX.GMA.Display_Probing;
  486. +
  487. +use HW.GFX.GMA;
  488. +use HW.GFX.GMA.Display_Probing;
  489. +
  490. +private package GMA.Mainboard is
  491. +
  492. + ports : constant Port_List :=
  493. + (
  494. + HDMI1, -- mainboard HDMI
  495. + DP2, -- dock DP
  496. + DP3, -- dock DP
  497. + Analog, -- mainboard VGA
  498. + LVDS,
  499. + others => Disabled);
  500. +
  501. +end GMA.Mainboard;
  502. diff --git a/src/mainboard/dell/e5520/gpio.c b/src/mainboard/dell/e5520/gpio.c
  503. new file mode 100644
  504. index 0000000000..f76b93d9f0
  505. --- /dev/null
  506. +++ b/src/mainboard/dell/e5520/gpio.c
  507. @@ -0,0 +1,195 @@
  508. +/* SPDX-License-Identifier: GPL-2.0-only */
  509. +
  510. +#include <southbridge/intel/common/gpio.h>
  511. +
  512. +static const struct pch_gpio_set1 pch_gpio_set1_mode = {
  513. + .gpio0 = GPIO_MODE_GPIO,
  514. + .gpio1 = GPIO_MODE_NATIVE,
  515. + .gpio2 = GPIO_MODE_GPIO,
  516. + .gpio3 = GPIO_MODE_GPIO,
  517. + .gpio4 = GPIO_MODE_GPIO,
  518. + .gpio5 = GPIO_MODE_NATIVE,
  519. + .gpio6 = GPIO_MODE_GPIO,
  520. + .gpio7 = GPIO_MODE_GPIO,
  521. + .gpio8 = GPIO_MODE_GPIO,
  522. + .gpio9 = GPIO_MODE_NATIVE,
  523. + .gpio10 = GPIO_MODE_NATIVE,
  524. + .gpio11 = GPIO_MODE_NATIVE,
  525. + .gpio12 = GPIO_MODE_GPIO,
  526. + .gpio13 = GPIO_MODE_GPIO,
  527. + .gpio14 = GPIO_MODE_GPIO,
  528. + .gpio15 = GPIO_MODE_GPIO,
  529. + .gpio16 = GPIO_MODE_NATIVE,
  530. + .gpio17 = GPIO_MODE_GPIO,
  531. + .gpio18 = GPIO_MODE_NATIVE,
  532. + .gpio19 = GPIO_MODE_GPIO,
  533. + .gpio20 = GPIO_MODE_NATIVE,
  534. + .gpio21 = GPIO_MODE_GPIO,
  535. + .gpio22 = GPIO_MODE_GPIO,
  536. + .gpio23 = GPIO_MODE_NATIVE,
  537. + .gpio24 = GPIO_MODE_GPIO,
  538. + .gpio25 = GPIO_MODE_NATIVE,
  539. + .gpio26 = GPIO_MODE_NATIVE,
  540. + .gpio27 = GPIO_MODE_GPIO,
  541. + .gpio28 = GPIO_MODE_GPIO,
  542. + .gpio29 = GPIO_MODE_GPIO,
  543. + .gpio30 = GPIO_MODE_GPIO,
  544. + .gpio31 = GPIO_MODE_NATIVE,
  545. +};
  546. +
  547. +static const struct pch_gpio_set1 pch_gpio_set1_direction = {
  548. + .gpio0 = GPIO_DIR_INPUT,
  549. + .gpio2 = GPIO_DIR_INPUT,
  550. + .gpio3 = GPIO_DIR_INPUT,
  551. + .gpio4 = GPIO_DIR_INPUT,
  552. + .gpio6 = GPIO_DIR_INPUT,
  553. + .gpio7 = GPIO_DIR_INPUT,
  554. + .gpio8 = GPIO_DIR_INPUT,
  555. + .gpio12 = GPIO_DIR_OUTPUT,
  556. + .gpio13 = GPIO_DIR_INPUT,
  557. + .gpio14 = GPIO_DIR_INPUT,
  558. + .gpio15 = GPIO_DIR_INPUT,
  559. + .gpio17 = GPIO_DIR_INPUT,
  560. + .gpio19 = GPIO_DIR_INPUT,
  561. + .gpio21 = GPIO_DIR_INPUT,
  562. + .gpio22 = GPIO_DIR_INPUT,
  563. + .gpio24 = GPIO_DIR_INPUT,
  564. + .gpio27 = GPIO_DIR_INPUT,
  565. + .gpio28 = GPIO_DIR_INPUT,
  566. + .gpio29 = GPIO_DIR_INPUT,
  567. + .gpio30 = GPIO_DIR_OUTPUT,
  568. +};
  569. +
  570. +static const struct pch_gpio_set1 pch_gpio_set1_level = {
  571. + .gpio12 = GPIO_LEVEL_HIGH,
  572. + .gpio30 = GPIO_LEVEL_HIGH,
  573. +};
  574. +
  575. +static const struct pch_gpio_set1 pch_gpio_set1_reset = {
  576. +};
  577. +
  578. +static const struct pch_gpio_set1 pch_gpio_set1_invert = {
  579. + .gpio0 = GPIO_INVERT,
  580. + .gpio8 = GPIO_INVERT,
  581. + .gpio14 = GPIO_INVERT,
  582. +};
  583. +
  584. +static const struct pch_gpio_set1 pch_gpio_set1_blink = {
  585. +};
  586. +
  587. +static const struct pch_gpio_set2 pch_gpio_set2_mode = {
  588. + .gpio32 = GPIO_MODE_NATIVE,
  589. + .gpio33 = GPIO_MODE_GPIO,
  590. + .gpio34 = GPIO_MODE_GPIO,
  591. + .gpio35 = GPIO_MODE_GPIO,
  592. + .gpio36 = GPIO_MODE_GPIO,
  593. + .gpio37 = GPIO_MODE_GPIO,
  594. + .gpio38 = GPIO_MODE_GPIO,
  595. + .gpio39 = GPIO_MODE_GPIO,
  596. + .gpio40 = GPIO_MODE_NATIVE,
  597. + .gpio41 = GPIO_MODE_NATIVE,
  598. + .gpio42 = GPIO_MODE_NATIVE,
  599. + .gpio43 = GPIO_MODE_NATIVE,
  600. + .gpio44 = GPIO_MODE_NATIVE,
  601. + .gpio45 = GPIO_MODE_NATIVE,
  602. + .gpio46 = GPIO_MODE_GPIO,
  603. + .gpio47 = GPIO_MODE_NATIVE,
  604. + .gpio48 = GPIO_MODE_GPIO,
  605. + .gpio49 = GPIO_MODE_NATIVE,
  606. + .gpio50 = GPIO_MODE_GPIO,
  607. + .gpio51 = GPIO_MODE_GPIO,
  608. + .gpio52 = GPIO_MODE_GPIO,
  609. + .gpio53 = GPIO_MODE_GPIO,
  610. + .gpio54 = GPIO_MODE_GPIO,
  611. + .gpio55 = GPIO_MODE_GPIO,
  612. + .gpio56 = GPIO_MODE_GPIO,
  613. + .gpio57 = GPIO_MODE_GPIO,
  614. + .gpio58 = GPIO_MODE_NATIVE,
  615. + .gpio59 = GPIO_MODE_NATIVE,
  616. + .gpio60 = GPIO_MODE_GPIO,
  617. + .gpio61 = GPIO_MODE_NATIVE,
  618. + .gpio62 = GPIO_MODE_NATIVE,
  619. + .gpio63 = GPIO_MODE_NATIVE,
  620. +};
  621. +
  622. +static const struct pch_gpio_set2 pch_gpio_set2_direction = {
  623. + .gpio33 = GPIO_DIR_INPUT,
  624. + .gpio34 = GPIO_DIR_OUTPUT,
  625. + .gpio35 = GPIO_DIR_INPUT,
  626. + .gpio36 = GPIO_DIR_INPUT,
  627. + .gpio37 = GPIO_DIR_OUTPUT,
  628. + .gpio38 = GPIO_DIR_INPUT,
  629. + .gpio39 = GPIO_DIR_INPUT,
  630. + .gpio46 = GPIO_DIR_OUTPUT,
  631. + .gpio48 = GPIO_DIR_INPUT,
  632. + .gpio50 = GPIO_DIR_OUTPUT,
  633. + .gpio51 = GPIO_DIR_OUTPUT,
  634. + .gpio52 = GPIO_DIR_INPUT,
  635. + .gpio53 = GPIO_DIR_INPUT,
  636. + .gpio54 = GPIO_DIR_INPUT,
  637. + .gpio55 = GPIO_DIR_OUTPUT,
  638. + .gpio56 = GPIO_DIR_INPUT,
  639. + .gpio57 = GPIO_DIR_INPUT,
  640. + .gpio60 = GPIO_DIR_OUTPUT,
  641. +};
  642. +
  643. +static const struct pch_gpio_set2 pch_gpio_set2_level = {
  644. + .gpio34 = GPIO_LEVEL_LOW,
  645. + .gpio37 = GPIO_LEVEL_LOW,
  646. + .gpio46 = GPIO_LEVEL_HIGH,
  647. + .gpio50 = GPIO_LEVEL_HIGH,
  648. + .gpio51 = GPIO_LEVEL_LOW,
  649. + .gpio55 = GPIO_LEVEL_LOW,
  650. + .gpio60 = GPIO_LEVEL_HIGH,
  651. +};
  652. +
  653. +static const struct pch_gpio_set2 pch_gpio_set2_reset = {
  654. +};
  655. +
  656. +static const struct pch_gpio_set3 pch_gpio_set3_mode = {
  657. + .gpio64 = GPIO_MODE_NATIVE,
  658. + .gpio65 = GPIO_MODE_NATIVE,
  659. + .gpio66 = GPIO_MODE_NATIVE,
  660. + .gpio67 = GPIO_MODE_NATIVE,
  661. + .gpio68 = GPIO_MODE_NATIVE,
  662. + .gpio69 = GPIO_MODE_NATIVE,
  663. + .gpio70 = GPIO_MODE_NATIVE,
  664. + .gpio71 = GPIO_MODE_NATIVE,
  665. + .gpio72 = GPIO_MODE_NATIVE,
  666. + .gpio73 = GPIO_MODE_NATIVE,
  667. + .gpio74 = GPIO_MODE_GPIO,
  668. + .gpio75 = GPIO_MODE_NATIVE,
  669. +};
  670. +
  671. +static const struct pch_gpio_set3 pch_gpio_set3_direction = {
  672. + .gpio74 = GPIO_DIR_INPUT,
  673. +};
  674. +
  675. +static const struct pch_gpio_set3 pch_gpio_set3_level = {
  676. +};
  677. +
  678. +static const struct pch_gpio_set3 pch_gpio_set3_reset = {
  679. +};
  680. +
  681. +const struct pch_gpio_map mainboard_gpio_map = {
  682. + .set1 = {
  683. + .mode = &pch_gpio_set1_mode,
  684. + .direction = &pch_gpio_set1_direction,
  685. + .level = &pch_gpio_set1_level,
  686. + .blink = &pch_gpio_set1_blink,
  687. + .invert = &pch_gpio_set1_invert,
  688. + .reset = &pch_gpio_set1_reset,
  689. + },
  690. + .set2 = {
  691. + .mode = &pch_gpio_set2_mode,
  692. + .direction = &pch_gpio_set2_direction,
  693. + .level = &pch_gpio_set2_level,
  694. + .reset = &pch_gpio_set2_reset,
  695. + },
  696. + .set3 = {
  697. + .mode = &pch_gpio_set3_mode,
  698. + .direction = &pch_gpio_set3_direction,
  699. + .level = &pch_gpio_set3_level,
  700. + .reset = &pch_gpio_set3_reset,
  701. + },
  702. +};
  703. diff --git a/src/mainboard/dell/e5520/hda_verb.c b/src/mainboard/dell/e5520/hda_verb.c
  704. new file mode 100644
  705. index 0000000000..e2efee3646
  706. --- /dev/null
  707. +++ b/src/mainboard/dell/e5520/hda_verb.c
  708. @@ -0,0 +1,33 @@
  709. +/* SPDX-License-Identifier: GPL-2.0-only */
  710. +
  711. +#include <device/azalia_device.h>
  712. +
  713. +const u32 cim_verb_data[] = {
  714. + 0x111d76e7, /* Codec Vendor / Device ID: IDT */
  715. + 0x1028049a, /* Subsystem ID */
  716. + 11, /* Number of 4 dword sets */
  717. + AZALIA_SUBVENDOR(0, 0x1028049a),
  718. + AZALIA_PIN_CFG(0, 0x0a, 0x04a11020),
  719. + AZALIA_PIN_CFG(0, 0x0b, 0x0421101f),
  720. + AZALIA_PIN_CFG(0, 0x0c, 0x400000f0),
  721. + AZALIA_PIN_CFG(0, 0x0d, 0x90170110),
  722. + AZALIA_PIN_CFG(0, 0x0e, 0x23011050),
  723. + AZALIA_PIN_CFG(0, 0x0f, 0x23a1102e),
  724. + AZALIA_PIN_CFG(0, 0x10, 0x400000f3),
  725. + AZALIA_PIN_CFG(0, 0x11, 0xd5a301a0),
  726. + AZALIA_PIN_CFG(0, 0x1f, 0x400000f0),
  727. + AZALIA_PIN_CFG(0, 0x20, 0x400000f0),
  728. +
  729. + 0x80862805, /* Codec Vendor / Device ID: Intel */
  730. + 0x80860101, /* Subsystem ID */
  731. + 4, /* Number of 4 dword sets */
  732. + AZALIA_SUBVENDOR(3, 0x80860101),
  733. + AZALIA_PIN_CFG(3, 0x05, 0x18560010),
  734. + AZALIA_PIN_CFG(3, 0x06, 0x18560020),
  735. + AZALIA_PIN_CFG(3, 0x07, 0x18560030),
  736. +
  737. +};
  738. +
  739. +const u32 pc_beep_verbs[0] = {};
  740. +
  741. +AZALIA_ARRAY_SIZES;
  742. diff --git a/src/mainboard/dell/e5520/mainboard.c b/src/mainboard/dell/e5520/mainboard.c
  743. new file mode 100644
  744. index 0000000000..31e49802fc
  745. --- /dev/null
  746. +++ b/src/mainboard/dell/e5520/mainboard.c
  747. @@ -0,0 +1,21 @@
  748. +/* SPDX-License-Identifier: GPL-2.0-only */
  749. +
  750. +#include <device/device.h>
  751. +#include <drivers/intel/gma/int15.h>
  752. +#include <southbridge/intel/bd82x6x/pch.h>
  753. +#include <ec/acpi/ec.h>
  754. +#include <console/console.h>
  755. +#include <pc80/keyboard.h>
  756. +
  757. +static void mainboard_enable(struct device *dev)
  758. +{
  759. +
  760. + /* FIXME: fix these values. */
  761. + install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS,
  762. + GMA_INT15_PANEL_FIT_DEFAULT,
  763. + GMA_INT15_BOOT_DISPLAY_DEFAULT, 0);
  764. +}
  765. +
  766. +struct chip_operations mainboard_ops = {
  767. + .enable_dev = mainboard_enable,
  768. +};
  769. --
  770. 2.43.0