blob: 75e212740d11cdb9c66d429876cb3c8ea59bea45 [file] [log] [blame]
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef SOC_INTEL_COMMON_BLOCK_PMC_H
#define SOC_INTEL_COMMON_BLOCK_PMC_H
#include <device/device.h>
#include <stdint.h>
/* PMC controller resource structure */
struct pmc_resource_config {
/* PMC PCI config offset for MMIO BAR */
uint8_t pwrmbase_offset;
/* MMIO BAR address */
uintptr_t pwrmbase_addr;
/* MMIO BAR size */
size_t pwrmbase_size;
/* PMC PCI config offset for IO BAR */
uint8_t abase_offset;
/* IO BAR address */
uintptr_t abase_addr;
/* IO BAR size */
size_t abase_size;
};
/*
* SoC overrides
*
* All new SoCs wishes to make use of common PMC PCI driver
* must implement below functionality .
*/
/*
* Function to initialize PMC controller.
*
* This initialization may differ between different SoC
*
* Input: Device Structure PMC PCI device
*/
void pmc_soc_init(struct device *dev);
/*
* SoC should fill this structure information based on
* PMC controller register information like PWRMBASE, ABASE offset
* BAR and Size
*
* Input: PMC config structure
* Output: -1 = Error, 0 = Success
*/
int pmc_soc_get_resources(struct pmc_resource_config *cfg);
/* API to set ACPI mode */
void pmc_set_acpi_mode(void);
/*
* Returns a reference to the PMC MUX device for the given port number.
* Returns NULL if not found or SoC does not support PMC MUX.
*
* Input: Port number (0-based)
* Output: Const pointer to PMC MUX device
*/
const struct device *soc_get_pmc_mux_device(int port_number);
#endif /* SOC_INTEL_COMMON_BLOCK_PMC_H */