0033-mb-dell-Add-Latitude-E6520-Sandy-Bridge.patch 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774
  1. From 5e8bff81220d4d0f663feed443e4594b76e442bf Mon Sep 17 00:00:00 2001
  2. From: Nicholas Chin <nic.c3.14@gmail.com>
  3. Date: Wed, 31 Jan 2024 22:07:25 -0700
  4. Subject: [PATCH] mb/dell: Add Latitude E6520 (Sandy Bridge)
  5. Change-Id: Ibdd40cc15642b8d404159d5962670ccc4167a9ec
  6. Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com>
  7. ---
  8. src/mainboard/dell/e6520/Kconfig | 38 +++++
  9. src/mainboard/dell/e6520/Kconfig.name | 2 +
  10. src/mainboard/dell/e6520/Makefile.inc | 6 +
  11. src/mainboard/dell/e6520/acpi/ec.asl | 9 +
  12. src/mainboard/dell/e6520/acpi/platform.asl | 12 ++
  13. src/mainboard/dell/e6520/acpi/superio.asl | 3 +
  14. src/mainboard/dell/e6520/acpi_tables.c | 16 ++
  15. src/mainboard/dell/e6520/board_info.txt | 6 +
  16. src/mainboard/dell/e6520/cmos.default | 9 +
  17. src/mainboard/dell/e6520/cmos.layout | 88 ++++++++++
  18. src/mainboard/dell/e6520/data.vbt | Bin 0 -> 6144 bytes
  19. src/mainboard/dell/e6520/devicetree.cb | 66 +++++++
  20. src/mainboard/dell/e6520/dsdt.asl | 30 ++++
  21. src/mainboard/dell/e6520/early_init.c | 32 ++++
  22. src/mainboard/dell/e6520/gma-mainboard.ads | 20 +++
  23. src/mainboard/dell/e6520/gpio.c | 190 +++++++++++++++++++++
  24. src/mainboard/dell/e6520/hda_verb.c | 33 ++++
  25. src/mainboard/dell/e6520/mainboard.c | 21 +++
  26. 18 files changed, 581 insertions(+)
  27. create mode 100644 src/mainboard/dell/e6520/Kconfig
  28. create mode 100644 src/mainboard/dell/e6520/Kconfig.name
  29. create mode 100644 src/mainboard/dell/e6520/Makefile.inc
  30. create mode 100644 src/mainboard/dell/e6520/acpi/ec.asl
  31. create mode 100644 src/mainboard/dell/e6520/acpi/platform.asl
  32. create mode 100644 src/mainboard/dell/e6520/acpi/superio.asl
  33. create mode 100644 src/mainboard/dell/e6520/acpi_tables.c
  34. create mode 100644 src/mainboard/dell/e6520/board_info.txt
  35. create mode 100644 src/mainboard/dell/e6520/cmos.default
  36. create mode 100644 src/mainboard/dell/e6520/cmos.layout
  37. create mode 100644 src/mainboard/dell/e6520/data.vbt
  38. create mode 100644 src/mainboard/dell/e6520/devicetree.cb
  39. create mode 100644 src/mainboard/dell/e6520/dsdt.asl
  40. create mode 100644 src/mainboard/dell/e6520/early_init.c
  41. create mode 100644 src/mainboard/dell/e6520/gma-mainboard.ads
  42. create mode 100644 src/mainboard/dell/e6520/gpio.c
  43. create mode 100644 src/mainboard/dell/e6520/hda_verb.c
  44. create mode 100644 src/mainboard/dell/e6520/mainboard.c
  45. diff --git a/src/mainboard/dell/e6520/Kconfig b/src/mainboard/dell/e6520/Kconfig
  46. new file mode 100644
  47. index 0000000000..db9f25b4ac
  48. --- /dev/null
  49. +++ b/src/mainboard/dell/e6520/Kconfig
  50. @@ -0,0 +1,38 @@
  51. +if BOARD_DELL_LATITUDE_E6520
  52. +
  53. +config BOARD_SPECIFIC_OPTIONS
  54. + def_bool y
  55. + select BOARD_ROMSIZE_KB_10240
  56. + select EC_ACPI
  57. + select EC_DELL_MEC5035
  58. + select GFX_GMA_PANEL_1_ON_LVDS
  59. + select HAVE_ACPI_RESUME
  60. + select HAVE_ACPI_TABLES
  61. + select HAVE_CMOS_DEFAULT
  62. + select HAVE_OPTION_TABLE
  63. + select INTEL_GMA_HAVE_VBT
  64. + select INTEL_INT15
  65. + select MAINBOARD_HAS_LIBGFXINIT
  66. + select MAINBOARD_USES_IFD_GBE_REGION
  67. + select NORTHBRIDGE_INTEL_SANDYBRIDGE
  68. + select SERIRQ_CONTINUOUS_MODE
  69. + select SOUTHBRIDGE_INTEL_BD82X6X
  70. + select SYSTEM_TYPE_LAPTOP
  71. + select USE_NATIVE_RAMINIT
  72. +
  73. +config DRAM_RESET_GATE_GPIO
  74. + default 60
  75. +
  76. +config MAINBOARD_DIR
  77. + default "dell/e6520"
  78. +
  79. +config MAINBOARD_PART_NUMBER
  80. + default "Latitude E6520"
  81. +
  82. +config USBDEBUG_HCD_INDEX
  83. + default 2
  84. +
  85. +config VGA_BIOS_ID
  86. + default "8086,0116"
  87. +
  88. +endif # BOARD_DELL_LATITUDE_E6520
  89. diff --git a/src/mainboard/dell/e6520/Kconfig.name b/src/mainboard/dell/e6520/Kconfig.name
  90. new file mode 100644
  91. index 0000000000..25968e80e5
  92. --- /dev/null
  93. +++ b/src/mainboard/dell/e6520/Kconfig.name
  94. @@ -0,0 +1,2 @@
  95. +config BOARD_DELL_LATITUDE_E6520
  96. + bool "Latitude E6520"
  97. diff --git a/src/mainboard/dell/e6520/Makefile.inc b/src/mainboard/dell/e6520/Makefile.inc
  98. new file mode 100644
  99. index 0000000000..ba64e93eb8
  100. --- /dev/null
  101. +++ b/src/mainboard/dell/e6520/Makefile.inc
  102. @@ -0,0 +1,6 @@
  103. +# SPDX-License-Identifier: GPL-2.0-only
  104. +bootblock-y += early_init.c
  105. +bootblock-y += gpio.c
  106. +romstage-y += early_init.c
  107. +romstage-y += gpio.c
  108. +ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += gma-mainboard.ads
  109. diff --git a/src/mainboard/dell/e6520/acpi/ec.asl b/src/mainboard/dell/e6520/acpi/ec.asl
  110. new file mode 100644
  111. index 0000000000..0d429410a9
  112. --- /dev/null
  113. +++ b/src/mainboard/dell/e6520/acpi/ec.asl
  114. @@ -0,0 +1,9 @@
  115. +/* SPDX-License-Identifier: GPL-2.0-only */
  116. +
  117. +Device(EC)
  118. +{
  119. + Name (_HID, EISAID("PNP0C09"))
  120. + Name (_UID, 0)
  121. + Name (_GPE, 16)
  122. +/* FIXME: EC support */
  123. +}
  124. diff --git a/src/mainboard/dell/e6520/acpi/platform.asl b/src/mainboard/dell/e6520/acpi/platform.asl
  125. new file mode 100644
  126. index 0000000000..2d24bbd9b9
  127. --- /dev/null
  128. +++ b/src/mainboard/dell/e6520/acpi/platform.asl
  129. @@ -0,0 +1,12 @@
  130. +/* SPDX-License-Identifier: GPL-2.0-only */
  131. +
  132. +Method(_WAK, 1)
  133. +{
  134. + /* FIXME: EC support */
  135. + Return(Package() {0, 0})
  136. +}
  137. +
  138. +Method(_PTS,1)
  139. +{
  140. + /* FIXME: EC support */
  141. +}
  142. diff --git a/src/mainboard/dell/e6520/acpi/superio.asl b/src/mainboard/dell/e6520/acpi/superio.asl
  143. new file mode 100644
  144. index 0000000000..55b1db5b11
  145. --- /dev/null
  146. +++ b/src/mainboard/dell/e6520/acpi/superio.asl
  147. @@ -0,0 +1,3 @@
  148. +/* SPDX-License-Identifier: GPL-2.0-only */
  149. +
  150. +#include <drivers/pc80/pc/ps2_controller.asl>
  151. diff --git a/src/mainboard/dell/e6520/acpi_tables.c b/src/mainboard/dell/e6520/acpi_tables.c
  152. new file mode 100644
  153. index 0000000000..e2759659bf
  154. --- /dev/null
  155. +++ b/src/mainboard/dell/e6520/acpi_tables.c
  156. @@ -0,0 +1,16 @@
  157. +/* SPDX-License-Identifier: GPL-2.0-only */
  158. +
  159. +#include <acpi/acpi_gnvs.h>
  160. +#include <soc/nvs.h>
  161. +
  162. +/* FIXME: check this function. */
  163. +void mainboard_fill_gnvs(struct global_nvs *gnvs)
  164. +{
  165. + /* The lid is open by default. */
  166. + gnvs->lids = 1;
  167. +
  168. + /* Temperature at which OS will shutdown */
  169. + gnvs->tcrt = 100;
  170. + /* Temperature at which OS will throttle CPU */
  171. + gnvs->tpsv = 90;
  172. +}
  173. diff --git a/src/mainboard/dell/e6520/board_info.txt b/src/mainboard/dell/e6520/board_info.txt
  174. new file mode 100644
  175. index 0000000000..34d5ad9e0b
  176. --- /dev/null
  177. +++ b/src/mainboard/dell/e6520/board_info.txt
  178. @@ -0,0 +1,6 @@
  179. +Category: laptop
  180. +ROM package: SOIC-8
  181. +ROM protocol: SPI
  182. +ROM socketed: n
  183. +Flashrom support: y
  184. +Release year: 2011
  185. diff --git a/src/mainboard/dell/e6520/cmos.default b/src/mainboard/dell/e6520/cmos.default
  186. new file mode 100644
  187. index 0000000000..279415dfd1
  188. --- /dev/null
  189. +++ b/src/mainboard/dell/e6520/cmos.default
  190. @@ -0,0 +1,9 @@
  191. +boot_option=Fallback
  192. +debug_level=Debug
  193. +power_on_after_fail=Disable
  194. +nmi=Enable
  195. +bluetooth=Enable
  196. +wwan=Enable
  197. +wlan=Enable
  198. +sata_mode=AHCI
  199. +me_state=Disabled
  200. diff --git a/src/mainboard/dell/e6520/cmos.layout b/src/mainboard/dell/e6520/cmos.layout
  201. new file mode 100644
  202. index 0000000000..1aa7e77bce
  203. --- /dev/null
  204. +++ b/src/mainboard/dell/e6520/cmos.layout
  205. @@ -0,0 +1,88 @@
  206. +## SPDX-License-Identifier: GPL-2.0-only
  207. +
  208. +# -----------------------------------------------------------------
  209. +entries
  210. +
  211. +# -----------------------------------------------------------------
  212. +0 120 r 0 reserved_memory
  213. +
  214. +# -----------------------------------------------------------------
  215. +# RTC_BOOT_BYTE (coreboot hardcoded)
  216. +384 1 e 4 boot_option
  217. +388 4 h 0 reboot_counter
  218. +
  219. +# -----------------------------------------------------------------
  220. +# coreboot config options: console
  221. +395 4 e 6 debug_level
  222. +
  223. +#400 8 r 0 reserved for century byte
  224. +
  225. +# coreboot config options: southbridge
  226. +408 1 e 1 nmi
  227. +409 2 e 7 power_on_after_fail
  228. +411 1 e 9 sata_mode
  229. +
  230. +# coreboot config options: EC
  231. +412 1 e 1 bluetooth
  232. +413 1 e 1 wwan
  233. +414 1 e 1 wlan
  234. +
  235. +# coreboot config options: ME
  236. +424 1 e 14 me_state
  237. +425 2 h 0 me_state_prev
  238. +
  239. +# coreboot config options: northbridge
  240. +432 3 e 11 gfx_uma_size
  241. +435 2 e 12 hybrid_graphics_mode
  242. +440 8 h 0 volume
  243. +
  244. +# VBOOT
  245. +448 128 r 0 vbnv
  246. +
  247. +# SandyBridge MRC Scrambler Seed values
  248. +896 32 r 0 mrc_scrambler_seed
  249. +928 32 r 0 mrc_scrambler_seed_s3
  250. +960 16 r 0 mrc_scrambler_seed_chk
  251. +
  252. +# coreboot config options: check sums
  253. +984 16 h 0 check_sum
  254. +
  255. +# -----------------------------------------------------------------
  256. +
  257. +enumerations
  258. +
  259. +#ID value text
  260. +1 0 Disable
  261. +1 1 Enable
  262. +2 0 Enable
  263. +2 1 Disable
  264. +4 0 Fallback
  265. +4 1 Normal
  266. +6 0 Emergency
  267. +6 1 Alert
  268. +6 2 Critical
  269. +6 3 Error
  270. +6 4 Warning
  271. +6 5 Notice
  272. +6 6 Info
  273. +6 7 Debug
  274. +6 8 Spew
  275. +7 0 Disable
  276. +7 1 Enable
  277. +7 2 Keep
  278. +9 0 AHCI
  279. +9 1 Compatible
  280. +11 0 32M
  281. +11 1 64M
  282. +11 2 96M
  283. +11 3 128M
  284. +11 4 160M
  285. +11 5 192M
  286. +11 6 224M
  287. +14 0 Normal
  288. +14 1 Disabled
  289. +
  290. +# -----------------------------------------------------------------
  291. +checksums
  292. +
  293. +checksum 392 447 984
  294. diff --git a/src/mainboard/dell/e6520/data.vbt b/src/mainboard/dell/e6520/data.vbt
  295. new file mode 100644
  296. index 0000000000000000000000000000000000000000..0ef16ee7cb482d2cb91ea80c3f419759355f7ba0
  297. GIT binary patch
  298. literal 6144
  299. zcmeHKZ){Ul6hE);wSB#PZ|mL$bQ^!}HW(eF@H)0JafGfbqsZ9G21{L7Sg{or$5uN)
  300. z_QgG55e!O(8p8*oBhhF`l$n^QF%rN;rzFNqqcPzFCd5QSB1Y7RKt1=pmTk1aFo9^Y
  301. z+x+gi_nvdlJ@?#m&wZWW=G#bH>ze$J`&!oe*Q|E0r!)d89LYY8b$aowZEoG-uiIF+
  302. z#n;$ezm6V<nGnvtc?lrGaf)1_);!W0?uqnojdw-1MQM|dwy`OcF?M@A)KgVV*N2}7
  303. zcXx+--0R}IwzW3-+`f2k?^Av5V7MpRO-q(9rn_R1@Xlz2Ztdy`$Gf6^w6~|bKi!!7
  304. z9;xq*^~bxmZQn^<^<`+2s=BdSM%VW2#FguN<FO^QuDhGIFquBu677q|cSj>jWFixQ
  305. z)4V8f0Gt`D`+>9Fr~tnJ76EJ`5D_F1cn-`0$RgN9unI6kfYkzIiO?W`ON4+34lv1_
  306. zNdPDkq1cf$p8^EW;TS*O$CdzNo#1fbIG_Oi0T(ti0jwyt0le_p_HlvX^CFvr)>$b>
  307. zO-z8^CSU`w=mIK7Q)@9fR;XUzrFu{T=rRyygIZBpU9+Or>+?4R9%~G?Y-|g)Z`Sti
  308. z+do(U*Wb-xR~DzjS<75#=Us4sH^C9U2FCbND7L7u$>M|<;t=AnRfI9C0v8c~AVg7t
  309. zIU<3D2oK^>L;%r(*o=4*u?Mja@dDyi#4zFn;(f#^#3*76aUSs#;tJv#La-6YLRdQB
  310. zdcvfERkvH?k~GJlfM<HR476j(@nfm+47<!Ult@^ua5M3h6A}q=C0ognX9aX4mxq)U
  311. zXOhm=DbLene?C%_16Q)2NRV@Yacz`D;{V>Ve-1?&ZXy}n)YwnVAgNlz#zX;=IX)-F
  312. z)9LL3lbEdY5Co)LsK?vP)7s}G(5xduE!Y!#Wgh<IN3(3ey=-oWU(9aEJ_HzV53Jbq
  313. zj5B5RjzLUt>_T&xi$uUA#0e}X3D~`J(bHz;DgTa@GrpW6=>eZwJeNYYo*GjF=``;(
  314. zuoQ3|V5YoKd$j=KK{`uSX*DeU1oJg=+RT6)rLe6%2>Ci^!5ao=*gS}wFN=nUf`fTF
  315. zM?Gb5ycWjM7I?MJ!2;w|LFg=UoLq-ytr2iemG)AsW}bI4X9PK}T5UKsQi7anu=tD6
  316. zf|={kXkNeQBD>6bQ3taC8XJOJ^e40_ydyfr&a41L^1)jNrK<B_wV}+ZE`p;QK=rDz
  317. zTw`SJ+e`Oc*icaF4INF51Xg*~ts@m)@9ETt(*@N7yy0)Ddce%i9{^k2kbd8=Wns~P
  318. zWBD$~himxDharxF@f!ti^0$~9Zxt{tg`@Dbl_0Ki2Xp_MEw-<z6qgep;XYmR%Dl-F
  319. z%3cBfcN;Avikpz-gmw_6mymu!Unk0YgnUfsk3{*6kQ;=S*p(_fS!JhDyYh^k?6uRk
  320. z?8--W@~NHvY*+ra6SG9iC1s^V)<|@Rqzp*pd5NBslrs`JC(&Oeg~v}CnJ$x+)iP<8
  321. z=`LA0Ad@39{XkZ}kjXbP{YzHtS!70*yy%LcnJ#cz4u%*Wq!^d*AVMZdr&l=#Qgik~
  322. ze2l)cX+!kF9EaFhY;0^Uo_#VNC?7K2Tf=ZR1y5);b!mCGG?<cc#M0rtHKYeKi%BE?
  323. z@Y6|P8fx#li}c`Uv24UGyZaM0To;Ep<_AWZA1t~bFgI)uf}&Eq=L_Cs89=>wnT0Vx
  324. z-jp>o1ffJNommZ4?=TIPlePIw0hgQ706f*tBC`#pg>9&zRHe>J2%RxBTrOc6Adh9E
  325. ziJr`?VQH!N!_GkoKaoq|+3$^Ae0#sUxXlmM1Huq~g<=Ls?ILv+nQcH%PQedGOlH=Q
  326. z77rMcJlH4Mkc#U2(IDv>rsm1aHpsdL_RdT^i_ACcQUMIJcSus}*(?CIiy^#^=t=g1
  327. z+*^Zbh30&^#_bKclSy9pL$<B~pK8m*sLpIdnHM@W$nA7Ea@Z`x27K?aNK<@lCW(2L
  328. zb@kB3H8kKy4W3Hu)NN|kd!DL^o#iR9a{QYV-Wl&r&hmIFX{ezkIV<4zFiVUQ@K>ao
  329. z00DnFy~Uek!JRwhVX!of0)$Sa*X^S~LMQH0<E(UUx}L=|;Kgw(r(4q=nD)T52c|tR
  330. O?SW|zOncy=dEg(6JAK&z
  331. literal 0
  332. HcmV?d00001
  333. diff --git a/src/mainboard/dell/e6520/devicetree.cb b/src/mainboard/dell/e6520/devicetree.cb
  334. new file mode 100644
  335. index 0000000000..cfba8ef4e7
  336. --- /dev/null
  337. +++ b/src/mainboard/dell/e6520/devicetree.cb
  338. @@ -0,0 +1,66 @@
  339. +chip northbridge/intel/sandybridge # FIXME: GPU registers may not always apply.
  340. + register "gfx" = "GMA_STATIC_DISPLAYS(1)"
  341. + register "gpu_cpu_backlight" = "0x00001312"
  342. + register "gpu_dp_b_hotplug" = "4"
  343. + register "gpu_dp_c_hotplug" = "4"
  344. + register "gpu_dp_d_hotplug" = "4"
  345. + register "gpu_panel_port_select" = "0"
  346. + register "gpu_panel_power_backlight_off_delay" = "2300"
  347. + register "gpu_panel_power_backlight_on_delay" = "2300"
  348. + register "gpu_panel_power_cycle_delay" = "6"
  349. + register "gpu_panel_power_down_delay" = "400"
  350. + register "gpu_panel_power_up_delay" = "400"
  351. + register "gpu_pch_backlight" = "0x13121312"
  352. +
  353. + register "spd_addresses" = "{0x50, 0, 0x52, 0}"
  354. +
  355. + device domain 0x0 on
  356. + subsystemid 0x1028 0x0494 inherit
  357. +
  358. + device ref host_bridge on end # Host bridge
  359. + device ref peg10 on end # PEG
  360. + device ref igd on end # iGPU
  361. +
  362. + chip southbridge/intel/bd82x6x # Intel Series 6 Cougar Point PCH
  363. + register "docking_supported" = "1"
  364. + register "gen1_dec" = "0x007c0681"
  365. + register "gen2_dec" = "0x007c0901"
  366. + register "gen3_dec" = "0x003c07e1"
  367. + register "gen4_dec" = "0x001c0901"
  368. + register "gpi0_routing" = "2"
  369. + register "pcie_hotplug_map" = "{ 0, 0, 1, 1, 0, 0, 0, 0 }"
  370. + register "pcie_port_coalesce" = "1"
  371. + register "sata_interface_speed_support" = "0x3"
  372. + register "sata_port_map" = "0x3b"
  373. + register "spi_lvscc" = "0x2005"
  374. + register "spi_uvscc" = "0x2005"
  375. +
  376. + device ref mei1 off end
  377. + device ref mei2 off end
  378. + device ref me_ide_r off end
  379. + device ref me_kt off end
  380. + device ref gbe on end
  381. + device ref ehci2 on end
  382. + device ref hda on end
  383. + device ref pcie_rp1 on end
  384. + device ref pcie_rp2 on end
  385. + device ref pcie_rp3 on end
  386. + device ref pcie_rp4 on end
  387. + device ref pcie_rp5 off end
  388. + device ref pcie_rp6 on end
  389. + device ref pcie_rp7 off end
  390. + device ref pcie_rp8 off end
  391. + device ref ehci1 on end
  392. + device ref pci_bridge off end
  393. + device ref lpc on
  394. + chip ec/dell/mec5035
  395. + device pnp ff.0 on end
  396. + end
  397. + end
  398. + device ref sata1 on end
  399. + device ref smbus on end
  400. + device ref sata2 off end
  401. + device ref thermal off end
  402. + end
  403. + end
  404. +end
  405. diff --git a/src/mainboard/dell/e6520/dsdt.asl b/src/mainboard/dell/e6520/dsdt.asl
  406. new file mode 100644
  407. index 0000000000..7d13c55b08
  408. --- /dev/null
  409. +++ b/src/mainboard/dell/e6520/dsdt.asl
  410. @@ -0,0 +1,30 @@
  411. +#define BRIGHTNESS_UP \_SB.PCI0.GFX0.INCB
  412. +#define BRIGHTNESS_DOWN \_SB.PCI0.GFX0.DECB
  413. +/* SPDX-License-Identifier: GPL-2.0-only */
  414. +
  415. +
  416. +#include <acpi/acpi.h>
  417. +
  418. +DefinitionBlock(
  419. + "dsdt.aml",
  420. + "DSDT",
  421. + ACPI_DSDT_REV_2,
  422. + OEM_ID,
  423. + ACPI_TABLE_CREATOR,
  424. + 0x20141018 /* OEM revision */
  425. +)
  426. +{
  427. + #include <acpi/dsdt_top.asl>
  428. + #include "acpi/platform.asl"
  429. + #include <cpu/intel/common/acpi/cpu.asl>
  430. + #include <southbridge/intel/common/acpi/platform.asl>
  431. + #include <southbridge/intel/bd82x6x/acpi/globalnvs.asl>
  432. + #include <southbridge/intel/common/acpi/sleepstates.asl>
  433. +
  434. + Device (\_SB.PCI0)
  435. + {
  436. + #include <northbridge/intel/sandybridge/acpi/sandybridge.asl>
  437. + #include <drivers/intel/gma/acpi/default_brightness_levels.asl>
  438. + #include <southbridge/intel/bd82x6x/acpi/pch.asl>
  439. + }
  440. +}
  441. diff --git a/src/mainboard/dell/e6520/early_init.c b/src/mainboard/dell/e6520/early_init.c
  442. new file mode 100644
  443. index 0000000000..2a37091df6
  444. --- /dev/null
  445. +++ b/src/mainboard/dell/e6520/early_init.c
  446. @@ -0,0 +1,32 @@
  447. +/* SPDX-License-Identifier: GPL-2.0-only */
  448. +
  449. +
  450. +#include <bootblock_common.h>
  451. +#include <device/pci_ops.h>
  452. +#include <ec/dell/mec5035/mec5035.h>
  453. +#include <southbridge/intel/bd82x6x/pch.h>
  454. +
  455. +const struct southbridge_usb_port mainboard_usb_ports[] = {
  456. + { 1, 1, 0 },
  457. + { 1, 1, 0 },
  458. + { 1, 1, 1 },
  459. + { 1, 1, 1 },
  460. + { 1, 0, 2 },
  461. + { 1, 1, 2 },
  462. + { 1, 0, 3 },
  463. + { 1, 0, 3 },
  464. + { 1, 1, 5 },
  465. + { 1, 1, 5 },
  466. + { 1, 1, 7 },
  467. + { 1, 1, 6 },
  468. + { 1, 0, 6 },
  469. + { 1, 0, 7 },
  470. +};
  471. +
  472. +void bootblock_mainboard_early_init(void)
  473. +{
  474. + pci_write_config16(PCH_LPC_DEV, LPC_EN, CNF1_LPC_EN | MC_LPC_EN
  475. + | KBC_LPC_EN | FDD_LPC_EN | LPT_LPC_EN
  476. + | COMB_LPC_EN | COMA_LPC_EN);
  477. + mec5035_early_init();
  478. +}
  479. diff --git a/src/mainboard/dell/e6520/gma-mainboard.ads b/src/mainboard/dell/e6520/gma-mainboard.ads
  480. new file mode 100644
  481. index 0000000000..2a16f44360
  482. --- /dev/null
  483. +++ b/src/mainboard/dell/e6520/gma-mainboard.ads
  484. @@ -0,0 +1,20 @@
  485. +-- SPDX-License-Identifier: GPL-2.0-or-later
  486. +
  487. +with HW.GFX.GMA;
  488. +with HW.GFX.GMA.Display_Probing;
  489. +
  490. +use HW.GFX.GMA;
  491. +use HW.GFX.GMA.Display_Probing;
  492. +
  493. +private package GMA.Mainboard is
  494. +
  495. + ports : constant Port_List :=
  496. + (
  497. + HDMI1, -- mainboard HDMI
  498. + DP2, -- dock DP
  499. + DP3, -- dock DP
  500. + Analog, -- mainboard VGA
  501. + LVDS,
  502. + others => Disabled);
  503. +
  504. +end GMA.Mainboard;
  505. diff --git a/src/mainboard/dell/e6520/gpio.c b/src/mainboard/dell/e6520/gpio.c
  506. new file mode 100644
  507. index 0000000000..61f01816c4
  508. --- /dev/null
  509. +++ b/src/mainboard/dell/e6520/gpio.c
  510. @@ -0,0 +1,190 @@
  511. +/* SPDX-License-Identifier: GPL-2.0-only */
  512. +
  513. +#include <southbridge/intel/common/gpio.h>
  514. +
  515. +static const struct pch_gpio_set1 pch_gpio_set1_mode = {
  516. + .gpio0 = GPIO_MODE_GPIO,
  517. + .gpio1 = GPIO_MODE_NATIVE,
  518. + .gpio2 = GPIO_MODE_GPIO,
  519. + .gpio3 = GPIO_MODE_NATIVE,
  520. + .gpio4 = GPIO_MODE_GPIO,
  521. + .gpio5 = GPIO_MODE_NATIVE,
  522. + .gpio6 = GPIO_MODE_GPIO,
  523. + .gpio7 = GPIO_MODE_GPIO,
  524. + .gpio8 = GPIO_MODE_GPIO,
  525. + .gpio9 = GPIO_MODE_NATIVE,
  526. + .gpio10 = GPIO_MODE_NATIVE,
  527. + .gpio11 = GPIO_MODE_NATIVE,
  528. + .gpio12 = GPIO_MODE_NATIVE,
  529. + .gpio13 = GPIO_MODE_GPIO,
  530. + .gpio14 = GPIO_MODE_GPIO,
  531. + .gpio15 = GPIO_MODE_GPIO,
  532. + .gpio16 = GPIO_MODE_GPIO,
  533. + .gpio17 = GPIO_MODE_GPIO,
  534. + .gpio18 = GPIO_MODE_NATIVE,
  535. + .gpio19 = GPIO_MODE_GPIO,
  536. + .gpio20 = GPIO_MODE_NATIVE,
  537. + .gpio21 = GPIO_MODE_GPIO,
  538. + .gpio22 = GPIO_MODE_GPIO,
  539. + .gpio23 = GPIO_MODE_NATIVE,
  540. + .gpio24 = GPIO_MODE_GPIO,
  541. + .gpio25 = GPIO_MODE_NATIVE,
  542. + .gpio26 = GPIO_MODE_NATIVE,
  543. + .gpio27 = GPIO_MODE_GPIO,
  544. + .gpio28 = GPIO_MODE_GPIO,
  545. + .gpio29 = GPIO_MODE_GPIO,
  546. + .gpio30 = GPIO_MODE_GPIO,
  547. + .gpio31 = GPIO_MODE_NATIVE,
  548. +};
  549. +
  550. +static const struct pch_gpio_set1 pch_gpio_set1_direction = {
  551. + .gpio0 = GPIO_DIR_INPUT,
  552. + .gpio2 = GPIO_DIR_INPUT,
  553. + .gpio4 = GPIO_DIR_INPUT,
  554. + .gpio6 = GPIO_DIR_INPUT,
  555. + .gpio7 = GPIO_DIR_INPUT,
  556. + .gpio8 = GPIO_DIR_INPUT,
  557. + .gpio13 = GPIO_DIR_INPUT,
  558. + .gpio14 = GPIO_DIR_INPUT,
  559. + .gpio15 = GPIO_DIR_INPUT,
  560. + .gpio16 = GPIO_DIR_INPUT,
  561. + .gpio17 = GPIO_DIR_INPUT,
  562. + .gpio19 = GPIO_DIR_INPUT,
  563. + .gpio21 = GPIO_DIR_INPUT,
  564. + .gpio22 = GPIO_DIR_INPUT,
  565. + .gpio24 = GPIO_DIR_INPUT,
  566. + .gpio27 = GPIO_DIR_INPUT,
  567. + .gpio28 = GPIO_DIR_INPUT,
  568. + .gpio29 = GPIO_DIR_INPUT,
  569. + .gpio30 = GPIO_DIR_OUTPUT,
  570. +};
  571. +
  572. +static const struct pch_gpio_set1 pch_gpio_set1_level = {
  573. + .gpio30 = GPIO_LEVEL_HIGH,
  574. +};
  575. +
  576. +static const struct pch_gpio_set1 pch_gpio_set1_reset = {
  577. +};
  578. +
  579. +static const struct pch_gpio_set1 pch_gpio_set1_invert = {
  580. + .gpio0 = GPIO_INVERT,
  581. + .gpio8 = GPIO_INVERT,
  582. + .gpio14 = GPIO_INVERT,
  583. +};
  584. +
  585. +static const struct pch_gpio_set1 pch_gpio_set1_blink = {
  586. +};
  587. +
  588. +static const struct pch_gpio_set2 pch_gpio_set2_mode = {
  589. + .gpio32 = GPIO_MODE_NATIVE,
  590. + .gpio33 = GPIO_MODE_GPIO,
  591. + .gpio34 = GPIO_MODE_GPIO,
  592. + .gpio35 = GPIO_MODE_GPIO,
  593. + .gpio36 = GPIO_MODE_GPIO,
  594. + .gpio37 = GPIO_MODE_GPIO,
  595. + .gpio38 = GPIO_MODE_GPIO,
  596. + .gpio39 = GPIO_MODE_GPIO,
  597. + .gpio40 = GPIO_MODE_NATIVE,
  598. + .gpio41 = GPIO_MODE_NATIVE,
  599. + .gpio42 = GPIO_MODE_NATIVE,
  600. + .gpio43 = GPIO_MODE_NATIVE,
  601. + .gpio44 = GPIO_MODE_NATIVE,
  602. + .gpio45 = GPIO_MODE_GPIO,
  603. + .gpio46 = GPIO_MODE_NATIVE,
  604. + .gpio47 = GPIO_MODE_NATIVE,
  605. + .gpio48 = GPIO_MODE_GPIO,
  606. + .gpio49 = GPIO_MODE_GPIO,
  607. + .gpio50 = GPIO_MODE_NATIVE,
  608. + .gpio51 = GPIO_MODE_GPIO,
  609. + .gpio52 = GPIO_MODE_GPIO,
  610. + .gpio53 = GPIO_MODE_NATIVE,
  611. + .gpio54 = GPIO_MODE_GPIO,
  612. + .gpio55 = GPIO_MODE_NATIVE,
  613. + .gpio56 = GPIO_MODE_NATIVE,
  614. + .gpio57 = GPIO_MODE_GPIO,
  615. + .gpio58 = GPIO_MODE_NATIVE,
  616. + .gpio59 = GPIO_MODE_NATIVE,
  617. + .gpio60 = GPIO_MODE_GPIO,
  618. + .gpio61 = GPIO_MODE_NATIVE,
  619. + .gpio62 = GPIO_MODE_NATIVE,
  620. + .gpio63 = GPIO_MODE_NATIVE,
  621. +};
  622. +
  623. +static const struct pch_gpio_set2 pch_gpio_set2_direction = {
  624. + .gpio33 = GPIO_DIR_INPUT,
  625. + .gpio34 = GPIO_DIR_OUTPUT,
  626. + .gpio35 = GPIO_DIR_INPUT,
  627. + .gpio36 = GPIO_DIR_INPUT,
  628. + .gpio37 = GPIO_DIR_INPUT,
  629. + .gpio38 = GPIO_DIR_INPUT,
  630. + .gpio39 = GPIO_DIR_INPUT,
  631. + .gpio45 = GPIO_DIR_OUTPUT,
  632. + .gpio48 = GPIO_DIR_INPUT,
  633. + .gpio49 = GPIO_DIR_OUTPUT,
  634. + .gpio51 = GPIO_DIR_INPUT,
  635. + .gpio52 = GPIO_DIR_INPUT,
  636. + .gpio54 = GPIO_DIR_INPUT,
  637. + .gpio57 = GPIO_DIR_INPUT,
  638. + .gpio60 = GPIO_DIR_OUTPUT,
  639. +};
  640. +
  641. +static const struct pch_gpio_set2 pch_gpio_set2_level = {
  642. + .gpio34 = GPIO_LEVEL_HIGH,
  643. + .gpio45 = GPIO_LEVEL_LOW,
  644. + .gpio49 = GPIO_LEVEL_LOW,
  645. + .gpio60 = GPIO_LEVEL_HIGH,
  646. +};
  647. +
  648. +static const struct pch_gpio_set2 pch_gpio_set2_reset = {
  649. +};
  650. +
  651. +static const struct pch_gpio_set3 pch_gpio_set3_mode = {
  652. + .gpio64 = GPIO_MODE_NATIVE,
  653. + .gpio65 = GPIO_MODE_NATIVE,
  654. + .gpio66 = GPIO_MODE_NATIVE,
  655. + .gpio67 = GPIO_MODE_NATIVE,
  656. + .gpio68 = GPIO_MODE_GPIO,
  657. + .gpio69 = GPIO_MODE_GPIO,
  658. + .gpio70 = GPIO_MODE_GPIO,
  659. + .gpio71 = GPIO_MODE_GPIO,
  660. + .gpio72 = GPIO_MODE_NATIVE,
  661. + .gpio73 = GPIO_MODE_NATIVE,
  662. + .gpio74 = GPIO_MODE_NATIVE,
  663. + .gpio75 = GPIO_MODE_NATIVE,
  664. +};
  665. +
  666. +static const struct pch_gpio_set3 pch_gpio_set3_direction = {
  667. + .gpio68 = GPIO_DIR_INPUT,
  668. + .gpio69 = GPIO_DIR_INPUT,
  669. + .gpio70 = GPIO_DIR_INPUT,
  670. + .gpio71 = GPIO_DIR_INPUT,
  671. +};
  672. +
  673. +static const struct pch_gpio_set3 pch_gpio_set3_level = {
  674. +};
  675. +
  676. +static const struct pch_gpio_set3 pch_gpio_set3_reset = {
  677. +};
  678. +
  679. +const struct pch_gpio_map mainboard_gpio_map = {
  680. + .set1 = {
  681. + .mode = &pch_gpio_set1_mode,
  682. + .direction = &pch_gpio_set1_direction,
  683. + .level = &pch_gpio_set1_level,
  684. + .blink = &pch_gpio_set1_blink,
  685. + .invert = &pch_gpio_set1_invert,
  686. + .reset = &pch_gpio_set1_reset,
  687. + },
  688. + .set2 = {
  689. + .mode = &pch_gpio_set2_mode,
  690. + .direction = &pch_gpio_set2_direction,
  691. + .level = &pch_gpio_set2_level,
  692. + .reset = &pch_gpio_set2_reset,
  693. + },
  694. + .set3 = {
  695. + .mode = &pch_gpio_set3_mode,
  696. + .direction = &pch_gpio_set3_direction,
  697. + .level = &pch_gpio_set3_level,
  698. + .reset = &pch_gpio_set3_reset,
  699. + },
  700. +};
  701. diff --git a/src/mainboard/dell/e6520/hda_verb.c b/src/mainboard/dell/e6520/hda_verb.c
  702. new file mode 100644
  703. index 0000000000..d33eb3b4c5
  704. --- /dev/null
  705. +++ b/src/mainboard/dell/e6520/hda_verb.c
  706. @@ -0,0 +1,33 @@
  707. +/* SPDX-License-Identifier: GPL-2.0-only */
  708. +
  709. +#include <device/azalia_device.h>
  710. +
  711. +const u32 cim_verb_data[] = {
  712. + 0x111d76e7, /* Codec Vendor / Device ID: IDT */
  713. + 0x10280494, /* Subsystem ID */
  714. + 11, /* Number of 4 dword sets */
  715. + AZALIA_SUBVENDOR(0, 0x10280494),
  716. + AZALIA_PIN_CFG(0, 0x0a, 0x03a11020),
  717. + AZALIA_PIN_CFG(0, 0x0b, 0x0321101f),
  718. + AZALIA_PIN_CFG(0, 0x0c, 0x400000f0),
  719. + AZALIA_PIN_CFG(0, 0x0d, 0x90170110),
  720. + AZALIA_PIN_CFG(0, 0x0e, 0x23011050),
  721. + AZALIA_PIN_CFG(0, 0x0f, 0x23a1102e),
  722. + AZALIA_PIN_CFG(0, 0x10, 0x400000f3),
  723. + AZALIA_PIN_CFG(0, 0x11, 0x400000f2),
  724. + AZALIA_PIN_CFG(0, 0x1f, 0x400000f0),
  725. + AZALIA_PIN_CFG(0, 0x20, 0x400000f0),
  726. +
  727. + 0x80862805, /* Codec Vendor / Device ID: Intel */
  728. + 0x80860101, /* Subsystem ID */
  729. + 4, /* Number of 4 dword sets */
  730. + AZALIA_SUBVENDOR(3, 0x80860101),
  731. + AZALIA_PIN_CFG(3, 0x05, 0x18560010),
  732. + AZALIA_PIN_CFG(3, 0x06, 0x18560020),
  733. + AZALIA_PIN_CFG(3, 0x07, 0x18560030),
  734. +
  735. +};
  736. +
  737. +const u32 pc_beep_verbs[0] = {};
  738. +
  739. +AZALIA_ARRAY_SIZES;
  740. diff --git a/src/mainboard/dell/e6520/mainboard.c b/src/mainboard/dell/e6520/mainboard.c
  741. new file mode 100644
  742. index 0000000000..31e49802fc
  743. --- /dev/null
  744. +++ b/src/mainboard/dell/e6520/mainboard.c
  745. @@ -0,0 +1,21 @@
  746. +/* SPDX-License-Identifier: GPL-2.0-only */
  747. +
  748. +#include <device/device.h>
  749. +#include <drivers/intel/gma/int15.h>
  750. +#include <southbridge/intel/bd82x6x/pch.h>
  751. +#include <ec/acpi/ec.h>
  752. +#include <console/console.h>
  753. +#include <pc80/keyboard.h>
  754. +
  755. +static void mainboard_enable(struct device *dev)
  756. +{
  757. +
  758. + /* FIXME: fix these values. */
  759. + install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS,
  760. + GMA_INT15_PANEL_FIT_DEFAULT,
  761. + GMA_INT15_BOOT_DISPLAY_DEFAULT, 0);
  762. +}
  763. +
  764. +struct chip_operations mainboard_ops = {
  765. + .enable_dev = mainboard_enable,
  766. +};
  767. --
  768. 2.43.0