From 5b3831c75abe5fc50739984eaa70fbada2575bb7 Mon Sep 17 00:00:00 2001 From: Felix Held Date: Mon, 30 Nov 2020 17:56:59 +0100 Subject: soc/amd: factor out common AOAC definitions The register locations and bit definitions are the same for Stoneyridge and Picasso. Since not all devices are present on all SoCs, keep those numbers in the SoC-specific code. Change-Id: Ib882927e399031c376738e5a35793b3d7654b9cf Signed-off-by: Felix Held Reviewed-on: https://review.coreboot.org/c/coreboot/+/48182 Tested-by: build bot (Jenkins) Reviewed-by: Marshall Dawson --- src/soc/amd/common/block/include/amdblocks/aoac.h | 35 +++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/soc/amd/common/block/include/amdblocks/aoac.h (limited to 'src/soc/amd/common') diff --git a/src/soc/amd/common/block/include/amdblocks/aoac.h b/src/soc/amd/common/block/include/amdblocks/aoac.h new file mode 100644 index 0000000000..f4f58e66e0 --- /dev/null +++ b/src/soc/amd/common/block/include/amdblocks/aoac.h @@ -0,0 +1,35 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef AMD_BLOCK_AOAC_H +#define AMD_BLOCK_AOAC_H + +#include + +/* FCH AOAC Registers 0xfed81e00 */ +#define AOAC_DEV_D3_CTL(device) (0x40 + device * 2) +#define AOAC_DEV_D3_STATE(device) (AOAC_DEV_D3_CTL(device) + 1) + +/* Bit definitions for Device D3 Control AOACx0000[40...7E; even byte addresses] */ +#define FCH_AOAC_TARGET_DEVICE_STATE (BIT(0) + BIT(1)) +#define FCH_AOAC_D0_UNINITIALIZED 0 +#define FCH_AOAC_D0_INITIALIZED 1 +#define FCH_AOAC_D1_2_3_WARM 2 +#define FCH_AOAC_D3_COLD 3 +#define FCH_AOAC_DEVICE_STATE BIT(2) +#define FCH_AOAC_PWR_ON_DEV BIT(3) +#define FCH_AOAC_SW_PWR_ON_RSTB BIT(4) +#define FCH_AOAC_SW_REF_CLK_OK BIT(5) +#define FCH_AOAC_SW_RST_B BIT(6) +#define FCH_AOAC_IS_SW_CONTROL BIT(7) + +/* Bit definitions for Device D3 State AOACx0000[41...7f; odd byte addresses] */ +#define FCH_AOAC_PWR_RST_STATE BIT(0) +#define FCH_AOAC_RST_CLK_OK_STATE BIT(1) +#define FCH_AOAC_RST_B_STATE BIT(2) +#define FCH_AOAC_DEV_OFF_GATING_STATE BIT(3) +#define FCH_AOAC_D3COLD BIT(4) +#define FCH_AOAC_CLK_OK_STATE BIT(5) +#define FCH_AOAC_STAT0 BIT(6) +#define FCH_AOAC_STAT1 BIT(7) + +#endif /* AMD_BLOCK_AOAC_H */ -- cgit v1.2.3