13 #include <soc/iomap.h>
20 #define PCIE_EXTERNAL_PORT_UUID "EFCC06CC-73AC-4BC3-BFF0-76143807C389"
21 #define PCIE_EXTERNAL_PORT_PROPERTY "ExternalFacingPort"
23 #define PCIE_HOTPLUG_IN_D3_UUID "6211E2C0-58A3-4AF3-90E1-927A4E0C55A4"
24 #define PCIE_HOTPLUG_IN_D3_PROPERTY "HotPlugSupportInD3"
32 #define PCIE_RTD3_STORAGE_UUID "5025030F-842F-4AB4-A561-99A5189762D0"
33 #define PCIE_RTD3_STORAGE_PROPERTY "StorageD3Enable"
36 #define PCH_PCIE_CFG_LSTS 0x52
37 #define PCH_PCIE_CFG_SPR 0xe0
38 #define PCH_PCIE_CFG_RPPGEN 0xe2
39 #define PCH_PCIE_CFG_LCAP_PN 0x4f
42 #define ACPI_REG_PCI_LINK_ACTIVE "LASX"
43 #define ACPI_REG_PCI_L23_RDY_ENTRY "L23E"
44 #define ACPI_REG_PCI_L23_RDY_DETECT "L23R"
45 #define ACPI_REG_PCI_L23_SAVE_STATE "NCB7"
48 #define RTD3_MUTEX_PATH "\\_SB.PCI0.R3MX"
133 if (
config->srcclk_pin >= 0) {
154 if (
config->skip_on_off_support)
162 if (
config->enable_gpio.pin_count) {
164 if (
config->enable_delay_ms)
169 if (
config->srcclk_pin >= 0)
173 if (
config->reset_gpio.pin_count) {
175 if (
config->reset_delay_ms)
183 if (
config->skip_on_off_support) {
208 if (
config->skip_on_off_support)
216 if (
config->reset_gpio.pin_count) {
218 if (
config->reset_off_delay_ms)
227 if (
config->srcclk_pin >= 0)
231 if (
config->enable_gpio.pin_count) {
233 if (
config->enable_off_delay_ms)
237 if (
config->skip_on_off_support) {
264 if (
config->enable_gpio.pin_count)
330 static bool mutex_created =
false;
333 static const char *
const power_res_states[] = {
"_PR0"};
360 if (!
config->enable_gpio.pin_count && !
config->reset_gpio.pin_count) {
361 printk(
BIOS_ERR,
"%s: Enable and/or Reset GPIO required for %s.\n",
365 if (
config->srcclk_pin > CONFIG_MAX_PCIE_CLOCK_SRC) {
367 config->srcclk_pin, scope);
377 if (
config->disable_l23) {
389 if (
config->srcclk_pin == 0) {
404 mutex_created =
true;
436 if (
config->skip_on_off_support) {
462 if (
config->is_external) {
struct acpi_dp * acpi_dp_add_package(struct acpi_dp *dp, struct acpi_dp *package)
const char * acpi_device_path(const struct device *dev)
struct acpi_dp * acpi_dp_add_integer(struct acpi_dp *dp, const char *name, uint64_t value)
void acpi_dp_write(struct acpi_dp *table)
const char * acpi_device_name(const struct device *dev)
struct acpi_dp * acpi_dp_new_table(const char *name)
void acpigen_write_ADR(uint64_t adr)
void acpigen_emit_namestring(const char *namepath)
void acpigen_pop_len(void)
void acpigen_write_scope(const char *name)
int acpigen_disable_tx_gpio(const struct acpi_gpio *gpio)
void acpigen_write_sleep(uint64_t sleep_ms)
void acpigen_write_delay_until_namestr_int(uint32_t wait_ms, const char *name, uint64_t value)
void acpigen_write_method_serialized(const char *name, int nargs)
void acpigen_write_power_res(const char *name, uint8_t level, uint16_t order, const char *const dev_states[], size_t dev_states_count)
void acpigen_write_name_integer(const char *name, uint64_t val)
void acpigen_write_STA(uint8_t status)
void acpigen_emit_byte(unsigned char b)
void acpigen_write_field(const char *name, const struct fieldlist *l, size_t count, uint8_t flags)
void acpigen_emit_word(unsigned int data)
void acpigen_emit_ext_op(uint8_t op)
void acpigen_write_store_int_to_namestr(uint64_t src, const char *dst)
void acpigen_write_device(const char *name)
int acpigen_enable_tx_gpio(const struct acpi_gpio *gpio)
void acpigen_write_mutex(const char *name, const uint8_t flags)
void acpigen_write_opregion(const struct opregion *opreg)
void acpigen_write_method(const char *name, int nargs)
void acpigen_write_else(void)
void acpigen_write_return_op(uint8_t arg)
void acpigen_write_if_lequal_op_op(uint8_t op1, uint8_t op2)
void acpigen_write_store_int_to_op(uint64_t src, uint8_t dst)
void acpigen_write_name_string(const char *name, const char *string)
void acpigen_write_if_lequal_namestr_int(const char *namestr, uint64_t val)
void acpigen_get_tx_gpio(const struct acpi_gpio *gpio)
enum pcie_rp_type soc_get_pcie_rp_type(const struct device *dev)
int soc_get_cpu_rp_vw_idx(const struct device *dev)
#define printk(level,...)
bool is_dev_enabled(const struct device *dev)
const char * dev_path(const struct device *dev)
@ ACPI_DEVICE_SLEEP_D3_COLD
#define ACPI_STATUS_DEVICE_ALL_ON
#define FIELDLIST_RESERVED(X)
#define FIELDLIST_OFFSET(X)
void acpigen_write_scope_end(void)
#define ACPI_MUTEX_NO_TIMEOUT
#define OPREGION(rname, space, offset, len)
#define FIELDLIST_NAMESTR(X, Y)
static void noop_read_resources(struct device *dev)
Standard device operations function pointers shims.
static void noop_set_resources(struct device *dev)
static DEVTREE_CONST void * config_of(const struct device *dev)
static __always_inline u8 pci_read_config8(const struct device *dev, u16 reg)
#define PCH_PWRM_BASE_ADDRESS
#define BIOS_INFO
BIOS_INFO - Expected events.
#define BIOS_ERR
BIOS_ERR - System in incomplete state.
#define PCI_BASE_CLASS_STORAGE
void pmc_ipc_acpi_set_pci_clock(unsigned int pcie_rp, unsigned int clock_pin, bool enable)
#define PCH_PCIE_CFG_LSTS
static const char * pcie_rtd3_acpi_name(const struct device *dev)
static void pcie_rtd3_acpi_method_status(const struct soc_intel_common_block_pcie_rtd3_config *config)
static void pcie_rtd3_acpi_method_srck(unsigned int pcie_rp, const struct soc_intel_common_block_pcie_rtd3_config *config)
static void pcie_rtd3_acpi_method_l23d(void)
#define PCIE_HOTPLUG_IN_D3_UUID
#define ACPI_REG_PCI_L23_RDY_ENTRY
#define ACPI_REG_PCI_LINK_ACTIVE
static void pcie_rtd3_acpi_fill_ssdt(const struct device *dev)
#define ACPI_REG_PCI_L23_RDY_DETECT
static void pcie_rtd3_acpi_enable(struct device *dev)
static void pcie_rtd3_acpi_method_dl23(void)
#define PCIE_EXTERNAL_PORT_UUID
static void write_modphy_opregion(unsigned int pcie_rp)
#define PCH_PCIE_CFG_RPPGEN
static struct device_operations pcie_rtd3_ops
static void pcie_rtd3_acpi_method_on(unsigned int pcie_rp, const struct soc_intel_common_block_pcie_rtd3_config *config, enum pcie_rp_type rp_type)
#define ACPI_REG_PCI_L23_SAVE_STATE
static void pcie_rtd3_acpi_l23_entry(void)
#define PCIE_HOTPLUG_IN_D3_PROPERTY
static void pcie_rtd3_acpi_method_off(int pcie_rp, const struct soc_intel_common_block_pcie_rtd3_config *config, enum pcie_rp_type rp_type)
static void pcie_rtd3_acpi_l23_exit(void)
#define PCIE_RTD3_STORAGE_PROPERTY
static int get_pcie_rp_pmc_idx(enum pcie_rp_type rp_type, const struct device *dev)
struct chip_operations soc_intel_common_block_pcie_rtd3_ops
#define PCH_PCIE_CFG_LCAP_PN
static void pcie_rtd3_enable_modphy_pg(unsigned int pcie_rp, enum modphy_pg_state state)
static void pcie_rtd3_acpi_method_pds0(unsigned int pcie_rp)
#define PCIE_EXTERNAL_PORT_PROPERTY
#define PCIE_RTD3_STORAGE_UUID
DEVTREE_CONST struct device * dev
void(* read_resources)(struct device *dev)
struct chip_operations * chip_ops
DEVTREE_CONST struct device * sibling
struct device_operations * ops
DEVTREE_CONST struct bus * bus