diff --git a/payloads/libpayload/drivers/timer/Kconfig b/payloads/libpayload/drivers/timer/Kconfig index d4586f8597..bcf4b06e39 100644 --- a/payloads/libpayload/drivers/timer/Kconfig +++ b/payloads/libpayload/drivers/timer/Kconfig @@ -10,7 +10,6 @@ ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. - config TIMER_RDTSC bool default y diff --git a/src/drivers/parade/ps8640/ps8640.c b/src/drivers/parade/ps8640/ps8640.c index f636f7001d..95965601ec 100644 --- a/src/drivers/parade/ps8640/ps8640.c +++ b/src/drivers/parade/ps8640/ps8640.c @@ -77,7 +77,7 @@ int ps8640_init(uint8_t bus, uint8_t chip) mdelay(50); - /** + /* * The Manufacturer Command Set (MCS) is a device dependent interface * intended for factory programming of the display module default * parameters. Once the display module is configured, the MCS shall be diff --git a/src/drivers/spi/cbfs_spi.c b/src/drivers/spi/cbfs_spi.c index e23bc5ca36..7aeec57cf6 100644 --- a/src/drivers/spi/cbfs_spi.c +++ b/src/drivers/spi/cbfs_spi.c @@ -34,7 +34,7 @@ static struct spi_flash *spi_flash_info; * * read SPI 62854 7db7: 10416 us, 3089 KB/s, 24.712 Mbps * - * The important number is the last one. It should roughyly match your SPI + * The important number is the last one. It should roughly match your SPI * clock. If it doesn't, your driver might need a little tuning. */ #define SPI_SPEED_DEBUG 0 @@ -43,7 +43,7 @@ static ssize_t spi_readat(const struct region_device *rd, void *b, size_t offset, size_t size) { struct stopwatch sw; - bool show = SPI_SPEED_DEBUG && size >= 4*KiB; + bool show = SPI_SPEED_DEBUG && size >= 4 * KiB; if (show) stopwatch_init(&sw); diff --git a/src/drivers/spi/tpm/Kconfig b/src/drivers/spi/tpm/Kconfig index 85b9c3be24..d66d9ffec0 100644 --- a/src/drivers/spi/tpm/Kconfig +++ b/src/drivers/spi/tpm/Kconfig @@ -8,6 +8,6 @@ config DRIVER_TPM_SPI_BUS depends on SPI_TPM config DRIVER_TPM_SPI_CHIP - int "Chip Select of the TPM chip on its SPI bus" - default 0 - depends on SPI_TPM + int "Chip Select of the TPM chip on its SPI bus" + default 0 + depends on SPI_TPM diff --git a/src/mainboard/google/gru/mainboard.c b/src/mainboard/google/gru/mainboard.c index 1893ef9cfd..4dc677cb53 100644 --- a/src/mainboard/google/gru/mainboard.c +++ b/src/mainboard/google/gru/mainboard.c @@ -75,10 +75,11 @@ static void register_apio_suspend(void) static void register_gpio_suspend(void) { /* - * these 3 pin to disable gpio2 ~ gpio4 1.5v, 1.8v, 3.3v power supply - * so need to shut down the power supply from high voltage to - * low voltage, and consider register_bl31() appends to the front off - * the list, we should register 1.5v enable pin to 3.3v enable pin + * These three GPIO params are used to shut down the 1.5V, 1.8V and + * 3.3V power rails, which need to be shut down ordered by voltage, + * with highest voltage first. + * Since register_bl31() appends to the front of the list, we need to + * register them backwards, with 1.5V coming first. */ static struct bl31_gpio_param param_p15_en = { .h = { diff --git a/src/mainboard/google/gru/romstage.c b/src/mainboard/google/gru/romstage.c index 4e0ada181e..7f84a2a2a1 100644 --- a/src/mainboard/google/gru/romstage.c +++ b/src/mainboard/google/gru/romstage.c @@ -42,8 +42,10 @@ static void init_dvs_outputs(void) static void prepare_usb(void) { - /* Do dwc3 core soft reset and phy reset. Kick these resets - * off early so they get at least 100ms to settle. */ + /* + * Do dwc3 core soft reset and phy reset. Kick these resets + * off early so they get at least 100ms to settle. + */ reset_usb_otg0(); reset_usb_otg1(); } diff --git a/src/soc/mediatek/mt8173/dsi.c b/src/soc/mediatek/mt8173/dsi.c index 6a4d8d7c3b..3500bf1d01 100644 --- a/src/soc/mediatek/mt8173/dsi.c +++ b/src/soc/mediatek/mt8173/dsi.c @@ -310,7 +310,7 @@ void mtk_dsi_pin_drv_ctrl(void) do { if (stopwatch_expired(&sw)) { - printk(BIOS_ERR, "enable lvdstx_power fail!!!\n"); + printk(BIOS_ERR, "enable lvdstx_power failed!!!\n"); return; } } while ((read32(&lvds_tx1->vopll_ctl3) & RG_AD_LVDSTX_PWR_ACK) == 0); diff --git a/src/soc/rockchip/rk3399/Makefile.inc b/src/soc/rockchip/rk3399/Makefile.inc index 8eb0a02d47..8448ff242e 100644 --- a/src/soc/rockchip/rk3399/Makefile.inc +++ b/src/soc/rockchip/rk3399/Makefile.inc @@ -64,15 +64,15 @@ ramstage-y += sdram.c ramstage-y += ../common/spi.c ramstage-$(CONFIG_DRIVERS_UART) += ../common/uart.c ramstage-y += clock.c -ramstage-y += display.c -ramstage-y += ../common/edp.c +ramstage-$(CONFIG_MAINBOARD_DO_NATIVE_VGA_INIT) += display.c +ramstage-$(CONFIG_MAINBOARD_DO_NATIVE_VGA_INIT) += ../common/edp.c ramstage-y += ../common/gpio.c ramstage-y += gpio.c ramstage-y += ../common/i2c.c ramstage-y += saradc.c ramstage-y += soc.c ramstage-y += timer.c -ramstage-y += ../common/vop.c +ramstage-$(CONFIG_MAINBOARD_DO_NATIVE_VGA_INIT) += ../common/vop.c ramstage-y += usb.c ramstage-y += bl31_plat_params.c diff --git a/src/soc/rockchip/rk3399/clock.c b/src/soc/rockchip/rk3399/clock.c index 2e8dbc1df0..eb413a1329 100644 --- a/src/soc/rockchip/rk3399/clock.c +++ b/src/soc/rockchip/rk3399/clock.c @@ -409,7 +409,7 @@ void rkclk_init(void) /* configure pmu pclk */ pclk_div = PPLL_HZ / PMU_PCLK_HZ - 1; - assert((unsigned)(PPLL_HZ - (pclk_div + 1) * PMU_PCLK_HZ) <= pclk_div + assert((unsigned int)(PPLL_HZ - (pclk_div + 1) * PMU_PCLK_HZ) <= pclk_div && pclk_div <= 0x1f); write32(&pmucru_ptr->pmucru_clksel[0], RK_CLRSETBITS(PMU_PCLK_DIV_CON_MASK << PMU_PCLK_DIV_CON_SHIFT, @@ -508,6 +508,7 @@ void rkclk_configure_cpu(enum apll_frequencies freq, enum cpu_cluster cluster) pll_con = &cru_ptr->apll_l_con[0]; break; case CPU_CLUSTER_BIG: + default: con_base = 2; parent = CLK_CORE_PLL_SEL_ABPLL; pll_con = &cru_ptr->apll_b_con[0]; diff --git a/src/soc/rockchip/rk3399/sdram.c b/src/soc/rockchip/rk3399/sdram.c index 7fbce9c931..e51cd8968d 100644 --- a/src/soc/rockchip/rk3399/sdram.c +++ b/src/soc/rockchip/rk3399/sdram.c @@ -450,11 +450,11 @@ static void phy_io_config(u32 channel, /* speed setting */ - if (sdram_params->ddr_freq < 400*MHz) + if (sdram_params->ddr_freq < 400 * MHz) speed = 0x0; - else if (sdram_params->ddr_freq < 800*MHz) + else if (sdram_params->ddr_freq < 800 * MHz) speed = 0x1; - else if (sdram_params->ddr_freq < 1200*MHz) + else if (sdram_params->ddr_freq < 1200 * MHz) speed = 0x2; else speed = 0x3; @@ -566,11 +566,7 @@ static int pctl_cfg(u32 channel, /* PHY_DLL_RST_EN */ clrsetbits_le32(&denali_phy[957], 0x3 << 24, 0x2 << 24); - /* - * FIXME: - * need to care ERROR bit, - * if 100ms do not get right status, return err - */ + /* FIXME: need to care ERROR bit */ stopwatch_init_msecs_expire(&sw, 100); while (!(read32(&denali_ctl[203]) & (1 << 3))) { if (stopwatch_expired(&sw)) @@ -1019,7 +1015,7 @@ void sdram_init(const struct rk3399_sdram_params *sdram_params) udelay(10); if (data_training(channel, sdram_params, PI_FULL_TRAINING)) { - printk(BIOS_DEBUG, + printk(BIOS_ERR, "SDRAM initialization failed, reset\n"); hard_reset(); } diff --git a/src/soc/rockchip/rk3399/soc.c b/src/soc/rockchip/rk3399/soc.c index 5e234d5767..4418a27a25 100644 --- a/src/soc/rockchip/rk3399/soc.c +++ b/src/soc/rockchip/rk3399/soc.c @@ -38,10 +38,10 @@ static void soc_init(device_t dev) */ mmio_resource(dev, 1, (0x10000 / KiB), (0x80000 / KiB)); - if (display_init_required()) + if (IS_ENABLED(CONFIG_MAINBOARD_DO_NATIVE_VGA_INIT) && display_init_required()) rk_display_init(dev); else - printk(BIOS_INFO, "Skipping display init.\n"); + printk(BIOS_INFO, "Display initialization disabled.\n"); /* We don't need big CPUs, but bring them up as a courtesy to Linux. */ rkclk_configure_cpu(APLL_600_MHZ, CPU_CLUSTER_BIG); diff --git a/util/cbfstool/cbfs-payload-linux.c b/util/cbfstool/cbfs-payload-linux.c index ac7e7294b9..6b4bf27b85 100644 --- a/util/cbfstool/cbfs-payload-linux.c +++ b/util/cbfstool/cbfs-payload-linux.c @@ -252,7 +252,7 @@ int parse_bzImage_to_payload(const struct buffer *input, } unsigned long kernel_base = 0x100000; - if ((hdr->protocol_version >= 0x200) && (!hdr->loadflags)) { + if ((hdr->protocol_version < 0x200) || !(hdr->loadflags & 1)) { kernel_base = 0x1000; /* zImage kernel */ } /* kernel prefers an address, so listen */