Duncan Laurie has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/31056
Change subject: soc/intel/cannonlake: Export function to set After G3 state
......................................................................
soc/intel/cannonlake: Export function to set After G3 state
Export the SOC level function to set the After G3 state so it
can be changed by the mainboard. The setting will be restored
by a normal boot but in some circumstances coreboot wants to
ensure that it will be powered up again after a reset.
BUG=b:121380403
TEST=update cr50 firmware on sarien and reboot and ensure the
host does not power off after the cr50 initiated reset.
Change-Id: I6cd572ac91229584b9907f87bb4b340963203c32
Signed-off-by: Duncan Laurie <dlaurie(a)google.com>
---
M src/soc/intel/cannonlake/include/soc/pmc.h
M src/soc/intel/cannonlake/pmc.c
2 files changed, 5 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/56/31056/1
diff --git a/src/soc/intel/cannonlake/include/soc/pmc.h b/src/soc/intel/cannonlake/include/soc/pmc.h
index 992e60d..c3957d3 100644
--- a/src/soc/intel/cannonlake/include/soc/pmc.h
+++ b/src/soc/intel/cannonlake/include/soc/pmc.h
@@ -162,4 +162,8 @@
#define SCIS_IRQ21 5
#define SCIS_IRQ22 6
#define SCIS_IRQ23 7
+
+struct device;
+void pmc_set_afterg3(struct device *dev, int s5pwr);
+
#endif
diff --git a/src/soc/intel/cannonlake/pmc.c b/src/soc/intel/cannonlake/pmc.c
index 4dabb2e..e111e94 100644
--- a/src/soc/intel/cannonlake/pmc.c
+++ b/src/soc/intel/cannonlake/pmc.c
@@ -30,7 +30,7 @@
* Set which power state system will be after reapplying
* the power (from G3 State)
*/
-static void pmc_set_afterg3(struct device *dev, int s5pwr)
+void pmc_set_afterg3(struct device *dev, int s5pwr)
{
uint8_t reg8;
uint8_t *pmcbase = pmc_mmio_regs();
--
To view, visit https://review.coreboot.org/c/coreboot/+/31056
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I6cd572ac91229584b9907f87bb4b340963203c32
Gerrit-Change-Number: 31056
Gerrit-PatchSet: 1
Gerrit-Owner: Duncan Laurie <dlaurie(a)chromium.org>
Gerrit-MessageType: newchange
Duncan Laurie has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/31055
Change subject: soc/intel/cannonlake: Disable CpuRatio and SaGv in recovery
......................................................................
soc/intel/cannonlake: Disable CpuRatio and SaGv in recovery
Disabling CpuRatio UPD for FSP will ensure it does not force a
hard reset to set the CPU Flex Ratio at boot. This is important
in a recovery mode boot where the SOC will lose power and need
to set the flex ratio again.
Disabling SaGv makes recovery mode training faster and mirrors
the setting that was done on Skylake.
BUG=b:123305400
TEST=reliably enter recovery mode on sarien
Change-Id: Ie9664493a980af9acce82faff81f4c4b1355be73
Signed-off-by: Duncan Laurie <dlaurie(a)google.com>
---
M src/soc/intel/cannonlake/romstage/fsp_params.c
1 file changed, 8 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/55/31055/1
diff --git a/src/soc/intel/cannonlake/romstage/fsp_params.c b/src/soc/intel/cannonlake/romstage/fsp_params.c
index 91810e8..ed7ece5 100644
--- a/src/soc/intel/cannonlake/romstage/fsp_params.c
+++ b/src/soc/intel/cannonlake/romstage/fsp_params.c
@@ -20,6 +20,7 @@
#include <soc/iomap.h>
#include <soc/pci_devs.h>
#include <soc/romstage.h>
+#include <vendorcode/google/chromeos/chromeos.h>
static void soc_memory_init_params(FSP_M_CONFIG *m_cfg, const config_t *config)
{
@@ -54,6 +55,13 @@
#if IS_ENABLED(CONFIG_SOC_INTEL_COFFEELAKE)
m_cfg->SkipMpInit = !chip_get_fsp_mp_init();
#endif
+
+ /* Disable CPU Flex Ratio and SaGv in recovery mode */
+ if (vboot_recovery_mode_enabled()) {
+ m_cfg->CpuRatio = 0;
+ m_cfg->SaGv = 0;
+ }
+
/* If ISH is enabled, enable ISH elements */
if (!dev)
m_cfg->PchIshEnable = 0;
--
To view, visit https://review.coreboot.org/c/coreboot/+/31055
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ie9664493a980af9acce82faff81f4c4b1355be73
Gerrit-Change-Number: 31055
Gerrit-PatchSet: 1
Gerrit-Owner: Duncan Laurie <dlaurie(a)chromium.org>
Gerrit-MessageType: newchange
Chandana Kishori Chiluveru has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/25213 )
Change subject: sdm845: Add USB support on cheza platform
......................................................................
Patch Set 65:
(7 comments)
https://review.coreboot.org/#/c/25213/64/src/mainboard/google/cheza/mainboa…
File src/mainboard/google/cheza/mainboard.c:
https://review.coreboot.org/#/c/25213/64/src/mainboard/google/cheza/mainboa…
PS64, Line 30: /* Setting up Secondary USB DWC3 controller. */
> nit: maybe mention that the primary isn't needed here because it's only used for DP on Cheza?
Ok
i will modify this as below
/*
* Primary USB is used only for DP functionality on cheza platform.
* Hence Setting up only Secondary USB DWC3 controller.
*/
https://review.coreboot.org/#/c/25213/64/src/mainboard/google/cheza/romstag…
File src/mainboard/google/cheza/romstage.c:
https://review.coreboot.org/#/c/25213/64/src/mainboard/google/cheza/romstag…
PS64, Line 22: these resets
: * off early so they get
> nit: singular now
"these resets" here i mean is core+ PHYs resets which is plural here.
reset_usb() on usb.c driver takes care of all the resets(usb core+qub phy+qmp phy) required for usb.
>>>>
/* Assert Core reset */
clock_reset_bcr(dwc3->usb3_bcr, 1);
/* Assert QUSB PHY reset */
clock_reset_bcr(dwc3->qusb2phy_bcr, 1);
/* Assert QMP PHY reset */
clock_reset_bcr(dwc3->gcc_usb3phy_bcr_reg, 1);
clock_reset_bcr(dwc3->gcc_qmpphy_bcr_reg, 1);
https://review.coreboot.org/#/c/25213/64/src/soc/qualcomm/sdm845/usb.c
File src/soc/qualcomm/sdm845/usb.c:
https://review.coreboot.org/#/c/25213/64/src/soc/qualcomm/sdm845/usb.c@359
PS64, Line 359: static const struct qmp_phy_init_tbl qmp_v3_usb3_serdes_tbl[] = {
> Okay, this is too much duplication. […]
for phy initialization order should be important. we can not change the sequence in SW which is suggested in HPG.
if you remember the ss change which i pushed separatly i used the same logic which you suggested here
https://review.coreboot.org/c/coreboot/+/29200/6/src/soc/qualcomm/sdm845/us…
static void qcom_qmp_phy_configure(void *base,
const struct qmp_phy_init_tbl tbl[],
int num)
{
int i;
const struct qmp_phy_init_tbl *t = tbl;
if (!t)
return;
for (i = 0; i < num; i++, t++)
write32(base + t->offset, t->val);
}
static void ss_qmp_uni_phy_init(struct usb_dwc3_cfg *dwc3)
{
struct stopwatch sw;
void *phy_base = dwc3->qmp_phy_base;
/* power up USB3 PHY */
write32(phy_base + USB3_UNI_POWER_DOWN_CONTROL, 0x01);
/* Serdes configuration */
qcom_qmp_phy_configure(&dwc3->qmp_phy_base->usb3_uniphy_qmp_pll_reg,
dwc3->serdes_tbl,
dwc3->serdes_tbl_num);
/* Tx, Rx, and PCS configurations */
qcom_qmp_phy_configure(&dwc3->qmp_phy_base->usb3_uniphy_qmp_tx,
dwc3->tx_tbl, dwc3->tx_tbl_num);
qcom_qmp_phy_configure(&dwc3->qmp_phy_base->usb3_uniphy_qmp_rx,
dwc3->rx_tbl, dwc3->rx_tbl_num);
qcom_qmp_phy_configure(&dwc3->qmp_phy_base->usb3_uniphy_qmp_pcs,
dwc3->pcs_tbl, dwc3->pcs_tbl_num);
/* perform software reset of PCS/Serdes */
write32(phy_base + USB3_UNI_SW_RESET, 0x00);
/* start PCS/Serdes to operation mode */
write32(phy_base + USB3_UNI_START, 0x03);
I did these changes again to make use of registers from the structures.
https://review.coreboot.org/#/c/25213/64/src/soc/qualcomm/sdm845/usb.c@467
PS64, Line 467: usb3_uniphy
> nit: it's a little confusing that these structs are all called "usb3" and "usb3_uniphy"... […]
Here usb_uniphy is uniphy which is used for secondary port.
USB3 phy is primay phy( USB+DP phy).
we can use this macro directly to search the registers related to the phy qmp in HPG document for SW programming.
https://review.coreboot.org/#/c/25213/64/src/soc/qualcomm/sdm845/usb.c@585
PS64, Line 585: int serdes_tbl_num;
> Only one table (the first one with the differences) needs to remain here if you combine them as ment […]
we can not do this as we have differences in all the regsiter sets(serdes, tx,rx,pcs).
below are the differences for q phys
{&qserdes_com_reg_layout->com_bias_en_clkbuflr_en, 0x08},
{&qserdes_com_reg_layout->com_cmn_config, 0x16},
{&uniphy_qserdes_com_reg_layout->com_bias_en_clkbuflr_en, 0x04},
{&uniphy_qserdes_com_reg_layout->com_cmn_config, 0x06},
{&qserdes_tx_reg_layout->tx_lane_mode_1, 0x16},
{&qserdes_tx_reg_layout->tx_res_code_lane_offset_rx, 0x09},
{&uniphy_qserdes_tx_reg_layout->tx_lane_mode_1, 0xc6},
{&uniphy_qserdes_tx_reg_layout->tx_res_code_lane_offset_rx, 0x06},
{&qserdes_rx_reg_layout->rx_rx_equ_adap_ctrl2, 0x0f},
{&qserdes_rx_reg_layout->rx_sigdet_deglitch_ctrl, 0x16},
{&uniphy_qserdes_rx_reg_layout->rx_vga_cal_ctrl2, 0x0c},
{&uniphy_qserdes_rx_reg_layout->rx_rx_mode_00, 0x50},
{&uniphy_qserdes_rx_reg_layout->rx_rx_equ_adap_ctrl2, 0x0e},
{&uniphy_qserdes_rx_reg_layout->rx_sigdet_deglitch_ctrl, 0x1c},
{&pcs_reg_layout->pcs_txmgn_v2, 0xb7},
{&pcs_reg_layout->pcs_txmgn_v3, 0x4e},
{&pcs_reg_layout->pcs_txmgn_v4, 0x65},
{&pcs_reg_layout->pcs_txmgn_ls, 0x6b},
{&uniphy_pcs_reg_layout->pcs_txmgn_v2, 0xb5},
{&uniphy_pcs_reg_layout->pcs_txmgn_v3, 0x4c},
{&uniphy_pcs_reg_layout->pcs_txmgn_v4, 0x64},
{&uniphy_pcs_reg_layout->pcs_txmgn_ls, 0x6a}
{&uniphy_pcs_reg_layout->pcs_refgen_req_config1, 0x21},
{&uniphy_pcs_reg_layout->pcs_refgen_req_config2, 0x60},
https://review.coreboot.org/#/c/25213/64/src/soc/qualcomm/sdm845/usb.c@782
PS64, Line 782: !
> Wait, just to double-check: are we waiting for the bit to become 1 or 0? wait_us() waits for the con […]
I have checked this and as you said we need to check vstatus bit to become 1. i will correct it.
HPG DOC:
QUSB2PHY_DEBUG_STAT5 wait for 88 uS for PLL lock; vstatus[0] changes from 0 to 1
I will the comment like below for this
/* DEBUG_STAT5: wait for 160uS for PLL lock; vstatus[0] changes from 0 to 1 */
long lock_us = wait_us(160, (read32(&dwc3->qusb_phy_dig->debug_stat5) &
VSTATUS_PLL_LOCK_STATUS_MASK));
if (!lock_us)
printk(BIOS_ERR, "ERROR: QUSB PHY PLL LOCK fails\n");
else
printk(BIOS_DEBUG, "QUSB PHY initialized and locked in %ldus\n",
lock_us);
https://review.coreboot.org/#/c/25213/64/src/soc/qualcomm/sdm845/usb.c@824
PS64, Line 824: USB3_PCS_PHYSTATUS));
> Again, this waits for PHYSTATUS to become 0, please make sure that's actually what you mean.
Yes, SW wait untill phystatus become 0.
you can refer the Software programming guide shared for phy init sequences.
Read PCS_PCS_STATUS
This can be done either of the two ways:
1) Finite delay can be added before observing PHYSTATUS = 1’b0
2) SW can continuously poll for PHYSTATUS = 1’b0
I will add this info as comment below
/* Wait for PHY initialization to be done
* PCS_STATUS: wait for 1ms for PHY STATUS;
* SW can continuously check for PHYSTATUS = 1.b0 */
long lock_us = wait_us(1000,
!(read32(&dwc3->qmp_pcs_reg->pcs_ready_status) &
USB3_PCS_PHYSTATUS));
--
To view, visit https://review.coreboot.org/c/coreboot/+/25213
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I475a7757239acb8ef22a4d61afd59b304a7f0acc
Gerrit-Change-Number: 25213
Gerrit-PatchSet: 65
Gerrit-Owner: T.Michael Turney <tturne(a)codeaurora.org>
Gerrit-Reviewer: Ciluveru chandana kishori <cchiluve(a)codeaurora.org>
Gerrit-Reviewer: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: T.Michael Turney <tturne(a)codeaurora.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Reviewer: mturney mturney <mturney(a)codeaurora.org>
Gerrit-CC: Chandana Kishori Chiluveru <cchiluve(a)qualcomm.corp-partner.google.com>
Gerrit-Comment-Date: Fri, 25 Jan 2019 05:45:55 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Julius Werner <jwerner(a)chromium.org>
Gerrit-MessageType: comment
Hello ron minnich, Shawn C, Jonathan Neuschäfer, Paul Menzel, build bot (Jenkins), Philipp Hug, Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/29494
to look at the new patch set (#30).
Change subject: riscv: add support to select the privilege level of the payload running
......................................................................
riscv: add support to select the privilege level of the payload running
Change-Id: I96961246cd257b63cf167238aa0cf6e65272b951
Signed-off-by: Xiang Wang <wxjstz(a)126.com>
---
M src/arch/riscv/Kconfig
M src/arch/riscv/Makefile.inc
M src/arch/riscv/boot.c
M src/arch/riscv/include/arch/boot.h
D src/arch/riscv/payload.S
A src/arch/riscv/payload.c
6 files changed, 83 insertions(+), 51 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/94/29494/30
--
To view, visit https://review.coreboot.org/c/coreboot/+/29494
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I96961246cd257b63cf167238aa0cf6e65272b951
Gerrit-Change-Number: 29494
Gerrit-PatchSet: 30
Gerrit-Owner: Xiang Wang <wxjstz(a)126.com>
Gerrit-Reviewer: Jonathan Neuschäfer <j.neuschaefer(a)gmx.net>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: Philipp Hug <philipp(a)hug.cx>
Gerrit-Reviewer: Shawn C <citypw(a)gmail.com>
Gerrit-Reviewer: Xiang Wang <wxjstz(a)126.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Reviewer: ron minnich <rminnich(a)gmail.com>
Gerrit-MessageType: newpatchset