the following patch was just integrated into master:
commit e4a8537ce20d801a5985ba6268ae83593063a4bf
Author: Subrata Banik <subrata.banik(a)intel.com>
Date: Sun Jul 24 00:36:12 2016 +0530
soc/intel/skylake: Add C entry bootblock support
List of activity performing in this patch
- early PCH programming
- early SA programming
- early CPU programming
- mainborad early gpio programming for UART and SPI
- car setup
- move chipset programming from verstage to post console
BUG=chrome-os-partner:55357
BRANCH=none
TEST=Built and booted kunimitsu till POST code 0x34
Change-Id: If20ab869de62cd4439f3f014f9362ccbec38e143
Signed-off-by: Barnali Sarkar <barnali.sarkar(a)intel.com>
Signed-off-by: Naveen Krishna Chatradhi <naveenkrishna.ch(a)intel.com>
Signed-off-by: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
Signed-off-by: Subrata Banik <subrata.banik(a)intel.com>
Reviewed-on: https://review.coreboot.org/15785
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
See https://review.coreboot.org/15785 for details.
-gerrit
the following patch was just integrated into master:
commit 68d5d8b28ab399b8dfb8ef6477d25311a319f2d5
Author: Subrata Banik <subrata.banik(a)intel.com>
Date: Mon Jul 18 14:13:52 2016 +0530
soc/intel/skylake: Do cache as ram and prepare for C entry
Enable cache-as-ram and prepare for c entry in bootblock.
BUG=chrome-os-partner:55357
BRANCH=none
TEST=Built and booted kunimitsu till POST code 0x2A
Credits-to: Aaron Durbin <adurbin(a)chromium.org>
Signed-off-by: Barnali Sarkar <barnali.sarkar(a)intel.com>
Signed-off-by: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
Signed-off-by: Subrata Banik <subrata.banik(a)intel.com>
Change-Id: I3412216cdf8ef7e952145943d33c3f07949da3c1
Reviewed-on: https://review.coreboot.org/15784
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
See https://review.coreboot.org/15784 for details.
-gerrit
Zhuo-hao Lee (zhuo-hao.lee(a)intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/15910
-gerrit
commit 024e1ddc86b33a611a47561074879a57c9cc2d8f
Author: Zhuo-hao Lee <zhuo-hao.lee(a)intel.com>
Date: Wed Jul 27 13:18:22 2016 +0800
skylake: fix VSDIO is at 0.8V when SDCard is not inserted
1. Enable SoC SD_CMD/D* signals pull-down of 20k when SD-card
is removed. When SD-card is disconnected, the pull-down is
disabled.
2. Provide path for weak leakage from buffers of SD_CMD/D* signal
to be grounded. Thus dropping voltage on the SD_CMD/D* signals to ~0V.
BUG=chrome-os-partner:54421
TEST=no power leakage when SDCard isn't inserted on skylake platform
Change-Id: I567199b172841125f8916a61a76005cfdaa62eb8
Signed-off-by: Zhuo-hao Lee <zhuo-hao.lee(a)intel.com>
---
src/soc/intel/skylake/acpi/scs.asl | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/src/soc/intel/skylake/acpi/scs.asl b/src/soc/intel/skylake/acpi/scs.asl
index 56f27a9..69bc82a 100644
--- a/src/soc/intel/skylake/acpi/scs.asl
+++ b/src/soc/intel/skylake/acpi/scs.asl
@@ -88,6 +88,14 @@ Device (SDXC)
Method (_PS0, 0, Serialized)
{
+ /* Disable 20K pull-down on CLK, CMD and DAT lines */
+ ^^PCRA (PID_GPIOCOM3, 0x4c4, 0xFFFFEFFF)
+ ^^PCRA (PID_GPIOCOM3, 0x4cc, 0xFFFFEFFF)
+ ^^PCRA (PID_GPIOCOM3, 0x4d4, 0xFFFFEFFF)
+ ^^PCRA (PID_GPIOCOM3, 0x4dc, 0xFFFFEFFF)
+ ^^PCRA (PID_GPIOCOM3, 0x4e4, 0xFFFFEFFF)
+ ^^PCRA (PID_GPIOCOM3, 0x4f4, 0xFFFFEFFF)
+
/* Disable Power Gate */
Store (0, ^PGEN)
@@ -113,6 +121,14 @@ Device (SDXC)
Store (3, Local0)
Store (Local0, ^D0D3)
Store (^D0D3, Local0)
+
+ /* Enable 20K pull-down on CLK, CMD and DAT lines */
+ ^^PCRO (PID_GPIOCOM3, 0x4c4, 0x00001000)
+ ^^PCRO (PID_GPIOCOM3, 0x4cc, 0x00001000)
+ ^^PCRO (PID_GPIOCOM3, 0x4d4, 0x00001000)
+ ^^PCRO (PID_GPIOCOM3, 0x4dc, 0x00001000)
+ ^^PCRO (PID_GPIOCOM3, 0x4e4, 0x00001000)
+ ^^PCRO (PID_GPIOCOM3, 0x4f4, 0x00001000)
}
Device (CARD)
Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/15035
-gerrit
commit 05fb9f3e420a351031b710fbf1e862152e7ec590
Author: Julius Werner <jwerner(a)chromium.org>
Date: Mon May 16 15:39:12 2016 -0700
libpayload: Replace majority of timer drivers with a generic one
Currently every non-x86 platform supported by libpayload needs to
provide its own timer driver. Most of the ones we have accumulated there
look almost identical: For the frequency, return a preset constant. For
the value, read a 32-bit register, possibly read another 32-bit register
and shift+OR it with the previous one, then return that.
Let's replace this with a single .c file that can easily handle all of
those cases. Menuconfig convenience can still be maintained by providing
several presets that select different defaults for the driver's
configuration options (register address(es) and frequency).
Removes an "enabled" check from Samsung MCT driver since coreboot always
unconditionally enables that timer anyway.
CQ-DEPEND=CL:344809
BRANCH=None
BUG=None
TEST=Booted Oak and Veyron, observed how dev-mode delay was still ~30s
Change-Id: I61cb7d2ffd4902aa841c57f9afa9cd991f770ace
Signed-off-by: Martin Roth <martinroth(a)chromium.org>
Original-Commit-Id: a036af6
Original-Change-Id: I9784e7c6aa5abd6d92478ea7ec1cf42c9a437546
Original-Signed-off-by: Julius Werner <jwerner(a)chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/347749
---
payloads/libpayload/Kconfig | 101 ++++++++++------------
payloads/libpayload/drivers/Makefile.inc | 11 +--
payloads/libpayload/drivers/timer/bg4cd.c | 26 ------
payloads/libpayload/drivers/timer/cygnus.c | 52 ------------
payloads/libpayload/drivers/timer/generic.c | 45 ++++++++++
payloads/libpayload/drivers/timer/ipq40xx.c | 52 ------------
payloads/libpayload/drivers/timer/ipq806x.c | 58 -------------
payloads/libpayload/drivers/timer/mct.c | 115 --------------------------
payloads/libpayload/drivers/timer/mtk_timer.c | 30 -------
payloads/libpayload/drivers/timer/rktimer.c | 42 ----------
payloads/libpayload/drivers/timer/tegra_1us.c | 41 ---------
11 files changed, 92 insertions(+), 481 deletions(-)
diff --git a/payloads/libpayload/Kconfig b/payloads/libpayload/Kconfig
index 276eb30..20f10ee 100644
--- a/payloads/libpayload/Kconfig
+++ b/payloads/libpayload/Kconfig
@@ -438,11 +438,11 @@ config TIMER_IPQ40XX
This is the timer driver for QCA IPQ40xx based
platforms.
-config TIMER_RK
- bool "Timer for Rockchip"
+config TIMER_RK3288
+ bool "Timer for Rockchip RK3288"
-config TIMER_BG4CD
- bool "Marvell BG4CD"
+config TIMER_RK3399
+ bool "Timer for Rockchip RK3399"
config TIMER_CYGNUS
bool "Timer for Cygnus"
@@ -455,41 +455,6 @@ config TIMER_MTK
endchoice
-config TIMER_MCT_HZ
- int "Exynos MCT frequency"
- depends on TIMER_MCT
- default 24000000
-
-config TIMER_MCT_ADDRESS
- hex "Exynos MCT base address"
- depends on TIMER_MCT
- default 0x101c0000
-
-config TIMER_RK_ADDRESS
- hex "Rockchip timer base address"
- depends on TIMER_RK
- default 0xff810020
-
-config TIMER_TEGRA_1US_ADDRESS
- hex "Tegra u1s timer base address"
- depends on TIMER_TEGRA_1US
- default 0x60005010
-
-config IPQ806X_TIMER_FREQ
- int "Hardware timer frequency"
- default 32000
- depends on TIMER_IPQ806X
- help
- IPQ hardware presently provides a single timer running at 32KHz, a
- finer granulariry timer is available but is not yet enabled.
-
-config IPQ806X_TIMER_REG
- hex "Timer register address"
- default 0x0200A008
- depends on TIMER_IPQ806X
- help
- Address of the register to read a free running timer value.
-
config ARMADA38X_TIMER_FREQ
int "Hardware timer frequency"
depends on TIMER_ARMADA38X
@@ -500,24 +465,46 @@ config ARMADA38X_TIMER_REG
default 0xF1020314
depends on TIMER_ARMADA38X
-config IPROC_PERIPH_GLB_TIM_REG_BASE
- hex "Cygnus timer base address"
- depends on TIMER_CYGNUS
- default 0x19020200
-
-config TIMER_MTK_HZ
- int "MediaTek GPT frequency"
- depends on TIMER_MTK
- default 13000000
- help
- Clock frequency of MediaTek General Purpose Timer.
-
-config TIMER_MTK_ADDRESS
- hex "MTK GPT register address"
- depends on TIMER_MTK
- default 0x10008048
- help
- Address of GPT4's counter register to read the FREERUN-mode timer value.
+config TIMER_GENERIC_HZ
+ int "Generic Timer Frequency"
+ default 500000000 if TIMER_CYGNUS
+ default 48000000 if TIMER_IPQ40XX
+ default 6250000 if TIMER_IPQ806X
+ default 24000000 if TIMER_MCT
+ default 13000000 if TIMER_MTK
+ default 24000000 if TIMER_RK3288
+ default 24000000 if TIMER_RK3399
+ default 1000000 if TIMER_TEGRA_1US
+ default 0
+ help
+ Clock frequency of generic time counter in Hertz. Leave at 0 to
+ disable when using a non-generic timer driver.
+
+config TIMER_GENERIC_REG
+ hex "Generic Timer Register Address"
+ default 0x19020200 if TIMER_CYGNUS
+ default 0x004A2000 if TIMER_IPQ40XX
+ default 0x0200A028 if TIMER_IPQ806X
+ default 0x101C0100 if TIMER_MCT
+ default 0x10008048 if TIMER_MTK
+ default 0xff810028 if TIMER_RK3288
+ default 0xff850008 if TIMER_RK3399
+ default 0x60005010 if TIMER_TEGRA_1US
+ default 0x0
+ help
+ Register address to read generic time counter from.
+
+config TIMER_GENERIC_HIGH_REG
+ hex "Generic Timer High Register Address"
+ default 0x19020204 if TIMER_CYGNUS
+ default 0x004A2004 if TIMER_IPQ40XX
+ default 0x101C0104 if TIMER_MCT
+ default 0xff81002C if TIMER_RK3288
+ default 0xff85000C if TIMER_RK3399
+ default 0x0
+ help
+ Register address to read high 32 bits of generic time counter from.
+ Leave at 0x0 for 32-bit counters.
config USB
bool "USB Support"
diff --git a/payloads/libpayload/drivers/Makefile.inc b/payloads/libpayload/drivers/Makefile.inc
index 75f08f2..3c6b12b 100644
--- a/payloads/libpayload/drivers/Makefile.inc
+++ b/payloads/libpayload/drivers/Makefile.inc
@@ -46,16 +46,11 @@ libc-$(CONFIG_LP_NVRAM) += nvram.c
libc-$(CONFIG_LP_NVRAM) += options.c
# Timer drivers
-libc-$(CONFIG_LP_TIMER_MTK) += timer/mtk_timer.c
-libc-$(CONFIG_LP_TIMER_MCT) += timer/mct.c
+ifneq ($(CONFIG_LP_TIMER_GENERIC_HZ),0)
+libc-y += timer/generic.c
+endif
libc-$(CONFIG_LP_TIMER_RDTSC) += timer/rdtsc.c
-libc-$(CONFIG_LP_TIMER_TEGRA_1US) += timer/tegra_1us.c
-libc-$(CONFIG_LP_TIMER_IPQ806X) += timer/ipq806x.c
-libc-$(CONFIG_LP_TIMER_IPQ40XX) += timer/ipq40xx.c
-libc-$(CONFIG_LP_TIMER_RK) += timer/rktimer.c
-libc-$(CONFIG_LP_TIMER_BG4CD) += timer/bg4cd.c
libc-$(CONFIG_LP_TIMER_IMG_PISTACHIO) += timer/img_pistachio.c
-libc-$(CONFIG_LP_TIMER_CYGNUS) += timer/cygnus.c
libc-$(CONFIG_LP_TIMER_ARMADA38X) += timer/armada38x.c
# Video console drivers
diff --git a/payloads/libpayload/drivers/timer/bg4cd.c b/payloads/libpayload/drivers/timer/bg4cd.c
deleted file mode 100644
index 649622b..0000000
--- a/payloads/libpayload/drivers/timer/bg4cd.c
+++ /dev/null
@@ -1,26 +0,0 @@
-
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2014 Google Electronics
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
-#include <libpayload.h>
-
-uint64_t timer_hz(void)
-{
- return 0;
-}
-
-uint64_t timer_raw_value(void)
-{
- return 0;
-}
diff --git a/payloads/libpayload/drivers/timer/cygnus.c b/payloads/libpayload/drivers/timer/cygnus.c
deleted file mode 100644
index c8f2098..0000000
--- a/payloads/libpayload/drivers/timer/cygnus.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2015 Google Electronics
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
-#include <libpayload.h>
-
-struct cygnus_timer {
- u32 gtim_glob_low;
- u32 gtim_glob_hi;
- u32 gtim_glob_ctrl;
-};
-
-static struct cygnus_timer * const timer_ptr =
- (void *)CONFIG_LP_IPROC_PERIPH_GLB_TIM_REG_BASE;
-
-uint64_t timer_hz(void)
-{
- /*
- * this is set up by coreboot as follows:
- *
- * PERIPH_CLOCK /
- * (((TIMER_GLB_TIM_CTRL_PRESC & TIMER_GLB_TIM_CTRL_PRESC_MASK)>>8) + 1)
- *
- * where PERIPH_CLOCK is typically 500000000.
- */
- return 500000000;
-}
-
-uint64_t timer_raw_value(void)
-{
- uint64_t cur_tick;
- uint32_t count_h;
- uint32_t count_l;
-
- do {
- count_h = readl(&timer_ptr->gtim_glob_hi);
- count_l = readl(&timer_ptr->gtim_glob_low);
- cur_tick = readl(&timer_ptr->gtim_glob_hi);
- } while (cur_tick != count_h);
-
- return (cur_tick << 32) + count_l;
-}
diff --git a/payloads/libpayload/drivers/timer/generic.c b/payloads/libpayload/drivers/timer/generic.c
new file mode 100644
index 0000000..5d0d977
--- /dev/null
+++ b/payloads/libpayload/drivers/timer/generic.c
@@ -0,0 +1,45 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2016 Google Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <assert.h>
+#include <libpayload.h>
+
+static uint32_t *const low_reg = phys_to_virt(CONFIG_LP_TIMER_GENERIC_REG);
+static uint32_t *const high_reg = phys_to_virt(CONFIG_LP_TIMER_GENERIC_HIGH_REG);
+
+uint64_t timer_hz(void)
+{
+ /* libc/time.c currently requires all timers to be at least 1MHz. */
+ assert(CONFIG_LP_TIMER_GENERIC_HZ >= 1000000);
+ return CONFIG_LP_TIMER_GENERIC_HZ;
+}
+
+uint64_t timer_raw_value(void)
+{
+ uint64_t cur_tick;
+ uint32_t count_h;
+ uint32_t count_l;
+
+ if (!high_reg)
+ return readl(low_reg);
+
+ do {
+ count_h = readl(high_reg);
+ count_l = readl(low_reg);
+ cur_tick = readl(high_reg);
+ } while (cur_tick != count_h);
+
+ return (cur_tick << 32) + count_l;
+}
diff --git a/payloads/libpayload/drivers/timer/ipq40xx.c b/payloads/libpayload/drivers/timer/ipq40xx.c
deleted file mode 100644
index 0ca2600..0000000
--- a/payloads/libpayload/drivers/timer/ipq40xx.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2015, 2016, The Linux Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of The Linux Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#include <libpayload.h>
-
-#define GCNT_FREQ_MHZ 48
-
-#define MSM_TMR_BASE ((void *)0x004a1000u)
-#define GCNT_CNTCV_LO (MSM_TMR_BASE + 0x1000)
-#define GCNT_CNTCV_HI (MSM_TMR_BASE + 0x1004)
-
-uint64_t timer_hz(void)
-{
- return GCNT_FREQ_MHZ * 1000 * 1000;
-}
-
-uint64_t timer_raw_value(void)
-{
- uint32_t hi, lo;
-
- do {
- hi = read32(GCNT_CNTCV_HI);
- lo = read32(GCNT_CNTCV_LO);
- } while (hi != read32(GCNT_CNTCV_HI));
-
- return ((((uint64_t)hi) << 32) | lo);
-}
diff --git a/payloads/libpayload/drivers/timer/ipq806x.c b/payloads/libpayload/drivers/timer/ipq806x.c
deleted file mode 100644
index f39f23d..0000000
--- a/payloads/libpayload/drivers/timer/ipq806x.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * This file is part of the depthcharge project.
- *
- * Copyright (C) 2014 The Linux Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <libpayload.h>
-
-/*
- * TODO(vbendeb): reverted this hack once proper timer code is in place (see
- * http://crosbug.com/p/28880 for details.
- */
-#define MIN_TIMER_FREQ 1000000
-
-uint64_t timer_hz(void)
-{
- return (CONFIG_LP_IPQ806X_TIMER_FREQ >= MIN_TIMER_FREQ) ?
- CONFIG_LP_IPQ806X_TIMER_FREQ : MIN_TIMER_FREQ;
-}
-
-uint64_t timer_raw_value(void)
-{
- uint64_t rawv = readl((void *)CONFIG_LP_IPQ806X_TIMER_REG);
-
- /*
- * This is extremely crude, but it kicks in only for the case when the
- * timer clock frequency is below 1MHz, which should never be the case
- * on a properly configured system. The compiler will eliminate the
- * check as long as config value exceeds 1MHz.
- */
- if (CONFIG_LP_IPQ806X_TIMER_FREQ < MIN_TIMER_FREQ)
- rawv *= (MIN_TIMER_FREQ / CONFIG_LP_IPQ806X_TIMER_FREQ);
-
- return rawv;
-}
diff --git a/payloads/libpayload/drivers/timer/mct.c b/payloads/libpayload/drivers/timer/mct.c
deleted file mode 100644
index 992643d..0000000
--- a/payloads/libpayload/drivers/timer/mct.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright 2013 Google Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <arch/io.h>
-#include <libpayload.h>
-#include <libpayload-config.h>
-#include <stdint.h>
-
-#include "config.h"
-
-struct __attribute__((packed)) mct_regs
-{
- uint32_t mct_cfg;
- uint8_t reserved0[0xfc];
- uint32_t g_cnt_l;
- uint32_t g_cnt_u;
- uint8_t reserved1[0x8];
- uint32_t g_cnt_wstat;
- uint8_t reserved2[0xec];
- uint32_t g_comp0_l;
- uint32_t g_comp0_u;
- uint32_t g_comp0_addr_incr;
- uint8_t reserved3[0x4];
- uint32_t g_comp1_l;
- uint32_t g_comp1_u;
- uint32_t g_comp1_addr_incr;
- uint8_t reserved4[0x4];
- uint32_t g_comp2_l;
- uint32_t g_comp2_u;
- uint32_t g_comp2_addr_incr;
- uint8_t reserved5[0x4];
- uint32_t g_comp3_l;
- uint32_t g_comp3_u;
- uint32_t g_comp3_addr_incr;
- uint8_t reserved6[0x4];
- uint32_t g_tcon;
- uint32_t g_int_cstat;
- uint32_t g_int_enb;
- uint32_t g_wstat;
- uint8_t reserved7[0xb0];
- uint32_t l0_tcntb;
- uint32_t l0_tcnto;
- uint32_t l0_icntb;
- uint32_t l0_icnto;
- uint32_t l0_frcntb;
- uint32_t l0_frcnto;
- uint8_t reserved8[0x8];
- uint32_t l0_tcon;
- uint8_t reserved9[0xc];
- uint32_t l0_int_cstat;
- uint32_t l0_int_enb;
- uint8_t reserved10[0x8];
- uint32_t l0_wstat;
- uint8_t reserved11[0xbc];
- uint32_t l1_tcntb;
- uint32_t l1_tcnto;
- uint32_t l1_icntb;
- uint32_t l1_icnto;
- uint32_t l1_frcntb;
- uint32_t l1_frcnto;
- uint8_t reserved12[0x8];
- uint32_t l1_tcon;
- uint8_t reserved13[0xc];
- uint32_t l1_int_cstat;
- uint32_t l1_int_enb;
- uint8_t reserved14[0x8];
- uint32_t l1_wstat;
-};
-
-uint64_t timer_hz(void)
-{
- return CONFIG_LP_TIMER_MCT_HZ;
-}
-
-uint64_t timer_raw_value(void)
-{
- static int enabled = 0;
-
- struct mct_regs * const mct =
- (struct mct_regs *)(uintptr_t)CONFIG_LP_TIMER_MCT_ADDRESS;
-
- if (!enabled) {
- writel(readl(&mct->g_tcon) | (0x1 << 8), &mct->g_tcon);
- enabled = 1;
- }
-
- uint64_t upper = readl(&mct->g_cnt_u);
- uint64_t lower = readl(&mct->g_cnt_l);
-
- return (upper << 32) | lower;
-}
diff --git a/payloads/libpayload/drivers/timer/mtk_timer.c b/payloads/libpayload/drivers/timer/mtk_timer.c
deleted file mode 100644
index 706ef48..0000000
--- a/payloads/libpayload/drivers/timer/mtk_timer.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright 2014 MediaTek Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
-#include <arch/io.h>
-#include <libpayload.h>
-#include <libpayload-config.h>
-#include <stdint.h>
-
-static uint32_t *const mtk_tmrus = (void*)CONFIG_LP_TIMER_MTK_ADDRESS;
-
-uint64_t timer_hz(void)
-{
- return CONFIG_LP_TIMER_MTK_HZ;
-}
-
-uint64_t timer_raw_value(void)
-{
- return (uint64_t)readl(mtk_tmrus);
-}
diff --git a/payloads/libpayload/drivers/timer/rktimer.c b/payloads/libpayload/drivers/timer/rktimer.c
deleted file mode 100644
index 5b4ce6b..0000000
--- a/payloads/libpayload/drivers/timer/rktimer.c
+++ /dev/null
@@ -1,42 +0,0 @@
-
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2014 Rockchip Electronics
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
-#include <arch/io.h>
-#include <libpayload.h>
-#include <stdint.h>
-struct rk_timer {
- u32 timer_load_count0;
- u32 timer_load_count1;
- u32 timer_curr_value0;
- u32 timer_curr_value1;
- u32 timer_ctrl_reg;
- u32 timer_int_status;
-};
-
-uint64_t timer_hz(void)
-{
- return 24000000;
-}
-
-uint64_t timer_raw_value(void)
-{
- uint64_t upper;
- uint64_t lower;
- struct rk_timer *rk_timer;
- rk_timer = (struct rk_timer *) CONFIG_LP_TIMER_RK_ADDRESS;
- lower = (uint64_t) rk_timer->timer_curr_value0;
- upper = (uint64_t) rk_timer->timer_curr_value1;
- return (upper << 32) | lower;
-}
diff --git a/payloads/libpayload/drivers/timer/tegra_1us.c b/payloads/libpayload/drivers/timer/tegra_1us.c
deleted file mode 100644
index f227ad0..0000000
--- a/payloads/libpayload/drivers/timer/tegra_1us.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2013 Google Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <libpayload.h>
-#include <libpayload-config.h>
-
-static uint32_t * const tegra_tmrus = (void *)CONFIG_LP_TIMER_TEGRA_1US_ADDRESS;
-
-uint64_t timer_hz(void)
-{
- return 1000 * 1000;
-}
-
-uint64_t timer_raw_value(void)
-{
- return readl(tegra_tmrus);
-}
Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/15914
-gerrit
commit 8e89fd62dcf8846262918f9ec9b50e015277843f
Author: Antonello Dettori <dev(a)dettori.io>
Date: Wed Jul 27 12:41:04 2016 +0200
libpayload: split "Drivers" config section in Kconfig
Move the configuration of the timer, storage and USB drivers from the
main Kconfig to three separate ones stored in the respective
directories.
This reduces the LOC of Kconfig and makes it more manageable.
Change-Id: I0786dbc1d5d8317c8ccb600f5de9ef4a8243d035
Signed-off-by: Antonello Dettori <dev(a)dettori.io>
---
payloads/libpayload/Kconfig | 283 +---------------------------
payloads/libpayload/drivers/storage/Kconfig | 59 ++++++
payloads/libpayload/drivers/timer/Kconfig | 129 +++++++++++++
payloads/libpayload/drivers/usb/Kconfig | 129 +++++++++++++
4 files changed, 320 insertions(+), 280 deletions(-)
diff --git a/payloads/libpayload/Kconfig b/payloads/libpayload/Kconfig
index 276eb30..51826ea 100644
--- a/payloads/libpayload/Kconfig
+++ b/payloads/libpayload/Kconfig
@@ -354,286 +354,9 @@ config SPEAKER
depends on ARCH_X86
default y
-config STORAGE
- bool "Support for storage devices"
- default y
- help
- Select this option if you want support for storage devices (like
- hard drives, memory sticks or optical drives).
-
-config STORAGE_64BIT_LBA
- bool "Use 64-bit integers to address sectors"
- depends on STORAGE
- default n
- help
- If this is selected, sectors will be addressed by an 64-bit integer.
- Select this to support LBA-48 for ATA drives.
-
-config STORAGE_ATA
- bool "Support ATA drives (i.e. hard drives)"
- depends on STORAGE
- default y
- help
- Select this option if you want support for ATA storage devices
- (i.e. hard drives).
-
-config STORAGE_ATAPI
- bool "Support ATAPI drives (i.e. optical drives)"
- depends on STORAGE
- default y
- select STORAGE_ATA
- help
- Select this option if you want support for ATAPI storage devices
- (i.e. optical drives like CD or DVD drives).
-
-config STORAGE_AHCI
- bool "Support for AHCI host controllers"
- depends on STORAGE && (STORAGE_ATA || STORAGE_ATAPI) && PCI
- default y
- help
- Select this option if you want support for SATA controllers in
- AHCI mode.
-
-config STORAGE_AHCI_ONLY_TESTED
- bool "Only enable tested controllers"
- depends on STORAGE_AHCI
- default y
- help
- If this option is selected only AHCI controllers which are known
- to work will be used.
-
-config TIMER_RDTSC
- bool
- default y
- depends on ARCH_X86
-
-choice
- prompt "Timer driver"
- default TIMER_NONE
- depends on !ARCH_X86
-
-config TIMER_NONE
- bool "None"
- help
- The timer driver is provided by the payload itself.
-
-config TIMER_MCT
- bool "Exynos MCT"
-
-config TIMER_TEGRA_1US
- bool "Tegra 1us"
-
-config TIMER_IPQ806X
- bool "Timer for ipq806x platforms"
-
-config TIMER_ARMADA38X
- bool "Timer for armada38x platforms"
- help
- This is the timer driver for marvell armada38x
- platforms.
-
-config TIMER_IPQ40XX
- bool "Timer for ipq40xx platforms"
- help
- This is the timer driver for QCA IPQ40xx based
- platforms.
-
-config TIMER_RK
- bool "Timer for Rockchip"
-
-config TIMER_BG4CD
- bool "Marvell BG4CD"
-
-config TIMER_CYGNUS
- bool "Timer for Cygnus"
-
-config TIMER_IMG_PISTACHIO
- bool "Timer for IMG Pistachio"
-
-config TIMER_MTK
- bool "Timer for MediaTek MT8173"
-
-endchoice
-
-config TIMER_MCT_HZ
- int "Exynos MCT frequency"
- depends on TIMER_MCT
- default 24000000
-
-config TIMER_MCT_ADDRESS
- hex "Exynos MCT base address"
- depends on TIMER_MCT
- default 0x101c0000
-
-config TIMER_RK_ADDRESS
- hex "Rockchip timer base address"
- depends on TIMER_RK
- default 0xff810020
-
-config TIMER_TEGRA_1US_ADDRESS
- hex "Tegra u1s timer base address"
- depends on TIMER_TEGRA_1US
- default 0x60005010
-
-config IPQ806X_TIMER_FREQ
- int "Hardware timer frequency"
- default 32000
- depends on TIMER_IPQ806X
- help
- IPQ hardware presently provides a single timer running at 32KHz, a
- finer granulariry timer is available but is not yet enabled.
-
-config IPQ806X_TIMER_REG
- hex "Timer register address"
- default 0x0200A008
- depends on TIMER_IPQ806X
- help
- Address of the register to read a free running timer value.
-
-config ARMADA38X_TIMER_FREQ
- int "Hardware timer frequency"
- depends on TIMER_ARMADA38X
- default 25000000
-
-config ARMADA38X_TIMER_REG
- hex "Timer register address"
- default 0xF1020314
- depends on TIMER_ARMADA38X
-
-config IPROC_PERIPH_GLB_TIM_REG_BASE
- hex "Cygnus timer base address"
- depends on TIMER_CYGNUS
- default 0x19020200
-
-config TIMER_MTK_HZ
- int "MediaTek GPT frequency"
- depends on TIMER_MTK
- default 13000000
- help
- Clock frequency of MediaTek General Purpose Timer.
-
-config TIMER_MTK_ADDRESS
- hex "MTK GPT register address"
- depends on TIMER_MTK
- default 0x10008048
- help
- Address of GPT4's counter register to read the FREERUN-mode timer value.
-
-config USB
- bool "USB Support"
- default y
-
-config USB_UHCI
- bool "Support for USB UHCI controllers"
- depends on USB && ARCH_X86
- default y
- help
- Select this option if you are going to use USB 1.1 on an Intel based
- system.
-
-config USB_OHCI
- bool "Support for USB OHCI controllers"
- depends on USB
- default y
- help
- Select this option if you are going to use USB 1.1 on a non-Intel based
- system.
-
-config USB_EHCI
- bool "Support for USB EHCI controllers"
- depends on USB
- default y
- help
- Select this option if you want to use USB 2.0
-
-config USB_XHCI
- bool "Support for USB xHCI controllers"
- depends on USB
- default y
- help
- Select this option if you want to use USB 3.0
-
-config USB_XHCI_MTK_QUIRK
- bool "Support for USB xHCI controllers on MTK SoC"
- depends on USB_XHCI
- help
- Select this option if you want to use USB 3.0 on MTK platform.
-
-config USB_DWC2
- bool "Support for USB DesignWare HCD controllers"
- depends on USB
- help
- Select this option if you want to use DesignWare USB 2.0 host controller
-
-config USB_HID
- bool "Support for USB keyboards"
- depends on USB
- default y
- help
- Select this option if you want to use devices complying to the
- USB HID (Human Interface Device) standard. Such devices are for
- example keyboards and mice. Currently only keyboards are supported.
- Say Y here unless you know exactly what you are doing.
-
-config USB_HUB
- bool "Support for USB hubs"
- depends on USB
- default y
- help
- Select this option if you want to compile in support for USB hubs.
- Say Y here unless you know exactly what you are doing.
-
-config USB_EHCI_HOSTPC_ROOT_HUB_TT
- bool "Support for USB EHCI ROOT HUB that has TT"
- depends on USB_EHCI
- default n
- help
- Select this option if USB EHCI root hub supports TT (Transaction
- Translator).
- To support this TT feature we read port-speed from non-standard
- register HOSTPC (offset 84h of Operational Register base).
-
-config USB_MSC
- bool "Support for USB storage"
- depends on USB
- default y
- help
- Select this option if you want to compile in support for USB mass
- storage devices (USB memory sticks, hard drives, CDROM/DVD drives)
- Say Y here unless you know exactly what you are doing.
-
-config USB_GEN_HUB
- bool
- default n if (!USB_HUB && !USB_XHCI)
- default y if (USB_HUB || USB_XHCI)
-config USB_PCI
- bool "Auto-scan PCI bus for USB host controllers"
- depends on USB
- default y if ARCH_X86
- default n
-
-config UDC
- bool "USB device mode support"
- default n
- help
- Select this option to add support for running as
- a USB device.
-
-config UDC_CI
- bool "ChipIdea driver for USB device mode"
- depends on UDC
- default n
- help
- Select this option to add the driver for ChipIdea
- USB device controller.
-
-config UDC_DWC2
- bool "Designware driver for USB device mode"
- depends on UDC
- default n
- help
- Select this option to add the driver for Designware
- USB device controller.
+source "drivers/timer/Kconfig"
+source "drivers/storage/Kconfig"
+source "drivers/usb/Kconfig"
endmenu
diff --git a/payloads/libpayload/drivers/storage/Kconfig b/payloads/libpayload/drivers/storage/Kconfig
new file mode 100644
index 0000000..961144e
--- /dev/null
+++ b/payloads/libpayload/drivers/storage/Kconfig
@@ -0,0 +1,59 @@
+##
+## This file is part of the coreboot project.
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; version 2 of the License.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+
+config STORAGE
+ bool "Support for storage devices"
+ default y
+ help
+ Select this option if you want support for storage devices (like
+ hard drives, memory sticks or optical drives).
+
+config STORAGE_64BIT_LBA
+ bool "Use 64-bit integers to address sectors"
+ depends on STORAGE
+ default n
+ help
+ If this is selected, sectors will be addressed by an 64-bit integer.
+ Select this to support LBA-48 for ATA drives.
+
+config STORAGE_ATA
+ bool "Support ATA drives (i.e. hard drives)"
+ depends on STORAGE
+ default y
+ help
+ Select this option if you want support for ATA storage devices
+ (i.e. hard drives).
+
+config STORAGE_ATAPI
+ bool "Support ATAPI drives (i.e. optical drives)"
+ depends on STORAGE
+ default y
+ select STORAGE_ATA
+ help
+ Select this option if you want support for ATAPI storage devices
+ (i.e. optical drives like CD or DVD drives).
+
+config STORAGE_AHCI
+ bool "Support for AHCI host controllers"
+ depends on STORAGE && (STORAGE_ATA || STORAGE_ATAPI) && PCI
+ default y
+ help
+ Select this option if you want support for SATA controllers in
+ AHCI mode.
+
+config STORAGE_AHCI_ONLY_TESTED
+ bool "Only enable tested controllers"
+ depends on STORAGE_AHCI
+ default y
+ help
+ If this option is selected only AHCI controllers which are known
+ to work will be used.
diff --git a/payloads/libpayload/drivers/timer/Kconfig b/payloads/libpayload/drivers/timer/Kconfig
new file mode 100644
index 0000000..8f047fa
--- /dev/null
+++ b/payloads/libpayload/drivers/timer/Kconfig
@@ -0,0 +1,129 @@
+##
+## This file is part of the coreboot project.
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; version 2 of the License.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+
+config TIMER_RDTSC
+ bool
+ default y
+ depends on ARCH_X86
+
+choice
+ prompt "Timer driver"
+ default TIMER_NONE
+ depends on !ARCH_X86
+
+config TIMER_NONE
+ bool "None"
+ help
+ The timer driver is provided by the payload itself.
+
+config TIMER_MCT
+ bool "Exynos MCT"
+
+config TIMER_TEGRA_1US
+ bool "Tegra 1us"
+
+config TIMER_IPQ806X
+ bool "Timer for ipq806x platforms"
+
+config TIMER_ARMADA38X
+ bool "Timer for armada38x platforms"
+ help
+ This is the timer driver for marvell armada38x
+ platforms.
+
+config TIMER_IPQ40XX
+ bool "Timer for ipq40xx platforms"
+ help
+ This is the timer driver for QCA IPQ40xx based
+ platforms.
+
+config TIMER_RK
+ bool "Timer for Rockchip"
+
+config TIMER_BG4CD
+ bool "Marvell BG4CD"
+
+config TIMER_CYGNUS
+ bool "Timer for Cygnus"
+
+config TIMER_IMG_PISTACHIO
+ bool "Timer for IMG Pistachio"
+
+config TIMER_MTK
+ bool "Timer for MediaTek MT8173"
+
+endchoice
+
+config TIMER_MCT_HZ
+ int "Exynos MCT frequency"
+ depends on TIMER_MCT
+ default 24000000
+
+config TIMER_MCT_ADDRESS
+ hex "Exynos MCT base address"
+ depends on TIMER_MCT
+ default 0x101c0000
+
+config TIMER_RK_ADDRESS
+ hex "Rockchip timer base address"
+ depends on TIMER_RK
+ default 0xff810020
+
+config TIMER_TEGRA_1US_ADDRESS
+ hex "Tegra u1s timer base address"
+ depends on TIMER_TEGRA_1US
+ default 0x60005010
+
+config IPQ806X_TIMER_FREQ
+ int "Hardware timer frequency"
+ default 32000
+ depends on TIMER_IPQ806X
+ help
+ IPQ hardware presently provides a single timer running at 32KHz, a
+ finer granulariry timer is available but is not yet enabled.
+
+config IPQ806X_TIMER_REG
+ hex "Timer register address"
+ default 0x0200A008
+ depends on TIMER_IPQ806X
+ help
+ Address of the register to read a free running timer value.
+
+config ARMADA38X_TIMER_FREQ
+ int "Hardware timer frequency"
+ depends on TIMER_ARMADA38X
+ default 25000000
+
+config ARMADA38X_TIMER_REG
+ hex "Timer register address"
+ default 0xF1020314
+ depends on TIMER_ARMADA38X
+
+config IPROC_PERIPH_GLB_TIM_REG_BASE
+ hex "Cygnus timer base address"
+ depends on TIMER_CYGNUS
+ default 0x19020200
+
+config TIMER_MTK_HZ
+ int "MediaTek GPT frequency"
+ depends on TIMER_MTK
+ default 13000000
+ help
+ Clock frequency of MediaTek General Purpose Timer.
+
+config TIMER_MTK_ADDRESS
+ hex "MTK GPT register address"
+ depends on TIMER_MTK
+ default 0x10008048
+ help
+ Address of GPT4's counter register to read the FREERUN-mode timer value.
+
diff --git a/payloads/libpayload/drivers/usb/Kconfig b/payloads/libpayload/drivers/usb/Kconfig
new file mode 100644
index 0000000..e1b68f7
--- /dev/null
+++ b/payloads/libpayload/drivers/usb/Kconfig
@@ -0,0 +1,129 @@
+##
+## This file is part of the coreboot project.
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; version 2 of the License.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+
+config USB
+ bool "USB Support"
+ default y
+
+config USB_UHCI
+ bool "Support for USB UHCI controllers"
+ depends on USB && ARCH_X86
+ default y
+ help
+ Select this option if you are going to use USB 1.1 on an Intel based
+ system.
+
+config USB_OHCI
+ bool "Support for USB OHCI controllers"
+ depends on USB
+ default y
+ help
+ Select this option if you are going to use USB 1.1 on a non-Intel based
+ system.
+
+config USB_EHCI
+ bool "Support for USB EHCI controllers"
+ depends on USB
+ default y
+ help
+ Select this option if you want to use USB 2.0
+
+config USB_XHCI
+ bool "Support for USB xHCI controllers"
+ depends on USB
+ default y
+ help
+ Select this option if you want to use USB 3.0
+
+config USB_XHCI_MTK_QUIRK
+ bool "Support for USB xHCI controllers on MTK SoC"
+ depends on USB_XHCI
+ help
+ Select this option if you want to use USB 3.0 on MTK platform.
+
+config USB_DWC2
+ bool "Support for USB DesignWare HCD controllers"
+ depends on USB
+ help
+ Select this option if you want to use DesignWare USB 2.0 host controller
+
+config USB_HID
+ bool "Support for USB keyboards"
+ depends on USB
+ default y
+ help
+ Select this option if you want to use devices complying to the
+ USB HID (Human Interface Device) standard. Such devices are for
+ example keyboards and mice. Currently only keyboards are supported.
+ Say Y here unless you know exactly what you are doing.
+
+config USB_HUB
+ bool "Support for USB hubs"
+ depends on USB
+ default y
+ help
+ Select this option if you want to compile in support for USB hubs.
+ Say Y here unless you know exactly what you are doing.
+
+config USB_EHCI_HOSTPC_ROOT_HUB_TT
+ bool "Support for USB EHCI ROOT HUB that has TT"
+ depends on USB_EHCI
+ default n
+ help
+ Select this option if USB EHCI root hub supports TT (Transaction
+ Translator).
+ To support this TT feature we read port-speed from non-standard
+ register HOSTPC (offset 84h of Operational Register base).
+
+config USB_MSC
+ bool "Support for USB storage"
+ depends on USB
+ default y
+ help
+ Select this option if you want to compile in support for USB mass
+ storage devices (USB memory sticks, hard drives, CDROM/DVD drives)
+ Say Y here unless you know exactly what you are doing.
+
+config USB_GEN_HUB
+ bool
+ default n if (!USB_HUB && !USB_XHCI)
+ default y if (USB_HUB || USB_XHCI)
+config USB_PCI
+ bool "Auto-scan PCI bus for USB host controllers"
+ depends on USB
+ default y if ARCH_X86
+ default n
+
+config UDC
+ bool "USB device mode support"
+ default n
+ help
+ Select this option to add support for running as
+ a USB device.
+
+config UDC_CI
+ bool "ChipIdea driver for USB device mode"
+ depends on UDC
+ default n
+ help
+ Select this option to add the driver for ChipIdea
+ USB device controller.
+
+config UDC_DWC2
+ bool "Designware driver for USB device mode"
+ depends on UDC
+ default n
+ help
+ Select this option to add the driver for Designware
+ USB device controller.
+