Hello Iru Cai,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/30890
to review the following change.
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
autoport: Add support for Haswell-LynxPoint platform
It can now generate a buildable source for Clevo W650SZ.
TODO: - Support Lynx Point LP (GPIO registers differ from non-LP) - Use PCH HD-Audio in azilia instead of the CPU/Northbridge HD-Audio
Change-Id: I4f6e8c97b5122101de2f36bba8ba9f8ddd5b813a Signed-off-by: Iru Cai mytbk920423@gmail.com --- M util/autoport/azalia.go A util/autoport/haswell.go A util/autoport/lynxpoint.go M util/autoport/main.go 4 files changed, 625 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/30890/1
diff --git a/util/autoport/azalia.go b/util/autoport/azalia.go index c525189..3090dd0 100644 --- a/util/autoport/azalia.go +++ b/util/autoport/azalia.go @@ -62,4 +62,9 @@ RegisterPCI(0x8086, 0x1c20, azalia{}) /* C216/ivybridge */ RegisterPCI(0x8086, 0x1e20, azalia{}) + /* Haswell */ + RegisterPCI(0x8086, 0x0c0c, azalia{}) + /* Lynx Point */ + RegisterPCI(0x8086, 0x8c20, azalia{}) + RegisterPCI(0x8086, 0x9c20, azalia{}) } diff --git a/util/autoport/haswell.go b/util/autoport/haswell.go new file mode 100644 index 0000000..d3c9d9f --- /dev/null +++ b/util/autoport/haswell.go @@ -0,0 +1,119 @@ +package main + +type haswellmc struct { + variant string +} + +func (i haswellmc) Scan(ctx Context, addr PCIDevData) { + inteltool := ctx.InfoSource.GetInteltool() + + /* FIXME:XX Move this somewhere else. */ + MainboardIncludes = append(MainboardIncludes, "drivers/intel/gma/int15.h") + MainboardEnable += (` /* FIXME: fix those values*/ + install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_DEFAULT, GMA_INT15_BOOT_DISPLAY_DEFAULT, 0); +`) + + DevTree = DevTreeNode{ + Chip: "northbridge/intel/haswell", + MissingParent: "northbridge", + Comment: "FIXME: check gfx.ndid and gfx.did", + 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), + "gpu_ddi_e_connected": FormatBool(((inteltool.IGD[0x64000] >> 4) & 1) == 0), + /* FIXME:XX hardcoded. */ + "gfx.ndid": "3", + "gfx.did": "{ 0x80000100, 0x80000240, 0x80000410, 0x80000410, 0x00000005 }", + }, + Children: []DevTreeNode{ + { + Chip: "cpu_cluster", + Dev: 0, + Children: []DevTreeNode{ + { + Chip: "cpu/intel/haswell", + Children: []DevTreeNode{ + { + Chip: "lapic", + Dev: 0, + }, + { + Chip: "lapic", + Dev: 0xacac, + Disabled: true, + }, + }, + Registers: map[string]string{ + /* FIXME:XX hardcoded. */ + "c1_acpower": "1", + "c2_acpower": "3", + "c3_acpower": "5", + "c1_battery": "1", + "c2_battery": "3", + "c3_battery": "5", + }, + }, + }, + }, + + { + Chip: "domain", + Dev: 0, + PCIController: true, + ChildPCIBus: 0, + PCISlots: []PCISlot{ + PCISlot{PCIAddr: PCIAddr{Dev: 0x0, Func: 0}, writeEmpty: true, additionalComment: "Host bridge"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x1, Func: 0}, writeEmpty: true, additionalComment: "PCIe Bridge for discrete graphics"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x2, Func: 0}, writeEmpty: true, additionalComment: "Internal graphics"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x3, Func: 0}, writeEmpty: true, additionalComment: "Mini-HD audio"}, + }, + }, + }, + } + + PutPCIDev(addr, "Host bridge") + + /* FIXME:XX some configs are unsupported. */ + + KconfigBool["CPU_INTEL_HASWELL"] = true + KconfigBool["NORTHBRIDGE_INTEL_HASWELL"] = true + KconfigBool["INTEL_INT15"] = true + KconfigBool["HAVE_ACPI_TABLES"] = true + KconfigBool["HAVE_ACPI_RESUME"] = true + + KconfigInt["MAX_CPUS"] = 8 + + DSDTIncludes = append(DSDTIncludes, DSDTInclude{ + File: "cpu/intel/common/acpi/cpu.asl", + }) + + DSDTPCI0Includes = append(DSDTPCI0Includes, DSDTInclude{ + File: "northbridge/intel/haswell/acpi/haswell.asl", + }, DSDTInclude{ + File: "drivers/intel/gma/acpi/default_brightness_levels.asl", + }) +} + +func init() { + RegisterPCI(0x8086, 0x0c00, haswellmc{variant: "Desktop"}) + RegisterPCI(0x8086, 0x0c04, haswellmc{variant: "Mobile"}) + RegisterPCI(0x8086, 0x0a04, haswellmc{variant: "ULT"}) + RegisterPCI(0x8086, 0x0c08, haswellmc{variant: "Server"}) + for _, id := range []uint16{ + 0x0402, 0x0412, 0x0422, + 0x0406, 0x0416, 0x0426, + 0x0d16, 0x0d26, 0x0d36, + 0x0a06, 0x0a16, 0x0a26, + } { + RegisterPCI(0x8086, id, GenericVGA{GenericPCI{Comment: "VGA controller"}}) + } +} diff --git a/util/autoport/lynxpoint.go b/util/autoport/lynxpoint.go new file mode 100644 index 0000000..df20c3f --- /dev/null +++ b/util/autoport/lynxpoint.go @@ -0,0 +1,495 @@ +package main + +import ( + "fmt" + "os" +) + +type lynxpoint struct { + variant string + node *DevTreeNode +} + +func (b lynxpoint) writeGPIOSet(ctx Context, sb *os.File, + val uint32, set uint, partno int, constraint uint32) { + + max := uint(32) + if set == 3 { + max = 12 + } + + bits := [6][2]string{ + {"GPIO_MODE_NATIVE", "GPIO_MODE_GPIO"}, + {"GPIO_DIR_OUTPUT", "GPIO_DIR_INPUT"}, + {"GPIO_LEVEL_LOW", "GPIO_LEVEL_HIGH"}, + {"GPIO_RESET_PWROK", "GPIO_RESET_RSMRST"}, + {"GPIO_NO_INVERT", "GPIO_INVERT"}, + {"GPIO_NO_BLINK", "GPIO_BLINK"}, + } + + for i := uint(0); i < max; i++ { + if ((constraint>>i)&1 == 1) { + fmt.Fprintf(sb, " .gpio%d = %s,\n", + (set-1)*32+i, + bits[partno][(val>>i)&1]) + } + } +} + +func (b lynxpoint) GPIO(ctx Context, inteltool InteltoolData) { + var constraint uint32 + gpio := Create(ctx, "gpio.c") + defer gpio.Close() + + AddROMStageFile("gpio.c", "") + + Add_gpl(gpio) + gpio.WriteString("#include <southbridge/intel/common/gpio.h>\n\n") + + /* TODO: different in LP PCH */ + addresses := [3][6]int{ + {0x00, 0x04, 0x0c, 0x60, 0x2c, 0x18}, + {0x30, 0x34, 0x38, 0x64, -1, -1}, + {0x40, 0x44, 0x48, 0x68, -1, -1}, + } + + for set := 1; set <= 3; set++ { + for partno, part := range []string{"mode", "direction", "level", "reset", "invert", "blink"} { + addr := addresses[set-1][partno] + if addr < 0 { + continue + } + fmt.Fprintf(gpio, "static const struct pch_gpio_set%d pch_gpio_set%d_%s = {\n", + set, set, part) + + constraint = 0xffffffff + switch part { + case "direction": + /* Ignored on native mode */ + constraint = inteltool.GPIO[uint16(addresses[set-1][0])] + case "level": + /* Level doesn't matter for input */ + constraint = inteltool.GPIO[uint16(addresses[set-1][0])] + constraint &^= inteltool.GPIO[uint16(addresses[set-1][1])] + case "reset": + /* Only show reset */ + constraint = inteltool.GPIO[uint16(addresses[set-1][3])] + case "invert": + /* Only on input and only show inverted GPIO */ + constraint = inteltool.GPIO[uint16(addresses[set-1][0])] + constraint &= inteltool.GPIO[uint16(addresses[set-1][1])] + constraint &= inteltool.GPIO[uint16(addresses[set-1][4])] + case "blink": + /* Only on output and only show blinking GPIO */ + constraint = inteltool.GPIO[uint16(addresses[set-1][0])] + constraint &^= inteltool.GPIO[uint16(addresses[set-1][1])] + constraint &= inteltool.GPIO[uint16(addresses[set-1][5])] + } + b.writeGPIOSet(ctx, gpio, inteltool.GPIO[uint16(addr)], uint(set), partno, constraint) + gpio.WriteString("};\n\n") + } + } + + gpio.WriteString(`const struct pch_gpio_map mainboard_gpio_map = { + .set1 = { + .mode = &pch_gpio_set1_mode, + .direction = &pch_gpio_set1_direction, + .level = &pch_gpio_set1_level, + .blink = &pch_gpio_set1_blink, + .invert = &pch_gpio_set1_invert, + .reset = &pch_gpio_set1_reset, + }, + .set2 = { + .mode = &pch_gpio_set2_mode, + .direction = &pch_gpio_set2_direction, + .level = &pch_gpio_set2_level, + .reset = &pch_gpio_set2_reset, + }, + .set3 = { + .mode = &pch_gpio_set3_mode, + .direction = &pch_gpio_set3_direction, + .level = &pch_gpio_set3_level, + .reset = &pch_gpio_set3_reset, + }, +}; +`) +} + +func (b lynxpoint) IsPCIeHotplug(ctx Context, port int) bool { + portDev, ok := PCIMap[PCIAddr{Bus: 0, Dev: 0x1c, Func: port}] + if !ok { + return false + } + return (portDev.ConfigDump[0xdb] & (1 << 6)) != 0 +} + +func (b lynxpoint) GetGPIOHeader() string { + return "southbridge/intel/lynxpoint/pch.h" +} + +func (b lynxpoint) EnableGPE(in int) { + b.node.Registers[fmt.Sprintf("gpi%d_routing", in)] = "2" +} + +func (b lynxpoint) EncodeGPE(in int) int { + return in + 0x10 +} + +func (b lynxpoint) DecodeGPE(in int) int { + return in - 0x10 +} + +func (b lynxpoint) NeedRouteGPIOManually() { + b.node.Comment += ", FIXME: set gpiX_routing for EC support" +} + +func (b lynxpoint) Scan(ctx Context, addr PCIDevData) { + + SouthBridge = &b + + inteltool := ctx.InfoSource.GetInteltool() + b.GPIO(ctx, inteltool) + + KconfigBool["SOUTHBRIDGE_INTEL_LYNXPOINT"] = true + if b.variant == "Lynx Point LP" { + KconfigBool["INTEL_LYNXPOINT_LP"] = true + } + KconfigBool["SERIRQ_CONTINUOUS_MODE"] = true + KconfigInt["USBDEBUG_HCD_INDEX"] = 2 + KconfigComment["USBDEBUG_HCD_INDEX"] = "FIXME: check this" + dmi := ctx.InfoSource.GetDMI() + if dmi.Vendor == "LENOVO" { + KconfigInt["DRAM_RESET_GATE_GPIO"] = 10 + } else { + KconfigInt["DRAM_RESET_GATE_GPIO"] = 60 + } + KconfigComment["DRAM_RESET_GATE_GPIO"] = "FIXME: check this" + + /* Not strictly speaking correct. These subsys/subvendor referer to PCI devices. + But most systems don't have any of those. But the config needs to be set + nevertheless. So set it to southbridge subsys/subvendor. */ + KconfigHex["MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID"] = uint32(GetLE16(addr.ConfigDump[0x2c:0x2e])) + KconfigHex["MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID"] = uint32(GetLE16(addr.ConfigDump[0x2e:0x30])) + + ich9GetFlashSize(ctx) + + DSDTDefines = append(DSDTDefines, + DSDTDefine{ + Key: "BRIGHTNESS_UP", + Value: "\_SB.PCI0.GFX0.INCB", + }, + DSDTDefine{ + Key: "BRIGHTNESS_DOWN", + Value: "\_SB.PCI0.GFX0.DECB", + }, + DSDTDefine{ + Key: "ACPI_VIDEO_DEVICE", + Value: "\_SB.PCI0.GFX0", + }) + + /* SPI init */ + MainboardIncludes = append(MainboardIncludes, "southbridge/intel/lynxpoint/pch.h") + + cur := DevTreeNode{ + Chip: "southbridge/intel/lynxpoint", + Comment: "Intel Series 8 Lynx Point PCH", + + Registers: map[string]string{ + "pirqa_routing": FormatHex8(PCIMap[PCIAddr{Bus: 0, Dev: 0x1f, Func: 0}].ConfigDump[0x60]), + "pirqb_routing": FormatHex8(PCIMap[PCIAddr{Bus: 0, Dev: 0x1f, Func: 0}].ConfigDump[0x61]), + "pirqc_routing": FormatHex8(PCIMap[PCIAddr{Bus: 0, Dev: 0x1f, Func: 0}].ConfigDump[0x62]), + "pirqd_routing": FormatHex8(PCIMap[PCIAddr{Bus: 0, Dev: 0x1f, Func: 0}].ConfigDump[0x63]), + "pirqe_routing": FormatHex8(PCIMap[PCIAddr{Bus: 0, Dev: 0x1f, Func: 0}].ConfigDump[0x68]), + "pirqf_routing": FormatHex8(PCIMap[PCIAddr{Bus: 0, Dev: 0x1f, Func: 0}].ConfigDump[0x69]), + "pirqg_routing": FormatHex8(PCIMap[PCIAddr{Bus: 0, Dev: 0x1f, Func: 0}].ConfigDump[0x6a]), + "pirqh_routing": FormatHex8(PCIMap[PCIAddr{Bus: 0, Dev: 0x1f, Func: 0}].ConfigDump[0x6b]), + "sata_ahci": "1", + "gen1_dec": FormatHexLE32(PCIMap[PCIAddr{Bus: 0, Dev: 0x1f, Func: 0}].ConfigDump[0x84:0x88]), + "gen2_dec": FormatHexLE32(PCIMap[PCIAddr{Bus: 0, Dev: 0x1f, Func: 0}].ConfigDump[0x88:0x8c]), + "gen3_dec": FormatHexLE32(PCIMap[PCIAddr{Bus: 0, Dev: 0x1f, Func: 0}].ConfigDump[0x8c:0x90]), + "gen4_dec": FormatHexLE32(PCIMap[PCIAddr{Bus: 0, Dev: 0x1f, Func: 0}].ConfigDump[0x90:0x94]), + "sata_port_map": fmt.Sprintf("0x%x", PCIMap[PCIAddr{Bus: 0, Dev: 0x1f, Func: 2}].ConfigDump[0x92]&0x3f), + }, + PCISlots: []PCISlot{ + PCISlot{PCIAddr: PCIAddr{Dev: 0x14, Func: 0}, writeEmpty: false, additionalComment: "USB 3.0 Controller"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x16, Func: 0}, writeEmpty: true, additionalComment: "Management Engine Interface 1"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x16, Func: 1}, writeEmpty: true, additionalComment: "Management Engine Interface 2"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x16, Func: 2}, writeEmpty: true, additionalComment: "Management Engine IDE-R"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x16, Func: 3}, writeEmpty: true, additionalComment: "Management Engine KT"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x19, Func: 0}, writeEmpty: true, additionalComment: "Intel Gigabit Ethernet"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x1a, Func: 0}, writeEmpty: true, additionalComment: "USB2 EHCI #2"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x1b, Func: 0}, writeEmpty: true, additionalComment: "High Definition Audio"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x1c, Func: 0}, writeEmpty: true, additionalComment: "PCIe Port #1"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x1c, Func: 1}, writeEmpty: true, additionalComment: "PCIe Port #2"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x1c, Func: 2}, writeEmpty: true, additionalComment: "PCIe Port #3"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x1c, Func: 3}, writeEmpty: true, additionalComment: "PCIe Port #4"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x1c, Func: 4}, writeEmpty: true, additionalComment: "PCIe Port #5"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x1c, Func: 5}, writeEmpty: true, additionalComment: "PCIe Port #6"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x1c, Func: 6}, writeEmpty: true, additionalComment: "PCIe Port #7"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x1c, Func: 7}, writeEmpty: true, additionalComment: "PCIe Port #8"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x1d, Func: 0}, writeEmpty: true, additionalComment: "USB2 EHCI #1"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x1e, Func: 0}, writeEmpty: true, additionalComment: "PCI bridge"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x1f, Func: 0}, writeEmpty: true, additionalComment: "LPC bridge"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x1f, Func: 2}, writeEmpty: true, additionalComment: "SATA Controller 1"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x1f, Func: 3}, writeEmpty: true, additionalComment: "SMBus"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x1f, Func: 5}, writeEmpty: true, additionalComment: "SATA Controller 2"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x1f, Func: 6}, writeEmpty: true, additionalComment: "Thermal"}, + }, + } + + b.node = &cur + + PutPCIChip(addr, cur) + PutPCIDevParent(addr, "PCI-LPC bridge", "lpc") + + DSDTIncludes = append(DSDTIncludes, DSDTInclude{ + File: "southbridge/intel/lynxpoint/acpi/platform.asl", + }) + DSDTIncludes = append(DSDTIncludes, DSDTInclude{ + File: "southbridge/intel/lynxpoint/acpi/globalnvs.asl", + Comment: "global NVS and variables", + }) + DSDTIncludes = append(DSDTIncludes, DSDTInclude{ + File: "southbridge/intel/lynxpoint/acpi/sleepstates.asl", + }) + DSDTPCI0Includes = append(DSDTPCI0Includes, DSDTInclude{ + File: "southbridge/intel/lynxpoint/acpi/pch.asl", + }) + + sb := Create(ctx, "romstage.c") + defer sb.Close() + Add_gpl(sb) + sb.WriteString(`#include <stdint.h> +#include <cpu/intel/romstage.h> +#include <cpu/intel/haswell/haswell.h> +#include <northbridge/intel/haswell/haswell.h> +#include <northbridge/intel/haswell/pei_data.h> +#include <southbridge/intel/common/gpio.h> +#include <southbridge/intel/lynxpoint/pch.h> + +static const struct rcba_config_instruction rcba_config[] = { +`) + RestoreDIRRoute(sb, "D31IR", uint16(inteltool.RCBA[0x3140])) + RestoreDIRRoute(sb, "D29IR", uint16(inteltool.RCBA[0x3144])) + RestoreDIRRoute(sb, "D28IR", uint16(inteltool.RCBA[0x3146])) + RestoreDIRRoute(sb, "D27IR", uint16(inteltool.RCBA[0x3148])) + RestoreDIRRoute(sb, "D26IR", uint16(inteltool.RCBA[0x314c])) + RestoreDIRRoute(sb, "D25IR", uint16(inteltool.RCBA[0x3150])) + RestoreDIRRoute(sb, "D22IR", uint16(inteltool.RCBA[0x315c])) + RestoreDIRRoute(sb, "D20IR", uint16(inteltool.RCBA[0x3160])) + + sb.WriteString(` + RCBA_RMW_REG_32(FD, ~0, PCH_DISABLE_ALWAYS), + + RCBA_END_CONFIG, +};`) + + sb.WriteString(` + +void mainboard_config_superio(void) +{ +} + +void mainboard_romstage_entry(unsigned long bist) +{ + struct pei_data pei_data = { + .pei_version = PEI_VERSION, + .mchbar = (uintptr_t)DEFAULT_MCHBAR, + .dmibar = (uintptr_t)DEFAULT_DMIBAR, + .epbar = DEFAULT_EPBAR, + .pciexbar = DEFAULT_PCIEXBAR, + .smbusbar = SMBUS_IO_BASE, + .wdbbar = 0x4000000, + .wdbsize = 0x1000, + .hpet_address = HPET_ADDR, + .rcba = (uintptr_t)DEFAULT_RCBA, + .pmbase = DEFAULT_PMBASE, + .gpiobase = DEFAULT_GPIOBASE, + .temp_mmio_base = 0xfed08000, + .system_type = 1, /* desktop/server, FIXME: check this */ + .tseg_size = CONFIG_SMM_TSEG_SIZE, + .spd_addresses = { 0xa0, 0xa2, 0xa4, 0xa6 }, /* FIXME: check this */ + .ec_present = 0, + .dimm_channel0_disabled = 0, /* FIXME: leave channel 0 enabled */ + .dimm_channel1_disabled = 0, /* FIXME: leave channel 1 enabled */ + .max_ddr3_freq = 1600, + .usb2_ports = { + /* Length, Enable, OCn#, Location */ +`) + + pdo1 := PCIMap[PCIAddr{Bus: 0, Dev: 0x1d, Func: 0}].ConfigDump[0x64] + ocmap1 := PCIMap[PCIAddr{Bus: 0, Dev: 0x1d, Func: 0}].ConfigDump[0x74:0x78] + pdo2 := PCIMap[PCIAddr{Bus: 0, Dev: 0x1a, Func: 0}].ConfigDump[0x64] + ocmap2 := PCIMap[PCIAddr{Bus: 0, Dev: 0x1a, Func: 0}].ConfigDump[0x74:0x78] + + for port := uint(0); port < 14; port++ { + var port_oc int = -1 + var port_pos string + var port_disable uint8 + + if port < 8 { + port_disable = (pdo1 >> port) & 1 + for oc := 0; oc < 4; oc++ { + if ((ocmap1[oc] & (1 << port)) != 0) { + port_oc = oc + break + } + } + } else { + port_disable = (pdo2 >> (port - 8)) & 1 + for oc := 0; oc < 4; oc++ { + if ((ocmap2[oc] & (1 << (port - 8))) != 0) { + port_oc = oc + 4 + break + } + } + } + if port_disable == 1 { + port_pos = "USB_PORT_SKIP" + } else { + port_pos = "USB_PORT_BACK_PANEL" + } + if port_oc == -1 { + fmt.Fprintf(sb, " { 0x0040, %d, USB_OC_PIN_SKIP, %s },\n", + (port_disable ^ 1), port_pos) + } else { + fmt.Fprintf(sb, " { 0x0040, %d, %d, %s },\n", + (port_disable ^ 1), port_oc, port_pos) + } + } + + sb.WriteString(` }, + .usb3_ports = { +`) + + xpdo := PCIMap[PCIAddr{Bus: 0, Dev: 0x14, Func: 0}].ConfigDump[0xe8] + u3ocm := PCIMap[PCIAddr{Bus: 0, Dev: 0x14, Func: 0}].ConfigDump[0xc8:0xd0] + + for port := uint(0); port < 6; port++ { + var port_oc int = -1 + port_disable := (xpdo >> port) & 1 + for oc := 0; oc < 8; oc++ { + if (u3ocm[oc] & (1 << port)) != 0 { + port_oc = oc + break + } + } + if port_oc == -1 { + fmt.Fprintf(sb, " { %d, USB_OC_PIN_SKIP },\n", + (port_disable ^ 1)) + } else { + fmt.Fprintf(sb, " { %d, %d },\n", + (port_disable ^ 1), port_oc) + } + } + + sb.WriteString(` }, + }; + + struct romstage_params romstage_params = { + .pei_data = &pei_data, + .gpio_map = &mainboard_gpio_map, + .rcba_config = &rcba_config[0], + .bist = bist, + }; + + romstage_common(&romstage_params); +}`) + + gnvs := Create(ctx, "acpi_tables.c") + defer gnvs.Close() + + Add_gpl(gnvs) + gnvs.WriteString(`#include <southbridge/intel/lynxpoint/nvs.h> + +/* FIXME: check this function. */ +void acpi_create_gnvs(global_nvs_t *gnvs) +{ + /* Disable USB ports in S3 by default */ + gnvs->s3u0 = 0; + gnvs->s3u1 = 0; + + /* Disable USB ports in S5 by default */ + gnvs->s5u0 = 0; + gnvs->s5u1 = 0; + + // the lid is open by default. + gnvs->lids = 1; + + gnvs->tcrt = 100; + gnvs->tpsv = 90; +} +`) + +} + +func init() { + for _, id := range []uint16 { + 0x8c41, 0x8c49, 0x8c4b, 0x8c4f, + } { + RegisterPCI(0x8086, uint16(id), lynxpoint{variant: "Lynx Point Mobile"}) + } + + for _, id := range []uint16 { + 0x8c42, 0x8c44, 0x8c46, 0x8c4a, + 0x8c4c, 0x8c4e, 0x8c50, 0x8c5c, + } { + RegisterPCI(0x8086, uint16(id), lynxpoint{variant: "Lynx Point Desktop"}) + } + + for _, id := range []uint16 { + 0x8c52, 0x8c54, 0x8c56, + } { + RegisterPCI(0x8086, uint16(id), lynxpoint{variant: "Lynx Point Server"}) + } + + for _, id := range []uint16 { + 0x9c41, 0x9c43, 0x9c45, + } { + RegisterPCI(0x8086, uint16(id), lynxpoint{variant: "Lynx Point LP"}) + } + + /* PCIe bridge */ + for _, id := range []uint16{ + 0x8c10, 0x8c12, 0x8c14, 0x8c16, 0x8c18, 0x8c1a, 0x8c1c, 0x8c1e, + 0x9c10, 0x9c12, 0x9c14, 0x9c16, 0x9c18, 0x9c1a, + } { + RegisterPCI(0x8086, id, GenericPCI{}) + } + + /* SMBus controller */ + RegisterPCI(0x8086, 0x1c22, GenericPCI{MissingParent: "smbus"}) + RegisterPCI(0x8086, 0x1e22, GenericPCI{MissingParent: "smbus"}) + RegisterPCI(0x8086, 0x8c22, GenericPCI{MissingParent: "smbus"}) + RegisterPCI(0x8086, 0x9c22, GenericPCI{MissingParent: "smbus"}) + + /* SATA */ + for _, id := range []uint16{ + 0x8c00, 0x8c02, 0x8c04, 0x8c06, 0x8c08, 0x8c0e, + 0x8c01, 0x8c03, 0x8c05, 0x8c07, 0x8c09, 0x8c0f, + 0x9c03, 0x9c05, 0x9c07, 0x9c0f, + } { + RegisterPCI(0x8086, id, GenericPCI{}) + } + + /* EHCI */ + for _, id := range []uint16{ + 0x9c26, 0x8c26, 0x8c2d, + } { + RegisterPCI(0x8086, id, GenericPCI{}) + } + + /* XHCI */ + RegisterPCI(0x8086, 0x8c31, GenericPCI{}) + RegisterPCI(0x8086, 0x9c31, GenericPCI{}) + + /* ME and children */ + for _, id := range []uint16{ + 0x8c3a, 0x8c3b, + } { + RegisterPCI(0x8086, id, GenericPCI{}) + } + + /* Ethernet */ + RegisterPCI(0x8086, 0x8c33, GenericPCI{}) +} diff --git a/util/autoport/main.go b/util/autoport/main.go index 05a829b..c1920a7 100644 --- a/util/autoport/main.go +++ b/util/autoport/main.go @@ -236,6 +236,12 @@ pcidev.ConfigDump[addr]) }
+func RestoreDIRRoute(f *os.File, regname string, val uint16) { + fmt.Fprintf(f, " RCBA_SET_REG_16(%s, DIR_ROUTE(PIRQ%c, PIRQ%c, PIRQ%c, PIRQ%c)),\n", + regname, 'A' + (val & 7), 'A' + ((val >> 4) & 7), + 'A' + ((val >> 8) & 7), 'A' + ((val >> 12) & 7)) +} + func RestorePCI32Simple(f *os.File, pcidev PCIDevData, addr uint16) { fmt.Fprintf(f, " pci_write_config32(PCI_DEV(%d, 0x%02x, %d), 0x%02x, 0x%02x%02x%02x%02x);\n", pcidev.Bus, pcidev.Dev, pcidev.Func, addr,
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/#/c/30890/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/#/c/30890/1//COMMIT_MSG@12 PS1, Line 12: Support Lynx Point LP (GPIO registers differ from non-LP) I have some C code here: https://github.com/Th3Fanbus/gpio-scripts/blob/master/hswgpio.c
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 1: Code-Review+1
Looks good, I may try it on asus/x555la if I have time.
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 1:
(2 comments)
https://review.coreboot.org/#/c/30890/1/util/autoport/lynxpoint.go File util/autoport/lynxpoint.go:
https://review.coreboot.org/#/c/30890/1/util/autoport/lynxpoint.go@228 PS1, Line 228: PCISlot{PCIAddr: PCIAddr{Dev: 0x1c, Func: 6}, writeEmpty: true, additionalComment: "PCIe Port #7"}, : PCISlot{PCIAddr: PCIAddr{Dev: 0x1c, Func: 7}, writeEmpty: true, additionalComment: "PCIe Port #8"}, These only exist on some variants. See int max_root_ports(void) in sb/intel/lynxpoint/pcie.c
https://review.coreboot.org/#/c/30890/1/util/autoport/lynxpoint.go@272 PS1, Line 272: RestoreDIRRoute(sb, "D31IR", uint16(inteltool.RCBA[0x3140])) : RestoreDIRRoute(sb, "D29IR", uint16(inteltool.RCBA[0x3144])) : RestoreDIRRoute(sb, "D28IR", uint16(inteltool.RCBA[0x3146])) : RestoreDIRRoute(sb, "D27IR", uint16(inteltool.RCBA[0x3148])) : RestoreDIRRoute(sb, "D26IR", uint16(inteltool.RCBA[0x314c])) : RestoreDIRRoute(sb, "D25IR", uint16(inteltool.RCBA[0x3150])) : RestoreDIRRoute(sb, "D22IR", uint16(inteltool.RCBA[0x315c])) : RestoreDIRRoute(sb, "D20IR", uint16(inteltool.RCBA[0x3160])) I typically leave this to reset default, or use the defaults on my platform. The ACPI _PRT tables are automatically generated so up to you if you want it here.
Tristan Corrick has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 1:
(15 comments)
Thanks for doing this!
https://review.coreboot.org/#/c/30890/1/util/autoport/azalia.go File util/autoport/azalia.go:
https://review.coreboot.org/#/c/30890/1/util/autoport/azalia.go@66 PS1, Line 66: RegisterPCI(0x8086, 0x0c0c, azalia{}) Mini-HD audio config is hardcoded in `nb/intel/haswell/minihd.c`. Is there a case where a different config is preferable?
https://review.coreboot.org/#/c/30890/1/util/autoport/haswell.go File util/autoport/haswell.go:
https://review.coreboot.org/#/c/30890/1/util/autoport/haswell.go@92 PS1, Line 92: Non-ULT boards will need to select `TSC_MONOTONIC_TIMER` to boot. They will also need to set `GFX_GMA_CPU_VARIANT` to "Normal" to get libgfxinit working, at least until the dynamic CPU detection patches are merged.
https://review.coreboot.org/#/c/30890/1/util/autoport/lynxpoint.go File util/autoport/lynxpoint.go:
https://review.coreboot.org/#/c/30890/1/util/autoport/lynxpoint.go@2 PS1, Line 2: A lot of this code (especially the GPIO stuff) is the same as bd82x6x. It would be great to see a common implementation shared between the two, instead of duplicated code.
https://review.coreboot.org/#/c/30890/1/util/autoport/lynxpoint.go@161 PS1, Line 161: if dmi.Vendor == "LENOVO" { : KconfigInt["DRAM_RESET_GATE_GPIO"] = 10 : } else { : KconfigInt["DRAM_RESET_GATE_GPIO"] = 60 : } : KconfigComment["DRAM_RESET_GATE_GPIO"] = "FIXME: check this" Lynx Point doesn't currently implement handling of DRAM_RESET_GATE_GPIO.
https://review.coreboot.org/#/c/30890/1/util/autoport/lynxpoint.go@189 PS1, Line 189: : /* SPI init */ : MainboardIncludes = append(MainboardIncludes, "southbridge/intel/lynxpoint/pch.h") This isn't needed, I think.
https://review.coreboot.org/#/c/30890/1/util/autoport/lynxpoint.go@211 PS1, Line 211: "sata_port_map": fmt.Sprintf("0x%x", PCIMap[PCIAddr{Bus: 0, Dev: 0x1f, Func: 2}].ConfigDump[0x92]&0x3f), I think this should go next to the other SATA register.
https://review.coreboot.org/#/c/30890/1/util/autoport/lynxpoint.go@214 PS1, Line 214: USB 3.0 Better to say xHCI controller.
https://review.coreboot.org/#/c/30890/1/util/autoport/lynxpoint.go@231 PS1, Line 231: PCISlot{PCIAddr: PCIAddr{Dev: 0x1e, Func: 0}, writeEmpty: true, additionalComment: "PCI bridge"}, Doesn't exist on Lynx Point.
https://review.coreboot.org/#/c/30890/1/util/autoport/lynxpoint.go@311 PS1, Line 311: FIXME: check this Perhaps mention somewhere that mrc.bin expects the SPD addresses left- shifted by 1.
https://review.coreboot.org/#/c/30890/1/util/autoport/lynxpoint.go@320 PS1, Line 320: pdo1 := PCIMap[PCIAddr{Bus: 0, Dev: 0x1d, Func: 0}].ConfigDump[0x64] : ocmap1 := PCIMap[PCIAddr{Bus: 0, Dev: 0x1d, Func: 0}].ConfigDump[0x74:0x78] : pdo2 := PCIMap[PCIAddr{Bus: 0, Dev: 0x1a, Func: 0}].ConfigDump[0x64] : ocmap2 := PCIMap[PCIAddr{Bus: 0, Dev: 0x1a, Func: 0}].ConfigDump[0x74:0x78] It's possible for the USB 2 ports to be routed to the xHCI controller, and in that case the EHCI controller(s) may be disabled, or the EHCI PDO/OCMAP invalid. I think it would be best to check the register XUSB2PR of the xHCI device to see which ports are routed where, and use that to decide, for each port, which device's OCMAP and PDO to use.
Also, LP only has a single EHCI controller: 0x1d.
https://review.coreboot.org/#/c/30890/1/util/autoport/lynxpoint.go@356 PS1, Line 356: 0x0040 Sometimes the USB port might need a greater value here, if the trace length is long enough. I experienced an error on my X10SLM+-F with 0x40 set, causing FreeBSD to crash while running rsync. It did take multiple terabytes of transfer to manifest. I haven't experienced it again after setting it to 0x110, so I'm reasonably confident that this setting does have an effect.
Documentation about this setting was actually removed a while ago, with commit b1c25e74af0a. Hopefully the description of the setting there is (still) accurate.
https://review.coreboot.org/#/c/30890/1/util/autoport/lynxpoint.go@392 PS1, Line 392: &rcba_config[0] Just `rcba_config` should be fine.
https://review.coreboot.org/#/c/30890/1/util/autoport/lynxpoint.go@461 PS1, Line 461: RegisterPCI(0x8086, 0x1c22, GenericPCI{MissingParent: "smbus"}) : RegisterPCI(0x8086, 0x1e22, GenericPCI{MissingParent: "smbus"}) These are for Cougar/Panther Point, not Lynx Point.
https://review.coreboot.org/#/c/30890/1/util/autoport/lynxpoint.go@488 PS1, Line 488: 0x8c3a, 0x8c3b, Also 0x8c3c, 0x8c3d, 0x9c3a, 0x9c3b, 0x9c3c, 0x9c3d.
https://review.coreboot.org/#/c/30890/1/util/autoport/lynxpoint.go@494 PS1, Line 494: RegisterPCI(0x8086, 0x8c33, GenericPCI{}) Some boards may have the thermal device 1f.6 (0x8c24) enabled.
LP boards can have a few more:
LAN: 0x155a (but it can vary depending on an EEPROM), SDIO: 0x9c35, "Intel(R) Smart Sound Technology": 0x9c36, Serial I/O: 0x9c6{0..6}.
Hello Iru Cai, Angel Pons, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/30890
to look at the new patch set (#2).
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
autoport: Add support for Haswell-LynxPoint platform
It can now generate a buildable source for Clevo W650SZ.
TODO: - Support Lynx Point LP (GPIO registers differ from non-LP) - Use PCH HD-Audio in azilia instead of the CPU/Northbridge HD-Audio
Change-Id: I4f6e8c97b5122101de2f36bba8ba9f8ddd5b813a Signed-off-by: Iru Cai mytbk920423@gmail.com --- M util/autoport/azalia.go A util/autoport/haswell.go A util/autoport/lynxpoint.go M util/autoport/main.go 4 files changed, 636 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/30890/2
Iru Cai (vimacs) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 2:
(10 comments)
https://review.coreboot.org/#/c/30890/1/util/autoport/lynxpoint.go File util/autoport/lynxpoint.go:
https://review.coreboot.org/#/c/30890/1/util/autoport/lynxpoint.go@161 PS1, Line 161: if dmi.Vendor == "LENOVO" { : KconfigInt["DRAM_RESET_GATE_GPIO"] = 10 : } else { : KconfigInt["DRAM_RESET_GATE_GPIO"] = 60 : } : KconfigComment["DRAM_RESET_GATE_GPIO"] = "FIXME: check this"
Lynx Point doesn't currently implement handling of DRAM_RESET_GATE_GPIO.
Done
https://review.coreboot.org/#/c/30890/1/util/autoport/lynxpoint.go@189 PS1, Line 189: : /* SPI init */ : MainboardIncludes = append(MainboardIncludes, "southbridge/intel/lynxpoint/pch.h")
This isn't needed, I think.
Done
https://review.coreboot.org/#/c/30890/1/util/autoport/lynxpoint.go@211 PS1, Line 211: "sata_port_map": fmt.Sprintf("0x%x", PCIMap[PCIAddr{Bus: 0, Dev: 0x1f, Func: 2}].ConfigDump[0x92]&0x3f),
I think this should go next to the other SATA register.
Done
https://review.coreboot.org/#/c/30890/1/util/autoport/lynxpoint.go@214 PS1, Line 214: USB 3.0
Better to say xHCI controller.
Done
https://review.coreboot.org/#/c/30890/1/util/autoport/lynxpoint.go@231 PS1, Line 231: PCISlot{PCIAddr: PCIAddr{Dev: 0x1e, Func: 0}, writeEmpty: true, additionalComment: "PCI bridge"},
Doesn't exist on Lynx Point.
Done
https://review.coreboot.org/#/c/30890/1/util/autoport/lynxpoint.go@272 PS1, Line 272: RestoreDIRRoute(sb, "D31IR", uint16(inteltool.RCBA[0x3140])) : RestoreDIRRoute(sb, "D29IR", uint16(inteltool.RCBA[0x3144])) : RestoreDIRRoute(sb, "D28IR", uint16(inteltool.RCBA[0x3146])) : RestoreDIRRoute(sb, "D27IR", uint16(inteltool.RCBA[0x3148])) : RestoreDIRRoute(sb, "D26IR", uint16(inteltool.RCBA[0x314c])) : RestoreDIRRoute(sb, "D25IR", uint16(inteltool.RCBA[0x3150])) : RestoreDIRRoute(sb, "D22IR", uint16(inteltool.RCBA[0x315c])) : RestoreDIRRoute(sb, "D20IR", uint16(inteltool.RCBA[0x3160]))
I typically leave this to reset default, or use the defaults on my platform. […]
I see google/slippy/variants/peppy also writes DxxIP registers. I still don't know which are needed.
https://review.coreboot.org/#/c/30890/1/util/autoport/lynxpoint.go@356 PS1, Line 356: 0x0040
Sometimes the USB port might need a greater value here, if the trace […]
I saw in mrc.bin that the position and length are computed to another value, then written to IOBP. But currently there isn't a tool to read IOBP registers.
https://review.coreboot.org/#/c/30890/1/util/autoport/lynxpoint.go@392 PS1, Line 392: &rcba_config[0]
Just `rcba_config` should be fine.
Done
https://review.coreboot.org/#/c/30890/1/util/autoport/lynxpoint.go@461 PS1, Line 461: RegisterPCI(0x8086, 0x1c22, GenericPCI{MissingParent: "smbus"}) : RegisterPCI(0x8086, 0x1e22, GenericPCI{MissingParent: "smbus"})
These are for Cougar/Panther Point, not Lynx Point.
Oh, I just copied these IDs from lynxpoint/smbus.c, and didn't check the document.
https://review.coreboot.org/#/c/30890/1/util/autoport/lynxpoint.go@488 PS1, Line 488: 0x8c3a, 0x8c3b,
Also 0x8c3c, 0x8c3d, 0x9c3a, 0x9c3b, 0x9c3c, 0x9c3d.
Done
Tristan Corrick has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/#/c/30890/1/util/autoport/lynxpoint.go File util/autoport/lynxpoint.go:
https://review.coreboot.org/#/c/30890/1/util/autoport/lynxpoint.go@272 PS1, Line 272: RestoreDIRRoute(sb, "D31IR", uint16(inteltool.RCBA[0x3140])) : RestoreDIRRoute(sb, "D29IR", uint16(inteltool.RCBA[0x3144])) : RestoreDIRRoute(sb, "D28IR", uint16(inteltool.RCBA[0x3146])) : RestoreDIRRoute(sb, "D27IR", uint16(inteltool.RCBA[0x3148])) : RestoreDIRRoute(sb, "D26IR", uint16(inteltool.RCBA[0x314c])) : RestoreDIRRoute(sb, "D25IR", uint16(inteltool.RCBA[0x3150])) : RestoreDIRRoute(sb, "D22IR", uint16(inteltool.RCBA[0x315c])) : RestoreDIRRoute(sb, "D20IR", uint16(inteltool.RCBA[0x3160]))
I see google/slippy/variants/peppy also writes DxxIP registers. I still don't know which are needed.
DxxIR and DxxIP are only useful to support legacy interrupt routing. I'm not aware of a major, mainstream OS that uses legacy interrupt routing by default. It would be fine to leave these registers at their reset defaults. As far as I know, legacy interrupt routing should still work in that case, but the interrupts might not be balanced very well.
Lynx Point could benefit from making this config PCH-specific instead of board-specific, as was done in commit 33b535f15ded for earlier PCHs.
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/#/c/30890/1/util/autoport/lynxpoint.go File util/autoport/lynxpoint.go:
https://review.coreboot.org/#/c/30890/1/util/autoport/lynxpoint.go@311 PS1, Line 311: FIXME: check this
Perhaps mention somewhere that mrc.bin expects the SPD addresses left- […]
Yup, I was caught unawares by this.
Hello Iru Cai, Angel Pons, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/30890
to look at the new patch set (#3).
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
autoport: Add support for Haswell-LynxPoint platform
It can now generate a buildable source for Clevo W650SZ.
TODO: - Support Lynx Point LP (GPIO registers differ from non-LP) - Use PCH HD-Audio in azilia instead of the CPU/Northbridge HD-Audio
Change-Id: I4f6e8c97b5122101de2f36bba8ba9f8ddd5b813a Signed-off-by: Iru Cai mytbk920423@gmail.com --- M util/autoport/azalia.go A util/autoport/haswell.go A util/autoport/lynxpoint.go M util/autoport/main.go 4 files changed, 637 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/30890/3
Hello Iru Cai, Angel Pons, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/30890
to look at the new patch set (#4).
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
autoport: Add support for Haswell-LynxPoint platform
It can now generate a buildable source for Clevo W650SZ.
TODO: - Support Lynx Point LP (GPIO registers differ from non-LP) - Use PCH HD-Audio in azilia instead of the CPU/Northbridge HD-Audio
Change-Id: I4f6e8c97b5122101de2f36bba8ba9f8ddd5b813a Signed-off-by: Iru Cai mytbk920423@gmail.com --- M util/autoport/azalia.go A util/autoport/haswell.go A util/autoport/lynxpoint.go M util/autoport/main.go 4 files changed, 637 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/30890/4
Iru Cai (vimacs) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 4:
(5 comments)
https://review.coreboot.org/#/c/30890/1/util/autoport/haswell.go File util/autoport/haswell.go:
https://review.coreboot.org/#/c/30890/1/util/autoport/haswell.go@92 PS1, Line 92:
Non-ULT boards will need to select `TSC_MONOTONIC_TIMER` to boot. They […]
Done
https://review.coreboot.org/#/c/30890/1/util/autoport/lynxpoint.go File util/autoport/lynxpoint.go:
https://review.coreboot.org/#/c/30890/1/util/autoport/lynxpoint.go@311 PS1, Line 311: FIXME: check this
Yup, I was caught unawares by this.
Done
https://review.coreboot.org/#/c/30890/1/util/autoport/lynxpoint.go@320 PS1, Line 320: pdo1 := PCIMap[PCIAddr{Bus: 0, Dev: 0x1d, Func: 0}].ConfigDump[0x64] : ocmap1 := PCIMap[PCIAddr{Bus: 0, Dev: 0x1d, Func: 0}].ConfigDump[0x74:0x78] : pdo2 := PCIMap[PCIAddr{Bus: 0, Dev: 0x1a, Func: 0}].ConfigDump[0x64] : ocmap2 := PCIMap[PCIAddr{Bus: 0, Dev: 0x1a, Func: 0}].ConfigDump[0x74:0x78]
It's possible for the USB 2 ports to be routed to the xHCI controller, […]
Done
https://review.coreboot.org/#/c/30890/1/util/autoport/lynxpoint.go@461 PS1, Line 461: RegisterPCI(0x8086, 0x1c22, GenericPCI{MissingParent: "smbus"}) : RegisterPCI(0x8086, 0x1e22, GenericPCI{MissingParent: "smbus"})
Oh, I just copied these IDs from lynxpoint/smbus.c, and didn't check the document.
Done
https://review.coreboot.org/#/c/30890/1/util/autoport/lynxpoint.go@494 PS1, Line 494: RegisterPCI(0x8086, 0x8c33, GenericPCI{})
Some boards may have the thermal device 1f.6 (0x8c24) enabled. […]
Done
Hello Iru Cai, Angel Pons, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/30890
to look at the new patch set (#5).
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
autoport: Add support for Haswell-LynxPoint platform
It can now generate a working source code for Clevo W650SZ.
TODO: - Support Lynx Point LP (GPIO registers differ from non-LP) - Use PCH HD-Audio in azilia instead of the CPU/Northbridge HD-Audio
Change-Id: I4f6e8c97b5122101de2f36bba8ba9f8ddd5b813a Signed-off-by: Iru Cai mytbk920423@gmail.com --- M util/autoport/azalia.go A util/autoport/haswell.go A util/autoport/lynxpoint.go M util/autoport/main.go 4 files changed, 631 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/30890/5
Hello Iru Cai, Angel Pons, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/30890
to look at the new patch set (#6).
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
autoport: Add support for Haswell-LynxPoint platform
It can now generate a working source code for Clevo W650SZ.
TODO: - Support Lynx Point LP (GPIO registers differ from non-LP)
Change-Id: I4f6e8c97b5122101de2f36bba8ba9f8ddd5b813a Signed-off-by: Iru Cai mytbk920423@gmail.com --- M util/autoport/azalia.go A util/autoport/haswell.go A util/autoport/lynxpoint.go M util/autoport/main.go 4 files changed, 627 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/30890/6
Daniel Maslowski has uploaded a new patch set (#8) to the change originally created by Iru Cai (vimacs). ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
autoport: Add support for Haswell-LynxPoint platform
It can now generate a buildable source for Clevo W650SZ.
TODO: - Support Lynx Point LP (GPIO registers differ from non-LP) - Use PCH HD-Audio in azilia instead of the CPU/Northbridge HD-Audio
Change-Id: I4f6e8c97b5122101de2f36bba8ba9f8ddd5b813a Signed-off-by: Iru Cai mytbk920423@gmail.com --- M util/autoport/azalia.go A util/autoport/haswell.go A util/autoport/lynxpoint.go M util/autoport/main.go 4 files changed, 636 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/30890/8
Iru Cai (vimacs) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 8:
Daniel Maslowski, you uploaded the patch set 2, which is outdated.
Daniel Maslowski has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 8:
Patch Set 8:
Daniel Maslowski, you uploaded the patch set 2, which is outdated.
Yeah I'm sorry, didn't intend that. I'm not used to Gerrit and didn't know how to fix it.
Christoph Pomaska has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 10:
The commit fails to recognize the PCIe bridge on ASUS H81M-K: 8086:0c01
Christoph Pomaska has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 10:
Patch Set 10:
The commit fails to recognize the PCIe bridge on ASUS H81M-K: 8086:0c01
I quick-fixed it by adding: `RegisterPCI(0x8086, 0x0c01, GenericPCI{})` behind the loop for the VGA controller
Christoph Pomaska has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 10:
Patch Set 10:
Patch Set 10:
The commit fails to recognize the PCIe bridge on ASUS H81M-K: 8086:0c01
I quick-fixed it by adding: `RegisterPCI(0x8086, 0x0c01, GenericPCI{})` behind the loop for the VGA controller
Sorry for dumbtalk: Autoport still runs into an "Index out of range" error...
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 10:
(2 comments)
Patch Set 10:
Patch Set 10:
Patch Set 10:
The commit fails to recognize the PCIe bridge on ASUS H81M-K: 8086:0c01
I quick-fixed it by adding: `RegisterPCI(0x8086, 0x0c01, GenericPCI{})` behind the loop for the VGA controller
Sorry for dumbtalk: Autoport still runs into an "Index out of range" error...
Um, why would you add a host bridge PCI ID to the VGA controller IDs?
https://review.coreboot.org/c/coreboot/+/30890/10/util/autoport/haswell.go File util/autoport/haswell.go:
https://review.coreboot.org/c/coreboot/+/30890/10/util/autoport/haswell.go@3... PS10, Line 35: "gfx.did": "{ 0x80000100, 0x80000240, 0x80000410, 0x80000410, 0x00000005 }", if you hardcode this, at least make it consistent with the gfx.ndid value
https://review.coreboot.org/c/coreboot/+/30890/10/util/autoport/lynxpoint.go File util/autoport/lynxpoint.go:
https://review.coreboot.org/c/coreboot/+/30890/10/util/autoport/lynxpoint.go... PS10, Line 401: // the lid is open by default. Please use consistent comments in generated code
Iru Cai (vimacs) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 10:
Patch Set 10:
Patch Set 10:
Patch Set 10:
The commit fails to recognize the PCIe bridge on ASUS H81M-K: 8086:0c01
I quick-fixed it by adding: `RegisterPCI(0x8086, 0x0c01, GenericPCI{})` behind the loop for the VGA controller
Sorry for dumbtalk: Autoport still runs into an "Index out of range" error...
Is this caused by the big DSDT table? You can try https://review.coreboot.org/c/coreboot/+/31759.
Christoph Pomaska has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 10:
Patch Set 10:
Patch Set 10:
Patch Set 10:
Patch Set 10:
The commit fails to recognize the PCIe bridge on ASUS H81M-K: 8086:0c01
I quick-fixed it by adding: `RegisterPCI(0x8086, 0x0c01, GenericPCI{})` behind the loop for the VGA controller
Sorry for dumbtalk: Autoport still runs into an "Index out of range" error...
Is this caused by the big DSDT table? You can try https://review.coreboot.org/c/coreboot/+/31759.
Nope, that didnt fix it. Log output:
panic: runtime error: index out of range
goroutine 1 [running]: main.lynxpoint.Scan(0x540a28, 0x12, 0x0, 0xc000012ce0, 0xf, 0xc000132100, 0x15, 0xc00001174f, 0x4, 0xc00001176f, ...) /home/sellerie/git/coreboot/util/autoport/lynxpoint.go:311 +0x2893 main.ScanRoot(0xc000012ce0, 0xf, 0xc000132100, 0x15, 0xc00001174f, 0x4, 0xc00001176f, 0xa, 0xc000132120, 0x1f, ...) /home/sellerie/git/coreboot/util/autoport/root.go:28 +0x319 main.main() /home/sellerie/git/coreboot/util/autoport/main.go:758 +0x5eb
Hello build bot (Jenkins), Angel Pons, Iru Cai,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/30890
to look at the new patch set (#11).
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
autoport: Add support for Haswell-LynxPoint platform
It can generate a working source code for Clevo W650SZ and Lenovo ThinkPad T440p.
Patchset 11: some fix up for the current coreboot code and LP PCH - calculate backlight frequency according in the latest Haswell devicetree - there's some small difference in reading flash chip size for LP PCH - only output 8 USB ports for LP PCH
Unresolved issues: - Should we use DxxIR registers from the machine running factory firmware?
TODO: - Support Lynx Point LP - GPIO - GPE support - Detect and generate the lengths and locations of the USB2 ports (need to read IOBP registers)
Change-Id: I4f6e8c97b5122101de2f36bba8ba9f8ddd5b813a Signed-off-by: Iru Cai mytbk920423@gmail.com --- M util/autoport/azalia.go A util/autoport/haswell.go A util/autoport/lynxpoint.go M util/autoport/main.go 4 files changed, 668 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/30890/11
Daniel Maslowski has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 11: Code-Review+1
I've used it the other day to bootstrap https://github.com/orangecms/coreboot/tree/lifebook-e734/ which got me compiling sources and so far I could get to the bootblock at least.
The only addition I made for my board is adding `RegisterPCI(0x8086, 0x153b, GenericPCI{})` for the Intel Corporation Ethernet Connection I217-V card.
Thank you for the great work! :)
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 11:
(12 comments)
https://review.coreboot.org/c/coreboot/+/30890/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/30890/1//COMMIT_MSG@12 PS1, Line 12: Support Lynx Point LP (GPIO registers differ from non-LP)
I have some C code here: https://github.com/Th3Fanbus/gpio-scripts/blob/master/hswgpio. […]
Ack
https://review.coreboot.org/c/coreboot/+/30890/10/util/autoport/haswell.go File util/autoport/haswell.go:
https://review.coreboot.org/c/coreboot/+/30890/10/util/autoport/haswell.go@3... PS10, Line 35: "gfx.did": "{ 0x80000100, 0x80000240, 0x80000410, 0x80000410, 0x00000005 }",
if you hardcode this, at least make it consistent with the gfx. […]
Done
https://review.coreboot.org/c/coreboot/+/30890/11/util/autoport/haswell.go File util/autoport/haswell.go:
https://review.coreboot.org/c/coreboot/+/30890/11/util/autoport/haswell.go@1... PS11, Line 109: File: "drivers/intel/gma/acpi/default_brightness_levels.asl", FIXME: This is not necessary if the board doesn't have backlight
https://review.coreboot.org/c/coreboot/+/30890/1/util/autoport/lynxpoint.go File util/autoport/lynxpoint.go:
https://review.coreboot.org/c/coreboot/+/30890/1/util/autoport/lynxpoint.go@... PS1, Line 228: PCISlot{PCIAddr: PCIAddr{Dev: 0x1c, Func: 6}, writeEmpty: true, additionalComment: "PCIe Port #7"}, : PCISlot{PCIAddr: PCIAddr{Dev: 0x1c, Func: 7}, writeEmpty: true, additionalComment: "PCIe Port #8"},
These only exist on some variants. See int max_root_ports(void) in sb/intel/lynxpoint/pcie. […]
We're not handling this for sandybridge
https://review.coreboot.org/c/coreboot/+/30890/1/util/autoport/lynxpoint.go@... PS1, Line 356: 0x0040
I saw in mrc.bin that the position and length are computed to another value, then written to IOBP. […]
These values depend on the trace lengths for USB and are documented somewhere, I think
https://review.coreboot.org/c/coreboot/+/30890/11/util/autoport/lynxpoint.go File util/autoport/lynxpoint.go:
https://review.coreboot.org/c/coreboot/+/30890/11/util/autoport/lynxpoint.go... PS11, Line 188: DSDTDefine{ : Key: "BRIGHTNESS_UP", : Value: "\_SB.PCI0.GFX0.INCB", : }, : DSDTDefine{ : Key: "BRIGHTNESS_DOWN", : Value: "\_SB.PCI0.GFX0.DECB", : }, : DSDTDefine{ : Key: "ACPI_VIDEO_DEVICE", : Value: "\_SB.PCI0.GFX0", : }) Those should be removed as they are unused in most cases
https://review.coreboot.org/c/coreboot/+/30890/11/util/autoport/lynxpoint.go... PS11, Line 240: SATA Controller 1 SATA Controller (AHCI)
https://review.coreboot.org/c/coreboot/+/30890/11/util/autoport/lynxpoint.go... PS11, Line 242: SATA Controller 2 SATA Controller (Legacy)
https://review.coreboot.org/c/coreboot/+/30890/11/util/autoport/lynxpoint.go... PS11, Line 250: PCI-LPC bridge Drop this part, it will result in "LPC bridge PCI-LPC bridge"
https://review.coreboot.org/c/coreboot/+/30890/11/util/autoport/lynxpoint.go... PS11, Line 309: .wdbbar = 0x4000000, : .wdbsize = 0x1000, These should not be needed at all
https://review.coreboot.org/c/coreboot/+/30890/11/util/autoport/lynxpoint.go... PS11, Line 426: : /* Disable USB ports in S3 by default */ : gnvs->s3u0 = 0; : gnvs->s3u1 = 0; : : /* Disable USB ports in S5 by default */ : gnvs->s5u0 = 0; : gnvs->s5u1 = 0; Drop these
https://review.coreboot.org/c/coreboot/+/30890/11/util/autoport/lynxpoint.go... PS11, Line 435: // the lid is open by default. /* The lid is open by default. FIXME: Not on desktops? */
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 11:
(1 comment)
https://review.coreboot.org/c/coreboot/+/30890/11/util/autoport/haswell.go File util/autoport/haswell.go:
https://review.coreboot.org/c/coreboot/+/30890/11/util/autoport/haswell.go@3... PS11, Line 39: FormatInt32(refclk / 128 / (inteltool.IGD[0xc8254] >> 16)) This results in a division by zero on desktop boards.
Hello build bot (Jenkins), Daniel Maslowski, Angel Pons, Iru Cai,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/30890
to look at the new patch set (#12).
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
autoport: Add support for Haswell-LynxPoint platform
It can generate a working source code for Clevo W650SZ and Lenovo ThinkPad T440p.
Patchset 12: - some fix up with the latest coreboot code - fill lengths and locations USB2 ports - LP GPIO
Unresolved issues: - Should we use DxxIR registers from the machine running factory firmware?
TODO: - Support Lynx Point LP - GPE support - Remove duplicated non-LP GPIO code generation code
Change-Id: I4f6e8c97b5122101de2f36bba8ba9f8ddd5b813a Signed-off-by: Iru Cai mytbk920423@gmail.com --- M util/autoport/azalia.go A util/autoport/haswell.go M util/autoport/log_reader.go A util/autoport/lynxpoint.go M util/autoport/main.go 5 files changed, 857 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/30890/12
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 12:
(3 comments)
https://review.coreboot.org/c/coreboot/+/30890/11/util/autoport/lynxpoint.go File util/autoport/lynxpoint.go:
https://review.coreboot.org/c/coreboot/+/30890/11/util/autoport/lynxpoint.go... PS11, Line 188: DSDTDefine{ : Key: "BRIGHTNESS_UP", : Value: "\_SB.PCI0.GFX0.INCB", : }, : DSDTDefine{ : Key: "BRIGHTNESS_DOWN", : Value: "\_SB.PCI0.GFX0.DECB", : }, : DSDTDefine{ : Key: "ACPI_VIDEO_DEVICE", : Value: "\_SB.PCI0.GFX0", : })
Those should be removed as they are unused in most cases
I meant all three values.
https://review.coreboot.org/c/coreboot/+/30890/11/util/autoport/lynxpoint.go... PS11, Line 309: .wdbbar = 0x4000000, : .wdbsize = 0x1000,
These should not be needed at all
Done
https://review.coreboot.org/c/coreboot/+/30890/12/util/autoport/lynxpoint.go File util/autoport/lynxpoint.go:
https://review.coreboot.org/c/coreboot/+/30890/12/util/autoport/lynxpoint.go... PS12, Line 128: switch g { The indentation is rather odd here
Hello build bot (Jenkins), Daniel Maslowski, Angel Pons, Iru Cai,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/30890
to look at the new patch set (#13).
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
autoport: Add support for Haswell-LynxPoint platform
It can generate working source code for: - Haswell mobile: Clevo W650SZ, Lenovo ThinkPad T440p (merged) - Haswell ULT: Dell Latitude E7240
Patchset 12, 13: - some fix up with the latest coreboot code - fill lengths and locations USB2 ports - LP GPIO
Unresolved issues: - Should we use DxxIR registers from the machine running factory firmware?
TODO: - Lynx Point LP - GPE registers in device tree - Trim down the LP GPIO output
Change-Id: I4f6e8c97b5122101de2f36bba8ba9f8ddd5b813a Signed-off-by: Iru Cai mytbk920423@gmail.com --- M util/autoport/azalia.go M util/autoport/bd82x6x.go A util/autoport/haswell.go M util/autoport/log_reader.go A util/autoport/lynxpoint.go M util/autoport/main.go 6 files changed, 752 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/30890/13
Iru Cai (vimacs) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 13:
(11 comments)
Now use the full struct for most of LP GPIO because the old one breaks things.
https://review.coreboot.org/c/coreboot/+/30890/11/util/autoport/haswell.go File util/autoport/haswell.go:
https://review.coreboot.org/c/coreboot/+/30890/11/util/autoport/haswell.go@3... PS11, Line 39: FormatInt32(refclk / 128 / (inteltool.IGD[0xc8254] >> 16))
This results in a division by zero on desktop boards.
Done
https://review.coreboot.org/c/coreboot/+/30890/11/util/autoport/haswell.go@1... PS11, Line 109: File: "drivers/intel/gma/acpi/default_brightness_levels.asl",
FIXME: This is not necessary if the board doesn't have backlight
Comment added.
https://review.coreboot.org/c/coreboot/+/30890/1/util/autoport/lynxpoint.go File util/autoport/lynxpoint.go:
https://review.coreboot.org/c/coreboot/+/30890/1/util/autoport/lynxpoint.go@... PS1, Line 2:
A lot of this code (especially the GPIO stuff) is the same as bd82x6x. […]
Done
https://review.coreboot.org/c/coreboot/+/30890/10/util/autoport/lynxpoint.go File util/autoport/lynxpoint.go:
https://review.coreboot.org/c/coreboot/+/30890/10/util/autoport/lynxpoint.go... PS10, Line 401: // the lid is open by default.
Please use consistent comments in generated code
Done
https://review.coreboot.org/c/coreboot/+/30890/11/util/autoport/lynxpoint.go File util/autoport/lynxpoint.go:
https://review.coreboot.org/c/coreboot/+/30890/11/util/autoport/lynxpoint.go... PS11, Line 188: DSDTDefine{ : Key: "BRIGHTNESS_UP", : Value: "\_SB.PCI0.GFX0.INCB", : }, : DSDTDefine{ : Key: "BRIGHTNESS_DOWN", : Value: "\_SB.PCI0.GFX0.DECB", : }, : DSDTDefine{ : Key: "ACPI_VIDEO_DEVICE", : Value: "\_SB.PCI0.GFX0", : })
I meant all three values.
Done
https://review.coreboot.org/c/coreboot/+/30890/11/util/autoport/lynxpoint.go... PS11, Line 240: SATA Controller 1
SATA Controller (AHCI)
Done
https://review.coreboot.org/c/coreboot/+/30890/11/util/autoport/lynxpoint.go... PS11, Line 242: SATA Controller 2
SATA Controller (Legacy)
Done
https://review.coreboot.org/c/coreboot/+/30890/11/util/autoport/lynxpoint.go... PS11, Line 250: PCI-LPC bridge
Drop this part, it will result in "LPC bridge PCI-LPC bridge"
Done
https://review.coreboot.org/c/coreboot/+/30890/11/util/autoport/lynxpoint.go... PS11, Line 426: : /* Disable USB ports in S3 by default */ : gnvs->s3u0 = 0; : gnvs->s3u1 = 0; : : /* Disable USB ports in S5 by default */ : gnvs->s5u0 = 0; : gnvs->s5u1 = 0;
Drop these
Done
https://review.coreboot.org/c/coreboot/+/30890/11/util/autoport/lynxpoint.go... PS11, Line 435: // the lid is open by default.
/* The lid is open by default. […]
Done
https://review.coreboot.org/c/coreboot/+/30890/12/util/autoport/lynxpoint.go File util/autoport/lynxpoint.go:
https://review.coreboot.org/c/coreboot/+/30890/12/util/autoport/lynxpoint.go... PS12, Line 128: switch g {
The indentation is rather odd here
Now I've used gofmt to reformat the code.
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 13:
(4 comments)
https://review.coreboot.org/c/coreboot/+/30890/13/util/autoport/haswell.go File util/autoport/haswell.go:
https://review.coreboot.org/c/coreboot/+/30890/13/util/autoport/haswell.go@1... PS13, Line 13: install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_EDP, Do we need this?
https://review.coreboot.org/c/coreboot/+/30890/13/util/autoport/lynxpoint.go File util/autoport/lynxpoint.go:
https://review.coreboot.org/c/coreboot/+/30890/13/util/autoport/lynxpoint.go... PS13, Line 87: /* TODO: create it as header files as other boards */ no.
https://review.coreboot.org/c/coreboot/+/30890/13/util/autoport/lynxpoint.go... PS13, Line 326: 1 if b.variant == LYNX_POINT_ULT, this should be 5
https://review.coreboot.org/c/coreboot/+/30890/13/util/autoport/lynxpoint.go... PS13, Line 585: /* SDIO */ : RegisterPCI(0x8086, 0x9c35, GenericPCI{}) : : /* Smart Sound Technology Controller */ : RegisterPCI(0x8086, 0x9c36, GenericPCI{}) : : /* Serial I/O */ : for id := uint16(0x9c60); id <= 0x9c66; id++ { : RegisterPCI(0x8086, id, GenericPCI{}) : } These probably don't apply to desktops
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 13:
(2 comments)
https://review.coreboot.org/c/coreboot/+/30890/13/util/autoport/lynxpoint.go File util/autoport/lynxpoint.go:
https://review.coreboot.org/c/coreboot/+/30890/13/util/autoport/lynxpoint.go... PS13, Line 278: romstage.c I've changed the format of this file substantially with topic:haswell-pei-data-noises. Most of the pei_data stuff is now handled either automatically or through other mechanisms
https://review.coreboot.org/c/coreboot/+/30890/13/util/autoport/lynxpoint.go... PS13, Line 326: 1
if b. […]
Not a problem anymore, it's determined automatically at runtime based on PCI IDs. But this needs to be changed quite a bit
Hello build bot (Jenkins), Daniel Maslowski, Angel Pons, Iru Cai,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/30890
to look at the new patch set (#14).
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
autoport: Add support for Haswell-LynxPoint platform
It can generate working source code for: - Haswell mobile: Clevo W650SZ, Lenovo ThinkPad T440p (merged) - Haswell ULT: Dell Latitude E7240
Patchset 12, 13: - some fix up with the latest coreboot code - fill lengths and locations USB2 ports - LP GPIO
Unresolved issues: - Should we use DxxIR registers from the machine running factory firmware?
TODO: - Lynx Point LP - GPE registers in device tree - Trim down the LP GPIO output
Change-Id: I4f6e8c97b5122101de2f36bba8ba9f8ddd5b813a Signed-off-by: Iru Cai mytbk920423@gmail.com --- M util/autoport/azalia.go M util/autoport/bd82x6x.go A util/autoport/haswell.go M util/autoport/log_reader.go A util/autoport/lynxpoint.go M util/autoport/main.go 6 files changed, 839 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/30890/14
Hello build bot (Jenkins), Daniel Maslowski, Angel Pons, Iru Cai,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/30890
to look at the new patch set (#15).
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
autoport: Add support for Haswell-LynxPoint platform
Unresolved issues: - Should we use DxxIR registers from the machine running factory firmware?
TODO: - Lynx Point LP - GPE registers in device tree (are these useful?)
Change-Id: I4f6e8c97b5122101de2f36bba8ba9f8ddd5b813a Signed-off-by: Iru Cai mytbk920423@gmail.com --- M util/autoport/azalia.go M util/autoport/bd82x6x.go A util/autoport/haswell.go M util/autoport/log_reader.go A util/autoport/lynxpoint.go M util/autoport/main.go 6 files changed, 857 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/30890/15
Hello build bot (Jenkins), Daniel Maslowski, Angel Pons, Iru Cai,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/30890
to look at the new patch set (#16).
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
autoport: Add support for Haswell-LynxPoint platform
Unresolved issues: - Should we use DxxIR registers from the machine running factory firmware?
TODO: - Lynx Point LP - GPE registers in device tree (are these useful?)
Change-Id: I4f6e8c97b5122101de2f36bba8ba9f8ddd5b813a Signed-off-by: Iru Cai mytbk920423@gmail.com --- M util/autoport/azalia.go M util/autoport/bd82x6x.go A util/autoport/haswell.go M util/autoport/log_reader.go A util/autoport/lynxpoint.go M util/autoport/main.go 6 files changed, 856 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/30890/16
Iru Cai (vimacs) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 16:
(3 comments)
https://review.coreboot.org/c/coreboot/+/30890/13/util/autoport/lynxpoint.go File util/autoport/lynxpoint.go:
https://review.coreboot.org/c/coreboot/+/30890/13/util/autoport/lynxpoint.go... PS13, Line 87: /* TODO: create it as header files as other boards */
no.
I see the gpio.h->gpio.c change in google/slippy.
https://review.coreboot.org/c/coreboot/+/30890/13/util/autoport/lynxpoint.go... PS13, Line 278: romstage.c
I've changed the format of this file substantially with topic:haswell-pei-data-noises. […]
Done
https://review.coreboot.org/c/coreboot/+/30890/15/util/autoport/lynxpoint.go File util/autoport/lynxpoint.go:
https://review.coreboot.org/c/coreboot/+/30890/15/util/autoport/lynxpoint.go... PS15, Line 330: /* FIXME: sata_*_gen3_dtle don't seem to be useful, just keep them here */ Hmm,these looks necessary. Linux can report I/O errors on ATA when this is not set. But why are there only two ports to set?
Hello build bot (Jenkins), Daniel Maslowski, Angel Pons, Iru Cai,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/30890
to look at the new patch set (#17).
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
autoport: Add support for Haswell-LynxPoint platform
Unresolved issues: - Should we use DxxIR registers from the machine running factory firmware?
TODO: - Lynx Point LP - GPE registers in device tree (are these useful?)
Change-Id: I4f6e8c97b5122101de2f36bba8ba9f8ddd5b813a Signed-off-by: Iru Cai mytbk920423@gmail.com --- M util/autoport/azalia.go M util/autoport/bd82x6x.go A util/autoport/haswell.go M util/autoport/log_reader.go A util/autoport/lynxpoint.go M util/autoport/main.go 6 files changed, 857 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/30890/17
Pablo Stebler has uploaded a new patch set (#18) to the change originally created by Iru Cai (vimacs). ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
autoport: Add support for Haswell-LynxPoint platform
It can generate working source code for: - Haswell mobile: Clevo W650SZ, Lenovo ThinkPad T440p (merged) - Haswell ULT: Dell Latitude E7240
Patchset 12, 13: - some fix up with the latest coreboot code - fill lengths and locations USB2 ports - LP GPIO
Unresolved issues: - Should we use DxxIR registers from the machine running factory firmware?
TODO: - Lynx Point LP - GPE registers in device tree - Trim down the LP GPIO output
Change-Id: I4f6e8c97b5122101de2f36bba8ba9f8ddd5b813a Signed-off-by: Iru Cai mytbk920423@gmail.com --- M util/autoport/azalia.go M util/autoport/bd82x6x.go A util/autoport/haswell.go M util/autoport/log_reader.go A util/autoport/lynxpoint.go M util/autoport/main.go 6 files changed, 839 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/30890/18
Hello build bot (Jenkins), Daniel Maslowski, Pablo Stebler, Angel Pons, Iru Cai,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/30890
to look at the new patch set (#20).
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
autoport: Add support for Haswell-LynxPoint platform
Unresolved issues: - Should we use DxxIR registers from the machine running factory firmware?
TODO: - Lynx Point LP - GPE registers in device tree (are these useful?)
Change-Id: I4f6e8c97b5122101de2f36bba8ba9f8ddd5b813a Signed-off-by: Iru Cai mytbk920423@gmail.com --- M util/autoport/azalia.go M util/autoport/bd82x6x.go A util/autoport/haswell.go M util/autoport/log_reader.go A util/autoport/lynxpoint.go M util/autoport/main.go 6 files changed, 859 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/30890/20
Hello build bot (Jenkins), Daniel Maslowski, Pablo Stebler, Angel Pons, Iru Cai,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/30890
to look at the new patch set (#21).
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
autoport: Add support for Haswell-LynxPoint platform
Unresolved issues: - Should we use DxxIR registers from the machine running factory firmware?
TODO: - Lynx Point LP - GPE registers in device tree (it seems we don't need this)
Change-Id: I4f6e8c97b5122101de2f36bba8ba9f8ddd5b813a Signed-off-by: Iru Cai mytbk920423@gmail.com --- M util/autoport/azalia.go M util/autoport/bd82x6x.go A util/autoport/haswell.go M util/autoport/log_reader.go A util/autoport/lynxpoint.go M util/autoport/main.go 6 files changed, 861 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/30890/21
Hello build bot (Jenkins), Daniel Maslowski, Pablo Stebler, Angel Pons, Iru Cai,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/30890
to look at the new patch set (#22).
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
autoport: Add support for Haswell-LynxPoint platform
Unresolved issues: - Should we use DxxIR registers from the machine running factory firmware?
TODO: - Lynx Point LP - GPE registers in device tree (it seems we don't need this)
Change-Id: I4f6e8c97b5122101de2f36bba8ba9f8ddd5b813a Signed-off-by: Iru Cai mytbk920423@gmail.com --- M util/autoport/azalia.go M util/autoport/bd82x6x.go A util/autoport/haswell.go M util/autoport/log_reader.go A util/autoport/lynxpoint.go M util/autoport/main.go 6 files changed, 861 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/30890/22
Attention is currently required from: Tristan Corrick, Arthur Heymans, Iru Cai (vimacs). Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 22:
(9 comments)
File util/autoport/azalia.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/11749886_76f8137c PS1, Line 66: RegisterPCI(0x8086, 0x0c0c, azalia{})
Mini-HD audio config is hardcoded in `nb/intel/haswell/minihd.c`. Is […]
Gone
File util/autoport/haswell.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/4b3c3e82_2a7f7860 PS22, Line 12: */ This should have a space
https://review.coreboot.org/c/coreboot/+/30890/comment/c87aafba_bc4621ee PS22, Line 50: dq_pins_interleaved Only matters for ULT. You can derive this from the DDR_SCRAM_MISC_CONTROL register:
const bool dq_pins_interleaved = !(MCHBAR32(0x2008) & 1 << 10)
https://review.coreboot.org/c/coreboot/+/30890/comment/0230c378_866bf45e PS22, Line 74: /* FIXME:XX hardcoded. */ : "c1_acpower": cstate[0], : "c2_acpower": cstate[1], : "c3_acpower": cstate[2], : "c1_battery": cstate[0], : "c2_battery": cstate[1], : "c3_battery": cstate[2], We no longer have C-states in the devicetree for Haswell.
File util/autoport/lynxpoint.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/8773f8b8_502c45bc PS1, Line 228: PCISlot{PCIAddr: PCIAddr{Dev: 0x1c, Func: 6}, writeEmpty: true, additionalComment: "PCIe Port #7"}, : PCISlot{PCIAddr: PCIAddr{Dev: 0x1c, Func: 7}, writeEmpty: true, additionalComment: "PCIe Port #8"},
We're not handling this for sandybridge
Done
https://review.coreboot.org/c/coreboot/+/30890/comment/99f8482d_d7819f72 PS1, Line 356: 0x0040
These values depend on the trace lengths for USB and are documented somewhere, I think
Done
File util/autoport/lynxpoint.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/88dc7d70_de73ec5b PS13, Line 326: 1
Not a problem anymore, it's determined automatically at runtime based on PCI IDs. […]
Done
https://review.coreboot.org/c/coreboot/+/30890/comment/0baea527_31e2d7e0 PS13, Line 585: /* SDIO */ : RegisterPCI(0x8086, 0x9c35, GenericPCI{}) : : /* Smart Sound Technology Controller */ : RegisterPCI(0x8086, 0x9c36, GenericPCI{}) : : /* Serial I/O */ : for id := uint16(0x9c60); id <= 0x9c66; id++ { : RegisterPCI(0x8086, id, GenericPCI{}) : }
These probably don't apply to desktops
These don't exist on non-LP.
File util/autoport/lynxpoint.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/25d2bf66_f6021c1f PS22, Line 593: gnvs := Create(ctx, "acpi_tables.c") I would not generate this file at all.
Attention is currently required from: Tristan Corrick, Arthur Heymans, Iru Cai (vimacs). Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 22:
(1 comment)
File util/autoport/lynxpoint.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/322ab959_b6f1209c PS22, Line 249: /* Shared with ME. Flashrom is unable to handle it. */ : FlashROMSupport = "n" No longer true.
Attention is currently required from: Tristan Corrick, Arthur Heymans, Iru Cai (vimacs). Hello build bot (Jenkins), Daniel Maslowski, Pablo Stebler, Angel Pons, Iru Cai,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/30890
to look at the new patch set (#23).
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
autoport: Add support for Haswell-LynxPoint platform
Unresolved issues: - Should we use DxxIR registers from the machine running factory firmware?
TODO: - Lynx Point LP - GPE registers in device tree (it seems we don't need this)
Change-Id: I4f6e8c97b5122101de2f36bba8ba9f8ddd5b813a Signed-off-by: Iru Cai mytbk920423@gmail.com --- M util/autoport/azalia.go M util/autoport/bd82x6x.go A util/autoport/haswell.go M util/autoport/log_reader.go A util/autoport/lynxpoint.go M util/autoport/main.go 6 files changed, 873 insertions(+), 10 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/30890/23
Attention is currently required from: Tristan Corrick, Arthur Heymans, Iru Cai (vimacs). Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 23: Code-Review+1
(4 comments)
File util/autoport/haswell.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/f69d62eb_c1f25a30 PS23, Line 18: */ nit: comment end should have a space before
File util/autoport/lynxpoint.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/08f3c690_09f4e16a PS23, Line 249: /* Shared with ME. Flashrom is unable to handle it. */ Untrue
https://review.coreboot.org/c/coreboot/+/30890/comment/18ff2078_c3fc9794 PS23, Line 393: void mainboard_config_superio(void) It's optional
https://review.coreboot.org/c/coreboot/+/30890/comment/ee11df2a_7a6d36dc PS23, Line 604: gnvs->tpsv = 90; Most often, this is dead code.
Attention is currently required from: Tristan Corrick, Arthur Heymans, Iru Cai (vimacs). Forkoz has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 23:
(1 comment)
Patchset:
PS23: Going to give this a go and see if it makes a better T440P port so my card reader can work again.
Attention is currently required from: Tristan Corrick, Arthur Heymans, Iru Cai (vimacs). Forkoz has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 23: Code-Review+1
Attention is currently required from: Tristan Corrick, Forkoz, Arthur Heymans. Iru Cai (vimacs) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 23:
(1 comment)
Patchset:
PS23:
Going to give this a go and see if it makes a better T440P port so my card reader can work again.
The T440p card reader problem may need a PCI device driver in the firmware, just like ricoh/rce822 which has a special init sequence, a routine to set subsystem id.
Attention is currently required from: Tristan Corrick, Arthur Heymans, Iru Cai (vimacs). Jamal Wright has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 23:
(1 comment)
Patchset:
PS23:
The T440p card reader problem may need a PCI device driver in the firmware, just like ricoh/rce822 w […]
Will have to see if there is a datasheet for the reader or the vendor fw has some module for it to disassemble.
Attention is currently required from: Tristan Corrick, Arthur Heymans, Iru Cai (vimacs). Hello build bot (Jenkins), Daniel Maslowski, Pablo Stebler, Jamal Wright, Angel Pons, Iru Cai,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/30890
to look at the new patch set (#24).
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
autoport: Add support for Haswell-LynxPoint platform
Unresolved issues: - Should we use DxxIR registers from the machine running factory firmware?
TODO: - Lynx Point LP - GPE registers in device tree (it seems we don't need this)
Change-Id: I4f6e8c97b5122101de2f36bba8ba9f8ddd5b813a Signed-off-by: Iru Cai mytbk920423@gmail.com --- M util/autoport/azalia.go M util/autoport/bd82x6x.go A util/autoport/haswell.go M util/autoport/log_reader.go A util/autoport/lynxpoint.go M util/autoport/main.go 6 files changed, 881 insertions(+), 10 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/30890/24
Attention is currently required from: Tristan Corrick, Arthur Heymans, Iru Cai (vimacs). Hello build bot (Jenkins), Daniel Maslowski, Pablo Stebler, Jamal Wright, Angel Pons, Iru Cai,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/30890
to look at the new patch set (#25).
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
autoport: Add support for Haswell-LynxPoint platform
Unresolved issues: - Should we use DxxIR registers from the machine running factory firmware?
TODO: - Lynx Point LP - GPE registers in device tree (it seems we don't need this)
Change-Id: I4f6e8c97b5122101de2f36bba8ba9f8ddd5b813a Signed-off-by: Iru Cai mytbk920423@gmail.com --- M util/autoport/azalia.go M util/autoport/bd82x6x.go A util/autoport/haswell.go M util/autoport/log_reader.go A util/autoport/lynxpoint.go M util/autoport/main.go 6 files changed, 881 insertions(+), 10 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/30890/25
Attention is currently required from: Tristan Corrick, Arthur Heymans, Iru Cai (vimacs). Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 25:
(1 comment)
File util/autoport/haswell.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/91639edd_9cec519e PS25, Line 150: RegisterPCI(0x8086, 0x0c0c, GenericPCI{}) 0x0a0c missing
Attention is currently required from: Tristan Corrick, Arthur Heymans, Iru Cai (vimacs). Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 26:
(1 comment)
Patchset:
PS26: Woups, didn't mean to rebase this change. My apologies!
Attention is currently required from: Tristan Corrick, Arthur Heymans, Iru Cai (vimacs). Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 26:
(1 comment)
File util/autoport/lynxpoint.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/1cd4a503_1d8f747c PS25, Line 298: KconfigInt["USBDEBUG_HCD_INDEX"] = 2 On LPT-LP, this should be 1
Attention is currently required from: Tristan Corrick, Arthur Heymans, Iru Cai (vimacs). Hello build bot (Jenkins), Daniel Maslowski, Pablo Stebler, Jamal Wright, Angel Pons, Iru Cai,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/30890
to look at the new patch set (#28).
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
autoport: Add support for Haswell-LynxPoint platform
Unresolved issues: - Should we use DxxIR registers from the machine running factory firmware?
Change-Id: I4f6e8c97b5122101de2f36bba8ba9f8ddd5b813a Signed-off-by: Iru Cai mytbk920423@gmail.com --- M util/autoport/azalia.go M util/autoport/bd82x6x.go A util/autoport/haswell.go M util/autoport/log_reader.go A util/autoport/lynxpoint.go M util/autoport/main.go 6 files changed, 922 insertions(+), 10 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/30890/28
Attention is currently required from: Tristan Corrick, Arthur Heymans, Iru Cai (vimacs). Hello build bot (Jenkins), Daniel Maslowski, Pablo Stebler, Jamal Wright, Angel Pons, Iru Cai,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/30890
to look at the new patch set (#29).
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
autoport: Add support for Haswell-LynxPoint platform
Unresolved issues: - Should we use DxxIR registers from the machine running factory firmware?
Change-Id: I4f6e8c97b5122101de2f36bba8ba9f8ddd5b813a Signed-off-by: Iru Cai mytbk920423@gmail.com --- M util/autoport/azalia.go M util/autoport/bd82x6x.go A util/autoport/haswell.go M util/autoport/log_reader.go A util/autoport/lynxpoint.go M util/autoport/main.go 6 files changed, 926 insertions(+), 10 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/30890/29
Attention is currently required from: Tristan Corrick, Arthur Heymans, Iru Cai (vimacs). Máté Kukri (mkukri) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 29:
(1 comment)
File util/autoport/lynxpoint.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/2c08008b_b4e6ba62 PS29, Line 524: const struct usb2_port_config mainboard_usb2_ports[MAX_USB2_PORTS] = { Shouldn't we check if the USB2 ports are actually routed to EHCI or xHCI before reading these values?
Attention is currently required from: Tristan Corrick, Arthur Heymans, Iru Cai (vimacs). Hello build bot (Jenkins), Daniel Maslowski, Pablo Stebler, Jamal Wright, Angel Pons, Iru Cai,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/30890
to look at the new patch set (#30).
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
autoport: Add support for Haswell-LynxPoint platform
Unresolved issues: - Should we use DxxIR registers from the machine running factory firmware?
Change-Id: I4f6e8c97b5122101de2f36bba8ba9f8ddd5b813a Signed-off-by: Iru Cai mytbk920423@gmail.com --- M util/autoport/azalia.go M util/autoport/bd82x6x.go A util/autoport/haswell.go M util/autoport/log_reader.go A util/autoport/lynxpoint.go M util/autoport/main.go 6 files changed, 901 insertions(+), 10 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/30890/30
Attention is currently required from: Tristan Corrick, Angel Pons, Arthur Heymans. Iru Cai (vimacs) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 30:
(13 comments)
File util/autoport/haswell.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/c235ed1d_89ef66a6 PS13, Line 13: install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_EDP,
Do we need this?
removed
File util/autoport/haswell.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/678b22ba_49d1162f PS22, Line 12: */
This should have a space
Done
https://review.coreboot.org/c/coreboot/+/30890/comment/610a36bf_b2e5da42 PS22, Line 50: dq_pins_interleaved
Only matters for ULT. You can derive this from the DDR_SCRAM_MISC_CONTROL register: […]
Done
https://review.coreboot.org/c/coreboot/+/30890/comment/e3e2165d_631a3150 PS22, Line 74: /* FIXME:XX hardcoded. */ : "c1_acpower": cstate[0], : "c2_acpower": cstate[1], : "c3_acpower": cstate[2], : "c1_battery": cstate[0], : "c2_battery": cstate[1], : "c3_battery": cstate[2],
We no longer have C-states in the devicetree for Haswell.
Done
File util/autoport/haswell.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/c091c94b_727eb7d2 PS23, Line 18: */
nit: comment end should have a space before
Done
File util/autoport/haswell.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/f9596141_48937b60 PS25, Line 150: RegisterPCI(0x8086, 0x0c0c, GenericPCI{})
0x0a0c missing
Done
File util/autoport/lynxpoint.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/2a31a665_2e009654 PS13, Line 585: /* SDIO */ : RegisterPCI(0x8086, 0x9c35, GenericPCI{}) : : /* Smart Sound Technology Controller */ : RegisterPCI(0x8086, 0x9c36, GenericPCI{}) : : /* Serial I/O */ : for id := uint16(0x9c60); id <= 0x9c66; id++ { : RegisterPCI(0x8086, id, GenericPCI{}) : }
These don't exist on non-LP.
This code is only used to register the device IDs to autoport.
File util/autoport/lynxpoint.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/ecaf59e1_b617f06c PS22, Line 249: /* Shared with ME. Flashrom is unable to handle it. */ : FlashROMSupport = "n"
No longer true.
Done
https://review.coreboot.org/c/coreboot/+/30890/comment/618b4866_671d8ccd PS22, Line 593: gnvs := Create(ctx, "acpi_tables.c")
I would not generate this file at all.
removed
File util/autoport/lynxpoint.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/07cff6e0_8cae181f PS23, Line 249: /* Shared with ME. Flashrom is unable to handle it. */
Untrue
Done
https://review.coreboot.org/c/coreboot/+/30890/comment/3b61be52_d9aa3168 PS23, Line 393: void mainboard_config_superio(void)
It's optional
Ack
https://review.coreboot.org/c/coreboot/+/30890/comment/c476d79d_06202414 PS23, Line 604: gnvs->tpsv = 90;
Most often, this is dead code.
removed
File util/autoport/lynxpoint.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/43d8e196_d0c596d5 PS25, Line 298: KconfigInt["USBDEBUG_HCD_INDEX"] = 2
On LPT-LP, this should be 1
Done
Attention is currently required from: Tristan Corrick, Arthur Heymans, Iru Cai (vimacs). Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 30: Code-Review+1
(1 comment)
File util/autoport/lynxpoint.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/c3655da5_15fad3ea PS13, Line 585: /* SDIO */ : RegisterPCI(0x8086, 0x9c35, GenericPCI{}) : : /* Smart Sound Technology Controller */ : RegisterPCI(0x8086, 0x9c36, GenericPCI{}) : : /* Serial I/O */ : for id := uint16(0x9c60); id <= 0x9c66; id++ { : RegisterPCI(0x8086, id, GenericPCI{}) : }
This code is only used to register the device IDs to autoport.
Ack
Attention is currently required from: Tristan Corrick, Arthur Heymans, Iru Cai (vimacs). Maxim Polyakov has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 32: Code-Review+1
(5 comments)
Patchset:
PS32: Thank you for this great work, but I have a few comments.
I am not an expert in the Haswell product series, and many things remain a mystery to me. Please, could you clarify some points in the code? It would be better to make more comments and use variable names that do not consist of a single character.
File util/autoport/lynxpoint.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/1893cf9e_8e56c838 PS32, Line 24: switch g { I would prefer to use a map here
const ( PIRQI = 0 PIRQJ = 1 ...
SOME_MAGIC_GPIO_8 = 8 ... )
func lp_gpio_to_pirq(g uint) int { var pirqmap = map[uint]int { SOME_MAGIC_GPIO_8: PIRQI, .... } pirq, valid := pirqmap[g] if valid { return pirq } return -1 }
* Please, instead of SOME_MAGIC_GPIO_8, choose a more similar meaning for this case.
https://review.coreboot.org/c/coreboot/+/30890/comment/c6b018d8_0999639e PS32, Line 170: uint16(0x100+g*8)] this is magic )) What does 0x100 mean? What does g mean?
https://review.coreboot.org/c/coreboot/+/30890/comment/aab9f7f2_3fde1942 PS32, Line 199: lvl = "LOW" I don't think we need any more variables fmt.Fprintf(gpio, "LP_GPIO_OUT_LOW\n")
https://review.coreboot.org/c/coreboot/+/30890/comment/2767657b_b70f11d0 PS32, Line 201: lvl = "HIGH" fmt.Fprintf(gpio, "LP_GPIO_OUT_HIGH\n")
Attention is currently required from: Máté Kukri, Maxim Polyakov, Tristan Corrick, Arthur Heymans, Iru Cai. Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 32:
(6 comments)
File util/autoport/bd82x6x.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/77bad9af_7fced718 PS32, Line 13: func writeGPIOSet(ctx Context, sb *os.File, Should non-bd82x6x stuff be moved into a separate file?
File util/autoport/lynxpoint.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/f7b63d6b_5749cdc7 PS1, Line 272: RestoreDIRRoute(sb, "D31IR", uint16(inteltool.RCBA[0x3140])) : RestoreDIRRoute(sb, "D29IR", uint16(inteltool.RCBA[0x3144])) : RestoreDIRRoute(sb, "D28IR", uint16(inteltool.RCBA[0x3146])) : RestoreDIRRoute(sb, "D27IR", uint16(inteltool.RCBA[0x3148])) : RestoreDIRRoute(sb, "D26IR", uint16(inteltool.RCBA[0x314c])) : RestoreDIRRoute(sb, "D25IR", uint16(inteltool.RCBA[0x3150])) : RestoreDIRRoute(sb, "D22IR", uint16(inteltool.RCBA[0x315c])) : RestoreDIRRoute(sb, "D20IR", uint16(inteltool.RCBA[0x3160]))
DxxIR and DxxIP are only useful to support legacy interrupt routing. I'm not aware of a major, mainstream OS that uses legacy interrupt routing by default. It would be fine to leave these registers at their reset defaults. As far as I know, legacy interrupt routing should still work in that case, but the interrupts might not be balanced very well.
Lynx Point could benefit from making this config PCH-specific instead of board-specific, as was done in commit 33b535f15ded for earlier PCHs.
I totally agree.
File util/autoport/lynxpoint.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/3570a2ad_08eebfde PS29, Line 524: const struct usb2_port_config mainboard_usb2_ports[MAX_USB2_PORTS] = {
Shouldn't we check if the USB2 ports are actually routed to EHCI or xHCI before reading these values […]
I imagine. It's better than nothing, though
File util/autoport/lynxpoint.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/243de1b2_036cad1a PS32, Line 170: uint16(0x100+g*8)]
this is magic )) What does 0x100 mean? What does g mean?
`g` is the GPIO number, and the resulting value is the offset of the `GPgCONFIGA` register for GPIO `g`
https://review.coreboot.org/c/coreboot/+/30890/comment/7c8195c6_1dcac0ee PS32, Line 199: lvl = "LOW"
I don't think we need any more variables […]
+1
https://review.coreboot.org/c/coreboot/+/30890/comment/b7aedfbf_2dd0148e PS32, Line 536: !isULT I'd flip the if/else branches to avoid the negation in the condition
Attention is currently required from: Máté Kukri, Tristan Corrick, Angel Pons, Arthur Heymans, Iru Cai. Maxim Polyakov has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 32:
(1 comment)
File util/autoport/lynxpoint.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/fb564bc3_bf9b7515 PS32, Line 170: uint16(0x100+g*8)]
`g` is the GPIO number, and the resulting value is the offset of the `GPgCONFIGA` register for GPIO […]
In this case, maybe rename g -> gpioNum and use constants for offsets
const ( GPgCONFIGA = 0x100 ... )
?
Attention is currently required from: Máté Kukri, Maxim Polyakov, Tristan Corrick, Arthur Heymans, Iru Cai. Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 32:
(1 comment)
File util/autoport/lynxpoint.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/dccd4c35_5380236c PS32, Line 170: uint16(0x100+g*8)]
In this case, maybe rename g -> gpioNum and use constants for offsets […]
or make functions to encapsulate the `inteltool.GPIO[uint16(...)]` stuff a bit?
Attention is currently required from: Máté Kukri, Maxim Polyakov, Tristan Corrick, Arthur Heymans, Iru Cai. Hello build bot (Jenkins), Daniel Maslowski, Maxim Polyakov, Pablo Stebler, Angel Pons, Jamal Wright, Iru Cai,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/30890
to look at the new patch set (#33).
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
autoport: Add support for Haswell-LynxPoint platform
Change-Id: I4f6e8c97b5122101de2f36bba8ba9f8ddd5b813a Signed-off-by: Iru Cai mytbk920423@gmail.com --- M util/autoport/azalia.go M util/autoport/bd82x6x.go A util/autoport/haswell.go M util/autoport/log_reader.go A util/autoport/lynxpoint.go M util/autoport/main.go 6 files changed, 886 insertions(+), 10 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/30890/33
Attention is currently required from: Máté Kukri, Maxim Polyakov, Tristan Corrick, Angel Pons, Arthur Heymans. Iru Cai has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 33:
(4 comments)
File util/autoport/lynxpoint.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/c2e8d251_d0db8ae7 PS1, Line 272: RestoreDIRRoute(sb, "D31IR", uint16(inteltool.RCBA[0x3140])) : RestoreDIRRoute(sb, "D29IR", uint16(inteltool.RCBA[0x3144])) : RestoreDIRRoute(sb, "D28IR", uint16(inteltool.RCBA[0x3146])) : RestoreDIRRoute(sb, "D27IR", uint16(inteltool.RCBA[0x3148])) : RestoreDIRRoute(sb, "D26IR", uint16(inteltool.RCBA[0x314c])) : RestoreDIRRoute(sb, "D25IR", uint16(inteltool.RCBA[0x3150])) : RestoreDIRRoute(sb, "D22IR", uint16(inteltool.RCBA[0x315c])) : RestoreDIRRoute(sb, "D20IR", uint16(inteltool.RCBA[0x3160]))
DxxIR and DxxIP are only useful to support legacy interrupt routing. I'm […]
Removed.
File util/autoport/lynxpoint.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/f077b1dc_6c0afe06 PS32, Line 199: lvl = "LOW"
+1
Done
https://review.coreboot.org/c/coreboot/+/30890/comment/4141ed9d_26568c21 PS32, Line 201: lvl = "HIGH"
fmt. […]
Done
https://review.coreboot.org/c/coreboot/+/30890/comment/bf791e19_c48f024a PS32, Line 536: !isULT
I'd flip the if/else branches to avoid the negation in the condition
Done
Attention is currently required from: Máté Kukri, Maxim Polyakov, Tristan Corrick, Angel Pons, Arthur Heymans, Iru Cai. Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 33: Code-Review+1
Attention is currently required from: Máté Kukri, Maxim Polyakov, Tristan Corrick, Arthur Heymans, Iru Cai. Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 33:
(1 comment)
File util/autoport/lynxpoint.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/a804a839_eaa654af PS29, Line 524: const struct usb2_port_config mainboard_usb2_ports[MAX_USB2_PORTS] = {
I imagine. […]
Actually, no. IIRC reference code always programs these settings, and I think the ports can be routed to the xHCI controller by OS drivers.
I haven't verified this, but I imagine the IOBP registers directly control the USB2 PHYs, independently of whether the PHYs are routed to the EHCI or xHCI controller.
Attention is currently required from: Máté Kukri, Maxim Polyakov, Tristan Corrick, Arthur Heymans, Iru Cai. Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 33: Code-Review+1
(2 comments)
File util/autoport/bd82x6x.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/5542ad6a_d7c211d0 PS32, Line 13: func writeGPIOSet(ctx Context, sb *os.File,
Should non-bd82x6x stuff be moved into a separate file?
Ping
File util/autoport/lynxpoint.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/a48abbbd_290a2c7a PS32, Line 24: switch g {
I would prefer to use a map here […]
Sounds good. GPIOs in LPT-LP are just numbers, so I wouldn't define names for them (8 means GPIO8, for example).
Attention is currently required from: Máté Kukri, Maxim Polyakov, Tristan Corrick, Arthur Heymans, Iru Cai.
Hello build bot (Jenkins), Daniel Maslowski, Maxim Polyakov, Paul Menzel, Pablo Stebler, Angel Pons, Jamal Wright, Iru Cai,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/30890
to look at the new patch set (#34).
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
autoport: Add support for Haswell-LynxPoint platform
Change-Id: I4f6e8c97b5122101de2f36bba8ba9f8ddd5b813a Signed-off-by: Iru Cai mytbk920423@gmail.com --- M util/autoport/azalia.go M util/autoport/bd82x6x.go A util/autoport/gpio_common.go A util/autoport/haswell.go M util/autoport/log_reader.go A util/autoport/lynxpoint.go A util/autoport/lynxpoint_lp_gpio.go M util/autoport/main.go 8 files changed, 1,037 insertions(+), 116 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/30890/34
Attention is currently required from: Máté Kukri, Maxim Polyakov, Tristan Corrick, Angel Pons, Arthur Heymans.
Iru Cai has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 34:
(3 comments)
Patchset:
PS34: Uploaded a new version for the devicetree change.
File util/autoport/bd82x6x.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/e18c0739_70965518 PS32, Line 13: func writeGPIOSet(ctx Context, sb *os.File,
Ping
Done
File util/autoport/lynxpoint.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/6a0f0d0f_dfa189c2 PS32, Line 170: uint16(0x100+g*8)]
or make functions to encapsulate the `inteltool.GPIO[uint16(... […]
Done
Attention is currently required from: Máté Kukri, Maxim Polyakov, Tristan Corrick, Angel Pons, Arthur Heymans.
Iru Cai has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890 )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 34:
(1 comment)
Patchset:
PS34:
Uploaded a new version for the devicetree change.
And also split out the LP GPIO stuff to a separate file.
Attention is currently required from: Angel Pons, Arthur Heymans, Iru Cai, Maxim, Tristan Corrick.
Nicholas Chin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890?usp=email )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 34:
(1 comment)
Patchset:
PS34: Seems like this is missing `haswell_pci_domain_ops`, causing resource allocation (I think) to be skipped. This leads to no RAM ranges being added to coreboot tables, causing the payload to fail to load with an error of "SELF segment doesn't target RAM"
Attention is currently required from: Angel Pons, Arthur Heymans, Maxim, Tristan Corrick.
Nicholas Chin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890?usp=email )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 34:
(1 comment)
Patchset:
PS34: I've been in contact with Iru, and I will be taking over this patch.
Attention is currently required from: Angel Pons, Arthur Heymans, Maxim, Nicholas Chin, Tristan Corrick.
Nicholas Chin has uploaded a new patch set (#35) to the change originally created by Iru Cai. ( https://review.coreboot.org/c/coreboot/+/30890?usp=email )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
autoport: Add support for Haswell-LynxPoint platform
Change-Id: I4f6e8c97b5122101de2f36bba8ba9f8ddd5b813a Signed-off-by: Iru Cai mytbk920423@gmail.com Signed-off-by: Nicholas Chin nic.c3.14@gmail.com --- M util/autoport/azalia.go M util/autoport/bd82x6x.go A util/autoport/gpio_common.go A util/autoport/haswell.go M util/autoport/log_reader.go A util/autoport/lynxpoint.go A util/autoport/lynxpoint_lp_gpio.go M util/autoport/main.go 8 files changed, 1,028 insertions(+), 116 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/30890/35
Attention is currently required from: Angel Pons, Arthur Heymans, Maxim, Tristan Corrick.
Nicholas Chin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890?usp=email )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 35:
(1 comment)
Patchset:
PS34:
Seems like this is missing `haswell_pci_domain_ops`, causing resource allocation (I think) to be ski […]
Done
Attention is currently required from: Angel Pons, Arthur Heymans, Iru Cai, Maxim, Nicholas Chin, Tristan Corrick.
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30890?usp=email )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 35:
(2 comments)
Commit Message:
https://review.coreboot.org/c/coreboot/+/30890/comment/4ae9c0ae_7a2d102d : PS35, Line 7: LynxPoint Lynx Point
File util/autoport/bd82x6x.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/011cb45c_a5581464 : PS35, Line 10: func IsPCIeHotplug(ctx Context, port int) bool { It’d be great if you elaborated in the commit message about the refactoring.
Attention is currently required from: Arthur Heymans, Iru Cai, Maxim, Nicholas Chin, Tristan Corrick.
Angel Pons has posted comments on this change by Iru Cai. ( https://review.coreboot.org/c/coreboot/+/30890?usp=email )
Change subject: autoport: Add support for Haswell-LynxPoint platform ......................................................................
Patch Set 35:
(1 comment)
File util/autoport/lynxpoint.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/188b39fd_32476f36?usp... : PS35, Line 189: "sata_port_map": fmt.Sprintf("0x%x", PCIMap[PCIAddr{Bus: 0, Dev: 0x1f, Func: 2}].ConfigDump[0x92]&0x3f), This crashes when the SATA device is disabled.
Attention is currently required from: Arthur Heymans, Iru Cai, Maxim, Name of user not set #1001638, Nicholas Chin.
Nicholas Chin has uploaded a new patch set (#36) to the change originally created by Iru Cai. ( https://review.coreboot.org/c/coreboot/+/30890?usp=email )
The following approvals got outdated and were removed: Verified+1 by build bot (Jenkins)
Change subject: autoport: Add support for Haswell-Lynx Point platform ......................................................................
autoport: Add support for Haswell-Lynx Point platform
Change-Id: I4f6e8c97b5122101de2f36bba8ba9f8ddd5b813a Signed-off-by: Iru Cai mytbk920423@gmail.com Signed-off-by: Nicholas Chin nic.c3.14@gmail.com --- M util/autoport/azalia.go A util/autoport/haswell.go M util/autoport/log_reader.go A util/autoport/lynxpoint.go A util/autoport/lynxpoint_lp_gpio.go M util/autoport/main.go 6 files changed, 898 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/30890/36
Attention is currently required from: Angel Pons, Arthur Heymans, Iru Cai, Maxim, Name of user not set #1001638, Paul Menzel.
Nicholas Chin has posted comments on this change by Iru Cai. ( https://review.coreboot.org/c/coreboot/+/30890?usp=email )
Change subject: autoport: Add support for Haswell-Lynx Point platform ......................................................................
Patch Set 36:
(4 comments)
Commit Message:
https://review.coreboot.org/c/coreboot/+/30890/comment/01b32661_c3339918?usp... : PS35, Line 7: LynxPoint
Lynx Point
Done
File util/autoport/bd82x6x.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/efc56d59_3fc74a17?usp... : PS35, Line 10: func IsPCIeHotplug(ctx Context, port int) bool {
It’d be great if you elaborated in the commit message about the refactoring.
I split out the GPIO refactoring to a separate commit, and reverted the change to `IsPCIeHotplug()` as I don't see an obvious reason it was changed.
File util/autoport/lynxpoint.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/feb94c8b_b575e72d?usp... : PS32, Line 24: switch g {
Sounds good. […]
Done
File util/autoport/lynxpoint.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/82e6139b_f6faa7cb?usp... : PS35, Line 189: "sata_port_map": fmt.Sprintf("0x%x", PCIMap[PCIAddr{Bus: 0, Dev: 0x1f, Func: 2}].ConfigDump[0x92]&0x3f),
This crashes when the SATA device is disabled.
Ack. Yeah, I'm aware of crashes when things are disabled. It also crashes if xHCI is disabled. I'll think I'll just address all these issues in a separate patch, as I think there's several instances (including in the existing snb code) that don't take into account disabled devices properly.
Attention is currently required from: Arthur Heymans, Iru Cai, Maxim, Name of user not set #1001638, Nicholas Chin, Paul Menzel.
Angel Pons has posted comments on this change by Iru Cai. ( https://review.coreboot.org/c/coreboot/+/30890?usp=email )
Change subject: autoport: Add support for Haswell-Lynx Point platform ......................................................................
Patch Set 36: Code-Review+2
Attention is currently required from: Arthur Heymans, Iru Cai, Maxim, Name of user not set #1001638, Nicholas Chin, Paul Menzel.
Nico Huber has posted comments on this change by Iru Cai. ( https://review.coreboot.org/c/coreboot/+/30890?usp=email )
The change is no longer submittable: All-Comments-Resolved is unsatisfied now.
Change subject: autoport: Add support for Haswell-Lynx Point platform ......................................................................
Patch Set 36: Code-Review+1
(2 comments)
File util/autoport/haswell.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/79fdfe00_29a88e89?usp... : PS36, Line 59: 7 What?
Oh, I see now. The lower bits used to mean something. I'm pretty sure we want `& 4`. Not sure why coreboot handles this anyway (VBIOS workaround?).
https://review.coreboot.org/c/coreboot/+/30890/comment/6d2df17b_4059d572?usp... : PS36, Line 132: 0x0d16, 0x0d22, 0x0d26, 0x0d36, /* Mobile 4+3, GT3e */ `gma.c` has 19 entries by now, I guess some are missing here?
Might add: I don't understand the mechanics here. The PCI devices all have their fixed addresses. For the sake of platform detection, `1f.0` should suffice.
Attention is currently required from: Arthur Heymans, Iru Cai, Maxim, Name of user not set #1001638, Nicholas Chin, Nico Huber, Paul Menzel.
Angel Pons has posted comments on this change by Iru Cai. ( https://review.coreboot.org/c/coreboot/+/30890?usp=email )
Change subject: autoport: Add support for Haswell-Lynx Point platform ......................................................................
Patch Set 36:
(1 comment)
File util/autoport/haswell.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/7c138492_1dc04644?usp... : PS36, Line 132: 0x0d16, 0x0d22, 0x0d26, 0x0d36, /* Mobile 4+3, GT3e */
`gma.c` has 19 entries by now, I guess some are missing here? […]
I believe the platform check should be delegated to inteltool or similar. But at that point I'd consider rewriting most of autoport anyway...
Attention is currently required from: Angel Pons, Arthur Heymans, Iru Cai, Maxim, Name of user not set #1001638, Nico Huber, Paul Menzel.
Nicholas Chin has posted comments on this change by Iru Cai. ( https://review.coreboot.org/c/coreboot/+/30890?usp=email )
Change subject: autoport: Add support for Haswell-Lynx Point platform ......................................................................
Patch Set 36:
(1 comment)
File util/autoport/haswell.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/439f84a9_4fa935d0?usp... : PS36, Line 132: 0x0d16, 0x0d22, 0x0d26, 0x0d36, /* Mobile 4+3, GT3e */
I believe the platform check should be delegated to inteltool or similar. […]
The iGPU IDs here aren't being used for platform detection. They register that ID as a `GenericVGA` type, which hooks in a `Scan()` method to be ran (the `(g GenericVGA) Scan()` function in `main.go`). That function just sets the VGA_BIOS_ID Kconfig and sets IGDEnabled to true, which is used to conditionally add gma-mainboard.ads and select the `MAINBOARD_HAS_LIBGFXINIT` Kconfig.
Attention is currently required from: Arthur Heymans, Iru Cai, Maxim, Name of user not set #1001638, Nicholas Chin, Nico Huber, Paul Menzel.
Angel Pons has posted comments on this change by Iru Cai. ( https://review.coreboot.org/c/coreboot/+/30890?usp=email )
Change subject: autoport: Add support for Haswell-Lynx Point platform ......................................................................
Patch Set 36: -Code-Review
(1 comment)
File util/autoport/haswell.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/f54ae636_812ff387?usp... : PS36, Line 132: 0x0d16, 0x0d22, 0x0d26, 0x0d36, /* Mobile 4+3, GT3e */
The iGPU IDs here aren't being used for platform detection. […]
And I tell everyone to drop the `VGA_BIOS_ID` Kconfig because it makes no sense in 99% of the cases...
Attention is currently required from: Angel Pons, Arthur Heymans, Iru Cai, Maxim, Name of user not set #1001638, Nico Huber, Paul Menzel.
Nicholas Chin has posted comments on this change by Iru Cai. ( https://review.coreboot.org/c/coreboot/+/30890?usp=email )
Change subject: autoport: Add support for Haswell-Lynx Point platform ......................................................................
Patch Set 36:
(1 comment)
File util/autoport/haswell.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/db877fc8_78bf3490?usp... : PS36, Line 132: 0x0d16, 0x0d22, 0x0d26, 0x0d36, /* Mobile 4+3, GT3e */
And I tell everyone to drop the `VGA_BIOS_ID` Kconfig because it makes no sense in 99% of the cases. […]
Spent some time reading through autoport's code to figure out what is actually happening. The only time calls to `RegisterPCI()` are actually necessary are to install special handling for certain devices through a `Scan()` method. Otherwise, all it does is explicitly map PCI IDs to `PCISlot` entries declared in the `Scan()` function of things like the host bridge (refer to `Scan()` in `sandybridge.go`) or the chipset (refer to `Scan()` in `bd82x6x.go`). Otherwise autoport states that it is an "Unsupported PCI Device", but it still is able to match the detected PCI devices to `PCISlot` entries through the bus/dev/function addresses. So I think only the host bridge, chipset, and any devices needing special handling need to be explicitly registered, and letting everything else get matched by their fixed address should be able to handle everything else.
I'll probably just add any missing IDs here for now, and then drop the VGA_BIOS_ID handling in a separate patch. I'll probably also drop the conditional inclusion of libgfxinit because I think it pretty much just works for all variants of supported architectures. The only case I can think of where it might be useful to conditionally include libgfxinit based on PCI IDs is systems that physically do not have an iGPU and where that isn't something that can be changed by a CPU swap, such as systems using the PM45 variant of GM45, which doesn't have an iGPU. But even then I don't think having a device enabled in the devicetree when it doesn't exist causes any issues in practice.
Attention is currently required from: Angel Pons, Arthur Heymans, Iru Cai, Maxim, Name of user not set #1001638, Nico Huber, Paul Menzel.
Nicholas Chin has posted comments on this change by Iru Cai. ( https://review.coreboot.org/c/coreboot/+/30890?usp=email )
Change subject: autoport: Add support for Haswell-Lynx Point platform ......................................................................
Patch Set 36:
(1 comment)
File util/autoport/haswell.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/57e4bef2_ab3e5e39?usp... : PS36, Line 132: 0x0d16, 0x0d22, 0x0d26, 0x0d36, /* Mobile 4+3, GT3e */
Spent some time reading through autoport's code to figure out what is actually happening. […]
If we want to drop RegisterPCI for everything except the host bridge, chipset, and devices needing special handling, that would be a separate patch.
Attention is currently required from: Angel Pons, Arthur Heymans, Iru Cai, Maxim, Name of user not set #1001638, Nico Huber, Paul Menzel.
Nicholas Chin has uploaded a new patch set (#37) to the change originally created by Iru Cai. ( https://review.coreboot.org/c/coreboot/+/30890?usp=email )
The following approvals got outdated and were removed: Code-Review+1 by Nico Huber, Verified+1 by build bot (Jenkins)
Change subject: autoport: Add support for Haswell-Lynx Point platform ......................................................................
autoport: Add support for Haswell-Lynx Point platform
Tested with the following devices (not exhaustive): - Dell Latitude E7240 - Dell Precision M6800 and M4800 - Asrock Z87E-ITX - Asrock Z87M OC Formula - Asrock Fatal1ty Z87 Professional
Change-Id: I4f6e8c97b5122101de2f36bba8ba9f8ddd5b813a Signed-off-by: Iru Cai mytbk920423@gmail.com Signed-off-by: Nicholas Chin nic.c3.14@gmail.com --- M util/autoport/azalia.go A util/autoport/haswell.go M util/autoport/log_reader.go A util/autoport/lynxpoint.go A util/autoport/lynxpoint_lp_gpio.go M util/autoport/main.go 6 files changed, 899 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/30890/37
Attention is currently required from: Angel Pons, Arthur Heymans, Iru Cai, Maxim, Name of user not set #1001638, Nico Huber, Paul Menzel.
Nicholas Chin has posted comments on this change by Iru Cai. ( https://review.coreboot.org/c/coreboot/+/30890?usp=email )
Change subject: autoport: Add support for Haswell-Lynx Point platform ......................................................................
Patch Set 37:
(2 comments)
File util/autoport/haswell.go:
https://review.coreboot.org/c/coreboot/+/30890/comment/46d3c4d6_f3e14867?usp... : PS36, Line 59: 7
What? […]
Done. Checked the Haswell Graphics PRM, Volume 2c: Command Reference: Registers and the lower two bits are marked as reserved and must be zero. On the earlier systems they were used to define the "HPD Short Pulse Duration".
https://review.coreboot.org/c/coreboot/+/30890/comment/6b609218_f171196a?usp... : PS36, Line 132: 0x0d16, 0x0d22, 0x0d26, 0x0d36, /* Mobile 4+3, GT3e */
If we want to drop RegisterPCI for everything except the host bridge, chipset, and devices needing s […]
Done. Added the rest of the PCI IDs.
Attention is currently required from: Arthur Heymans, Iru Cai, Maxim, Name of user not set #1001638, Nicholas Chin, Nico Huber, Paul Menzel.
Angel Pons has posted comments on this change by Iru Cai. ( https://review.coreboot.org/c/coreboot/+/30890?usp=email )
Change subject: autoport: Add support for Haswell-Lynx Point platform ......................................................................
Patch Set 37: Code-Review+2
Attention is currently required from: Arthur Heymans, Iru Cai, Maxim, Name of user not set #1001638, Nicholas Chin, Paul Menzel.
Nico Huber has posted comments on this change by Iru Cai. ( https://review.coreboot.org/c/coreboot/+/30890?usp=email )
Change subject: autoport: Add support for Haswell-Lynx Point platform ......................................................................
Patch Set 37: Code-Review+1
Nico Huber has submitted this change. ( https://review.coreboot.org/c/coreboot/+/30890?usp=email )
Change subject: autoport: Add support for Haswell-Lynx Point platform ......................................................................
autoport: Add support for Haswell-Lynx Point platform
Tested with the following devices (not exhaustive): - Dell Latitude E7240 - Dell Precision M6800 and M4800 - Asrock Z87E-ITX - Asrock Z87M OC Formula - Asrock Fatal1ty Z87 Professional
Change-Id: I4f6e8c97b5122101de2f36bba8ba9f8ddd5b813a Signed-off-by: Iru Cai mytbk920423@gmail.com Signed-off-by: Nicholas Chin nic.c3.14@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/30890 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Angel Pons th3fanbus@gmail.com Reviewed-by: Nico Huber nico.h@gmx.de --- M util/autoport/azalia.go A util/autoport/haswell.go M util/autoport/log_reader.go A util/autoport/lynxpoint.go A util/autoport/lynxpoint_lp_gpio.go M util/autoport/main.go 6 files changed, 899 insertions(+), 3 deletions(-)
Approvals: Nico Huber: Looks good to me, but someone else must approve Angel Pons: Looks good to me, approved build bot (Jenkins): Verified
diff --git a/util/autoport/azalia.go b/util/autoport/azalia.go index c98b03c..6dd78b1 100644 --- a/util/autoport/azalia.go +++ b/util/autoport/azalia.go @@ -61,4 +61,7 @@ RegisterPCI(0x8086, 0x1c20, azalia{}) /* C216/ivybridge */ RegisterPCI(0x8086, 0x1e20, azalia{}) + /* Lynx Point */ + RegisterPCI(0x8086, 0x8c20, azalia{}) + RegisterPCI(0x8086, 0x9c20, azalia{}) } diff --git a/util/autoport/haswell.go b/util/autoport/haswell.go new file mode 100644 index 0000000..588d271 --- /dev/null +++ b/util/autoport/haswell.go @@ -0,0 +1,140 @@ +package main + +import "fmt" + +type haswellmc struct { + variant string +} + +func divceil(a uint32, b uint32) uint32 { + return (a + b - 1) / b +} + +func getPanelCfg(inteltool InteltoolData, isULT bool) string { + var refclk uint32 + var pwm_hz uint32 + + if isULT { + refclk = 24000000 + } else { + refclk = 135000000 + } + if (inteltool.IGD[0xc8254] >> 16) != 0 { + pwm_hz = refclk / 128 / (inteltool.IGD[0xc8254] >> 16) + } else { + pwm_hz = 0 + } + + gpu_panel_power_up_delay := (inteltool.IGD[0xc7208] >> 16) & 0x1fff + gpu_panel_power_backlight_on_delay := inteltool.IGD[0xc7208] & 0x1fff + gpu_panel_power_down_delay := (inteltool.IGD[0xc720c] >> 16) & 0x1fff + gpu_panel_power_backlight_off_delay := inteltool.IGD[0xc720c] & 0x1fff + gpu_panel_power_cycle_delay := inteltool.IGD[0xc7210] & 0x1f + + return fmt.Sprintf(`{ + .up_delay_ms = %3d, + .down_delay_ms = %3d, + .cycle_delay_ms = %3d, + .backlight_on_delay_ms = %3d, + .backlight_off_delay_ms = %3d, + .backlight_pwm_hz = %3d, + }`, + divceil(gpu_panel_power_up_delay, 10), + divceil(gpu_panel_power_down_delay, 10), + (gpu_panel_power_cycle_delay-1)*100, + divceil(gpu_panel_power_backlight_on_delay, 10), + divceil(gpu_panel_power_backlight_off_delay, 10), + pwm_hz) +} + +func (i haswellmc) Scan(ctx Context, addr PCIDevData) { + inteltool := ctx.InfoSource.GetInteltool() + + isULT := (i.variant == "ULT") + DevTree = DevTreeNode{ + Chip: "northbridge/intel/haswell", + MissingParent: "northbridge", + Comment: "FIXME: check ec_present, usb_xhci_on_resume, gfx", + Registers: map[string]string{ + "gpu_dp_b_hotplug": FormatInt32((inteltool.IGD[0xc4030] >> 2) & 4), + "gpu_dp_c_hotplug": FormatInt32((inteltool.IGD[0xc4030] >> 10) & 4), + "gpu_dp_d_hotplug": FormatInt32((inteltool.IGD[0xc4030] >> 18) & 4), + "panel_cfg": getPanelCfg(inteltool, isULT), + "gpu_ddi_e_connected": FormatBool(((inteltool.IGD[0x64000] >> 4) & 1) == 0), + "ec_present": "false", + "usb_xhci_on_resume": "false", + /* FIXME:XX hardcoded. */ + "gfx": "GMA_STATIC_DISPLAYS(0)", + }, + Children: []DevTreeNode{ + { + Chip: "cpu/intel/haswell", + Children: []DevTreeNode{ + { + Chip: "cpu_cluster", + Dev: 0, + Ops: "haswell_cpu_bus_ops", + }, + }, + }, + + { + Chip: "domain", + Dev: 0, + Ops: "haswell_pci_domain_ops", + PCIController: true, + ChildPCIBus: 0, + PCISlots: []PCISlot{ + PCISlot{PCIAddr: PCIAddr{Dev: 0x0, Func: 0}, writeEmpty: true, additionalComment: i.variant}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x1, Func: 0}, writeEmpty: !isULT, additionalComment: "PCIe Bridge for discrete graphics"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x2, Func: 0}, writeEmpty: true, additionalComment: "Internal graphics"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x3, Func: 0}, writeEmpty: true, additionalComment: "Mini-HD audio"}, + }, + }, + }, + } + + if isULT { + DevTree.Registers["dq_pins_interleaved"] = FormatBool(((inteltool.MCHBAR[0x2008] >> 10) & 1) == 0) + } + + PutPCIDev(addr, "Host bridge") + + KconfigBool["NORTHBRIDGE_INTEL_HASWELL"] = true + KconfigBool["HAVE_ACPI_TABLES"] = true + KconfigBool["HAVE_ACPI_RESUME"] = true + + DSDTIncludes = append(DSDTIncludes, DSDTInclude{ + File: "cpu/intel/common/acpi/cpu.asl", + }) + + DSDTPCI0Includes = append(DSDTPCI0Includes, DSDTInclude{ + File: "northbridge/intel/haswell/acpi/hostbridge.asl", + }, DSDTInclude{ + File: "drivers/intel/gma/acpi/default_brightness_levels.asl", + Comment: "FIXME: remove this if the board doesn't have backlight", + }) +} + +func init() { + RegisterPCI(0x8086, 0x0c00, haswellmc{variant: "Desktop"}) + RegisterPCI(0x8086, 0x0c04, haswellmc{variant: "Mobile"}) + RegisterPCI(0x8086, 0x0a04, haswellmc{variant: "ULT"}) + RegisterPCI(0x8086, 0x0c08, haswellmc{variant: "Server"}) + RegisterPCI(0x8086, 0x0d00, haswellmc{variant: "Crystal Well Desktop"}) + RegisterPCI(0x8086, 0x0d04, haswellmc{variant: "Crystal Well Mobile"}) + RegisterPCI(0x8086, 0x0d08, haswellmc{variant: "Crystal Well Server"}) + for _, id := range []uint16{ + 0x0402, 0x0412, 0x041e, 0x0422, 0x0d22, /* Desktop */ + 0x0406, 0x0416, 0x0426, /* Mobile */ + 0x040a, 0x041a, 0x042a, /* Server */ + 0x0a06, 0x0a16, 0x0a26, /* ULT */ + 0x0a0e, 0x0a1e, /* ULX */ + 0x0d16, 0x0d26, 0x0d36, /* Mobile 4+3, GT3e */ + } { + RegisterPCI(0x8086, id, GenericVGA{GenericPCI{Comment: "VGA controller"}}) + } + /* CPU HD Audio */ + RegisterPCI(0x8086, 0x0a0c, GenericPCI{}) + RegisterPCI(0x8086, 0x0c0c, GenericPCI{}) +} diff --git a/util/autoport/log_reader.go b/util/autoport/log_reader.go index b144804..b0518d2 100644 --- a/util/autoport/log_reader.go +++ b/util/autoport/log_reader.go @@ -180,7 +180,10 @@ paragraph := "" ret.GPIO = map[uint16]uint32{} ret.RCBA = map[uint16]uint32{} + ret.IOBP = map[uint32]uint32{} ret.IGD = map[uint32]uint32{} + ret.MCHBAR = map[uint16]uint32{} + ret.PMBASE = map[uint16]uint32{} for scanner.Scan() { line := scanner.Text() switch { @@ -188,10 +191,18 @@ addr, value := 0, 0 fmt.Sscanf(line, "0x%x: 0x%x", &addr, &value) ret.RCBA[uint16(addr)] = uint32(value) + case len(line) > 11 && line[0] == '0' && line[1] == 'x' && line[10] == ':' && paragraph == "IOBP": + addr, value := 0, 0 + fmt.Sscanf(line, "0x%x: 0x%x", &addr, &value) + ret.IOBP[uint32(addr)] = uint32(value) case len(line) > 9 && line[0] == '0' && line[1] == 'x' && line[8] == ':' && paragraph == "IGD": addr, value := 0, 0 fmt.Sscanf(line, "0x%x: 0x%x", &addr, &value) ret.IGD[uint32(addr)] = uint32(value) + case len(line) > 7 && line[0] == '0' && line[1] == 'x' && line[6] == ':' && paragraph == "MCHBAR": + addr, value := 0, 0 + fmt.Sscanf(line, "0x%x: 0x%x", &addr, &value) + ret.MCHBAR[uint16(addr)] = uint32(value) case strings.Contains(line, "DEFAULT"): continue case strings.Contains(line, "DIFF"): @@ -200,6 +211,10 @@ addr, value := 0, 0 fmt.Sscanf(line, "gpiobase+0x%x: 0x%x", &addr, &value) ret.GPIO[uint16(addr)] = uint32(value) + case strings.HasPrefix(line, "pmbase"): + addr, value := 0, 0 + fmt.Sscanf(line, "pmbase+0x%x: 0x%x", &addr, &value) + ret.PMBASE[uint16(addr)] = uint32(value) case strings.HasPrefix(line, "============="): paragraph = strings.Trim(line, "= ") } diff --git a/util/autoport/lynxpoint.go b/util/autoport/lynxpoint.go new file mode 100644 index 0000000..98a1ca8 --- /dev/null +++ b/util/autoport/lynxpoint.go @@ -0,0 +1,490 @@ +package main + +import "fmt" + +type LPVariant int + +const ( + LYNX_POINT_MOBILE LPVariant = iota + LYNX_POINT_DESKTOP + LYNX_POINT_SERVER + LYNX_POINT_ULT +) + +type lynxpoint struct { + variant LPVariant + node *DevTreeNode +} + +func lpPchGetFlashSize(ctx Context) { + inteltool := ctx.InfoSource.GetInteltool() + /* In LP PCH, Boot BIOS Straps field in GCS has only one bit. */ + switch (inteltool.RCBA[0x3410] >> 10) & 1 { + case 0: + ROMProtocol = "SPI" + highflkb := uint32(0) + for reg := uint16(0); reg < 5; reg++ { + fl := (inteltool.RCBA[0x3854+4*reg] >> 16) & 0x1fff + flkb := (fl + 1) << 2 + if flkb > highflkb { + highflkb = flkb + } + } + ROMSizeKB = int(highflkb) + FlashROMSupport = "y" + } +} + +func (b lynxpoint) GetGPIOHeader() string { + return "southbridge/intel/lynxpoint/pch.h" +} + +func (b lynxpoint) EnableGPE(in int) { + if b.variant != LYNX_POINT_ULT { + b.node.Registers[fmt.Sprintf("gpi%d_routing", in)] = "2" + } +} + +func (b lynxpoint) EncodeGPE(in int) int { + return in + 0x10 +} + +func (b lynxpoint) DecodeGPE(in int) int { + return in - 0x10 +} + +func (b lynxpoint) NeedRouteGPIOManually() { + b.node.Comment += ", FIXME: set gpiX_routing for EC support" +} + +func GetLptDesktopEHCISetting(loc_param uint32, txamp uint32) (string, int) { + var port_pos string + var port_length int + + if loc_param == 4 { + port_pos = "USB_PORT_BACK_PANEL" + if txamp <= 2 { + port_length = 0x40 + } else if txamp >= 4 { + port_length = 0x140 + } else { + port_length = 0x110 + } + } else { + port_pos = "USB_PORT_FLEX" + port_length = 0x40 + } + return port_pos, port_length +} + +func GetLptMobileEHCISetting(loc_param uint32, txamp uint32) (string, int) { + var port_pos string + var port_length int + + if loc_param == 4 { + port_pos = "USB_PORT_DOCK" + if txamp <= 1 { + port_length = 0x40 + } else { + port_length = 0x80 + } + } else if loc_param == 6 { + /* not internal, not dock, port_length >= 0x70 */ + port_pos = "USB_PORT_BACK_PANEL" + if txamp <= 2 { + port_length = 0x80 + } else { + port_length = 0x110 + } + } else { + port_pos = "USB_PORT_BACK_PANEL" + port_length = 0x40 + } + return port_pos, port_length +} + +func GetLptLPEHCISetting(loc_param uint32, txamp uint32) (string, int) { + var port_pos string + var port_length int + + if loc_param == 6 { + /* back panel or mini pcie, length >= 0x70 */ + port_pos = "USB_PORT_MINI_PCIE" + if txamp <= 2 { + port_length = 0x80 + } else { + port_length = 0x110 + } + } else if loc_param == 4 { + port_pos = "USB_PORT_DOCK" + if txamp <= 1 { + port_length = 0x40 + } else { + port_length = 0x80 + } + } else { + port_pos = "USB_PORT_BACK_PANEL" + port_length = 0x40 + } + return port_pos, port_length +} + +func (b lynxpoint) Scan(ctx Context, addr PCIDevData) { + + SouthBridge = &b + + inteltool := ctx.InfoSource.GetInteltool() + + isULT := (b.variant == LYNX_POINT_ULT) + + if isULT { + Lynxpoint_LP_GPIO(ctx, inteltool) + } else { + GPIO(ctx, inteltool) + } + + KconfigBool["SOUTHBRIDGE_INTEL_LYNXPOINT"] = true + if isULT { + KconfigBool["INTEL_LYNXPOINT_LP"] = true + } + KconfigBool["SERIRQ_CONTINUOUS_MODE"] = true + if isULT { + KconfigInt["USBDEBUG_HCD_INDEX"] = 1 + } else { + KconfigInt["USBDEBUG_HCD_INDEX"] = 2 + KconfigComment["USBDEBUG_HCD_INDEX"] = "FIXME: check this" + } + + if isULT { + lpPchGetFlashSize(ctx) + } else { + ich9GetFlashSize(ctx) + } + + FADT := ctx.InfoSource.GetACPI()["FACP"] + + sp0dtle_data := (inteltool.IOBP[0xea002750] >> 24) & 0xf + sp0dtle_edge := (inteltool.IOBP[0xea002754] >> 16) & 0xf + sp1dtle_data := (inteltool.IOBP[0xea002550] >> 24) & 0xf + sp1dtle_edge := (inteltool.IOBP[0xea002554] >> 16) & 0xf + + if sp0dtle_data != sp0dtle_edge { + fmt.Printf("Different SATA Gen3 port0 DTLE data and edge values are used.\n") + } + + if sp1dtle_data != sp1dtle_edge { + fmt.Printf("Different SATA Gen3 port1 DTLE data and edge values are used.\n") + } + + cur := DevTreeNode{ + Chip: "southbridge/intel/lynxpoint", + Comment: "Intel Series 8 Lynx Point PCH", + + /* alt_gp_smi_en is not generated because coreboot doesn't use SMI like OEM firmware */ + Registers: map[string]string{ + "gen1_dec": FormatHexLE32(PCIMap[PCIAddr{Bus: 0, Dev: 0x1f, Func: 0}].ConfigDump[0x84:0x88]), + "gen2_dec": FormatHexLE32(PCIMap[PCIAddr{Bus: 0, Dev: 0x1f, Func: 0}].ConfigDump[0x88:0x8c]), + "gen3_dec": FormatHexLE32(PCIMap[PCIAddr{Bus: 0, Dev: 0x1f, Func: 0}].ConfigDump[0x8c:0x90]), + "gen4_dec": FormatHexLE32(PCIMap[PCIAddr{Bus: 0, Dev: 0x1f, Func: 0}].ConfigDump[0x90:0x94]), + "sata_port_map": fmt.Sprintf("0x%x", PCIMap[PCIAddr{Bus: 0, Dev: 0x1f, Func: 2}].ConfigDump[0x92]&0x3f), + "docking_supported": (FormatBool((FADT[113] & (1 << 1)) != 0)), + "sata_port0_gen3_dtle": fmt.Sprintf("0x%x", sp0dtle_data), + "sata_port1_gen3_dtle": fmt.Sprintf("0x%x", sp1dtle_data), + }, + PCISlots: []PCISlot{ + PCISlot{PCIAddr: PCIAddr{Dev: 0x13, Func: 0}, writeEmpty: isULT, additionalComment: "Smart Sound Audio DSP"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x14, Func: 0}, writeEmpty: true, additionalComment: "xHCI Controller"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x15, Func: 0}, writeEmpty: isULT, additionalComment: "Serial I/O DMA"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x15, Func: 1}, writeEmpty: isULT, additionalComment: "I2C0"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x15, Func: 2}, writeEmpty: isULT, additionalComment: "I2C1"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x15, Func: 3}, writeEmpty: isULT, additionalComment: "GSPI0"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x15, Func: 4}, writeEmpty: isULT, additionalComment: "GSPI1"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x15, Func: 5}, writeEmpty: isULT, additionalComment: "UART0"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x15, Func: 6}, writeEmpty: isULT, additionalComment: "UART1"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x16, Func: 0}, writeEmpty: true, additionalComment: "Management Engine Interface 1"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x16, Func: 1}, writeEmpty: true, additionalComment: "Management Engine Interface 2"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x16, Func: 2}, writeEmpty: true, additionalComment: "Management Engine IDE-R"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x16, Func: 3}, writeEmpty: true, additionalComment: "Management Engine KT"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x17, Func: 0}, writeEmpty: isULT, additionalComment: "SDIO"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x19, Func: 0}, writeEmpty: true, additionalComment: "Intel Gigabit Ethernet"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x1a, Func: 0}, writeEmpty: !isULT, additionalComment: "USB2 EHCI #2"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x1b, Func: 0}, writeEmpty: true, additionalComment: "High Definition Audio"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x1c, Func: 0}, writeEmpty: true, additionalComment: "PCIe Port #1"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x1c, Func: 1}, writeEmpty: true, additionalComment: "PCIe Port #2"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x1c, Func: 2}, writeEmpty: true, additionalComment: "PCIe Port #3"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x1c, Func: 3}, writeEmpty: true, additionalComment: "PCIe Port #4"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x1c, Func: 4}, writeEmpty: true, additionalComment: "PCIe Port #5"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x1c, Func: 5}, writeEmpty: true, additionalComment: "PCIe Port #6"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x1c, Func: 6}, writeEmpty: !isULT, additionalComment: "PCIe Port #7"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x1c, Func: 7}, writeEmpty: !isULT, additionalComment: "PCIe Port #8"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x1d, Func: 0}, writeEmpty: true, additionalComment: "USB2 EHCI #1"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x1f, Func: 0}, writeEmpty: true, additionalComment: "LPC bridge"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x1f, Func: 2}, writeEmpty: true, additionalComment: "SATA Controller (AHCI)"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x1f, Func: 3}, writeEmpty: true, additionalComment: "SMBus"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x1f, Func: 5}, writeEmpty: !isULT, additionalComment: "SATA Controller (Legacy)"}, + PCISlot{PCIAddr: PCIAddr{Dev: 0x1f, Func: 6}, writeEmpty: true, additionalComment: "Thermal"}, + }, + } + + if isULT { + cur.Registers["gpe0_en_1"] = fmt.Sprintf("0x%x", inteltool.PMBASE[0x90]) + cur.Registers["gpe0_en_2"] = fmt.Sprintf("0x%x", inteltool.PMBASE[0x94]) + cur.Registers["gpe0_en_3"] = fmt.Sprintf("0x%x", inteltool.PMBASE[0x98]) + cur.Registers["gpe0_en_4"] = fmt.Sprintf("0x%x", inteltool.PMBASE[0x9c]) + } else { + cur.Registers["gpe0_en_1"] = fmt.Sprintf("0x%x", inteltool.PMBASE[0x28]) + cur.Registers["gpe0_en_2"] = fmt.Sprintf("0x%x", inteltool.PMBASE[0x2c]) + } + + b.node = &cur + + PutPCIChip(addr, cur) + PutPCIDevParent(addr, "", "lpc") + + DSDTIncludes = append(DSDTIncludes, DSDTInclude{ + File: "southbridge/intel/common/acpi/platform.asl", + }) + DSDTIncludes = append(DSDTIncludes, DSDTInclude{ + File: "southbridge/intel/lynxpoint/acpi/globalnvs.asl", + Comment: "global NVS and variables", + }) + DSDTIncludes = append(DSDTIncludes, DSDTInclude{ + File: "southbridge/intel/common/acpi/sleepstates.asl", + }) + DSDTPCI0Includes = append(DSDTPCI0Includes, DSDTInclude{ + File: "southbridge/intel/lynxpoint/acpi/pch.asl", + }) + + AddBootBlockFile("bootblock.c", "") + bb := Create(ctx, "bootblock.c") + defer bb.Close() + Add_gpl(bb) + bb.WriteString(`#include <southbridge/intel/lynxpoint/pch.h> + +/* FIXME: remove this if not needed */ +void mainboard_config_superio(void) +{ +} +`) + + sb := Create(ctx, "romstage.c") + defer sb.Close() + Add_gpl(sb) + sb.WriteString(`#include <stdint.h> +#include <northbridge/intel/haswell/haswell.h> +#include <northbridge/intel/haswell/raminit.h> +#include <southbridge/intel/lynxpoint/pch.h> + +void mainboard_config_rcba(void) +{ +} + +/* FIXME: called after romstage_common, remove it if not used */ +void mb_late_romstage_setup(void) +{ +} + +void mb_get_spd_map(struct spd_info *spdi) +{ + /* FIXME: check this */ + spdi->addresses[0] = 0x50; + spdi->addresses[1] = 0x51; + spdi->addresses[2] = 0x52; + spdi->addresses[3] = 0x53; +} + +const struct usb2_port_config mainboard_usb2_ports[MAX_USB2_PORTS] = { + /* FIXME: Length and Location are computed from IOBP values, may be inaccurate */ + /* Length, Enable, OCn#, Location */ +`) + + pdo1 := PCIMap[PCIAddr{Bus: 0, Dev: 0x1d, Func: 0}].ConfigDump[0x64] + ocmap1 := PCIMap[PCIAddr{Bus: 0, Dev: 0x1d, Func: 0}].ConfigDump[0x74:0x78] + + var pdo2 uint8 + var ocmap2 []uint8 + var nPorts uint + if isULT { + nPorts = 8 + } else { + pdo2 = PCIMap[PCIAddr{Bus: 0, Dev: 0x1a, Func: 0}].ConfigDump[0x64] + ocmap2 = PCIMap[PCIAddr{Bus: 0, Dev: 0x1a, Func: 0}].ConfigDump[0x74:0x78] + nPorts = 14 + } + + xusb2pr := GetLE16(PCIMap[PCIAddr{Bus: 0, Dev: 0x14, Func: 0}].ConfigDump[0xd0:0xd4]) + + for port := uint(0); port < nPorts; port++ { + var port_oc int = -1 + var port_pos string + var port_disable uint8 + + if port < 8 { + port_disable = ((pdo1 >> port) & (uint8(xusb2pr>>port) ^ 1)) & 1 + for oc := 0; oc < 4; oc++ { + if (ocmap1[oc] & (1 << port)) != 0 { + port_oc = oc + break + } + } + } else { + port_disable = ((pdo2 >> (port - 8)) & (uint8(xusb2pr>>port) ^ 1)) & 1 + for oc := 0; oc < 4; oc++ { + if (ocmap2[oc] & (1 << (port - 8))) != 0 { + port_oc = oc + 4 + break + } + } + } + + /* get USB2 port length and location from IOBP */ + port_iobp := inteltool.IOBP[0xe5004100+uint32(port)*0x100] + loc_param := (port_iobp >> 8) & 7 + txamp := (port_iobp >> 11) & 7 + var port_length int + + if isULT { + port_pos, port_length = GetLptLPEHCISetting(loc_param, txamp) + } else if b.variant == LYNX_POINT_MOBILE { + port_pos, port_length = GetLptMobileEHCISetting(loc_param, txamp) + } else { /* desktop or server */ + port_pos, port_length = GetLptDesktopEHCISetting(loc_param, txamp) + } + + if port_disable == 1 { + port_pos = "USB_PORT_SKIP" + } + + if port_oc == -1 { + fmt.Fprintf(sb, "\t{ 0x%04x, %d, USB_OC_PIN_SKIP, %s },\n", + port_length, (port_disable ^ 1), port_pos) + } else { + fmt.Fprintf(sb, "\t{ 0x%04x, %d, %d, %s },\n", + port_length, (port_disable ^ 1), port_oc, port_pos) + } + } + + sb.WriteString(`}; + +const struct usb3_port_config mainboard_usb3_ports[MAX_USB3_PORTS] = { +`) + + xpdo := PCIMap[PCIAddr{Bus: 0, Dev: 0x14, Func: 0}].ConfigDump[0xe8] + u3ocm := PCIMap[PCIAddr{Bus: 0, Dev: 0x14, Func: 0}].ConfigDump[0xc8:0xd0] + + if !isULT { + nPorts = 6 + } else { + nPorts = 4 + } + + for port := uint(0); port < nPorts; port++ { + var port_oc int = -1 + port_disable := (xpdo >> port) & 1 + for oc := 0; oc < 8; oc++ { + if (u3ocm[oc] & (1 << port)) != 0 { + port_oc = oc + break + } + } + if port_oc == -1 { + fmt.Fprintf(sb, "\t{ %d, USB_OC_PIN_SKIP },\n", + (port_disable ^ 1)) + } else { + fmt.Fprintf(sb, "\t{ %d, %d },\n", + (port_disable ^ 1), port_oc) + } + } + + sb.WriteString(`}; +`) + +} + +func init() { + for _, id := range []uint16{ + 0x8c41, 0x8c49, 0x8c4b, 0x8c4f, + } { + RegisterPCI(0x8086, uint16(id), lynxpoint{variant: LYNX_POINT_MOBILE}) + } + + for _, id := range []uint16{ + 0x8c42, 0x8c44, 0x8c46, 0x8c4a, + 0x8c4c, 0x8c4e, 0x8c50, 0x8c5c, + } { + RegisterPCI(0x8086, uint16(id), lynxpoint{variant: LYNX_POINT_DESKTOP}) + } + + for _, id := range []uint16{ + 0x8c52, 0x8c54, 0x8c56, + } { + RegisterPCI(0x8086, uint16(id), lynxpoint{variant: LYNX_POINT_SERVER}) + } + + for _, id := range []uint16{ + 0x9c41, 0x9c43, 0x9c45, + } { + RegisterPCI(0x8086, uint16(id), lynxpoint{variant: LYNX_POINT_ULT}) + } + + /* PCIe bridge */ + for _, id := range []uint16{ + 0x8c10, 0x8c12, 0x8c14, 0x8c16, 0x8c18, 0x8c1a, 0x8c1c, 0x8c1e, + 0x9c10, 0x9c12, 0x9c14, 0x9c16, 0x9c18, 0x9c1a, + } { + RegisterPCI(0x8086, id, GenericPCI{}) + } + + /* SMBus controller */ + RegisterPCI(0x8086, 0x8c22, GenericPCI{MissingParent: "smbus"}) + RegisterPCI(0x8086, 0x9c22, GenericPCI{MissingParent: "smbus"}) + + /* SATA */ + for _, id := range []uint16{ + 0x8c00, 0x8c02, 0x8c04, 0x8c06, 0x8c08, 0x8c0e, + 0x8c01, 0x8c03, 0x8c05, 0x8c07, 0x8c09, 0x8c0f, + 0x9c03, 0x9c05, 0x9c07, 0x9c0f, + } { + RegisterPCI(0x8086, id, GenericPCI{}) + } + + /* EHCI */ + for _, id := range []uint16{ + 0x9c26, 0x8c26, 0x8c2d, + } { + RegisterPCI(0x8086, id, GenericPCI{}) + } + + /* XHCI */ + RegisterPCI(0x8086, 0x8c31, GenericPCI{}) + RegisterPCI(0x8086, 0x9c31, GenericPCI{}) + + /* ME and children */ + for _, id := range []uint16{ + 0x8c3a, 0x8c3b, 0x8c3c, 0x8c3d, + 0x9c3a, 0x9c3b, 0x9c3c, 0x9c3d, + } { + RegisterPCI(0x8086, id, GenericPCI{}) + } + + /* Ethernet */ + RegisterPCI(0x8086, 0x8c33, GenericPCI{}) + + /* Thermal */ + RegisterPCI(0x8086, 0x8c24, GenericPCI{}) + RegisterPCI(0x8086, 0x9c24, GenericPCI{}) + + /* LAN Controller on LP PCH (if EEPROM has 0x0000/0xffff in DID) */ + RegisterPCI(0x8086, 0x155a, GenericPCI{}) + + /* SDIO */ + RegisterPCI(0x8086, 0x9c35, GenericPCI{}) + + /* Smart Sound Technology Controller */ + RegisterPCI(0x8086, 0x9c36, GenericPCI{}) + + /* Serial I/O */ + for id := uint16(0x9c60); id <= 0x9c66; id++ { + RegisterPCI(0x8086, id, GenericPCI{}) + } +} diff --git a/util/autoport/lynxpoint_lp_gpio.go b/util/autoport/lynxpoint_lp_gpio.go new file mode 100644 index 0000000..ee5944c --- /dev/null +++ b/util/autoport/lynxpoint_lp_gpio.go @@ -0,0 +1,240 @@ +package main + +import ( + "fmt" + "os" + "strings" +) + +const ( + PIRQI = 0 + PIRQJ = 1 + PIRQK = 2 + PIRQL = 3 + PIRQM = 4 + PIRQN = 5 + PIRQO = 6 + PIRQP = 7 + PIRQQ = 8 + PIRQR = 9 + PIRQS = 10 + PIRQT = 11 + PIRQU = 12 + PIRQV = 13 + PIRQW = 14 + PIRQX = 15 +) + +/* from sb/intel/lynxpoint/lp_gpio.c */ +func lp_gpio_to_pirq(gpioNum uint16) int { + var pirqmap = map[uint16] int { + 8: PIRQI, + 9: PIRQJ, + 10: PIRQK, + 13: PIRQL, + 14: PIRQM, + 45: PIRQN, + 46: PIRQO, + 47: PIRQP, + 48: PIRQQ, + 49: PIRQR, + 50: PIRQS, + 51: PIRQT, + 52: PIRQU, + 53: PIRQV, + 54: PIRQW, + 55: PIRQX, + } + pirq, valid := pirqmap[gpioNum] + if (valid) { + return pirq + } else { + return -1 + } +} + +func conf0str(conf0 uint32) string { + if (conf0 & 1) == 0 { + return "GPIO_MODE_NATIVE" + } else { + s := []string{"GPIO_MODE_GPIO"} + var gpio_output bool + if ((conf0 >> 2) & 1) == 1 { + s = append(s, "GPIO_DIR_INPUT") + gpio_output = false + } else { + s = append(s, "GPIO_DIR_OUTPUT") + gpio_output = true + } + if ((conf0 >> 3) & 1) == 1 { + s = append(s, "GPIO_INVERT") + } + if ((conf0 >> 4) & 1) == 1 { + s = append(s, "GPIO_IRQ_LEVEL") + } + if gpio_output { + if ((conf0 >> 31) & 1) == 1 { + s = append(s, "GPO_LEVEL_HIGH") + } else { + s = append(s, "GPO_LEVEL_LOW") + } + } + return strings.Join(s, " | ") + } +} + +func lpgpio_preset(conf0 uint32, owner uint32, route uint32, irqen uint32, pirq uint32) string { + if conf0 == 0xd { /* 0b1101: MODE_GPIO | INPUT | INVERT */ + if owner == 0 { /* OWNER_ACPI */ + if irqen == 0 && pirq == 0 { + if route == 0 { /* SCI */ + return "GPIO_ACPI_SCI" + } else { + return "GPIO_ACPI_SMI" + } + } + return "" + } else { /* OWNER_GPIO */ + if route == 0 && irqen == 0 && pirq != 0 { + return "GPIO_INPUT_INVERT" + } + return "" + } + } + + if conf0 == 0x5 && owner == 1 { /* 0b101: MODE_GPIO | INPUT, OWNER_GPIO */ + if route == 0 && irqen == 0 { + if pirq == 1 { + return "GPIO_PIRQ" + } else { + return "GPIO_INPUT" + } + } + return "" + } + + if owner == 1 && irqen == 1 { + if route == 0 && pirq == 0 { + if conf0 == 0x5 { /* 0b00101 */ + return "GPIO_IRQ_EDGE" + } + if conf0 == 0x15 { /* 0b10101 */ + return "GPIO_IRQ_LEVEL" + } + } + return "" + } + return "" +} + +func gpio_str(conf0 uint32, conf1 uint32, owner uint32, route uint32, irqen uint32, reset uint32, blink uint32, pirq uint32) string { + s := []string{} + s = append(s, fmt.Sprintf(".conf0 = %s", conf0str(conf0))) + if conf1 != 0 { + s = append(s, fmt.Sprintf(".conf1 = 0x%x", conf1)) + } + if owner != 0 { + s = append(s, ".owner = GPIO_OWNER_GPIO") + } + if route != 0 { + s = append(s, ".route = GPIO_ROUTE_SMI") + } + if irqen != 0 { + s = append(s, ".irqen = GPIO_IRQ_ENABLE") + } + if reset != 0 { + s = append(s, ".reset = GPIO_RESET_RSMRST") + } + if blink != 0 { + s = append(s, ".blink = GPO_BLINK") + } + if pirq != 0 { + s = append(s, ".pirq = GPIO_PIRQ_APIC_ROUTE") + } + return strings.Join(s, ", ") +} + +/* start addresses of GPIO registers */ +const ( + GPIO_OWN = 0x0 + GPIPIRQ2IOXAPIC = 0x10 + GPO_BLINK = 0x18 + GPI_ROUT = 0x30 + GP_RST_SEL = 0x60 + GPI_IE = 0x90 + GPnCONFIGA = 0x100 + GPnCONFIGB = 0x104 +) + +func PrintLPGPIO(gpio *os.File, inteltool InteltoolData) { + for gpioNum := uint16(0); gpioNum <= 94; gpioNum++ { + if gpioNum < 10 { + fmt.Fprintf(gpio, "\t[%d] = ", gpioNum) + } else { + fmt.Fprintf(gpio, "\t[%d] = ", gpioNum) + } + conf0 := inteltool.GPIO[GPnCONFIGA+gpioNum*8] + conf1 := inteltool.GPIO[GPnCONFIGB+gpioNum*8] + set := gpioNum / 32 + bit := gpioNum % 32 + /* owner only effective in GPIO mode */ + owner := (inteltool.GPIO[GPIO_OWN+set*4] >> bit) & 1 + route := (inteltool.GPIO[GPI_ROUT+set*4] >> bit) & 1 + irqen := (inteltool.GPIO[GPI_IE+set*4] >> bit) & 1 + reset := (inteltool.GPIO[GP_RST_SEL+set*4] >> bit) & 1 + var blink, pirq uint32 + /* blink only effective in GPIO output mode */ + if set == 0 { + blink = (inteltool.GPIO[GPO_BLINK] >> bit) & 1 + } else { + blink = 0 + } + irqset := lp_gpio_to_pirq(gpioNum) + if irqset >= 0 { + pirq = (inteltool.GPIO[GPIPIRQ2IOXAPIC] >> uint(irqset)) & 1 + } else { + pirq = 0 + } + + if (conf0 & 1) == 0 { + fmt.Fprintf(gpio, "LP_GPIO_NATIVE,\n") + } else if (conf0 & 4) == 0 { + /* configured as output */ + if ((conf0 >> 31) & 1) == 0 { + fmt.Fprintf(gpio, "LP_GPIO_OUT_LOW,\n") + } else { + fmt.Fprintf(gpio, "LP_GPIO_OUT_HIGH,\n") + } + } else if (conf1 & 4) != 0 { + /* configured as input and sensing disabled */ + fmt.Fprintf(gpio, "LP_GPIO_UNUSED,\n") + } else { + is_preset := false + if conf1 == 0 && reset == 0 && blink == 0 { + preset := lpgpio_preset(conf0, owner, route, irqen, pirq) + if preset != "" { + fmt.Fprintf(gpio, "LP_%s,\n", preset) + is_preset = true + } + } + if !is_preset { + fmt.Fprintf(gpio, "{ %s },\n", gpio_str(conf0, conf1, owner, route, irqen, reset, blink, pirq)) + } + } + } +} + +func Lynxpoint_LP_GPIO(ctx Context, inteltool InteltoolData) { + gpio := Create(ctx, "gpio.c") + defer gpio.Close() + + AddROMStageFile("gpio.c", "") + + Add_gpl(gpio) + gpio.WriteString(`#include <southbridge/intel/lynxpoint/lp_gpio.h> + +const struct pch_lp_gpio_map mainboard_lp_gpio_map[] = { +`) + PrintLPGPIO(gpio, inteltool) + gpio.WriteString("\tLP_GPIO_END\n};\n") +} diff --git a/util/autoport/main.go b/util/autoport/main.go index 21dbbf0..8a3ee6c 100644 --- a/util/autoport/main.go +++ b/util/autoport/main.go @@ -31,9 +31,12 @@ }
type InteltoolData struct { - GPIO map[uint16]uint32 - RCBA map[uint16]uint32 - IGD map[uint32]uint32 + GPIO map[uint16]uint32 + RCBA map[uint16]uint32 + IOBP map[uint32]uint32 + IGD map[uint32]uint32 + MCHBAR map[uint16]uint32 + PMBASE map[uint16]uint32 }
type DMIData struct { @@ -253,6 +256,7 @@ SubVendor uint16 SubSystem uint16 Chip string + Ops string Comment string }
@@ -380,6 +384,10 @@ fmt.Fprintf(dt, " # %s", dev.Comment) } fmt.Fprintf(dt, "\n") + if dev.Ops != "" { + Offset(dt, offset+1) + fmt.Fprintf(dt, "ops %s\n", dev.Ops) + } if dev.Chip == "pci" && dev.SubSystem != 0 && dev.SubVendor != 0 { Offset(dt, offset+1) fmt.Fprintf(dt, "subsystemid 0x%04x 0x%04x\n", dev.SubVendor, dev.SubSystem)