Name of user not set #1002789 has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/38723 )
Change subject: mainboard/lenovo/t440p: Enable dGPU on Lenovo T440P ......................................................................
mainboard/lenovo/t440p: Enable dGPU on Lenovo T440P
Enable the dGPU on the Lenovo T440P. It uses the same code (roughly) of the T430S. By default, it is set to be disabled however it can be enabled via the nvram option enable_dual_graphics.
Change-Id: Idf8c2c0d1ae34bda8736448d3e350396e3cf7a93 Signed-off-by: Chris Morgan macromorgan@hotmail.com --- M src/mainboard/lenovo/t440p/cmos.default M src/mainboard/lenovo/t440p/cmos.layout M src/mainboard/lenovo/t440p/romstage.c 3 files changed, 23 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/23/38723/1
diff --git a/src/mainboard/lenovo/t440p/cmos.default b/src/mainboard/lenovo/t440p/cmos.default index 0949e7b..bb8626d 100644 --- a/src/mainboard/lenovo/t440p/cmos.default +++ b/src/mainboard/lenovo/t440p/cmos.default @@ -10,4 +10,5 @@ sticky_fn=Disable trackpoint=Enable backlight=Keyboard +enable_dual_graphics=Disable usb_always_on=Disable diff --git a/src/mainboard/lenovo/t440p/cmos.layout b/src/mainboard/lenovo/t440p/cmos.layout index f65933a..802857e 100644 --- a/src/mainboard/lenovo/t440p/cmos.layout +++ b/src/mainboard/lenovo/t440p/cmos.layout @@ -69,7 +69,7 @@ 424 1 e 1 f1_to_f12_as_primary
# coreboot config options: northbridge -#435 2 e 12 hybrid_graphics_mode +435 1 e 1 enable_dual_graphics #437 3 r 0 unused 440 8 h 0 volume
diff --git a/src/mainboard/lenovo/t440p/romstage.c b/src/mainboard/lenovo/t440p/romstage.c index c8c630b..95d117e 100644 --- a/src/mainboard/lenovo/t440p/romstage.c +++ b/src/mainboard/lenovo/t440p/romstage.c @@ -22,6 +22,9 @@ #include <northbridge/intel/haswell/pei_data.h> #include <southbridge/intel/common/gpio.h> #include <southbridge/intel/lynxpoint/pch.h> +#include <option.h> +#include <ec/lenovo/pmh7/pmh7.h> +#include <device/pci_ops.h>
static const struct rcba_config_instruction rcba_config[] = { RCBA_SET_REG_16(D31IR, DIR_ROUTE(PIRQA, PIRQD, PIRQC, PIRQA)), @@ -100,4 +103,22 @@ };
romstage_common(&romstage_params); + + u8 enable_peg; + if (get_option(&enable_peg, "enable_dual_graphics") != CB_SUCCESS) + enable_peg = 0; + + bool power_en = pmh7_dgpu_power_state(); + + if (enable_peg != power_en) + pmh7_dgpu_power_enable(!power_en); + + if (!enable_peg) { + // Hide disabled dGPU device + u32 reg32 = pci_read_config32(PCI_DEV(0, 0, 0), DEVEN); + reg32 &= ~DEVEN_D1F0EN; + + pci_write_config32(PCI_DEV(0, 0, 0), DEVEN, reg32); + } + }
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38723 )
Change subject: mainboard/lenovo/t440p: Enable dGPU on Lenovo T440P ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/38723/1/src/mainboard/lenovo/t440p/... File src/mainboard/lenovo/t440p/cmos.layout:
https://review.coreboot.org/c/coreboot/+/38723/1/src/mainboard/lenovo/t440p/... PS1, Line 111: #12 0 Integrated Only Remove as well
Hello Alexander Couzens, Patrick Rudolph, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/38723
to look at the new patch set (#2).
Change subject: mainboard/lenovo/t440p: Enable dGPU on Lenovo T440P ......................................................................
mainboard/lenovo/t440p: Enable dGPU on Lenovo T440P
Enable the dGPU on the Lenovo T440P. It uses the same code (roughly) of the T430S. By default, it is set to be disabled however it can be enabled via the nvram option enable_dual_graphics.
Change-Id: Idf8c2c0d1ae34bda8736448d3e350396e3cf7a93 Signed-off-by: Chris Morgan macromorgan@hotmail.com --- M src/mainboard/lenovo/t440p/cmos.default M src/mainboard/lenovo/t440p/cmos.layout M src/mainboard/lenovo/t440p/romstage.c 3 files changed, 23 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/23/38723/2
Hello Alexander Couzens, Patrick Rudolph, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/38723
to look at the new patch set (#3).
Change subject: mainboard/lenovo/t440p: Enable dGPU on Lenovo T440P ......................................................................
mainboard/lenovo/t440p: Enable dGPU on Lenovo T440P
Enable the dGPU on the Lenovo T440P. It uses the same code (roughly) of the T430S. By default, it is set to be disabled however it can be enabled via the nvram option enable_dual_graphics. Removed hybrid graphics options too.
Change-Id: Idf8c2c0d1ae34bda8736448d3e350396e3cf7a93 Signed-off-by: Chris Morgan macromorgan@hotmail.com --- M src/mainboard/lenovo/t440p/cmos.default M src/mainboard/lenovo/t440p/cmos.layout M src/mainboard/lenovo/t440p/romstage.c 3 files changed, 23 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/23/38723/3
Name of user not set #1002789 has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38723 )
Change subject: mainboard/lenovo/t440p: Enable dGPU on Lenovo T440P ......................................................................
Patch Set 3:
(1 comment)
Removed old cmos values for hybrid graphics (not present on T440p).
https://review.coreboot.org/c/coreboot/+/38723/1/src/mainboard/lenovo/t440p/... File src/mainboard/lenovo/t440p/cmos.layout:
https://review.coreboot.org/c/coreboot/+/38723/1/src/mainboard/lenovo/t440p/... PS1, Line 111: #12 0 Integrated Only
Remove as well
Fixed in subsequent commit.
Iru Cai (vimacs) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38723 )
Change subject: mainboard/lenovo/t440p: Enable dGPU on Lenovo T440P ......................................................................
Patch Set 3:
What's the difference between dual graphics and hybrid graphics? T430 and T530 use DRIVERS_LENOVO_HYBRID_GRAPHICS, and T430s doesn't use this.
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38723 )
Change subject: mainboard/lenovo/t440p: Enable dGPU on Lenovo T440P ......................................................................
Patch Set 3:
Patch Set 3:
What's the difference between dual graphics and hybrid graphics? T430 and T530 use DRIVERS_LENOVO_HYBRID_GRAPHICS, and T430s doesn't use this.
Hybrid graphics is a feature of dual graphics allowing to switch the display panel to either gpu at runtime. To safe costs and higher throughput graphics interconnects newer platforms doesn't have this mux any more. Starting with the t430s, it only has dual graphics/Optimus.
Hello Alexander Couzens, Patrick Rudolph, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/38723
to look at the new patch set (#4).
Change subject: mainboard/lenovo/t440p: Enable dGPU on Lenovo T440P ......................................................................
mainboard/lenovo/t440p: Enable dGPU on Lenovo T440P
Enable the dGPU on the Lenovo T440P. It uses the same code (roughly) of the T430S. By default, it is set to be disabled however it can be enabled via the nvram option enable_dual_graphics. Removed hybrid graphics options too. Tested on a T440P with Ubuntu 18.04.3 (successful). Tested on same machine with Windows 10 1909 (blue screen at boot).
Change-Id: Idf8c2c0d1ae34bda8736448d3e350396e3cf7a93 Signed-off-by: Chris Morgan macromorgan@hotmail.com --- M src/mainboard/lenovo/t440p/cmos.default M src/mainboard/lenovo/t440p/cmos.layout M src/mainboard/lenovo/t440p/romstage.c 3 files changed, 23 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/23/38723/4
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38723 )
Change subject: mainboard/lenovo/t440p: Enable dGPU on Lenovo T440P ......................................................................
Patch Set 4:
(4 comments)
Does some documentation need to be updated?
https://review.coreboot.org/c/coreboot/+/38723/4//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/38723/4//COMMIT_MSG@7 PS4, Line 7: mainboard mb
https://review.coreboot.org/c/coreboot/+/38723/4//COMMIT_MSG@12 PS4, Line 12: Removed hybrid graphics options too. Why?
https://review.coreboot.org/c/coreboot/+/38723/4//COMMIT_MSG@9 PS4, Line 9: Enable the dGPU on the Lenovo T440P. It uses the same code : (roughly) of the T430S. By default, it is set to be : disabled however it can be enabled via the nvram option : enable_dual_graphics. Removed hybrid graphics options too. : Tested on a T440P with Ubuntu 18.04.3 (successful). Tested : on same machine with Windows 10 1909 (blue screen at boot). Please reflow for 75 characters.
https://review.coreboot.org/c/coreboot/+/38723/4/src/mainboard/lenovo/t440p/... File src/mainboard/lenovo/t440p/romstage.c:
https://review.coreboot.org/c/coreboot/+/38723/4/src/mainboard/lenovo/t440p/... PS4, Line 123: Please remove the blank line.
Hello Alexander Couzens, Patrick Rudolph, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/38723
to look at the new patch set (#5).
Change subject: mb/lenovo/t440p: Enable dGPU on Lenovo T440P ......................................................................
mb/lenovo/t440p: Enable dGPU on Lenovo T440P
Enable the dGPU on the Lenovo T440P. It uses the same code (roughly) of the T430S. By default, it is set to be disabled however it can be enabled via the nvram option enable_dual_graphics. Removed hybrid graphics options too as they are not valid for the T440p. Tested on a T440P with Ubuntu 18.04.4 with Kernel 5.3.0-29 (successful). Tested on same machine with Windows 10 1909 (machine check exception bluescreen).
Change-Id: Idf8c2c0d1ae34bda8736448d3e350396e3cf7a93 Signed-off-by: Chris Morgan macromorgan@hotmail.com --- M src/mainboard/lenovo/t440p/cmos.default M src/mainboard/lenovo/t440p/cmos.layout M src/mainboard/lenovo/t440p/romstage.c 3 files changed, 22 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/23/38723/5
Name of user not set #1002789 has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38723 )
Change subject: mb/lenovo/t440p: Enable dGPU on Lenovo T440P ......................................................................
Patch Set 5:
(4 comments)
Comments resolved.
https://review.coreboot.org/c/coreboot/+/38723/4//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/38723/4//COMMIT_MSG@7 PS4, Line 7: mainboard
mb
Ack
https://review.coreboot.org/c/coreboot/+/38723/4//COMMIT_MSG@12 PS4, Line 12: Removed hybrid graphics options too.
Why?
They are not valid for the T440p which has a muxless dGPU.
https://review.coreboot.org/c/coreboot/+/38723/4//COMMIT_MSG@9 PS4, Line 9: Enable the dGPU on the Lenovo T440P. It uses the same code : (roughly) of the T430S. By default, it is set to be : disabled however it can be enabled via the nvram option : enable_dual_graphics. Removed hybrid graphics options too. : Tested on a T440P with Ubuntu 18.04.3 (successful). Tested : on same machine with Windows 10 1909 (blue screen at boot).
Please reflow for 75 characters.
Ack
https://review.coreboot.org/c/coreboot/+/38723/4/src/mainboard/lenovo/t440p/... File src/mainboard/lenovo/t440p/romstage.c:
https://review.coreboot.org/c/coreboot/+/38723/4/src/mainboard/lenovo/t440p/... PS4, Line 123:
Please remove the blank line.
Ack
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38723 )
Change subject: mb/lenovo/t440p: Enable dGPU on Lenovo T440P ......................................................................
Patch Set 5: Code-Review+2
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/38723 )
Change subject: mb/lenovo/t440p: Enable dGPU on Lenovo T440P ......................................................................
mb/lenovo/t440p: Enable dGPU on Lenovo T440P
Enable the dGPU on the Lenovo T440P. It uses the same code (roughly) of the T430S. By default, it is set to be disabled however it can be enabled via the nvram option enable_dual_graphics. Removed hybrid graphics options too as they are not valid for the T440p. Tested on a T440P with Ubuntu 18.04.4 with Kernel 5.3.0-29 (successful). Tested on same machine with Windows 10 1909 (machine check exception bluescreen).
Change-Id: Idf8c2c0d1ae34bda8736448d3e350396e3cf7a93 Signed-off-by: Chris Morgan macromorgan@hotmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/38723 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Patrick Rudolph siro@das-labor.org --- M src/mainboard/lenovo/t440p/cmos.default M src/mainboard/lenovo/t440p/cmos.layout M src/mainboard/lenovo/t440p/romstage.c 3 files changed, 22 insertions(+), 4 deletions(-)
Approvals: build bot (Jenkins): Verified Patrick Rudolph: Looks good to me, approved
diff --git a/src/mainboard/lenovo/t440p/cmos.default b/src/mainboard/lenovo/t440p/cmos.default index 0949e7b..bb8626d 100644 --- a/src/mainboard/lenovo/t440p/cmos.default +++ b/src/mainboard/lenovo/t440p/cmos.default @@ -10,4 +10,5 @@ sticky_fn=Disable trackpoint=Enable backlight=Keyboard +enable_dual_graphics=Disable usb_always_on=Disable diff --git a/src/mainboard/lenovo/t440p/cmos.layout b/src/mainboard/lenovo/t440p/cmos.layout index f65933a..9c09104 100644 --- a/src/mainboard/lenovo/t440p/cmos.layout +++ b/src/mainboard/lenovo/t440p/cmos.layout @@ -69,7 +69,7 @@ 424 1 e 1 f1_to_f12_as_primary
# coreboot config options: northbridge -#435 2 e 12 hybrid_graphics_mode +435 1 e 1 enable_dual_graphics #437 3 r 0 unused 440 8 h 0 volume
@@ -108,9 +108,6 @@ 10 1 Keyboard #10 2 Thinklight only 10 3 None -#12 0 Integrated Only -#12 1 Discrete Only -#12 2 Dual Graphics 13 0 Disable 13 1 AC and battery 13 2 AC only diff --git a/src/mainboard/lenovo/t440p/romstage.c b/src/mainboard/lenovo/t440p/romstage.c index c8c630b..283a52b 100644 --- a/src/mainboard/lenovo/t440p/romstage.c +++ b/src/mainboard/lenovo/t440p/romstage.c @@ -22,6 +22,9 @@ #include <northbridge/intel/haswell/pei_data.h> #include <southbridge/intel/common/gpio.h> #include <southbridge/intel/lynxpoint/pch.h> +#include <option.h> +#include <ec/lenovo/pmh7/pmh7.h> +#include <device/pci_ops.h>
static const struct rcba_config_instruction rcba_config[] = { RCBA_SET_REG_16(D31IR, DIR_ROUTE(PIRQA, PIRQD, PIRQC, PIRQA)), @@ -100,4 +103,21 @@ };
romstage_common(&romstage_params); + + u8 enable_peg; + if (get_option(&enable_peg, "enable_dual_graphics") != CB_SUCCESS) + enable_peg = 0; + + bool power_en = pmh7_dgpu_power_state(); + + if (enable_peg != power_en) + pmh7_dgpu_power_enable(!power_en); + + if (!enable_peg) { + // Hide disabled dGPU device + u32 reg32 = pci_read_config32(PCI_DEV(0, 0, 0), DEVEN); + reg32 &= ~DEVEN_D1F0EN; + + pci_write_config32(PCI_DEV(0, 0, 0), DEVEN, reg32); + } }