0026-mb-dell-Add-Latitude-E6530-Ivy-Bridge.patch 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793
  1. From 973783a989cdcb7b77029e369156c81eefe8cc67 Mon Sep 17 00:00:00 2001
  2. From: Nicholas Chin <nic.c3.14@gmail.com>
  3. Date: Sat, 19 Aug 2023 16:19:10 -0600
  4. Subject: [PATCH 26/30] mb/dell: Add Latitude E6530 (Ivy Bridge)
  5. Mainboard is QALA0/LA-7761P (UMA). The dGPU model was not tested. This
  6. is based on the autoport output with some manual tweaks. The flash is
  7. 8MiB + 4MiB. It can be internally flashed by sending a command to the
  8. EC, which causes the EC to pull the FDO pin low and the firmware to skip
  9. setting up any chipset based write protections. [1] The EC is the SMSC
  10. MEC5055, which seems to be compatible with the existing MEC5035 code.
  11. [1] https://gitlab.com/nic3-14159/dell-flash-unlock
  12. Change-Id: I93c6622fc5da1d0d61a5b2c197ac7227d9525908
  13. Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com>
  14. ---
  15. src/mainboard/dell/e6530/Kconfig | 37 ++++
  16. src/mainboard/dell/e6530/Kconfig.name | 2 +
  17. src/mainboard/dell/e6530/Makefile.inc | 6 +
  18. src/mainboard/dell/e6530/acpi/ec.asl | 9 +
  19. src/mainboard/dell/e6530/acpi/platform.asl | 12 ++
  20. src/mainboard/dell/e6530/acpi/superio.asl | 3 +
  21. src/mainboard/dell/e6530/acpi_tables.c | 16 ++
  22. src/mainboard/dell/e6530/board_info.txt | 6 +
  23. src/mainboard/dell/e6530/cmos.default | 9 +
  24. src/mainboard/dell/e6530/cmos.layout | 88 ++++++++++
  25. src/mainboard/dell/e6530/data.vbt | Bin 0 -> 4280 bytes
  26. src/mainboard/dell/e6530/devicetree.cb | 68 ++++++++
  27. src/mainboard/dell/e6530/dsdt.asl | 30 ++++
  28. src/mainboard/dell/e6530/early_init.c | 38 ++++
  29. src/mainboard/dell/e6530/gma-mainboard.ads | 20 +++
  30. src/mainboard/dell/e6530/gpio.c | 192 +++++++++++++++++++++
  31. src/mainboard/dell/e6530/hda_verb.c | 33 ++++
  32. src/mainboard/dell/e6530/mainboard.c | 21 +++
  33. 18 files changed, 590 insertions(+)
  34. create mode 100644 src/mainboard/dell/e6530/Kconfig
  35. create mode 100644 src/mainboard/dell/e6530/Kconfig.name
  36. create mode 100644 src/mainboard/dell/e6530/Makefile.inc
  37. create mode 100644 src/mainboard/dell/e6530/acpi/ec.asl
  38. create mode 100644 src/mainboard/dell/e6530/acpi/platform.asl
  39. create mode 100644 src/mainboard/dell/e6530/acpi/superio.asl
  40. create mode 100644 src/mainboard/dell/e6530/acpi_tables.c
  41. create mode 100644 src/mainboard/dell/e6530/board_info.txt
  42. create mode 100644 src/mainboard/dell/e6530/cmos.default
  43. create mode 100644 src/mainboard/dell/e6530/cmos.layout
  44. create mode 100644 src/mainboard/dell/e6530/data.vbt
  45. create mode 100644 src/mainboard/dell/e6530/devicetree.cb
  46. create mode 100644 src/mainboard/dell/e6530/dsdt.asl
  47. create mode 100644 src/mainboard/dell/e6530/early_init.c
  48. create mode 100644 src/mainboard/dell/e6530/gma-mainboard.ads
  49. create mode 100644 src/mainboard/dell/e6530/gpio.c
  50. create mode 100644 src/mainboard/dell/e6530/hda_verb.c
  51. create mode 100644 src/mainboard/dell/e6530/mainboard.c
  52. diff --git a/src/mainboard/dell/e6530/Kconfig b/src/mainboard/dell/e6530/Kconfig
  53. new file mode 100644
  54. index 0000000000..582adddbd4
  55. --- /dev/null
  56. +++ b/src/mainboard/dell/e6530/Kconfig
  57. @@ -0,0 +1,37 @@
  58. +if BOARD_DELL_LATITUDE_E6530
  59. +
  60. +config BOARD_SPECIFIC_OPTIONS
  61. + def_bool y
  62. + select BOARD_ROMSIZE_KB_12288
  63. + select EC_ACPI
  64. + select EC_DELL_MEC5035
  65. + select GFX_GMA_PANEL_1_ON_LVDS
  66. + select HAVE_ACPI_RESUME
  67. + select HAVE_ACPI_TABLES
  68. + select HAVE_CMOS_DEFAULT
  69. + select HAVE_OPTION_TABLE
  70. + select INTEL_GMA_HAVE_VBT
  71. + select INTEL_INT15
  72. + select MAINBOARD_HAS_LIBGFXINIT
  73. + select MAINBOARD_USES_IFD_GBE_REGION
  74. + select NORTHBRIDGE_INTEL_SANDYBRIDGE
  75. + select SERIRQ_CONTINUOUS_MODE
  76. + select SOUTHBRIDGE_INTEL_C216
  77. + select SYSTEM_TYPE_LAPTOP
  78. + select USE_NATIVE_RAMINIT
  79. +
  80. +config MAINBOARD_DIR
  81. + default "dell/e6530"
  82. +
  83. +config MAINBOARD_PART_NUMBER
  84. + default "Latitude E6530"
  85. +
  86. +config VGA_BIOS_ID
  87. + default "8086,0166"
  88. +
  89. +config DRAM_RESET_GATE_GPIO
  90. + default 60
  91. +
  92. +config USBDEBUG_HCD_INDEX
  93. + default 2
  94. +endif
  95. diff --git a/src/mainboard/dell/e6530/Kconfig.name b/src/mainboard/dell/e6530/Kconfig.name
  96. new file mode 100644
  97. index 0000000000..01ed76d107
  98. --- /dev/null
  99. +++ b/src/mainboard/dell/e6530/Kconfig.name
  100. @@ -0,0 +1,2 @@
  101. +config BOARD_DELL_LATITUDE_E6530
  102. + bool "Latitude E6530"
  103. diff --git a/src/mainboard/dell/e6530/Makefile.inc b/src/mainboard/dell/e6530/Makefile.inc
  104. new file mode 100644
  105. index 0000000000..ba64e93eb8
  106. --- /dev/null
  107. +++ b/src/mainboard/dell/e6530/Makefile.inc
  108. @@ -0,0 +1,6 @@
  109. +# SPDX-License-Identifier: GPL-2.0-only
  110. +bootblock-y += early_init.c
  111. +bootblock-y += gpio.c
  112. +romstage-y += early_init.c
  113. +romstage-y += gpio.c
  114. +ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += gma-mainboard.ads
  115. diff --git a/src/mainboard/dell/e6530/acpi/ec.asl b/src/mainboard/dell/e6530/acpi/ec.asl
  116. new file mode 100644
  117. index 0000000000..0d429410a9
  118. --- /dev/null
  119. +++ b/src/mainboard/dell/e6530/acpi/ec.asl
  120. @@ -0,0 +1,9 @@
  121. +/* SPDX-License-Identifier: GPL-2.0-only */
  122. +
  123. +Device(EC)
  124. +{
  125. + Name (_HID, EISAID("PNP0C09"))
  126. + Name (_UID, 0)
  127. + Name (_GPE, 16)
  128. +/* FIXME: EC support */
  129. +}
  130. diff --git a/src/mainboard/dell/e6530/acpi/platform.asl b/src/mainboard/dell/e6530/acpi/platform.asl
  131. new file mode 100644
  132. index 0000000000..2d24bbd9b9
  133. --- /dev/null
  134. +++ b/src/mainboard/dell/e6530/acpi/platform.asl
  135. @@ -0,0 +1,12 @@
  136. +/* SPDX-License-Identifier: GPL-2.0-only */
  137. +
  138. +Method(_WAK, 1)
  139. +{
  140. + /* FIXME: EC support */
  141. + Return(Package() {0, 0})
  142. +}
  143. +
  144. +Method(_PTS,1)
  145. +{
  146. + /* FIXME: EC support */
  147. +}
  148. diff --git a/src/mainboard/dell/e6530/acpi/superio.asl b/src/mainboard/dell/e6530/acpi/superio.asl
  149. new file mode 100644
  150. index 0000000000..55b1db5b11
  151. --- /dev/null
  152. +++ b/src/mainboard/dell/e6530/acpi/superio.asl
  153. @@ -0,0 +1,3 @@
  154. +/* SPDX-License-Identifier: GPL-2.0-only */
  155. +
  156. +#include <drivers/pc80/pc/ps2_controller.asl>
  157. diff --git a/src/mainboard/dell/e6530/acpi_tables.c b/src/mainboard/dell/e6530/acpi_tables.c
  158. new file mode 100644
  159. index 0000000000..e2759659bf
  160. --- /dev/null
  161. +++ b/src/mainboard/dell/e6530/acpi_tables.c
  162. @@ -0,0 +1,16 @@
  163. +/* SPDX-License-Identifier: GPL-2.0-only */
  164. +
  165. +#include <acpi/acpi_gnvs.h>
  166. +#include <soc/nvs.h>
  167. +
  168. +/* FIXME: check this function. */
  169. +void mainboard_fill_gnvs(struct global_nvs *gnvs)
  170. +{
  171. + /* The lid is open by default. */
  172. + gnvs->lids = 1;
  173. +
  174. + /* Temperature at which OS will shutdown */
  175. + gnvs->tcrt = 100;
  176. + /* Temperature at which OS will throttle CPU */
  177. + gnvs->tpsv = 90;
  178. +}
  179. diff --git a/src/mainboard/dell/e6530/board_info.txt b/src/mainboard/dell/e6530/board_info.txt
  180. new file mode 100644
  181. index 0000000000..4601a4aaba
  182. --- /dev/null
  183. +++ b/src/mainboard/dell/e6530/board_info.txt
  184. @@ -0,0 +1,6 @@
  185. +Category: laptop
  186. +ROM package: SOIC-8
  187. +ROM protocol: SPI
  188. +ROM socketed: n
  189. +Flashrom support: y
  190. +Release year: 2012
  191. diff --git a/src/mainboard/dell/e6530/cmos.default b/src/mainboard/dell/e6530/cmos.default
  192. new file mode 100644
  193. index 0000000000..279415dfd1
  194. --- /dev/null
  195. +++ b/src/mainboard/dell/e6530/cmos.default
  196. @@ -0,0 +1,9 @@
  197. +boot_option=Fallback
  198. +debug_level=Debug
  199. +power_on_after_fail=Disable
  200. +nmi=Enable
  201. +bluetooth=Enable
  202. +wwan=Enable
  203. +wlan=Enable
  204. +sata_mode=AHCI
  205. +me_state=Disabled
  206. diff --git a/src/mainboard/dell/e6530/cmos.layout b/src/mainboard/dell/e6530/cmos.layout
  207. new file mode 100644
  208. index 0000000000..e85ea4c661
  209. --- /dev/null
  210. +++ b/src/mainboard/dell/e6530/cmos.layout
  211. @@ -0,0 +1,88 @@
  212. +## SPDX-License-Identifier: GPL-2.0-only
  213. +
  214. +# -----------------------------------------------------------------
  215. +entries
  216. +
  217. +# -----------------------------------------------------------------
  218. +0 120 r 0 reserved_memory
  219. +
  220. +# -----------------------------------------------------------------
  221. +# RTC_BOOT_BYTE (coreboot hardcoded)
  222. +384 1 e 4 boot_option
  223. +388 4 h 0 reboot_counter
  224. +
  225. +# -----------------------------------------------------------------
  226. +# coreboot config options: console
  227. +395 4 e 6 debug_level
  228. +
  229. +#400 8 r 0 reserved for century byte
  230. +
  231. +# coreboot config options: southbridge
  232. +408 1 e 1 nmi
  233. +409 2 e 7 power_on_after_fail
  234. +411 1 e 9 sata_mode
  235. +
  236. +# coreboot config options: EC
  237. +412 1 e 1 bluetooth
  238. +413 1 e 1 wwan
  239. +415 1 e 1 wlan
  240. +
  241. +# coreboot config options: ME
  242. +424 1 e 14 me_state
  243. +425 2 h 0 me_state_prev
  244. +
  245. +# coreboot config options: northbridge
  246. +432 3 e 11 gfx_uma_size
  247. +435 2 e 12 hybrid_graphics_mode
  248. +440 8 h 0 volume
  249. +
  250. +# VBOOT
  251. +448 128 r 0 vbnv
  252. +
  253. +# SandyBridge MRC Scrambler Seed values
  254. +896 32 r 0 mrc_scrambler_seed
  255. +928 32 r 0 mrc_scrambler_seed_s3
  256. +960 16 r 0 mrc_scrambler_seed_chk
  257. +
  258. +# coreboot config options: check sums
  259. +984 16 h 0 check_sum
  260. +
  261. +# -----------------------------------------------------------------
  262. +
  263. +enumerations
  264. +
  265. +#ID value text
  266. +1 0 Disable
  267. +1 1 Enable
  268. +2 0 Enable
  269. +2 1 Disable
  270. +4 0 Fallback
  271. +4 1 Normal
  272. +6 0 Emergency
  273. +6 1 Alert
  274. +6 2 Critical
  275. +6 3 Error
  276. +6 4 Warning
  277. +6 5 Notice
  278. +6 6 Info
  279. +6 7 Debug
  280. +6 8 Spew
  281. +7 0 Disable
  282. +7 1 Enable
  283. +7 2 Keep
  284. +9 0 AHCI
  285. +9 1 Compatible
  286. +11 0 32M
  287. +11 1 64M
  288. +11 2 96M
  289. +11 3 128M
  290. +11 4 160M
  291. +11 5 192M
  292. +11 6 224M
  293. +14 0 Normal
  294. +14 1 Disabled
  295. +
  296. +# -----------------------------------------------------------------
  297. +checksums
  298. +
  299. +checksum 392 447 984
  300. diff --git a/src/mainboard/dell/e6530/data.vbt b/src/mainboard/dell/e6530/data.vbt
  301. new file mode 100644
  302. index 0000000000000000000000000000000000000000..af64a913d521fe240ce30e114e90fe75d3841bbc
  303. GIT binary patch
  304. literal 4280
  305. zcmdT{U2GiH75-*te`aTAcGqJQY$rA+e`ZbWcy_TDH@NC}cbl$*NjAn^RtPm->J7GV
  306. zY_m3jN`RN*h9FvG3Do9+qP$c^s1;PLB3@br9>Ag%La5?TLP`-2DDaR65U2_)=g!QU
  307. zIJ+cPr4+cc-@WIad+wQY&YW{+c1J!nPPgn&^^N3Hy*D37jg0=7CSl@*=mXr>x75gi
  308. zTMlK0$A=H4Mh~QKqCa92jz_;d3rtFqp(o-4gCnzxrJ2}Rw@^!haWp<ahv&+aDb5_3
  309. zE0-vq=pkms7Ves!pD#^PA#PF^_wjBTO=oC(ayR{asyKURiBdh3?x76Ll#Z5WXklvl
  310. z@M5XFK#OxUXqrdzedca+l4WK~_tG8Hv&HgsX`$Za3pnYy`CpW$@0?nsSh|}MrfK#j
  311. z%y^t^lPNt{p5INwGcz<MWEN<wv`{J^Eluv$Rb2&6%ZgV5Bp(6~Lz2Eoz~@C!!B)bs
  312. z1x-OrK~}*8L07Po(5+xZL6I<}phTEf5QRsVJYHa{f^AXPFaoSsnJ0feXUdB=CJ>Fv
  313. zr&_=Q6YubieL}zoiJ0a+c+(bGwFN5g1pz;^rGP1sM+lHB@UAPM2&F=RB&yv@$caXF
  314. ze~Io&3CQe=cMHr!e{yiokd?~p&F&k`jg99Ex7}WO=$8*Kx8wXv4eSa_CJqKVkyRr&
  315. zCdcqs*@M5!gD84e@fW{|5B#mDGTH;JFw`h^stQcTjf@V3pNe8&f$=NG?-+klRGea*
  316. zX1vOHi}4@EM~qJyfuM>e#%9J&Mjzt`j5OnB#;uGZ<1WTMj3vgSj3*esXZY{I`KqUa
  317. zfbB~~a>piTMAVDNyHR<{<v-=}gXhE(15|emxueb8Kv%5>0{F7}8pool{7_h6u?7yg
  318. zlyNm>-Eq_&WjW{0$9ZHq6x?~W8l2#1g0CyrtN#R-nbWG(?>iNG1zRiZgj;Lm_%rVe
  319. zwZ6i{g#sR5xudpbj~5H9TNIQ3gMikIG@l(Z4IR@^2|Vu|LZteLF5@$KH5`Pr&3_vn
  320. z^!Fn27&z6hSPR+*;D*&lm-)OE=ZgjK*(X&XdBq7RDUd7>|Lou?UMNg6lVCB;TPz{Z
  321. zN4-~p*Rr=uq8OYdlAy38{}dt5%2}aUax{}zWzDRgmsn2|!)=Bp)U35;Ld3H+Ye=*_
  322. z4S&0{5*TVI!OU-SWz$XUwrrnb%9?NHau^uhn>&;%&X#8O7mt)SIJr8D$u?NS=rUW6
  323. zCmnxV&FgUDAWX}gZ+1AH&-C4Q=3sl5RX9=OWPfCtcRZi4tkX44YYfRH*@?H7T=Kz=
  324. zG*i-wU2jbJMK%ChTMTXZFJEm~k;KCj*D60g=j!2ns8Q`g%jSRK^?=IwL^|I5-K2zH
  325. z8*A0-mL%Q`R#xatM^u^E=IrX+2&bc;3rv!NipS^G*6zlIRAV(JJDU($OBHuptd&1(
  326. zoNu>t*Q}|siS8#MYavR6j7&(~AEL#OaV(^+gy>YrSPiLfgy{2-p=xT2Mtd}4R8#XB
  327. z-LDysYw8J&{-GJKYwEiif07x7u5QsOr5oeA`ZJxDb>p|XdQzvCb>nSaeP1UfY_x~f
  328. z9bwuRHf|5Ahr{&iu<>+QeI`t=g^e>|^=z1;5o23K?TP5uo%2>aXQWCKr#dH;Qr0*j
  329. z3LecKKarw5`Xblzd$&H4oP%y&l3egyUc<=<Azs)*u}X^*n$F~s2O<-paSF?q*HB+n
  330. zqBfj5;J|x@hM`M(QD20jrkwi8`y3l;8qO;#l8A#CMI8Kg9E{ERsT>TGXaGC^5Cz)J
  331. z4?eb?Kub*nWYdmhV-4?j<o}k#pt-{wK;b3U(B^+`s7-`HYOZOxv<+RG^LulAxKL|9
  332. z3NH#9{Lg*7U1&gy<zHSG$;LMHby+V=ENlGFVLKjt%kkph7kP1M8|vebT=K5)*E>JW
  333. zjd{Tu*o*CE*QO)}{_J>haU5zn+1QJ^eBg|d5n5-%|DwS@1+<Mtvat=iZ3BF??pZXh
  334. zth4PnnWL*s%}k43fbe34>yaZ_2@Kj<UGt)`2G5>K>)nIBR-xB@+1PQ2*c$lV?Z13o
  335. zbX%CHpm`!1Z4$d28~9k{rfu-0w@xg6{q!u2{)Dm_))4RK$?#7P*t7V+g_9d<V!MD`
  336. zaj`t-?uy6zsjzp<-IdM6g(XhQX2iF<+p?Kmw6?a+f^VMex*PuetNfqf+4_FpD%8TW
  337. eZvUbDHC^NLu5~gtzg|!EqSkX2ep9pg!tpEeo1jDh
  338. literal 0
  339. HcmV?d00001
  340. diff --git a/src/mainboard/dell/e6530/devicetree.cb b/src/mainboard/dell/e6530/devicetree.cb
  341. new file mode 100644
  342. index 0000000000..96eed178c5
  343. --- /dev/null
  344. +++ b/src/mainboard/dell/e6530/devicetree.cb
  345. @@ -0,0 +1,68 @@
  346. +chip northbridge/intel/sandybridge # FIXME: GPU registers may not always apply.
  347. + register "gfx" = "GMA_STATIC_DISPLAYS(1)"
  348. + register "gpu_cpu_backlight" = "0x00000251"
  349. + register "gpu_dp_b_hotplug" = "4"
  350. + register "gpu_dp_c_hotplug" = "4"
  351. + register "gpu_dp_d_hotplug" = "4"
  352. + register "gpu_panel_port_select" = "0"
  353. + register "gpu_panel_power_backlight_off_delay" = "2300"
  354. + register "gpu_panel_power_backlight_on_delay" = "2300"
  355. + register "gpu_panel_power_cycle_delay" = "6"
  356. + register "gpu_panel_power_down_delay" = "400"
  357. + register "gpu_panel_power_up_delay" = "400"
  358. + register "gpu_pch_backlight" = "0x13121312"
  359. +
  360. + device domain 0x0 on
  361. + subsystemid 0x1028 0x0535 inherit
  362. +
  363. + device ref host_bridge on end # Host bridge
  364. + device ref peg10 off end # PEG
  365. + device ref igd on end # iGPU
  366. +
  367. + chip southbridge/intel/bd82x6x # Intel Series 6 Cougar Point PCH
  368. + register "docking_supported" = "1"
  369. + register "gen1_dec" = "0x007c0681"
  370. + register "gen2_dec" = "0x005c0921"
  371. + register "gen3_dec" = "0x003c07e1"
  372. + register "gen4_dec" = "0x007c0901"
  373. + register "gpi0_routing" = "2"
  374. + register "pcie_hotplug_map" = "{ 0, 0, 1, 1, 0, 0, 0, 0 }"
  375. + register "pcie_port_coalesce" = "1"
  376. + register "sata_interface_speed_support" = "0x3"
  377. + register "sata_port_map" = "0x33"
  378. + register "spi_lvscc" = "0x2005"
  379. + register "spi_uvscc" = "0x2005"
  380. + register "superspeed_capable_ports" = "0x0000000f"
  381. + register "xhci_overcurrent_mapping" = "0x00000c03"
  382. + register "xhci_switchable_ports" = "0x0000000f"
  383. +
  384. + device ref xhci on end # USB 3.0 Controller
  385. + device ref mei1 off end # Management Engine Interface 1
  386. + device ref mei2 off end # Management Engine Interface 2
  387. + device ref me_ide_r off end # Management Engine IDE-R
  388. + device ref me_kt on end # Management Engine KT
  389. + device ref gbe on end # Intel Gigabit Ethernet
  390. + device ref ehci2 on end # USB2 EHCI #2
  391. + device ref hda on end # High Definition Audio
  392. + device ref pcie_rp1 on end # PCIe Port #1
  393. + device ref pcie_rp2 on end # PCIe Port #2
  394. + device ref pcie_rp3 on end # PCIe Port #3
  395. + device ref pcie_rp4 on end # PCIe Port #4
  396. + device ref pcie_rp5 off end # PCIe Port #5
  397. + device ref pcie_rp6 on end # PCIe Port #6
  398. + device ref pcie_rp7 off end # PCIe Port #7
  399. + device ref pcie_rp8 off end # PCIe Port #8
  400. + device ref ehci1 on end # USB2 EHCI #1
  401. + device ref pci_bridge off end # PCI bridge
  402. + device ref lpc on # LPC bridge
  403. + chip ec/dell/mec5035
  404. + device pnp ff.0 on end
  405. + end
  406. + end
  407. + device ref sata1 on end # SATA Controller 1
  408. + device ref smbus on end # SMBus
  409. + device ref sata2 off end # SATA Controller 2
  410. + device ref thermal off end # Thermal
  411. + end
  412. + end
  413. +end
  414. diff --git a/src/mainboard/dell/e6530/dsdt.asl b/src/mainboard/dell/e6530/dsdt.asl
  415. new file mode 100644
  416. index 0000000000..7d13c55b08
  417. --- /dev/null
  418. +++ b/src/mainboard/dell/e6530/dsdt.asl
  419. @@ -0,0 +1,30 @@
  420. +#define BRIGHTNESS_UP \_SB.PCI0.GFX0.INCB
  421. +#define BRIGHTNESS_DOWN \_SB.PCI0.GFX0.DECB
  422. +/* SPDX-License-Identifier: GPL-2.0-only */
  423. +
  424. +
  425. +#include <acpi/acpi.h>
  426. +
  427. +DefinitionBlock(
  428. + "dsdt.aml",
  429. + "DSDT",
  430. + ACPI_DSDT_REV_2,
  431. + OEM_ID,
  432. + ACPI_TABLE_CREATOR,
  433. + 0x20141018 /* OEM revision */
  434. +)
  435. +{
  436. + #include <acpi/dsdt_top.asl>
  437. + #include "acpi/platform.asl"
  438. + #include <cpu/intel/common/acpi/cpu.asl>
  439. + #include <southbridge/intel/common/acpi/platform.asl>
  440. + #include <southbridge/intel/bd82x6x/acpi/globalnvs.asl>
  441. + #include <southbridge/intel/common/acpi/sleepstates.asl>
  442. +
  443. + Device (\_SB.PCI0)
  444. + {
  445. + #include <northbridge/intel/sandybridge/acpi/sandybridge.asl>
  446. + #include <drivers/intel/gma/acpi/default_brightness_levels.asl>
  447. + #include <southbridge/intel/bd82x6x/acpi/pch.asl>
  448. + }
  449. +}
  450. diff --git a/src/mainboard/dell/e6530/early_init.c b/src/mainboard/dell/e6530/early_init.c
  451. new file mode 100644
  452. index 0000000000..d57f48e7f1
  453. --- /dev/null
  454. +++ b/src/mainboard/dell/e6530/early_init.c
  455. @@ -0,0 +1,38 @@
  456. +/* SPDX-License-Identifier: GPL-2.0-only */
  457. +
  458. +
  459. +#include <bootblock_common.h>
  460. +#include <device/pci_ops.h>
  461. +#include <ec/dell/mec5035/mec5035.h>
  462. +#include <northbridge/intel/sandybridge/raminit_native.h>
  463. +#include <southbridge/intel/bd82x6x/pch.h>
  464. +
  465. +const struct southbridge_usb_port mainboard_usb_ports[] = {
  466. + { 1, 1, 0 },
  467. + { 1, 1, 0 },
  468. + { 1, 1, 1 },
  469. + { 1, 1, 1 },
  470. + { 1, 1, 2 },
  471. + { 1, 1, 2 },
  472. + { 1, 0, 3 },
  473. + { 1, 1, 3 },
  474. + { 1, 1, 4 },
  475. + { 1, 1, 4 },
  476. + { 1, 1, 5 },
  477. + { 1, 1, 5 },
  478. + { 1, 2, 6 },
  479. + { 1, 2, 6 },
  480. +};
  481. +
  482. +void bootblock_mainboard_early_init(void)
  483. +{
  484. + pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x82, 0x1c0f);
  485. + pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x80, 0x0000);
  486. + mec5035_early_init();
  487. +}
  488. +
  489. +void mainboard_get_spd(spd_raw_data *spd, bool id_only)
  490. +{
  491. + read_spd(&spd[0], 0x50, id_only);
  492. + read_spd(&spd[2], 0x52, id_only);
  493. +}
  494. diff --git a/src/mainboard/dell/e6530/gma-mainboard.ads b/src/mainboard/dell/e6530/gma-mainboard.ads
  495. new file mode 100644
  496. index 0000000000..1310830c8e
  497. --- /dev/null
  498. +++ b/src/mainboard/dell/e6530/gma-mainboard.ads
  499. @@ -0,0 +1,20 @@
  500. +-- SPDX-License-Identifier: GPL-2.0-or-later
  501. +
  502. +with HW.GFX.GMA;
  503. +with HW.GFX.GMA.Display_Probing;
  504. +
  505. +use HW.GFX.GMA;
  506. +use HW.GFX.GMA.Display_Probing;
  507. +
  508. +private package GMA.Mainboard is
  509. +
  510. + ports : constant Port_List :=
  511. + (
  512. + HDMI1, -- mainboard HDMI
  513. + DP2, -- dock DP
  514. + DP3, -- dock DP
  515. + Analog, --mainboard VGA
  516. + LVDS,
  517. + others => Disabled);
  518. +
  519. +end GMA.Mainboard;
  520. diff --git a/src/mainboard/dell/e6530/gpio.c b/src/mainboard/dell/e6530/gpio.c
  521. new file mode 100644
  522. index 0000000000..777570765a
  523. --- /dev/null
  524. +++ b/src/mainboard/dell/e6530/gpio.c
  525. @@ -0,0 +1,192 @@
  526. +/* SPDX-License-Identifier: GPL-2.0-only */
  527. +
  528. +#include <southbridge/intel/common/gpio.h>
  529. +
  530. +static const struct pch_gpio_set1 pch_gpio_set1_mode = {
  531. + .gpio0 = GPIO_MODE_GPIO,
  532. + .gpio1 = GPIO_MODE_GPIO,
  533. + .gpio2 = GPIO_MODE_GPIO,
  534. + .gpio3 = GPIO_MODE_GPIO,
  535. + .gpio4 = GPIO_MODE_GPIO,
  536. + .gpio5 = GPIO_MODE_NATIVE,
  537. + .gpio6 = GPIO_MODE_GPIO,
  538. + .gpio7 = GPIO_MODE_GPIO,
  539. + .gpio8 = GPIO_MODE_GPIO,
  540. + .gpio9 = GPIO_MODE_NATIVE,
  541. + .gpio10 = GPIO_MODE_NATIVE,
  542. + .gpio11 = GPIO_MODE_NATIVE,
  543. + .gpio12 = GPIO_MODE_NATIVE,
  544. + .gpio13 = GPIO_MODE_GPIO,
  545. + .gpio14 = GPIO_MODE_GPIO,
  546. + .gpio15 = GPIO_MODE_GPIO,
  547. + .gpio16 = GPIO_MODE_GPIO,
  548. + .gpio17 = GPIO_MODE_GPIO,
  549. + .gpio18 = GPIO_MODE_NATIVE,
  550. + .gpio19 = GPIO_MODE_GPIO,
  551. + .gpio20 = GPIO_MODE_NATIVE,
  552. + .gpio21 = GPIO_MODE_GPIO,
  553. + .gpio22 = GPIO_MODE_GPIO,
  554. + .gpio23 = GPIO_MODE_NATIVE,
  555. + .gpio24 = GPIO_MODE_GPIO,
  556. + .gpio25 = GPIO_MODE_NATIVE,
  557. + .gpio26 = GPIO_MODE_NATIVE,
  558. + .gpio27 = GPIO_MODE_GPIO,
  559. + .gpio28 = GPIO_MODE_GPIO,
  560. + .gpio29 = GPIO_MODE_GPIO,
  561. + .gpio30 = GPIO_MODE_NATIVE,
  562. + .gpio31 = GPIO_MODE_NATIVE,
  563. +};
  564. +
  565. +static const struct pch_gpio_set1 pch_gpio_set1_direction = {
  566. + .gpio0 = GPIO_DIR_INPUT,
  567. + .gpio1 = GPIO_DIR_INPUT,
  568. + .gpio2 = GPIO_DIR_INPUT,
  569. + .gpio3 = GPIO_DIR_INPUT,
  570. + .gpio4 = GPIO_DIR_INPUT,
  571. + .gpio6 = GPIO_DIR_INPUT,
  572. + .gpio7 = GPIO_DIR_INPUT,
  573. + .gpio8 = GPIO_DIR_INPUT,
  574. + .gpio13 = GPIO_DIR_INPUT,
  575. + .gpio14 = GPIO_DIR_INPUT,
  576. + .gpio15 = GPIO_DIR_INPUT,
  577. + .gpio16 = GPIO_DIR_INPUT,
  578. + .gpio17 = GPIO_DIR_INPUT,
  579. + .gpio19 = GPIO_DIR_INPUT,
  580. + .gpio21 = GPIO_DIR_INPUT,
  581. + .gpio22 = GPIO_DIR_INPUT,
  582. + .gpio24 = GPIO_DIR_INPUT,
  583. + .gpio27 = GPIO_DIR_INPUT,
  584. + .gpio28 = GPIO_DIR_OUTPUT,
  585. + .gpio29 = GPIO_DIR_INPUT,
  586. +};
  587. +
  588. +static const struct pch_gpio_set1 pch_gpio_set1_level = {
  589. + .gpio28 = GPIO_LEVEL_LOW,
  590. +};
  591. +
  592. +static const struct pch_gpio_set1 pch_gpio_set1_reset = {
  593. + .gpio30 = GPIO_RESET_RSMRST,
  594. +};
  595. +
  596. +static const struct pch_gpio_set1 pch_gpio_set1_invert = {
  597. + .gpio0 = GPIO_INVERT,
  598. + .gpio8 = GPIO_INVERT,
  599. + .gpio13 = GPIO_INVERT,
  600. + .gpio14 = GPIO_INVERT,
  601. +};
  602. +
  603. +static const struct pch_gpio_set1 pch_gpio_set1_blink = {
  604. +};
  605. +
  606. +static const struct pch_gpio_set2 pch_gpio_set2_mode = {
  607. + .gpio32 = GPIO_MODE_NATIVE,
  608. + .gpio33 = GPIO_MODE_GPIO,
  609. + .gpio34 = GPIO_MODE_GPIO,
  610. + .gpio35 = GPIO_MODE_GPIO,
  611. + .gpio36 = GPIO_MODE_GPIO,
  612. + .gpio37 = GPIO_MODE_GPIO,
  613. + .gpio38 = GPIO_MODE_GPIO,
  614. + .gpio39 = GPIO_MODE_GPIO,
  615. + .gpio40 = GPIO_MODE_NATIVE,
  616. + .gpio41 = GPIO_MODE_NATIVE,
  617. + .gpio42 = GPIO_MODE_NATIVE,
  618. + .gpio43 = GPIO_MODE_NATIVE,
  619. + .gpio44 = GPIO_MODE_NATIVE,
  620. + .gpio45 = GPIO_MODE_GPIO,
  621. + .gpio46 = GPIO_MODE_NATIVE,
  622. + .gpio47 = GPIO_MODE_NATIVE,
  623. + .gpio48 = GPIO_MODE_GPIO,
  624. + .gpio49 = GPIO_MODE_GPIO,
  625. + .gpio50 = GPIO_MODE_NATIVE,
  626. + .gpio51 = GPIO_MODE_GPIO,
  627. + .gpio52 = GPIO_MODE_GPIO,
  628. + .gpio53 = GPIO_MODE_NATIVE,
  629. + .gpio54 = GPIO_MODE_GPIO,
  630. + .gpio55 = GPIO_MODE_NATIVE,
  631. + .gpio56 = GPIO_MODE_NATIVE,
  632. + .gpio57 = GPIO_MODE_GPIO,
  633. + .gpio58 = GPIO_MODE_NATIVE,
  634. + .gpio59 = GPIO_MODE_NATIVE,
  635. + .gpio60 = GPIO_MODE_GPIO,
  636. + .gpio61 = GPIO_MODE_NATIVE,
  637. + .gpio62 = GPIO_MODE_NATIVE,
  638. + .gpio63 = GPIO_MODE_NATIVE,
  639. +};
  640. +
  641. +static const struct pch_gpio_set2 pch_gpio_set2_direction = {
  642. + .gpio33 = GPIO_DIR_INPUT,
  643. + .gpio34 = GPIO_DIR_OUTPUT,
  644. + .gpio35 = GPIO_DIR_INPUT,
  645. + .gpio36 = GPIO_DIR_INPUT,
  646. + .gpio37 = GPIO_DIR_INPUT,
  647. + .gpio38 = GPIO_DIR_INPUT,
  648. + .gpio39 = GPIO_DIR_INPUT,
  649. + .gpio45 = GPIO_DIR_OUTPUT,
  650. + .gpio48 = GPIO_DIR_INPUT,
  651. + .gpio49 = GPIO_DIR_INPUT,
  652. + .gpio51 = GPIO_DIR_INPUT,
  653. + .gpio52 = GPIO_DIR_INPUT,
  654. + .gpio54 = GPIO_DIR_INPUT,
  655. + .gpio57 = GPIO_DIR_INPUT,
  656. + .gpio60 = GPIO_DIR_OUTPUT,
  657. +};
  658. +
  659. +static const struct pch_gpio_set2 pch_gpio_set2_level = {
  660. + .gpio34 = GPIO_LEVEL_HIGH,
  661. + .gpio45 = GPIO_LEVEL_LOW,
  662. + .gpio60 = GPIO_LEVEL_HIGH,
  663. +};
  664. +
  665. +static const struct pch_gpio_set2 pch_gpio_set2_reset = {
  666. +};
  667. +
  668. +static const struct pch_gpio_set3 pch_gpio_set3_mode = {
  669. + .gpio64 = GPIO_MODE_NATIVE,
  670. + .gpio65 = GPIO_MODE_NATIVE,
  671. + .gpio66 = GPIO_MODE_NATIVE,
  672. + .gpio67 = GPIO_MODE_NATIVE,
  673. + .gpio68 = GPIO_MODE_GPIO,
  674. + .gpio69 = GPIO_MODE_GPIO,
  675. + .gpio70 = GPIO_MODE_GPIO,
  676. + .gpio71 = GPIO_MODE_GPIO,
  677. + .gpio72 = GPIO_MODE_NATIVE,
  678. + .gpio73 = GPIO_MODE_NATIVE,
  679. + .gpio74 = GPIO_MODE_NATIVE,
  680. + .gpio75 = GPIO_MODE_NATIVE,
  681. +};
  682. +
  683. +static const struct pch_gpio_set3 pch_gpio_set3_direction = {
  684. + .gpio68 = GPIO_DIR_INPUT,
  685. + .gpio69 = GPIO_DIR_INPUT,
  686. + .gpio70 = GPIO_DIR_INPUT,
  687. + .gpio71 = GPIO_DIR_INPUT,
  688. +};
  689. +
  690. +static const struct pch_gpio_set3 pch_gpio_set3_level = {
  691. +};
  692. +
  693. +static const struct pch_gpio_set3 pch_gpio_set3_reset = {
  694. +};
  695. +
  696. +const struct pch_gpio_map mainboard_gpio_map = {
  697. + .set1 = {
  698. + .mode = &pch_gpio_set1_mode,
  699. + .direction = &pch_gpio_set1_direction,
  700. + .level = &pch_gpio_set1_level,
  701. + .blink = &pch_gpio_set1_blink,
  702. + .invert = &pch_gpio_set1_invert,
  703. + .reset = &pch_gpio_set1_reset,
  704. + },
  705. + .set2 = {
  706. + .mode = &pch_gpio_set2_mode,
  707. + .direction = &pch_gpio_set2_direction,
  708. + .level = &pch_gpio_set2_level,
  709. + .reset = &pch_gpio_set2_reset,
  710. + },
  711. + .set3 = {
  712. + .mode = &pch_gpio_set3_mode,
  713. + .direction = &pch_gpio_set3_direction,
  714. + .level = &pch_gpio_set3_level,
  715. + .reset = &pch_gpio_set3_reset,
  716. + },
  717. +};
  718. diff --git a/src/mainboard/dell/e6530/hda_verb.c b/src/mainboard/dell/e6530/hda_verb.c
  719. new file mode 100644
  720. index 0000000000..9de7e34311
  721. --- /dev/null
  722. +++ b/src/mainboard/dell/e6530/hda_verb.c
  723. @@ -0,0 +1,33 @@
  724. +/* SPDX-License-Identifier: GPL-2.0-only */
  725. +
  726. +#include <device/azalia_device.h>
  727. +
  728. +const u32 cim_verb_data[] = {
  729. + 0x111d76df, /* Codec Vendor / Device ID: IDT */
  730. + 0x10280535, /* Subsystem ID */
  731. + 11, /* Number of 4 dword sets */
  732. + AZALIA_SUBVENDOR(0, 0x10280535),
  733. + AZALIA_PIN_CFG(0, 0x0a, 0x03a11020),
  734. + AZALIA_PIN_CFG(0, 0x0b, 0x0321101f),
  735. + AZALIA_PIN_CFG(0, 0x0c, 0x400000f0),
  736. + AZALIA_PIN_CFG(0, 0x0d, 0x90170110),
  737. + AZALIA_PIN_CFG(0, 0x0e, 0x23011050),
  738. + AZALIA_PIN_CFG(0, 0x0f, 0x23a1102e),
  739. + AZALIA_PIN_CFG(0, 0x10, 0x400000f3),
  740. + AZALIA_PIN_CFG(0, 0x11, 0xd5a30130),
  741. + AZALIA_PIN_CFG(0, 0x1f, 0x400000f0),
  742. + AZALIA_PIN_CFG(0, 0x20, 0x400000f0),
  743. +
  744. + 0x80862806, /* Codec Vendor / Device ID: Intel */
  745. + 0x80860101, /* Subsystem ID */
  746. + 4, /* Number of 4 dword sets */
  747. + AZALIA_SUBVENDOR(3, 0x80860101),
  748. + AZALIA_PIN_CFG(3, 0x05, 0x18560010),
  749. + AZALIA_PIN_CFG(3, 0x06, 0x18560020),
  750. + AZALIA_PIN_CFG(3, 0x07, 0x18560030),
  751. +
  752. +};
  753. +
  754. +const u32 pc_beep_verbs[0] = {};
  755. +
  756. +AZALIA_ARRAY_SIZES;
  757. diff --git a/src/mainboard/dell/e6530/mainboard.c b/src/mainboard/dell/e6530/mainboard.c
  758. new file mode 100644
  759. index 0000000000..31e49802fc
  760. --- /dev/null
  761. +++ b/src/mainboard/dell/e6530/mainboard.c
  762. @@ -0,0 +1,21 @@
  763. +/* SPDX-License-Identifier: GPL-2.0-only */
  764. +
  765. +#include <device/device.h>
  766. +#include <drivers/intel/gma/int15.h>
  767. +#include <southbridge/intel/bd82x6x/pch.h>
  768. +#include <ec/acpi/ec.h>
  769. +#include <console/console.h>
  770. +#include <pc80/keyboard.h>
  771. +
  772. +static void mainboard_enable(struct device *dev)
  773. +{
  774. +
  775. + /* FIXME: fix these values. */
  776. + install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS,
  777. + GMA_INT15_PANEL_FIT_DEFAULT,
  778. + GMA_INT15_BOOT_DISPLAY_DEFAULT, 0);
  779. +}
  780. +
  781. +struct chip_operations mainboard_ops = {
  782. + .enable_dev = mainboard_enable,
  783. +};
  784. --
  785. 2.39.2