5 type haswellmc
struct {
9 func divceil(a
uint32, b
uint32) uint32 {
10 return (a
+ b
- 1) / b
13 func getPanelCfg(inteltool InteltoolData
, isULT
bool) string {
22 if (inteltool
.IGD
[0xc8254] >> 16) != 0 {
23 pwm_hz
= refclk
/ 128 / (inteltool
.IGD
[0xc8254] >> 16)
28 gpu_panel_power_up_delay
:= (inteltool
.IGD
[0xc7208] >> 16) & 0x1fff
29 gpu_panel_power_backlight_on_delay
:= inteltool
.IGD
[0xc7208] & 0x1fff
30 gpu_panel_power_down_delay
:= (inteltool
.IGD
[0xc720c] >> 16) & 0x1fff
31 gpu_panel_power_backlight_off_delay
:= inteltool
.IGD
[0xc720c] & 0x1fff
32 gpu_panel_power_cycle_delay
:= inteltool
.IGD
[0xc7210] & 0x1f
37 .cycle_delay_ms = %3d,
38 .backlight_on_delay_ms = %3d,
39 .backlight_off_delay_ms = %3d,
40 .backlight_pwm_hz = %3d,
42 divceil(gpu_panel_power_up_delay
, 10),
43 divceil(gpu_panel_power_down_delay
, 10),
44 (gpu_panel_power_cycle_delay
-1)*100,
45 divceil(gpu_panel_power_backlight_on_delay
, 10),
46 divceil(gpu_panel_power_backlight_off_delay
, 10),
50 func (i haswellmc
) Scan(ctx Context
, addr PCIDevData
) {
51 inteltool
:= ctx
.InfoSource
.GetInteltool()
53 isULT
:= (i
.variant
== "ULT")
54 DevTree
= DevTreeNode
{
55 Chip
: "northbridge/intel/haswell",
56 MissingParent
: "northbridge",
57 Comment
: "FIXME: check ec_present, usb_xhci_on_resume, gfx",
58 Registers
: map[string]string{
59 "gpu_dp_b_hotplug": FormatInt32((inteltool
.IGD
[0xc4030] >> 2) & 4),
60 "gpu_dp_c_hotplug": FormatInt32((inteltool
.IGD
[0xc4030] >> 10) & 4),
61 "gpu_dp_d_hotplug": FormatInt32((inteltool
.IGD
[0xc4030] >> 18) & 4),
62 "panel_cfg": getPanelCfg(inteltool
, isULT
),
63 "gpu_ddi_e_connected": FormatBool(((inteltool
.IGD
[0x64000] >> 4) & 1) == 0),
64 "ec_present": "false",
65 "usb_xhci_on_resume": "false",
66 /* FIXME:XX hardcoded. */
67 "gfx": "GMA_STATIC_DISPLAYS(0)",
68 "spd_addresses": "{0x50, 0x51, 0x52, 0x53}\" # FIXME: Put proper SPD map here",
70 Children
: []DevTreeNode
{
72 Chip
: "cpu/intel/haswell",
73 Children
: []DevTreeNode
{
77 Ops
: "haswell_cpu_bus_ops",
85 Ops
: "haswell_pci_domain_ops",
89 PCISlot
{PCIAddr
: PCIAddr
{Dev
: 0x0, Func
: 0}, writeEmpty
: true, additionalComment
: i
.variant
},
90 PCISlot
{PCIAddr
: PCIAddr
{Dev
: 0x1, Func
: 0}, writeEmpty
: !isULT
, additionalComment
: "PCIe Bridge for discrete graphics"},
91 PCISlot
{PCIAddr
: PCIAddr
{Dev
: 0x2, Func
: 0}, writeEmpty
: true, additionalComment
: "Internal graphics"},
92 PCISlot
{PCIAddr
: PCIAddr
{Dev
: 0x3, Func
: 0}, writeEmpty
: true, additionalComment
: "Mini-HD audio"},
99 DevTree
.Registers
["dq_pins_interleaved"] = FormatBool(((inteltool
.MCHBAR
[0x2008] >> 10) & 1) == 0)
102 PutPCIDev(addr
, "Host bridge")
104 KconfigBool
["NORTHBRIDGE_INTEL_HASWELL"] = true
105 KconfigBool
["HAVE_ACPI_TABLES"] = true
106 KconfigBool
["HAVE_ACPI_RESUME"] = true
108 DSDTIncludes
= append(DSDTIncludes
, DSDTInclude
{
109 File
: "cpu/intel/common/acpi/cpu.asl",
112 DSDTPCI0Includes
= append(DSDTPCI0Includes
, DSDTInclude
{
113 File
: "northbridge/intel/haswell/acpi/hostbridge.asl",
115 File
: "drivers/intel/gma/acpi/default_brightness_levels.asl",
116 Comment
: "FIXME: remove this if the board doesn't have backlight",
121 RegisterPCI(0x8086, 0x0c00, haswellmc
{variant
: "Desktop"})
122 RegisterPCI(0x8086, 0x0c04, haswellmc
{variant
: "Mobile"})
123 RegisterPCI(0x8086, 0x0a04, haswellmc
{variant
: "ULT"})
124 RegisterPCI(0x8086, 0x0c08, haswellmc
{variant
: "Server"})
125 RegisterPCI(0x8086, 0x0d00, haswellmc
{variant
: "Crystal Well Desktop"})
126 RegisterPCI(0x8086, 0x0d04, haswellmc
{variant
: "Crystal Well Mobile"})
127 RegisterPCI(0x8086, 0x0d08, haswellmc
{variant
: "Crystal Well Server"})
128 for _
, id
:= range []uint16{
129 0x0402, 0x0412, 0x041e, 0x0422, 0x0d22, /* Desktop */
130 0x0406, 0x0416, 0x0426, /* Mobile */
131 0x040a, 0x041a, 0x042a, /* Server */
132 0x0a06, 0x0a16, 0x0a26, /* ULT */
133 0x0a0e, 0x0a1e, /* ULX */
134 0x0d16, 0x0d26, 0x0d36, /* Mobile 4+3, GT3e */
136 RegisterPCI(0x8086, id
, GenericVGA
{GenericPCI
{Comment
: "VGA controller"}})
139 RegisterPCI(0x8086, 0x0a0c, GenericPCI
{})
140 RegisterPCI(0x8086, 0x0c0c, GenericPCI
{})