Patrick Georgi (patrick(a)georgi-clan.de) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4409
-gerrit
commit 5f9c3deabc6df025d528c25cabb67e5a3ccca25e
Author: Duncan Laurie <dlaurie(a)chromium.org>
Date: Tue Jul 30 16:15:14 2013 -0700
lynxpoint: XHCI: Advertise D3 as lowest wake state
The recommended value in docs is D2, but lynxpoint XHCI does not even
support D2 state which causes the kernel to think this device cannot
be used as a wake source:
kernel: xhci_hcd 0000:00:14.0: System wakeup enabled by ACPI
kernel: ACPI: Device does not support D2
kernel: xhci_hcd 0000:00:14.0: System wakeup disabled by ACPI
Additionally this means the kernel will never put the device into D3
state by itself. There is SMI code that will put the device into D3
before suspend so advertising D3 here should be correct.
With this change the kernel will put the controller into D3 on suspend
and back to D0 on resume, including executing the ACPI methods
for _PS0/_PS3 that contain chipset specific workarounds.
In addition add a _PSC method to directly return the D state from the
device registers. With ALL USB devices removed the XHCI controller
goes into D3 state and the kernel can have a hard time determining
the state of the device at boot.
A kernel compiled with CONFIG_ACPI_DEBUG=y and module parameters
acpi.debug_layer=0x7f acpi.debug_level=0x2f can be used to see
what ACPI methods are executed:
kernel: xhci_hcd 0000:00:14.0: System wakeup enabled by ACPI
kernel: ACPI: Execute Method [\_SB_.PCI0.XHCI._PS3] (Node ffff8801000a7f50)
kernel: ACPI: Preparing to enter system sleep state S3
...
kernel: ACPI: Waking up from system sleep state S3
kernel: ACPI: Execute Method [\_SB_.PCI0.XHCI._PS0] (Node ffff8801000a7f28)
kernel: xhci_hcd 0000:00:14.0: power state changed by ACPI to D0
Change-Id: Ic64040eb4dd1947a1e2f0ee253a64be683e0ec70
Signed-off-by: Duncan Laurie <dlaurie(a)chromium.org>
meld with s3d
Change-Id: Ic6789720c4efe661dcb03a4afce8d88115854472
Reviewed-on: https://gerrit.chromium.org/gerrit/63916
Tested-by: Duncan Laurie <dlaurie(a)chromium.org>
Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
Commit-Queue: Duncan Laurie <dlaurie(a)chromium.org>
---
src/southbridge/intel/lynxpoint/acpi/usb.asl | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/southbridge/intel/lynxpoint/acpi/usb.asl b/src/southbridge/intel/lynxpoint/acpi/usb.asl
index 1a0ad34..c22dbb8 100644
--- a/src/southbridge/intel/lynxpoint/acpi/usb.asl
+++ b/src/southbridge/intel/lynxpoint/acpi/usb.asl
@@ -238,6 +238,11 @@ Device (XHCI)
LPCL ()
}
+ Method (_PSC, 0, NotSerialized)
+ {
+ Return (^D0D3)
+ }
+
Method (_PS0, 0, Serialized)
{
If (LEqual (^DVID, 0xFFFF)) {
@@ -375,12 +380,12 @@ Device (XHCI)
Method(_S3D,0) // Highest D State in S3 State
{
- Return (2)
+ Return (3)
}
Method(_S4D,0) // Highest D State in S4 State
{
- Return (2)
+ Return (3)
}
Device (HUB7)
Patrick Georgi (patrick(a)georgi-clan.de) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4407
-gerrit
commit 64aaa1ddd2e0740d67d485bc5c88a8a22c33ed15
Author: Duncan Laurie <dlaurie(a)chromium.org>
Date: Tue Jul 30 16:05:55 2013 -0700
lynxpoint: Route all USB ports to XHCI in finalize step
This commit adds a new Kconfig option for the LynxPoint
southbridge that will have coreboot route all of the USB
ports to the XHCI controller in the finalize step (i.e.
after the bootloader) and disable the EHCI controller(s).
Additionally when doing this the XHCI USB3 ports need
to be put into an expected state on resume in order to make
the kernel state machine happy.
Part of this could also be done in depthcharge but there
are also some resume-time steps required so it makes sense
to keep it all together in coreboot.
This can theoretically save ~100mW at runtime.
Verify that the EHCI controller is not found in Linux and
that booting from USB still works.
Change-Id: I3ddfecc0ab12a4302e6034ea8d13ccd8ea2a655d
Signed-off-by: Duncan Laurie <dlaurie(a)chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/63802
Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
---
src/include/cpu/x86/smm.h | 1 +
src/southbridge/intel/lynxpoint/Kconfig | 7 +++
src/southbridge/intel/lynxpoint/pch.h | 1 +
src/southbridge/intel/lynxpoint/smihandler.c | 7 +++
src/southbridge/intel/lynxpoint/usb_xhci.c | 90 ++++++++++++++++++++++++++++
5 files changed, 106 insertions(+)
diff --git a/src/include/cpu/x86/smm.h b/src/include/cpu/x86/smm.h
index 607c0f0..feb50ec 100644
--- a/src/include/cpu/x86/smm.h
+++ b/src/include/cpu/x86/smm.h
@@ -372,6 +372,7 @@ typedef struct {
#define APM_CNT_ACPI_ENABLE 0xe1
#define APM_CNT_MBI_UPDATE 0xeb
#define APM_CNT_GNVS_UPDATE 0xea
+#define APM_CNT_FINALIZE 0xcb
#define APM_STS 0xb3
/* SMI handler function prototypes */
diff --git a/src/southbridge/intel/lynxpoint/Kconfig b/src/southbridge/intel/lynxpoint/Kconfig
index 28ebdb6..5ff00db 100644
--- a/src/southbridge/intel/lynxpoint/Kconfig
+++ b/src/southbridge/intel/lynxpoint/Kconfig
@@ -76,4 +76,11 @@ config ME_MBP_CLEAR_LATE
finalize step. This can speed up boot time if the ME takes
a long time to indicate this status.
+config FINALIZE_USB_ROUTE_XHCI
+ bool "Route all ports to XHCI controller in finalize step"
+ default y
+ help
+ If you set this option to y, the USB ports will be routed
+ to the XHCI controller during the finalize SMM callback.
+
endif
diff --git a/src/southbridge/intel/lynxpoint/pch.h b/src/southbridge/intel/lynxpoint/pch.h
index c16c009..6e1b10c 100644
--- a/src/southbridge/intel/lynxpoint/pch.h
+++ b/src/southbridge/intel/lynxpoint/pch.h
@@ -92,6 +92,7 @@ void intel_pch_finalize_smm(void);
void usb_ehci_sleep_prepare(device_t dev, u8 slp_typ);
void usb_ehci_disable(device_t dev);
void usb_xhci_sleep_prepare(device_t dev, u8 slp_typ);
+void usb_xhci_route_all(void);
#endif
diff --git a/src/southbridge/intel/lynxpoint/smihandler.c b/src/southbridge/intel/lynxpoint/smihandler.c
index e920cfe..d1e9bbc 100644
--- a/src/southbridge/intel/lynxpoint/smihandler.c
+++ b/src/southbridge/intel/lynxpoint/smihandler.c
@@ -135,8 +135,10 @@ static void southbridge_smi_sleep(void)
mainboard_smi_sleep(slp_typ-2);
/* USB sleep preparations */
+#if !CONFIG_FINALIZE_USB_ROUTE_XHCI
usb_ehci_sleep_prepare(PCH_EHCI1_DEV, slp_typ);
usb_ehci_sleep_prepare(PCH_EHCI2_DEV, slp_typ);
+#endif
usb_xhci_sleep_prepare(PCH_XHCI_DEV, slp_typ);
#if CONFIG_ELOG_GSMI
@@ -314,6 +316,11 @@ static void southbridge_smi_apmc(void)
printk(BIOS_DEBUG, "SMI#: Setting GNVS to %p\n", gnvs);
}
break;
+ case APM_CNT_FINALIZE:
+#if CONFIG_FINALIZE_USB_ROUTE_XHCI
+ usb_xhci_route_all();
+#endif
+ break;
#if CONFIG_ELOG_GSMI
case ELOG_GSMI_APM_CNT:
southbridge_smi_gsmi();
diff --git a/src/southbridge/intel/lynxpoint/usb_xhci.c b/src/southbridge/intel/lynxpoint/usb_xhci.c
index 5adf88c..dbf0f40 100644
--- a/src/southbridge/intel/lynxpoint/usb_xhci.c
+++ b/src/southbridge/intel/lynxpoint/usb_xhci.c
@@ -189,6 +189,47 @@ void usb_xhci_sleep_prepare(device_t dev, u8 slp_typ)
pci_or_config16(dev, XHCI_PWR_CTL_STS, PWR_CTL_ENABLE_PME);
}
+/* Route all ports to XHCI controller */
+void usb_xhci_route_all(void)
+{
+ u32 port_mask, route;
+ u16 reg16;
+
+ /* Skip if EHCI is already disabled */
+ if (RCBA32(FD) & PCH_DISABLE_EHCI1)
+ return;
+
+ /* Set D0 state */
+ reg16 = pci_read_config16(PCH_XHCI_DEV, XHCI_PWR_CTL_STS);
+ reg16 &= ~PWR_CTL_SET_MASK;
+ reg16 |= PWR_CTL_SET_D0;
+ pci_write_config16(PCH_XHCI_DEV, XHCI_PWR_CTL_STS, reg16);
+
+ /* Set USB3 superspeed enable */
+ port_mask = pci_read_config32(PCH_XHCI_DEV, XHCI_USB3PRM);
+ route = pci_read_config32(PCH_XHCI_DEV, XHCI_USB3PR);
+ route &= ~XHCI_USB3PR_SSEN;
+ route |= XHCI_USB3PR_SSEN & port_mask;
+ pci_write_config32(PCH_XHCI_DEV, XHCI_USB3PR, route);
+
+ /* Route USB2 ports to XHCI controller */
+ port_mask = pci_read_config32(PCH_XHCI_DEV, XHCI_USB2PRM);
+ route = pci_read_config32(PCH_XHCI_DEV, XHCI_USB2PR);
+ route &= ~XHCI_USB2PR_HCSEL;
+ route |= XHCI_USB2PR_HCSEL & port_mask;
+ pci_write_config32(PCH_XHCI_DEV, XHCI_USB2PR, route);
+
+ /* Disable EHCI controller */
+ usb_ehci_disable(PCH_EHCI1_DEV);
+
+ /* LynxPoint-H has a second EHCI controller */
+ if (!pch_is_lp())
+ usb_ehci_disable(PCH_EHCI2_DEV);
+
+ /* Reset and clear port change status */
+ usb_xhci_reset_usb3(PCH_XHCI_DEV, 1);
+}
+
#else /* !__SMM__ */
static void usb_xhci_clock_gating(device_t dev)
@@ -237,6 +278,49 @@ static void usb_xhci_clock_gating(device_t dev)
pci_write_config32(dev, 0xa4, reg32);
}
+/* Re-enable ports that are disabled */
+static void usb_xhci_enable_ports_usb3(device_t dev)
+{
+#if CONFIG_FINALIZE_USB_ROUTE_XHCI
+ int port;
+ u32 portsc, status, disabled;
+ u32 mem_base = usb_xhci_mem_base(dev);
+ int port_count = usb_xhci_port_count_usb3(dev);
+
+ if (!mem_base || !port_count)
+ return;
+
+ /* Get port disable override map */
+ disabled = pci_read_config32(dev, XHCI_USB3PDO);
+
+ for (port = 0; port < port_count; port++) {
+ /* Skip overridden ports */
+ if (disabled & (1 << port))
+ continue;
+ portsc = mem_base + XHCI_USB3_PORTSC(port);
+ status = read32(portsc) & XHCI_USB3_PORTSC_PLS;
+
+ switch (status) {
+ case XHCI_PLSR_RXDETECT:
+ /* Clear change status */
+ printk(BIOS_DEBUG, "usb_xhci reset port %d\n", port);
+ usb_xhci_reset_status_usb3(mem_base, port);
+ break;
+ case XHCI_PLSR_DISABLED:
+ default:
+ /* Transition to enabled */
+ printk(BIOS_DEBUG, "usb_xhci enable port %d\n", port);
+ usb_xhci_reset_port_usb3(mem_base, port);
+ status = read32(portsc);
+ status &= ~XHCI_USB3_PORTSC_PLS;
+ status |= XHCI_PLSW_ENABLE | XHCI_USB3_PORTSC_LWS;
+ write32(portsc, status);
+ break;
+ }
+ }
+#endif
+}
+
static void usb_xhci_init(device_t dev)
{
struct resource *bar0 = find_resource(dev, PCI_BASE_ADDRESS_0);
@@ -305,6 +389,12 @@ static void usb_xhci_init(device_t dev)
reg32 &= ~(1 << 23); /* unsupported request */
reg32 |= (1 << 31);
pci_write_config32(dev, 0x40, reg32);
+
+#if CONFIG_HAVE_ACPI_RESUME
+ /* Enable ports that are disabled before returning to OS */
+ if (acpi_slp_type == 3)
+ usb_xhci_enable_ports_usb3(dev);
+#endif
}
static void usb_xhci_set_subsystem(device_t dev, unsigned vendor,
the following patch was just integrated into master:
commit c0ab219040be9329a5b233da7513e54be5ec3c60
Author: David Hendricks <dhendrix(a)chromium.org>
Date: Thu Aug 1 19:09:21 2013 -0700
pit: disable LCD FETs before doing any graphics init
This ensures that the LCD FETs are off before we do graphics init.
FIXME: The location of the code is sub-optimal and should probably be
done in romstage, but there are __PRE_RAM__ considerations to take
into account.
Signed-off-by: David Hendricks <dhendrix(a)chromium.org>
Change-Id: I0844030d0a0e51eee1d29f1762f0b495777268df
Reviewed-on: https://gerrit.chromium.org/gerrit/64305
Reviewed-by: Ronald G. Minnich <rminnich(a)chromium.org>
Commit-Queue: Ronald G. Minnich <rminnich(a)chromium.org>
Tested-by: Ronald G. Minnich <rminnich(a)chromium.org>
See http://review.coreboot.org/4470 for details.
-gerrit
the following patch was just integrated into master:
commit b1b9e4e583a451b97fbd379e2b1f8ecc16e12119
Author: David Hendricks <dhendrix(a)chromium.org>
Date: Mon Aug 12 14:52:45 2013 -0700
exynos5420: Assign corect parent PLLs
Assign correct parent PLL's for the following clocks:
ACLK_400_WCORE (MPLL->CPLL) (400 -> 333MHz)
PCLK_200_FSYS (MPLL->DPLL) (200 -> 200MHz)
MUX_ACLK_100_NOC_SEL (MPLL -> DPLL) (100 -> 100MHz)
ACLK_266 (DPLL->MPLL) (300 -> 266MHz)
ACLK_200_DISP1(MPLL->DPLL) (200 -> 200MHz)
ACLK_400_MSCL(MPLL->CPLL) (400 -> 333MHz)
ACLK_66 (MPLL->CPLL) (66.666 -> 66.6MHz)
MUX_ACLK_400_DISP1_SEL (CPLL->DPLL) (666 -> 300MHz)
MUX_MPHY_REFCLK (MPLL->OSC)
MUX_UNIPRO (MPLL->OSC)
MUX_MIPI1 (EPLL->OSC)
MUX_DP1_EXT_VID (EPLL->OSC)
MUX_FIMD1_OPT (EPLL->OSC)
MUX_IPLL(IPLL->OSC)
This also corrects the clock dividers for few of the clocks,
as the clock parent changes affect the final frequency of the
clocks.
This is ported from: https://gerrit.chromium.org/gerrit/#/c/62437/
Signed-off-by: David Hendricks <dhendrix(a)chromium.org>
Change-Id: Ie833c01913d0961a6190446bd573511de8dee5f8
Reviewed-on: https://gerrit.chromium.org/gerrit/65620
Commit-Queue: Ronald G. Minnich <rminnich(a)chromium.org>
Reviewed-by: Ronald G. Minnich <rminnich(a)chromium.org>
Tested-by: Ronald G. Minnich <rminnich(a)chromium.org>
See http://review.coreboot.org/4469 for details.
-gerrit
the following patch was just integrated into master:
commit 50214f893dd0dd58911bcf3760265c4a58c92d3d
Author: David Hendricks <dhendrix(a)chromium.org>
Date: Mon Aug 12 13:24:24 2013 -0700
exynos5420: don't assume MPLL for i2c parent clock
This reads the clock select field for MUX_ACLK_66_SEL in the
CLK_SRC_TOP1 register in order to obtain the source clock rate
for I2C peripherals. Before we were always assuming that the source
was the MPLL.
Unfortunately not all fields in the CLK_SRC_TOPn registers are
enumerated the same with regard to clock select. So this is just
a one-off for now.
This is basically ported from https://gerrit.chromium.org/gerrit/#/c/62443.
Signed-off-by: David Hendricks <dhendrix(a)chromium.org>
Change-Id: I9fa85194ae1a1fadab79695f059efdc2e2f1f75f
Reviewed-on: https://gerrit.chromium.org/gerrit/65611
Reviewed-by: Ronald G. Minnich <rminnich(a)chromium.org>
Tested-by: David Hendricks <dhendrix(a)chromium.org>
Commit-Queue: David Hendricks <dhendrix(a)chromium.org>
See http://review.coreboot.org/4468 for details.
-gerrit
the following patch was just integrated into master:
commit c31eb3619d09671960d6fa2614c53fc5dfa2e4cf
Author: David Hendricks <dhendrix(a)chromium.org>
Date: Fri Aug 9 18:59:02 2013 -0700
exynos5420: Set SPLL to 400MHz
Increase SPLL to 400MHz from 300MHz as we set SPLL as the
switching parent for ARM and KFC. This value is as per
recommendation of the hardware team.
This is ported from https://gerrit.chromium.org/gerrit/62618
Signed-off-by: David Hendricks <dhendrix(a)chromium.org>
Change-Id: I8a5a5b957083b0b1f3e3e318fe5753cf7ae19223
Reviewed-on: https://gerrit.chromium.org/gerrit/65432
Reviewed-by: Gabe Black <gabeblack(a)chromium.org>
Tested-by: David Hendricks <dhendrix(a)chromium.org>
Commit-Queue: Gabe Black <gabeblack(a)chromium.org>
See http://review.coreboot.org/4464 for details.
-gerrit
the following patch was just integrated into master:
commit 21c908bf6280b4c52dc983f0deb25b3439f75b27
Author: David Hendricks <dhendrix(a)chromium.org>
Date: Thu Aug 8 20:45:53 2013 -0700
exynos5420: re-factor clock_get_periph_rate()
This re-factors clock_get_periph_rate() to be a simpler and also
make a few corrections along the way. To summarize:
- clk_bit_info is no longer used. It had numerous errors and was
really painful anyway since it was just a bunch of opaque magic
numbers that made bugs non-obvious.
- Clock source bitfields for peripherals handled in the switch
statement are 3 bits, not 4. Some divider values are 3 bits,
some are 4. The earlier code always assumed 4 bits for both
which included reserved bits in many cases.
- UART source clock and divider shift values were wrong.
- PWM clock divider was being read from the wrong register.
- SPI3 divider value was being read from the wrong register.
- There was a really confusing calculation for SDMMC0 and SDMMC2
clock rates, but it was never actually used since the switch
statement never handled PERIPH_ID_SDMMC{0,2} and would thus
return if they were ever passed into this function.
Signed-off-by: David Hendricks <dhendrix(a)chromium.org>
Change-Id: I0a03a64d8b42fbe83dbf377292597ce681b22f4b
Reviewed-on: https://gerrit.chromium.org/gerrit/65284
Commit-Queue: David Hendricks <dhendrix(a)chromium.org>
Tested-by: David Hendricks <dhendrix(a)chromium.org>
Reviewed-by: Gabe Black <gabeblack(a)chromium.org>
See http://review.coreboot.org/4463 for details.
-gerrit
the following patch was just integrated into master:
commit 568a2b0f9800e31e28465191801b9f36194b1e3a
Author: David Hendricks <dhendrix(a)chromium.org>
Date: Thu Aug 8 19:03:03 2013 -0700
exynos5420: add a peripheral clock select --> PLL decoder
This adds a helper function to translate between peripheral clock
select fields in clock source registers and PLLs. Some of this was
already done to handle a few special cases, this generalizes the
earlier work so that follow-up patches can do further clean-up.
Unfortunately, the PLLs represented by clock select fields in
various modules are not uniformly ordered. So for now we focus on
peripheral clock sources only.
Signed-off-by: David Hendricks <dhendrix(a)chromium.org>
Change-Id: Id58a3e488650d09e6a35c22d5394fcbf0ee9ddff
Reviewed-on: https://gerrit.chromium.org/gerrit/65283
Commit-Queue: David Hendricks <dhendrix(a)chromium.org>
Tested-by: David Hendricks <dhendrix(a)chromium.org>
Reviewed-by: Gabe Black <gabeblack(a)chromium.org>
See http://review.coreboot.org/4462 for details.
-gerrit