-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Move P2SB from Apollo Lake to a more generic location - Add a function to find a device by drvdata in DM core - Enhancement of DM IRQ uclass driver - Add a clock driver for Intel devices - Add support for ACPI general-purpose events - Add a TPM driver for H1/Cr50 - Enable TPM on Google Chromebook Coral
- Loading branch information
Showing
38 changed files
with
1,640 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
// SPDX-License-Identifier: GPL-2.0+ | ||
/* | ||
* Copyright 2019 Google, LLC | ||
* Written by Simon Glass <[email protected]> | ||
*/ | ||
|
||
#include <common.h> | ||
#include <dm.h> | ||
#include <irq.h> | ||
#include <asm/io.h> | ||
|
||
/** | ||
* struct acpi_gpe_priv - private driver information | ||
* | ||
* @acpi_base: Base I/O address of ACPI registers | ||
*/ | ||
struct acpi_gpe_priv { | ||
ulong acpi_base; | ||
}; | ||
|
||
#define GPE0_STS(x) (0x20 + ((x) * 4)) | ||
|
||
static int acpi_gpe_read_and_clear(struct irq *irq) | ||
{ | ||
struct acpi_gpe_priv *priv = dev_get_priv(irq->dev); | ||
u32 mask, sts; | ||
ulong start; | ||
int ret = 0; | ||
int bank; | ||
|
||
bank = irq->id / 32; | ||
mask = 1 << (irq->id % 32); | ||
|
||
/* Wait up to 1ms for GPE status to clear */ | ||
start = get_timer(0); | ||
do { | ||
if (get_timer(start) > 1) | ||
return ret; | ||
|
||
sts = inl(priv->acpi_base + GPE0_STS(bank)); | ||
if (sts & mask) { | ||
outl(mask, priv->acpi_base + GPE0_STS(bank)); | ||
ret = 1; | ||
} | ||
} while (sts & mask); | ||
|
||
return ret; | ||
} | ||
|
||
static int acpi_gpe_ofdata_to_platdata(struct udevice *dev) | ||
{ | ||
struct acpi_gpe_priv *priv = dev_get_priv(dev); | ||
|
||
priv->acpi_base = dev_read_addr(dev); | ||
if (!priv->acpi_base || priv->acpi_base == FDT_ADDR_T_NONE) | ||
return log_msg_ret("acpi_base", -EINVAL); | ||
|
||
return 0; | ||
} | ||
|
||
static int acpi_gpe_of_xlate(struct irq *irq, struct ofnode_phandle_args *args) | ||
{ | ||
irq->id = args->args[0]; | ||
|
||
return 0; | ||
} | ||
|
||
static const struct irq_ops acpi_gpe_ops = { | ||
.read_and_clear = acpi_gpe_read_and_clear, | ||
.of_xlate = acpi_gpe_of_xlate, | ||
}; | ||
|
||
static const struct udevice_id acpi_gpe_ids[] = { | ||
{ .compatible = "intel,acpi-gpe", .data = X86_IRQT_ACPI_GPE }, | ||
{ } | ||
}; | ||
|
||
U_BOOT_DRIVER(acpi_gpe_drv) = { | ||
.name = "acpi_gpe", | ||
.id = UCLASS_IRQ, | ||
.of_match = acpi_gpe_ids, | ||
.ops = &acpi_gpe_ops, | ||
.ofdata_to_platdata = acpi_gpe_ofdata_to_platdata, | ||
.priv_auto_alloc_size = sizeof(struct acpi_gpe_priv), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,6 @@ endif | |
|
||
obj-y += hostbridge.o | ||
obj-y += lpc.o | ||
obj-y += p2sb.o | ||
obj-y += pch.o | ||
obj-y += pmc.o | ||
obj-y += uart.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,77 +24,20 @@ | |
#define HIDE_BIT BIT(0) | ||
|
||
#define INTEL_GSPI_MAX 3 | ||
#define INTEL_I2C_DEV_MAX 8 | ||
#define MAX_USB2_PORTS 8 | ||
|
||
enum { | ||
CHIPSET_LOCKDOWN_FSP = 0, /* FSP handles locking per UPDs */ | ||
CHIPSET_LOCKDOWN_COREBOOT, /* coreboot handles locking */ | ||
}; | ||
|
||
enum i2c_speed { | ||
I2C_SPEED_STANDARD = 100000, | ||
I2C_SPEED_FAST = 400000, | ||
I2C_SPEED_FAST_PLUS = 1000000, | ||
I2C_SPEED_HIGH = 3400000, | ||
I2C_SPEED_FAST_ULTRA = 5000000, | ||
}; | ||
|
||
/* | ||
* Timing values are in units of clock period, with the clock speed | ||
* provided by the SOC | ||
* | ||
* TODO([email protected]): Connect this up to the I2C driver | ||
*/ | ||
struct dw_i2c_speed_config { | ||
enum i2c_speed speed; | ||
/* SCL high and low period count */ | ||
u16 scl_lcnt; | ||
u16 scl_hcnt; | ||
/* | ||
* SDA hold time should be 300ns in standard and fast modes | ||
* and long enough for deterministic logic level change in | ||
* fast-plus and high speed modes. | ||
* | ||
* [15:0] SDA TX Hold Time | ||
* [23:16] SDA RX Hold Time | ||
*/ | ||
u32 sda_hold; | ||
}; | ||
|
||
/* Serial IRQ control. SERIRQ_QUIET is the default (0) */ | ||
enum serirq_mode { | ||
SERIRQ_QUIET, | ||
SERIRQ_CONTINUOUS, | ||
SERIRQ_OFF, | ||
}; | ||
|
||
/* | ||
* This I2C controller has support for 3 independent speed configs but can | ||
* support both FAST_PLUS and HIGH speeds through the same set of speed | ||
* config registers. These are treated separately so the speed config values | ||
* can be provided via ACPI to the OS. | ||
*/ | ||
#define DW_I2C_SPEED_CONFIG_COUNT 4 | ||
|
||
struct dw_i2c_bus_config { | ||
/* Bus should be enabled in TPL with temporary base */ | ||
int early_init; | ||
/* Bus speed in Hz, default is I2C_SPEED_FAST (400 KHz) */ | ||
enum i2c_speed speed; | ||
/* | ||
* If rise_time_ns is non-zero the calculations for lcnt and hcnt | ||
* registers take into account the times of the bus. However, if | ||
* there is a match in speed_config those register values take | ||
* precedence | ||
*/ | ||
int rise_time_ns; | ||
int fall_time_ns; | ||
int data_hold_time_ns; | ||
/* Specific bus speed configuration */ | ||
struct dw_i2c_speed_config speed_config[DW_I2C_SPEED_CONFIG_COUNT]; | ||
}; | ||
|
||
struct gspi_cfg { | ||
/* Bus speed in MHz */ | ||
u32 speed_mhz; | ||
|
@@ -110,7 +53,6 @@ struct gspi_cfg { | |
struct soc_intel_common_config { | ||
int chipset_lockdown; | ||
struct gspi_cfg gspi[INTEL_GSPI_MAX]; | ||
struct dw_i2c_bus_config i2c[INTEL_I2C_DEV_MAX]; | ||
}; | ||
|
||
enum pnp_settings { | ||
|
@@ -593,7 +535,7 @@ int arch_fsps_preinit(void) | |
struct udevice *itss; | ||
int ret; | ||
|
||
ret = uclass_first_device_err(UCLASS_IRQ, &itss); | ||
ret = irq_first_device_type(X86_IRQT_ITSS, &itss); | ||
if (ret) | ||
return log_msg_ret("no itss", ret); | ||
/* | ||
|
@@ -634,7 +576,7 @@ int arch_fsp_init_r(void) | |
if (ret) | ||
return ret; | ||
|
||
ret = uclass_first_device_err(UCLASS_IRQ, &itss); | ||
ret = irq_first_device_type(X86_IRQT_ITSS, &itss); | ||
if (ret) | ||
return log_msg_ret("no itss", ret); | ||
/* Restore GPIO IRQ polarities back to previous settings */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.