2014-10-15 21:51:47 +02:00
|
|
|
package main
|
|
|
|
|
2020-04-10 14:56:07 +02:00
|
|
|
import "fmt"
|
|
|
|
|
2014-10-15 21:51:47 +02:00
|
|
|
type sandybridgemc struct {
|
|
|
|
}
|
|
|
|
|
|
|
|
func (i sandybridgemc) Scan(ctx Context, addr PCIDevData) {
|
|
|
|
inteltool := ctx.InfoSource.GetInteltool()
|
|
|
|
|
|
|
|
/* FIXME:XX Move this somewhere else. */
|
|
|
|
MainboardIncludes = append(MainboardIncludes, "drivers/intel/gma/int15.h")
|
2020-01-08 15:05:56 +01:00
|
|
|
MainboardEnable += (` /* FIXME: fix these values. */
|
2019-01-16 01:12:21 +01:00
|
|
|
install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS,
|
|
|
|
GMA_INT15_PANEL_FIT_DEFAULT,
|
|
|
|
GMA_INT15_BOOT_DISPLAY_DEFAULT, 0);
|
2014-10-15 21:51:47 +02:00
|
|
|
`)
|
|
|
|
|
|
|
|
DevTree = DevTreeNode{
|
|
|
|
Chip: "northbridge/intel/sandybridge",
|
|
|
|
MissingParent: "northbridge",
|
2020-01-08 15:05:56 +01:00
|
|
|
Comment: "FIXME: GPU registers may not always apply.",
|
2014-10-15 21:51:47 +02:00
|
|
|
Registers: map[string]string{
|
|
|
|
"gpu_dp_b_hotplug": FormatInt32((inteltool.IGD[0xc4030] >> 2) & 7),
|
|
|
|
"gpu_dp_c_hotplug": FormatInt32((inteltool.IGD[0xc4030] >> 10) & 7),
|
|
|
|
"gpu_dp_d_hotplug": FormatInt32((inteltool.IGD[0xc4030] >> 18) & 7),
|
|
|
|
"gpu_panel_port_select": FormatInt32((inteltool.IGD[0xc7208] >> 30) & 3),
|
|
|
|
"gpu_panel_power_up_delay": FormatInt32((inteltool.IGD[0xc7208] >> 16) & 0x1fff),
|
|
|
|
"gpu_panel_power_backlight_on_delay": FormatInt32(inteltool.IGD[0xc7208] & 0x1fff),
|
|
|
|
"gpu_panel_power_down_delay": FormatInt32((inteltool.IGD[0xc720c] >> 16) & 0x1fff),
|
|
|
|
"gpu_panel_power_backlight_off_delay": FormatInt32(inteltool.IGD[0xc720c] & 0x1fff),
|
|
|
|
"gpu_panel_power_cycle_delay": FormatInt32(inteltool.IGD[0xc7210] & 0xff),
|
|
|
|
"gpu_cpu_backlight": FormatHex32(inteltool.IGD[0x48254]),
|
|
|
|
"gpu_pch_backlight": FormatHex32((inteltool.IGD[0xc8254] >> 16) * 0x10001),
|
2020-04-10 14:56:07 +02:00
|
|
|
"gfx": fmt.Sprintf("GMA_STATIC_DISPLAYS(%d)", (inteltool.IGD[0xc6200] >> 12) & 1),
|
2014-10-15 21:51:47 +02:00
|
|
|
},
|
|
|
|
Children: []DevTreeNode{
|
|
|
|
{
|
|
|
|
Chip: "cpu_cluster",
|
|
|
|
Dev: 0,
|
|
|
|
Children: []DevTreeNode{
|
|
|
|
{
|
|
|
|
Chip: "cpu/intel/model_206ax",
|
|
|
|
Comment: "FIXME: check all registers",
|
|
|
|
Registers: map[string]string{
|
|
|
|
/* FIXME:XX hardcoded. */
|
2021-01-04 17:02:23 +01:00
|
|
|
"acpi_c1": "1",
|
|
|
|
"acpi_c2": "3",
|
|
|
|
"acpi_c3": "5",
|
2014-10-15 21:51:47 +02:00
|
|
|
},
|
|
|
|
Children: []DevTreeNode{
|
2019-01-21 17:55:02 +01:00
|
|
|
{
|
|
|
|
Chip: "lapic",
|
|
|
|
Dev: 0,
|
|
|
|
},
|
2014-10-15 21:51:47 +02:00
|
|
|
{
|
|
|
|
Chip: "lapic",
|
|
|
|
Dev: 0xacac,
|
|
|
|
Disabled: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
Chip: "domain",
|
|
|
|
Dev: 0,
|
|
|
|
PCIController: true,
|
|
|
|
ChildPCIBus: 0,
|
|
|
|
PCISlots: []PCISlot{
|
|
|
|
PCISlot{PCIAddr: PCIAddr{Dev: 0x0, Func: 0}, writeEmpty: true, additionalComment: "Host bridge"},
|
2020-01-08 15:05:56 +01:00
|
|
|
PCISlot{PCIAddr: PCIAddr{Dev: 0x1, Func: 0}, writeEmpty: true, additionalComment: "PEG"},
|
|
|
|
PCISlot{PCIAddr: PCIAddr{Dev: 0x2, Func: 0}, writeEmpty: true, additionalComment: "iGPU"},
|
2014-10-15 21:51:47 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
PutPCIDev(addr, "Host bridge")
|
|
|
|
|
|
|
|
/* FIXME:XX some configs are unsupported. */
|
2019-05-10 16:48:14 +02:00
|
|
|
KconfigBool["NORTHBRIDGE_INTEL_SANDYBRIDGE"] = true
|
2016-02-10 02:36:04 +01:00
|
|
|
KconfigBool["USE_NATIVE_RAMINIT"] = true
|
2014-10-15 21:51:47 +02:00
|
|
|
KconfigBool["INTEL_INT15"] = true
|
|
|
|
KconfigBool["HAVE_ACPI_TABLES"] = true
|
|
|
|
KconfigBool["HAVE_ACPI_RESUME"] = true
|
|
|
|
|
|
|
|
DSDTIncludes = append(DSDTIncludes, DSDTInclude{
|
2019-01-16 00:18:33 +01:00
|
|
|
File: "cpu/intel/common/acpi/cpu.asl",
|
2014-10-15 21:51:47 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
DSDTPCI0Includes = append(DSDTPCI0Includes, DSDTInclude{
|
|
|
|
File: "northbridge/intel/sandybridge/acpi/sandybridge.asl",
|
2015-08-27 13:31:46 +02:00
|
|
|
}, DSDTInclude{
|
|
|
|
File: "drivers/intel/gma/acpi/default_brightness_levels.asl",
|
2014-10-15 21:51:47 +02:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
2019-05-10 16:48:14 +02:00
|
|
|
RegisterPCI(0x8086, 0x0100, sandybridgemc{})
|
|
|
|
RegisterPCI(0x8086, 0x0104, sandybridgemc{})
|
|
|
|
RegisterPCI(0x8086, 0x0150, sandybridgemc{})
|
|
|
|
RegisterPCI(0x8086, 0x0154, sandybridgemc{})
|
2020-01-10 19:48:20 +01:00
|
|
|
RegisterPCI(0x8086, 0x0158, sandybridgemc{})
|
2014-10-15 21:51:47 +02:00
|
|
|
for _, id := range []uint16{
|
2017-07-29 01:46:23 +02:00
|
|
|
0x0102, 0x0106, 0x010a,
|
|
|
|
0x0112, 0x0116, 0x0122, 0x0126,
|
|
|
|
0x0152, 0x0156, 0x0162, 0x0166,
|
2014-10-15 21:51:47 +02:00
|
|
|
} {
|
2020-01-08 15:05:56 +01:00
|
|
|
RegisterPCI(0x8086, id, GenericVGA{GenericPCI{}})
|
2014-10-15 21:51:47 +02:00
|
|
|
}
|
2019-02-10 19:52:51 +01:00
|
|
|
|
|
|
|
/* PCIe bridge */
|
|
|
|
for _, id := range []uint16{
|
|
|
|
0x0101, 0x0105, 0x0109, 0x010d,
|
|
|
|
0x0151, 0x0155, 0x0159, 0x015d,
|
|
|
|
} {
|
|
|
|
RegisterPCI(0x8086, id, GenericPCI{})
|
|
|
|
}
|
2014-10-15 21:51:47 +02:00
|
|
|
}
|