You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
Merge 1487b29030 ("ACPI: processor: Fix evaluating _PDC method when running as Xen dom0") into android12-5.10-lts
Steps on the way to 5.10.180 Change-Id: I7ff36de2cd04657e3f9e7c688fe1555823564e10 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -414,8 +414,8 @@
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
|
||||
ranges = <0x81000000 0 0x40200000 0x40200000 0 0x00100000>,
|
||||
<0x82000000 0 0x40300000 0x40300000 0 0x00d00000>;
|
||||
ranges = <0x81000000 0x0 0x00000000 0x40200000 0x0 0x00100000>,
|
||||
<0x82000000 0x0 0x40300000 0x40300000 0x0 0x00d00000>;
|
||||
|
||||
interrupts = <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupt-names = "msi";
|
||||
|
||||
@@ -465,8 +465,8 @@
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
|
||||
ranges = <0x81000000 0 0x0fe00000 0x0fe00000 0 0x00100000 /* downstream I/O */
|
||||
0x82000000 0 0x08000000 0x08000000 0 0x07e00000>; /* non-prefetchable memory */
|
||||
ranges = <0x81000000 0x0 0x00000000 0x0fe00000 0x0 0x00010000 /* I/O */
|
||||
0x82000000 0x0 0x08000000 0x08000000 0x0 0x07e00000>; /* MEM */
|
||||
|
||||
interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupt-names = "msi";
|
||||
@@ -516,8 +516,8 @@
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
|
||||
ranges = <0x81000000 0 0x31e00000 0x31e00000 0 0x00100000 /* downstream I/O */
|
||||
0x82000000 0 0x2e000000 0x2e000000 0 0x03e00000>; /* non-prefetchable memory */
|
||||
ranges = <0x81000000 0x0 0x00000000 0x31e00000 0x0 0x00010000 /* I/O */
|
||||
0x82000000 0x0 0x2e000000 0x2e000000 0x0 0x03e00000>; /* MEM */
|
||||
|
||||
interrupts = <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupt-names = "msi";
|
||||
@@ -567,8 +567,8 @@
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
|
||||
ranges = <0x81000000 0 0x35e00000 0x35e00000 0 0x00100000 /* downstream I/O */
|
||||
0x82000000 0 0x32000000 0x32000000 0 0x03e00000>; /* non-prefetchable memory */
|
||||
ranges = <0x81000000 0x0 0x00000000 0x35e00000 0x0 0x00010000 /* I/O */
|
||||
0x82000000 0x0 0x32000000 0x32000000 0x0 0x03e00000>; /* MEM */
|
||||
|
||||
interrupts = <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupt-names = "msi";
|
||||
|
||||
@@ -607,10 +607,8 @@
|
||||
phys = <&pcie_phy1>;
|
||||
phy-names = "pciephy";
|
||||
|
||||
ranges = <0x81000000 0 0x10200000 0x10200000
|
||||
0 0x10000>, /* downstream I/O */
|
||||
<0x82000000 0 0x10220000 0x10220000
|
||||
0 0xfde0000>; /* non-prefetchable memory */
|
||||
ranges = <0x81000000 0x0 0x00000000 0x10200000 0x0 0x10000>, /* I/O */
|
||||
<0x82000000 0x0 0x10220000 0x10220000 0x0 0xfde0000>; /* MEM */
|
||||
|
||||
interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupt-names = "msi";
|
||||
@@ -671,10 +669,8 @@
|
||||
phys = <&pcie_phy0>;
|
||||
phy-names = "pciephy";
|
||||
|
||||
ranges = <0x81000000 0 0x20200000 0x20200000
|
||||
0 0x10000>, /* downstream I/O */
|
||||
<0x82000000 0 0x20220000 0x20220000
|
||||
0 0xfde0000>; /* non-prefetchable memory */
|
||||
ranges = <0x81000000 0x0 0x00000000 0x20200000 0x0 0x10000>, /* I/O */
|
||||
<0x82000000 0x0 0x20220000 0x20220000 0x0 0xfde0000>; /* MEM */
|
||||
|
||||
interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupt-names = "msi";
|
||||
|
||||
@@ -744,8 +744,8 @@
|
||||
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
ranges = <0x01000000 0x0 0x0c200000 0x0c200000 0x0 0x100000>,
|
||||
<0x02000000 0x0 0x0c300000 0x0c300000 0x0 0xd00000>;
|
||||
ranges = <0x01000000 0x0 0x00000000 0x0c200000 0x0 0x100000>,
|
||||
<0x02000000 0x0 0x0c300000 0x0c300000 0x0 0xd00000>;
|
||||
|
||||
interrupts = <GIC_SPI 405 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupt-names = "msi";
|
||||
@@ -796,8 +796,8 @@
|
||||
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
ranges = <0x01000000 0x0 0x0d200000 0x0d200000 0x0 0x100000>,
|
||||
<0x02000000 0x0 0x0d300000 0x0d300000 0x0 0xd00000>;
|
||||
ranges = <0x01000000 0x0 0x00000000 0x0d200000 0x0 0x100000>,
|
||||
<0x02000000 0x0 0x0d300000 0x0d300000 0x0 0xd00000>;
|
||||
|
||||
interrupts = <GIC_SPI 413 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupt-names = "msi";
|
||||
@@ -845,8 +845,8 @@
|
||||
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
ranges = <0x01000000 0x0 0x0e200000 0x0e200000 0x0 0x100000>,
|
||||
<0x02000000 0x0 0x0e300000 0x0e300000 0x0 0x1d00000>;
|
||||
ranges = <0x01000000 0x0 0x00000000 0x0e200000 0x0 0x100000>,
|
||||
<0x02000000 0x0 0x0e300000 0x0e300000 0x0 0x1d00000>;
|
||||
|
||||
device_type = "pci";
|
||||
|
||||
|
||||
@@ -942,7 +942,7 @@
|
||||
phys = <&pciephy>;
|
||||
phy-names = "pciephy";
|
||||
|
||||
ranges = <0x01000000 0x0 0x1b200000 0x1b200000 0x0 0x100000>,
|
||||
ranges = <0x01000000 0x0 0x00000000 0x1b200000 0x0 0x100000>,
|
||||
<0x02000000 0x0 0x1b300000 0x1b300000 0x0 0xd00000>;
|
||||
|
||||
#interrupt-cells = <1>;
|
||||
@@ -1187,7 +1187,7 @@
|
||||
compatible = "arm,coresight-stm", "arm,primecell";
|
||||
reg = <0x06002000 0x1000>,
|
||||
<0x16280000 0x180000>;
|
||||
reg-names = "stm-base", "stm-data-base";
|
||||
reg-names = "stm-base", "stm-stimulus-base";
|
||||
status = "disabled";
|
||||
|
||||
clocks = <&rpmcc RPM_SMD_QDSS_CLK>, <&rpmcc RPM_SMD_QDSS_A_CLK>;
|
||||
|
||||
@@ -196,8 +196,8 @@
|
||||
cpu-idle-states = <&LITTLE_CPU_SLEEP_0
|
||||
&LITTLE_CPU_SLEEP_1
|
||||
&CLUSTER_SLEEP_0>;
|
||||
capacity-dmips-mhz = <607>;
|
||||
dynamic-power-coefficient = <100>;
|
||||
capacity-dmips-mhz = <611>;
|
||||
dynamic-power-coefficient = <290>;
|
||||
qcom,freq-domain = <&cpufreq_hw 0>;
|
||||
operating-points-v2 = <&cpu0_opp_table>;
|
||||
interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
|
||||
@@ -221,8 +221,8 @@
|
||||
cpu-idle-states = <&LITTLE_CPU_SLEEP_0
|
||||
&LITTLE_CPU_SLEEP_1
|
||||
&CLUSTER_SLEEP_0>;
|
||||
capacity-dmips-mhz = <607>;
|
||||
dynamic-power-coefficient = <100>;
|
||||
capacity-dmips-mhz = <611>;
|
||||
dynamic-power-coefficient = <290>;
|
||||
qcom,freq-domain = <&cpufreq_hw 0>;
|
||||
operating-points-v2 = <&cpu0_opp_table>;
|
||||
interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
|
||||
@@ -243,8 +243,8 @@
|
||||
cpu-idle-states = <&LITTLE_CPU_SLEEP_0
|
||||
&LITTLE_CPU_SLEEP_1
|
||||
&CLUSTER_SLEEP_0>;
|
||||
capacity-dmips-mhz = <607>;
|
||||
dynamic-power-coefficient = <100>;
|
||||
capacity-dmips-mhz = <611>;
|
||||
dynamic-power-coefficient = <290>;
|
||||
qcom,freq-domain = <&cpufreq_hw 0>;
|
||||
operating-points-v2 = <&cpu0_opp_table>;
|
||||
interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
|
||||
@@ -265,8 +265,8 @@
|
||||
cpu-idle-states = <&LITTLE_CPU_SLEEP_0
|
||||
&LITTLE_CPU_SLEEP_1
|
||||
&CLUSTER_SLEEP_0>;
|
||||
capacity-dmips-mhz = <607>;
|
||||
dynamic-power-coefficient = <100>;
|
||||
capacity-dmips-mhz = <611>;
|
||||
dynamic-power-coefficient = <290>;
|
||||
qcom,freq-domain = <&cpufreq_hw 0>;
|
||||
operating-points-v2 = <&cpu0_opp_table>;
|
||||
interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
|
||||
@@ -288,7 +288,7 @@
|
||||
cpu-idle-states = <&BIG_CPU_SLEEP_0
|
||||
&BIG_CPU_SLEEP_1
|
||||
&CLUSTER_SLEEP_0>;
|
||||
dynamic-power-coefficient = <396>;
|
||||
dynamic-power-coefficient = <442>;
|
||||
qcom,freq-domain = <&cpufreq_hw 1>;
|
||||
operating-points-v2 = <&cpu4_opp_table>;
|
||||
interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
|
||||
@@ -310,7 +310,7 @@
|
||||
cpu-idle-states = <&BIG_CPU_SLEEP_0
|
||||
&BIG_CPU_SLEEP_1
|
||||
&CLUSTER_SLEEP_0>;
|
||||
dynamic-power-coefficient = <396>;
|
||||
dynamic-power-coefficient = <442>;
|
||||
qcom,freq-domain = <&cpufreq_hw 1>;
|
||||
operating-points-v2 = <&cpu4_opp_table>;
|
||||
interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
|
||||
@@ -332,7 +332,7 @@
|
||||
cpu-idle-states = <&BIG_CPU_SLEEP_0
|
||||
&BIG_CPU_SLEEP_1
|
||||
&CLUSTER_SLEEP_0>;
|
||||
dynamic-power-coefficient = <396>;
|
||||
dynamic-power-coefficient = <442>;
|
||||
qcom,freq-domain = <&cpufreq_hw 1>;
|
||||
operating-points-v2 = <&cpu4_opp_table>;
|
||||
interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
|
||||
@@ -354,7 +354,7 @@
|
||||
cpu-idle-states = <&BIG_CPU_SLEEP_0
|
||||
&BIG_CPU_SLEEP_1
|
||||
&CLUSTER_SLEEP_0>;
|
||||
dynamic-power-coefficient = <396>;
|
||||
dynamic-power-coefficient = <442>;
|
||||
qcom,freq-domain = <&cpufreq_hw 1>;
|
||||
operating-points-v2 = <&cpu4_opp_table>;
|
||||
interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
|
||||
@@ -1816,8 +1816,8 @@
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
|
||||
ranges = <0x01000000 0x0 0x60200000 0 0x60200000 0x0 0x100000>,
|
||||
<0x02000000 0x0 0x60300000 0 0x60300000 0x0 0xd00000>;
|
||||
ranges = <0x01000000 0x0 0x00000000 0x0 0x60200000 0x0 0x100000>,
|
||||
<0x02000000 0x0 0x60300000 0x0 0x60300000 0x0 0xd00000>;
|
||||
|
||||
interrupts = <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupt-names = "msi";
|
||||
@@ -1920,7 +1920,7 @@
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
|
||||
ranges = <0x01000000 0x0 0x40200000 0x0 0x40200000 0x0 0x100000>,
|
||||
ranges = <0x01000000 0x0 0x00000000 0x0 0x40200000 0x0 0x100000>,
|
||||
<0x02000000 0x0 0x40300000 0x0 0x40300000 0x0 0x1fd00000>;
|
||||
|
||||
interrupts = <GIC_SPI 307 IRQ_TYPE_EDGE_RISING>;
|
||||
|
||||
@@ -49,17 +49,14 @@
|
||||
opp-shared;
|
||||
opp-800000000 {
|
||||
opp-hz = /bits/ 64 <800000000>;
|
||||
opp-microvolt = <820000>;
|
||||
clock-latency-ns = <300000>;
|
||||
};
|
||||
opp-1000000000 {
|
||||
opp-hz = /bits/ 64 <1000000000>;
|
||||
opp-microvolt = <820000>;
|
||||
clock-latency-ns = <300000>;
|
||||
};
|
||||
opp-1200000000 {
|
||||
opp-hz = /bits/ 64 <1200000000>;
|
||||
opp-microvolt = <820000>;
|
||||
clock-latency-ns = <300000>;
|
||||
opp-suspend;
|
||||
};
|
||||
|
||||
@@ -60,17 +60,14 @@
|
||||
opp-shared;
|
||||
opp-800000000 {
|
||||
opp-hz = /bits/ 64 <800000000>;
|
||||
opp-microvolt = <820000>;
|
||||
clock-latency-ns = <300000>;
|
||||
};
|
||||
opp-1000000000 {
|
||||
opp-hz = /bits/ 64 <1000000000>;
|
||||
opp-microvolt = <820000>;
|
||||
clock-latency-ns = <300000>;
|
||||
};
|
||||
opp-1200000000 {
|
||||
opp-hz = /bits/ 64 <1200000000>;
|
||||
opp-microvolt = <820000>;
|
||||
clock-latency-ns = <300000>;
|
||||
opp-suspend;
|
||||
};
|
||||
|
||||
@@ -197,10 +197,10 @@ static DEFINE_PER_CPU(struct threshold_bank **, threshold_banks);
|
||||
* A list of the banks enabled on each logical CPU. Controls which respective
|
||||
* descriptors to initialize later in mce_threshold_create_device().
|
||||
*/
|
||||
static DEFINE_PER_CPU(unsigned int, bank_map);
|
||||
static DEFINE_PER_CPU(u64, bank_map);
|
||||
|
||||
/* Map of banks that have more than MCA_MISC0 available. */
|
||||
static DEFINE_PER_CPU(u32, smca_misc_banks_map);
|
||||
static DEFINE_PER_CPU(u64, smca_misc_banks_map);
|
||||
|
||||
static void amd_threshold_interrupt(void);
|
||||
static void amd_deferred_error_interrupt(void);
|
||||
@@ -229,7 +229,7 @@ static void smca_set_misc_banks_map(unsigned int bank, unsigned int cpu)
|
||||
return;
|
||||
|
||||
if (low & MASK_BLKPTR_LO)
|
||||
per_cpu(smca_misc_banks_map, cpu) |= BIT(bank);
|
||||
per_cpu(smca_misc_banks_map, cpu) |= BIT_ULL(bank);
|
||||
|
||||
}
|
||||
|
||||
@@ -492,7 +492,7 @@ static u32 smca_get_block_address(unsigned int bank, unsigned int block,
|
||||
if (!block)
|
||||
return MSR_AMD64_SMCA_MCx_MISC(bank);
|
||||
|
||||
if (!(per_cpu(smca_misc_banks_map, cpu) & BIT(bank)))
|
||||
if (!(per_cpu(smca_misc_banks_map, cpu) & BIT_ULL(bank)))
|
||||
return 0;
|
||||
|
||||
return MSR_AMD64_SMCA_MCx_MISCy(bank, block - 1);
|
||||
@@ -536,7 +536,7 @@ prepare_threshold_block(unsigned int bank, unsigned int block, u32 addr,
|
||||
int new;
|
||||
|
||||
if (!block)
|
||||
per_cpu(bank_map, cpu) |= (1 << bank);
|
||||
per_cpu(bank_map, cpu) |= BIT_ULL(bank);
|
||||
|
||||
memset(&b, 0, sizeof(b));
|
||||
b.cpu = cpu;
|
||||
@@ -1048,7 +1048,7 @@ static void amd_threshold_interrupt(void)
|
||||
return;
|
||||
|
||||
for (bank = 0; bank < this_cpu_read(mce_num_banks); ++bank) {
|
||||
if (!(per_cpu(bank_map, cpu) & (1 << bank)))
|
||||
if (!(per_cpu(bank_map, cpu) & BIT_ULL(bank)))
|
||||
continue;
|
||||
|
||||
first_block = bp[bank]->blocks;
|
||||
@@ -1525,7 +1525,7 @@ int mce_threshold_create_device(unsigned int cpu)
|
||||
return -ENOMEM;
|
||||
|
||||
for (bank = 0; bank < numbanks; ++bank) {
|
||||
if (!(this_cpu_read(bank_map) & (1 << bank)))
|
||||
if (!(this_cpu_read(bank_map) & BIT_ULL(bank)))
|
||||
continue;
|
||||
err = threshold_create_bank(bp, cpu, bank);
|
||||
if (err) {
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
#include <linux/acpi.h>
|
||||
#include <acpi/processor.h>
|
||||
|
||||
#include <xen/xen.h>
|
||||
|
||||
#include "internal.h"
|
||||
|
||||
#define _COMPONENT ACPI_PROCESSOR_COMPONENT
|
||||
@@ -50,6 +52,15 @@ static bool __init processor_physically_present(acpi_handle handle)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (xen_initial_domain())
|
||||
/*
|
||||
* When running as a Xen dom0 the number of processors Linux
|
||||
* sees can be different from the real number of processors on
|
||||
* the system, and we still need to execute _PDC for all of
|
||||
* them.
|
||||
*/
|
||||
return xen_processor_present(acpi_id);
|
||||
|
||||
type = (acpi_type == ACPI_TYPE_DEVICE) ? 1 : 0;
|
||||
cpuid = acpi_get_cpuid(handle, type, acpi_id);
|
||||
|
||||
|
||||
@@ -136,16 +136,27 @@ static bool check_locality(struct tpm_chip *chip, int l)
|
||||
return false;
|
||||
}
|
||||
|
||||
static int release_locality(struct tpm_chip *chip, int l)
|
||||
static int __tpm_tis_relinquish_locality(struct tpm_tis_data *priv, int l)
|
||||
{
|
||||
struct tpm_tis_data *priv = dev_get_drvdata(&chip->dev);
|
||||
|
||||
tpm_tis_write8(priv, TPM_ACCESS(l), TPM_ACCESS_ACTIVE_LOCALITY);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int request_locality(struct tpm_chip *chip, int l)
|
||||
static int tpm_tis_relinquish_locality(struct tpm_chip *chip, int l)
|
||||
{
|
||||
struct tpm_tis_data *priv = dev_get_drvdata(&chip->dev);
|
||||
|
||||
mutex_lock(&priv->locality_count_mutex);
|
||||
priv->locality_count--;
|
||||
if (priv->locality_count == 0)
|
||||
__tpm_tis_relinquish_locality(priv, l);
|
||||
mutex_unlock(&priv->locality_count_mutex);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __tpm_tis_request_locality(struct tpm_chip *chip, int l)
|
||||
{
|
||||
struct tpm_tis_data *priv = dev_get_drvdata(&chip->dev);
|
||||
unsigned long stop, timeout;
|
||||
@@ -186,6 +197,20 @@ again:
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int tpm_tis_request_locality(struct tpm_chip *chip, int l)
|
||||
{
|
||||
struct tpm_tis_data *priv = dev_get_drvdata(&chip->dev);
|
||||
int ret = 0;
|
||||
|
||||
mutex_lock(&priv->locality_count_mutex);
|
||||
if (priv->locality_count == 0)
|
||||
ret = __tpm_tis_request_locality(chip, l);
|
||||
if (!ret)
|
||||
priv->locality_count++;
|
||||
mutex_unlock(&priv->locality_count_mutex);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static u8 tpm_tis_status(struct tpm_chip *chip)
|
||||
{
|
||||
struct tpm_tis_data *priv = dev_get_drvdata(&chip->dev);
|
||||
@@ -638,7 +663,7 @@ static int probe_itpm(struct tpm_chip *chip)
|
||||
if (vendor != TPM_VID_INTEL)
|
||||
return 0;
|
||||
|
||||
if (request_locality(chip, 0) != 0)
|
||||
if (tpm_tis_request_locality(chip, 0) != 0)
|
||||
return -EBUSY;
|
||||
|
||||
rc = tpm_tis_send_data(chip, cmd_getticks, len);
|
||||
@@ -659,7 +684,7 @@ static int probe_itpm(struct tpm_chip *chip)
|
||||
|
||||
out:
|
||||
tpm_tis_ready(chip);
|
||||
release_locality(chip, priv->locality);
|
||||
tpm_tis_relinquish_locality(chip, priv->locality);
|
||||
|
||||
return rc;
|
||||
}
|
||||
@@ -714,25 +739,17 @@ static irqreturn_t tis_int_handler(int dummy, void *dev_id)
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
static int tpm_tis_gen_interrupt(struct tpm_chip *chip)
|
||||
static void tpm_tis_gen_interrupt(struct tpm_chip *chip)
|
||||
{
|
||||
const char *desc = "attempting to generate an interrupt";
|
||||
u32 cap2;
|
||||
cap_t cap;
|
||||
int ret;
|
||||
|
||||
ret = request_locality(chip, 0);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (chip->flags & TPM_CHIP_FLAG_TPM2)
|
||||
ret = tpm2_get_tpm_pt(chip, 0x100, &cap2, desc);
|
||||
else
|
||||
ret = tpm1_getcap(chip, TPM_CAP_PROP_TIS_TIMEOUT, &cap, desc, 0);
|
||||
|
||||
release_locality(chip, 0);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Register the IRQ and issue a command that will cause an interrupt. If an
|
||||
@@ -755,52 +772,55 @@ static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask,
|
||||
}
|
||||
priv->irq = irq;
|
||||
|
||||
rc = tpm_tis_read8(priv, TPM_INT_VECTOR(priv->locality),
|
||||
&original_int_vec);
|
||||
rc = tpm_tis_request_locality(chip, 0);
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
|
||||
rc = tpm_tis_read8(priv, TPM_INT_VECTOR(priv->locality),
|
||||
&original_int_vec);
|
||||
if (rc < 0) {
|
||||
tpm_tis_relinquish_locality(chip, priv->locality);
|
||||
return rc;
|
||||
}
|
||||
|
||||
rc = tpm_tis_write8(priv, TPM_INT_VECTOR(priv->locality), irq);
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
goto restore_irqs;
|
||||
|
||||
rc = tpm_tis_read32(priv, TPM_INT_STATUS(priv->locality), &int_status);
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
goto restore_irqs;
|
||||
|
||||
/* Clear all existing */
|
||||
rc = tpm_tis_write32(priv, TPM_INT_STATUS(priv->locality), int_status);
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
|
||||
goto restore_irqs;
|
||||
/* Turn on */
|
||||
rc = tpm_tis_write32(priv, TPM_INT_ENABLE(priv->locality),
|
||||
intmask | TPM_GLOBAL_INT_ENABLE);
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
goto restore_irqs;
|
||||
|
||||
priv->irq_tested = false;
|
||||
|
||||
/* Generate an interrupt by having the core call through to
|
||||
* tpm_tis_send
|
||||
*/
|
||||
rc = tpm_tis_gen_interrupt(chip);
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
tpm_tis_gen_interrupt(chip);
|
||||
|
||||
restore_irqs:
|
||||
/* tpm_tis_send will either confirm the interrupt is working or it
|
||||
* will call disable_irq which undoes all of the above.
|
||||
*/
|
||||
if (!(chip->flags & TPM_CHIP_FLAG_IRQ)) {
|
||||
rc = tpm_tis_write8(priv, original_int_vec,
|
||||
TPM_INT_VECTOR(priv->locality));
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
|
||||
return 1;
|
||||
tpm_tis_write8(priv, original_int_vec,
|
||||
TPM_INT_VECTOR(priv->locality));
|
||||
rc = -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
tpm_tis_relinquish_locality(chip, priv->locality);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* Try to find the IRQ the TPM is using. This is for legacy x86 systems that
|
||||
@@ -914,8 +934,8 @@ static const struct tpm_class_ops tpm_tis = {
|
||||
.req_complete_mask = TPM_STS_DATA_AVAIL | TPM_STS_VALID,
|
||||
.req_complete_val = TPM_STS_DATA_AVAIL | TPM_STS_VALID,
|
||||
.req_canceled = tpm_tis_req_canceled,
|
||||
.request_locality = request_locality,
|
||||
.relinquish_locality = release_locality,
|
||||
.request_locality = tpm_tis_request_locality,
|
||||
.relinquish_locality = tpm_tis_relinquish_locality,
|
||||
.clk_enable = tpm_tis_clkrun_enable,
|
||||
};
|
||||
|
||||
@@ -949,6 +969,8 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,
|
||||
priv->timeout_min = TPM_TIMEOUT_USECS_MIN;
|
||||
priv->timeout_max = TPM_TIMEOUT_USECS_MAX;
|
||||
priv->phy_ops = phy_ops;
|
||||
priv->locality_count = 0;
|
||||
mutex_init(&priv->locality_count_mutex);
|
||||
|
||||
dev_set_drvdata(&chip->dev, priv);
|
||||
|
||||
@@ -995,14 +1017,14 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,
|
||||
TPM_INTF_DATA_AVAIL_INT | TPM_INTF_STS_VALID_INT;
|
||||
intmask &= ~TPM_GLOBAL_INT_ENABLE;
|
||||
|
||||
rc = request_locality(chip, 0);
|
||||
rc = tpm_tis_request_locality(chip, 0);
|
||||
if (rc < 0) {
|
||||
rc = -ENODEV;
|
||||
goto out_err;
|
||||
}
|
||||
|
||||
tpm_tis_write32(priv, TPM_INT_ENABLE(priv->locality), intmask);
|
||||
release_locality(chip, 0);
|
||||
tpm_tis_relinquish_locality(chip, 0);
|
||||
|
||||
rc = tpm_chip_start(chip);
|
||||
if (rc)
|
||||
@@ -1062,13 +1084,13 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,
|
||||
* proper timeouts for the driver.
|
||||
*/
|
||||
|
||||
rc = request_locality(chip, 0);
|
||||
rc = tpm_tis_request_locality(chip, 0);
|
||||
if (rc < 0)
|
||||
goto out_err;
|
||||
|
||||
rc = tpm_get_timeouts(chip);
|
||||
|
||||
release_locality(chip, 0);
|
||||
tpm_tis_relinquish_locality(chip, 0);
|
||||
|
||||
if (rc) {
|
||||
dev_err(dev, "Could not get TPM timeouts and durations\n");
|
||||
@@ -1076,17 +1098,21 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,
|
||||
goto out_err;
|
||||
}
|
||||
|
||||
if (irq) {
|
||||
if (irq)
|
||||
tpm_tis_probe_irq_single(chip, intmask, IRQF_SHARED,
|
||||
irq);
|
||||
if (!(chip->flags & TPM_CHIP_FLAG_IRQ)) {
|
||||
dev_err(&chip->dev, FW_BUG
|
||||
else
|
||||
tpm_tis_probe_irq(chip, intmask);
|
||||
|
||||
if (!(chip->flags & TPM_CHIP_FLAG_IRQ)) {
|
||||
dev_err(&chip->dev, FW_BUG
|
||||
"TPM interrupt not working, polling instead\n");
|
||||
|
||||
disable_interrupts(chip);
|
||||
}
|
||||
} else {
|
||||
tpm_tis_probe_irq(chip, intmask);
|
||||
rc = tpm_tis_request_locality(chip, 0);
|
||||
if (rc < 0)
|
||||
goto out_err;
|
||||
disable_interrupts(chip);
|
||||
tpm_tis_relinquish_locality(chip, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1147,28 +1173,27 @@ int tpm_tis_resume(struct device *dev)
|
||||
struct tpm_chip *chip = dev_get_drvdata(dev);
|
||||
int ret;
|
||||
|
||||
ret = tpm_tis_request_locality(chip, 0);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (chip->flags & TPM_CHIP_FLAG_IRQ)
|
||||
tpm_tis_reenable_interrupts(chip);
|
||||
|
||||
ret = tpm_pm_resume(dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
goto out;
|
||||
|
||||
/*
|
||||
* TPM 1.2 requires self-test on resume. This function actually returns
|
||||
* an error code but for unknown reason it isn't handled.
|
||||
*/
|
||||
if (!(chip->flags & TPM_CHIP_FLAG_TPM2)) {
|
||||
ret = request_locality(chip, 0);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (!(chip->flags & TPM_CHIP_FLAG_TPM2))
|
||||
tpm1_do_selftest(chip);
|
||||
out:
|
||||
tpm_tis_relinquish_locality(chip, 0);
|
||||
|
||||
release_locality(chip, 0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(tpm_tis_resume);
|
||||
#endif
|
||||
|
||||
@@ -90,6 +90,8 @@ enum tpm_tis_flags {
|
||||
|
||||
struct tpm_tis_data {
|
||||
u16 manufacturer_id;
|
||||
struct mutex locality_count_mutex;
|
||||
unsigned int locality_count;
|
||||
int locality;
|
||||
int irq;
|
||||
bool irq_tested;
|
||||
|
||||
@@ -1261,7 +1261,7 @@ static struct rockchip_clk_branch rk3399_clk_branches[] __initdata = {
|
||||
RK3399_CLKSEL_CON(56), 6, 2, MFLAGS,
|
||||
RK3399_CLKGATE_CON(10), 7, GFLAGS),
|
||||
|
||||
COMPOSITE_NOGATE(SCLK_CIF_OUT, "clk_cifout", mux_clk_cif_p, 0,
|
||||
COMPOSITE_NOGATE(SCLK_CIF_OUT, "clk_cifout", mux_clk_cif_p, CLK_SET_RATE_PARENT,
|
||||
RK3399_CLKSEL_CON(56), 5, 1, MFLAGS, 0, 5, DFLAGS),
|
||||
|
||||
/* gic */
|
||||
|
||||
@@ -509,7 +509,7 @@ rir_found:
|
||||
}
|
||||
|
||||
static u8 skx_close_row[] = {
|
||||
15, 16, 17, 18, 20, 21, 22, 28, 10, 11, 12, 13, 29, 30, 31, 32, 33
|
||||
15, 16, 17, 18, 20, 21, 22, 28, 10, 11, 12, 13, 29, 30, 31, 32, 33, 34
|
||||
};
|
||||
|
||||
static u8 skx_close_column[] = {
|
||||
@@ -517,7 +517,7 @@ static u8 skx_close_column[] = {
|
||||
};
|
||||
|
||||
static u8 skx_open_row[] = {
|
||||
14, 15, 16, 20, 28, 21, 22, 23, 24, 25, 26, 27, 29, 30, 31, 32, 33
|
||||
14, 15, 16, 20, 28, 21, 22, 23, 24, 25, 26, 27, 29, 30, 31, 32, 33, 34
|
||||
};
|
||||
|
||||
static u8 skx_open_column[] = {
|
||||
|
||||
@@ -1262,8 +1262,7 @@ static int qcom_scm_probe(struct platform_device *pdev)
|
||||
static void qcom_scm_shutdown(struct platform_device *pdev)
|
||||
{
|
||||
/* Clean shutdown, disable download mode to allow normal restart */
|
||||
if (download_mode)
|
||||
qcom_scm_set_download_mode(false);
|
||||
qcom_scm_set_download_mode(false);
|
||||
}
|
||||
|
||||
static const struct of_device_id qcom_scm_dt_match[] = {
|
||||
|
||||
@@ -103,22 +103,19 @@ void adv7533_dsi_power_off(struct adv7511 *adv)
|
||||
enum drm_mode_status adv7533_mode_valid(struct adv7511 *adv,
|
||||
const struct drm_display_mode *mode)
|
||||
{
|
||||
int lanes;
|
||||
unsigned long max_lane_freq;
|
||||
struct mipi_dsi_device *dsi = adv->dsi;
|
||||
u8 bpp = mipi_dsi_pixel_format_to_bpp(dsi->format);
|
||||
|
||||
if (mode->clock > 80000)
|
||||
lanes = 4;
|
||||
else
|
||||
lanes = 3;
|
||||
/* Check max clock for either 7533 or 7535 */
|
||||
if (mode->clock > (adv->type == ADV7533 ? 80000 : 148500))
|
||||
return MODE_CLOCK_HIGH;
|
||||
|
||||
/*
|
||||
* TODO: add support for dynamic switching of lanes
|
||||
* by using the bridge pre_enable() op . Till then filter
|
||||
* out the modes which shall need different number of lanes
|
||||
* than what was configured in the device tree.
|
||||
*/
|
||||
if (lanes != dsi->lanes)
|
||||
return MODE_BAD;
|
||||
/* Check max clock for each lane */
|
||||
max_lane_freq = (adv->type == ADV7533 ? 800000 : 891000);
|
||||
|
||||
if (mode->clock * bpp > max_lane_freq * adv->num_dsi_lanes)
|
||||
return MODE_CLOCK_HIGH;
|
||||
|
||||
return MODE_OK;
|
||||
}
|
||||
|
||||
@@ -488,8 +488,9 @@ retry:
|
||||
*/
|
||||
dev->mode_config.delayed_event = true;
|
||||
if (dev->mode_config.poll_enabled)
|
||||
schedule_delayed_work(&dev->mode_config.output_poll_work,
|
||||
0);
|
||||
mod_delayed_work(system_wq,
|
||||
&dev->mode_config.output_poll_work,
|
||||
0);
|
||||
}
|
||||
|
||||
/* Re-enable polling in case the global poll config changed. */
|
||||
|
||||
@@ -1569,6 +1569,7 @@ struct msm_gpu *a5xx_gpu_init(struct drm_device *dev)
|
||||
struct a5xx_gpu *a5xx_gpu = NULL;
|
||||
struct adreno_gpu *adreno_gpu;
|
||||
struct msm_gpu *gpu;
|
||||
unsigned int nr_rings;
|
||||
int ret;
|
||||
|
||||
if (!pdev) {
|
||||
@@ -1589,7 +1590,12 @@ struct msm_gpu *a5xx_gpu_init(struct drm_device *dev)
|
||||
|
||||
check_speed_bin(&pdev->dev);
|
||||
|
||||
ret = adreno_gpu_init(dev, pdev, adreno_gpu, &funcs, 4);
|
||||
nr_rings = 4;
|
||||
|
||||
if (adreno_is_a510(adreno_gpu))
|
||||
nr_rings = 1;
|
||||
|
||||
ret = adreno_gpu_init(dev, pdev, adreno_gpu, &funcs, nr_rings);
|
||||
if (ret) {
|
||||
a5xx_destroy(&(a5xx_gpu->base.base));
|
||||
return ERR_PTR(ret);
|
||||
|
||||
@@ -301,8 +301,11 @@ struct msm_gpu *adreno_load_gpu(struct drm_device *dev)
|
||||
if (ret)
|
||||
return NULL;
|
||||
|
||||
/* Make sure pm runtime is active and reset any previous errors */
|
||||
pm_runtime_set_active(&pdev->dev);
|
||||
/*
|
||||
* Now that we have firmware loaded, and are ready to begin
|
||||
* booting the gpu, go ahead and enable runpm:
|
||||
*/
|
||||
pm_runtime_enable(&pdev->dev);
|
||||
|
||||
ret = pm_runtime_get_sync(&pdev->dev);
|
||||
if (ret < 0) {
|
||||
|
||||
@@ -916,7 +916,6 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev,
|
||||
pm_runtime_set_autosuspend_delay(dev,
|
||||
adreno_gpu->info->inactive_period);
|
||||
pm_runtime_use_autosuspend(dev);
|
||||
pm_runtime_enable(dev);
|
||||
|
||||
ret = msm_gpu_init(drm, pdev, &adreno_gpu->base, &funcs->base,
|
||||
adreno_gpu->info->name, &adreno_gpu_config);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user