Lines Matching +full:zephyr +full:- +full:base
4 * SPDX-License-Identifier: Apache-2.0
8 #include <zephyr/logging/log.h>
13 #include <zephyr/kernel.h>
16 #include <zephyr/device.h>
17 #include <zephyr/init.h>
21 #include <zephyr/drivers/pcie/pcie.h>
24 static int pcie_ptm_root_setup(const struct device *dev, uint32_t base) in pcie_ptm_root_setup() argument
26 const struct pcie_ptm_root_config *config = dev->config; in pcie_ptm_root_setup()
30 cap.raw = pcie_conf_read(config->pcie->bdf, base + PTM_CAP_REG_OFFSET); in pcie_ptm_root_setup()
32 LOG_ERR("PTM root not supported on 0x%x", config->pcie->bdf); in pcie_ptm_root_setup()
33 return -ENOTSUP; in pcie_ptm_root_setup()
39 pcie_conf_write(config->pcie->bdf, base + PTM_CTRL_REG_OFFSET, ctrl.raw); in pcie_ptm_root_setup()
41 LOG_DBG("PTM root 0x%x enabled", config->pcie->bdf); in pcie_ptm_root_setup()
48 const struct pcie_ptm_root_config *config = dev->config; in pcie_ptm_root_init()
51 reg = pcie_get_ext_cap(config->pcie->bdf, PCIE_EXT_CAP_ID_PTM); in pcie_ptm_root_init()
53 LOG_ERR("PTM capability not exposed on 0x%x", config->pcie->bdf); in pcie_ptm_root_init()
54 return -ENODEV; in pcie_ptm_root_init()
74 uint32_t base; in DT_INST_FOREACH_STATUS_OKAY() local
78 base = pcie_get_ext_cap(bdf, PCIE_EXT_CAP_ID_PTM); in DT_INST_FOREACH_STATUS_OKAY()
79 if (base == 0) { in DT_INST_FOREACH_STATUS_OKAY()
84 cap.raw = pcie_conf_read(bdf, base + PTM_CAP_REG_OFFSET); in DT_INST_FOREACH_STATUS_OKAY()
92 pcie_conf_write(bdf, base + PTM_CTRL_REG_OFFSET, ctrl.raw); in DT_INST_FOREACH_STATUS_OKAY()