2019-12-09 00:40:10 +00:00
|
|
|
// 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,
|
|
|
|
};
|
|
|
|
|
2021-08-07 13:24:04 +00:00
|
|
|
#if CONFIG_IS_ENABLED(OF_REAL)
|
2019-12-09 00:40:10 +00:00
|
|
|
static const struct udevice_id apl_pch_ids[] = {
|
|
|
|
{ .compatible = "intel,apl-pch" },
|
|
|
|
{ }
|
|
|
|
};
|
2020-12-23 15:11:30 +00:00
|
|
|
#endif
|
2019-12-09 00:40:10 +00:00
|
|
|
|
2020-10-05 11:27:01 +00:00
|
|
|
U_BOOT_DRIVER(intel_apl_pch) = {
|
|
|
|
.name = "intel_apl_pch",
|
2019-12-09 00:40:10 +00:00
|
|
|
.id = UCLASS_PCH,
|
2020-12-23 15:11:30 +00:00
|
|
|
.of_match = of_match_ptr(apl_pch_ids),
|
2019-12-09 00:40:10 +00:00
|
|
|
.ops = &apl_pch_ops,
|
|
|
|
};
|