diff options
author | 2023-10-10 14:33:42 +0000 | |
---|---|---|
committer | 2023-10-10 14:33:42 +0000 | |
commit | af1a266670d040d2f4083ff309d732d648afba2a (patch) | |
tree | 2fc46203448ddcc6f81546d379abfaeb323575e9 /roms/u-boot/arch/x86/cpu/apollolake/pch.c | |
parent | e02cda008591317b1625707ff8e115a4841aa889 (diff) |
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'roms/u-boot/arch/x86/cpu/apollolake/pch.c')
-rw-r--r-- | roms/u-boot/arch/x86/cpu/apollolake/pch.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/roms/u-boot/arch/x86/cpu/apollolake/pch.c b/roms/u-boot/arch/x86/cpu/apollolake/pch.c new file mode 100644 index 000000000..39d6ad5ed --- /dev/null +++ b/roms/u-boot/arch/x86/cpu/apollolake/pch.c @@ -0,0 +1,38 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright 2019 Google LLC + */ + +#include <common.h> +#include <dm.h> +#include <pch.h> +#include <spl.h> +#include <asm/lpc_common.h> + +#define BIOS_CTRL 0xdc + +static int apl_set_spi_protect(struct udevice *dev, bool protect) +{ + if (spl_phase() == PHASE_SPL) + return lpc_set_spi_protect(dev, BIOS_CTRL, protect); + + return 0; +} + +static const struct pch_ops apl_pch_ops = { + .set_spi_protect = apl_set_spi_protect, +}; + +#if !CONFIG_IS_ENABLED(OF_PLATDATA) +static const struct udevice_id apl_pch_ids[] = { + { .compatible = "intel,apl-pch" }, + { } +}; +#endif + +U_BOOT_DRIVER(intel_apl_pch) = { + .name = "intel_apl_pch", + .id = UCLASS_PCH, + .of_match = of_match_ptr(apl_pch_ids), + .ops = &apl_pch_ops, +}; |