<div dir="ltr">Yes, I think it's worth having them in upstream SeaBIOS!<div><br></div><div>I've been thinking about creating a way of passing this information between coreboot and SeaBIOS in the future, so we don't have to keep the handlers around twice. One way of doing that would be to have the handler live in SMM and have SeaBIOS do an SMI command to get the right answers. Would you be open to something like that?</div>
<div><br></div><div>Stefan</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jan 17, 2014 at 4:43 PM, Kevin O'Connor <span dir="ltr"><<a href="mailto:kevin@koconnor.net" target="_blank">kevin@koconnor.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Add in the detection for a handful of additional boards found in the<br>
Chromium repo.  This ports over and simplifies the code in that repo.<br>
<br>
Signed-off-by: Kevin O'Connor <<a href="mailto:kevin@koconnor.net">kevin@koconnor.net</a>><br>
---<br>
<br>
Are these boards in active distribution and is it worth having them in<br>
the seabios main repo?<br>
<br>
---<br>
 src/vgahooks.c | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--<br>
 1 file changed, 88 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/vgahooks.c b/src/vgahooks.c<br>
index 6a4acfe..f7bf660 100644<br>
--- a/src/vgahooks.c<br>
+++ b/src/vgahooks.c<br>
@@ -32,6 +32,7 @@ handle_157fXX(struct bregs *regs)<br>
     set_code_unimplemented(regs, RET_EUNSUPPORTED);<br>
 }<br>
<br>
+<br>
 /****************************************************************<br>
  * Via hooks<br>
  ****************************************************************/<br>
@@ -175,7 +176,16 @@ via_setup(struct pci_device *pci)<br>
  * Intel VGA hooks<br>
  ****************************************************************/<br>
<br>
-u8 IntelDisplayType VARFSEG, IntelDisplayId VARFSEG;<br>
+u8 IntelDisplayType VARFSEG, IntelDisplayId VARFSEG, IntelPanelFitting VARFSEG;<br>
+u16 IntelActiveLFP VARFSEG;<br>
+<br>
+static void<br>
+intel_155f34(struct bregs *regs)<br>
+{<br>
+    regs->ax = 0x005f;<br>
+    regs->cl = GET_GLOBAL(IntelPanelFitting);<br>
+    set_success(regs);<br>
+}<br>
<br>
 static void<br>
 intel_155f35(struct bregs *regs)<br>
@@ -194,6 +204,43 @@ intel_155f40(struct bregs *regs)<br>
 }<br>
<br>
 static void<br>
+intel_155f51(struct bregs *regs)<br>
+{<br>
+    regs->ax = 0x005f;<br>
+    regs->cx = GET_GLOBAL(IntelActiveLFP);<br>
+    set_success(regs);<br>
+}<br>
+<br>
+static void<br>
+intel_155f70(struct bregs *regs)<br>
+{<br>
+    switch (regs->ch) {<br>
+    case 0:<br>
+        /* Get Mux */<br>
+        regs->ax = 0x005f;<br>
+        regs->cx = 0x0000;<br>
+        set_success(regs);<br>
+        break;<br>
+    case 1:<br>
+        /* Set Mux */<br>
+        regs->ax = 0x005f;<br>
+        regs->cx = 0x0000;<br>
+        set_success(regs);<br>
+        break;<br>
+    case 2:<br>
+        /* Get SG/Non-SG mode */<br>
+        regs->ax = 0x005f;<br>
+        regs->cx = 0x0000;<br>
+        set_success(regs);<br>
+        break;<br>
+    default:<br>
+        /* Interrupt was not handled */<br>
+        handle_155fXX(regs);<br>
+        break;<br>
+    }<br>
+}<br>
+<br>
+static void<br>
 intel_155f50(struct bregs *regs)<br>
 {<br>
     /* Mandatory hook on some Dell laptops */<br>
@@ -205,9 +252,12 @@ static void<br>
 intel_155f(struct bregs *regs)<br>
 {<br>
     switch (regs->al) {<br>
+    case 0x34: intel_155f34(regs); break;<br>
     case 0x35: intel_155f35(regs); break;<br>
     case 0x40: intel_155f40(regs); break;<br>
     case 0x50: intel_155f50(regs); break;<br>
+    case 0x51: intel_155f51(regs); break;<br>
+    case 0x70: intel_155f70(regs); break;<br>
     default:   handle_155fXX(regs); break;<br>
     }<br>
 }<br>
@@ -254,6 +304,34 @@ getac_setup(struct pci_device *pci)<br>
 {<br>
 }<br>
<br>
+static void<br>
+stumpy_setup(struct pci_device *pci)<br>
+{<br>
+    VGAHookHandlerType = VH_INTEL;<br>
+    IntelPanelFitting = 0;<br>
+    IntelDisplayType = BOOT_DISPLAY_DEFAULT;<br>
+    IntelActiveLFP = 0x0003;<br>
+}<br>
+<br>
+static void<br>
+lumpy_setup(struct pci_device *pci)<br>
+{<br>
+    VGAHookHandlerType = VH_INTEL;<br>
+    IntelPanelFitting = 0;<br>
+    IntelDisplayType = BOOT_DISPLAY_DEFAULT;<br>
+    IntelActiveLFP = 0x0001;<br>
+}<br>
+<br>
+static void<br>
+link_setup(struct pci_device *pci)<br>
+{<br>
+    VGAHookHandlerType = VH_INTEL;<br>
+    IntelPanelFitting = 0;<br>
+    IntelDisplayType = BOOT_DISPLAY_DEFAULT;<br>
+    IntelActiveLFP = 0x0003;<br>
+}<br>
+<br>
+<br>
 /****************************************************************<br>
  * Silicon Motion hooks<br>
  ****************************************************************/<br>
@@ -295,6 +373,7 @@ winent_mb6047_setup(struct pci_device *pci)<br>
     SmiBootDisplay = 0x02;<br>
 }<br>
<br>
+<br>
 /****************************************************************<br>
  * Entry and setup<br>
  ****************************************************************/<br>
@@ -345,7 +424,14 @@ vgahook_setup(struct pci_device *pci)<br>
         getac_setup(pci);<br>
     else if (strcmp(CBvendor, "RODA") == 0 && strcmp(CBpart, "RK886EX") == 0)<br>
         roda_setup(pci);<br>
-    else if (strcmp(CBvendor, "Win Enterprise") == 0 && strcmp(CBpart, "MB6047") == 0)<br>
+    else if (strcmp(CBvendor, "SAMSUNG") == 0 && strcmp(CBpart, "Stumpy") == 0)<br>
+        stumpy_setup(pci);<br>
+    else if (strcmp(CBvendor, "SAMSUNG") == 0 && strcmp(CBpart, "Lumpy") == 0)<br>
+        lumpy_setup(pci);<br>
+    else if (strcmp(CBvendor, "GOOGLE") == 0 && strcmp(CBpart, "Link") == 0)<br>
+        link_setup(pci);<br>
+    else if (strcmp(CBvendor, "Win Enterprise") == 0<br>
+             && strcmp(CBpart, "MB6047") == 0)<br>
         winent_mb6047_setup(pci);<br>
     else if (pci->vendor == PCI_VENDOR_ID_VIA)<br>
         via_setup(pci);<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.8.3.1<br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse;color:rgb(153,153,153)"><span style="color:rgb(51,102,255)"><div>
Stefan Reinauer</div>G</span><span style="color:rgb(204,0,0)">o</span><span style="color:rgb(255,204,0);background-color:rgb(255,255,255)">o</span><span style="color:rgb(51,102,255)">g</span><span style="color:rgb(0,153,0)">l</span><span style="color:rgb(204,0,0)">e</span> Inc.</span><br>
</span>
</div>