mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
PCI: keystone: Relocate ks_pcie_set/clear_dbi_mode()
[ Upstream commit 5125fdc3292eea20870d4e6cefa62dc1245ce7ec ] Relocate ks_pcie_set_dbi_mode() and ks_pcie_clear_dbi_mode() to avoid forward declaration in a subsequent patch. No functional change intended. Link: https://lore.kernel.org/linux-pci/20240328085041.2916899-2-s-vadapalli@ti.com Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com> Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Stable-dep-of: 9ffa0e70b2da ("PCI: keystone: Don't enable BAR 0 for AM654x") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
e33e9444ff
commit
cc6cc778c3
@@ -247,6 +247,48 @@ static struct irq_chip ks_pcie_msi_irq_chip = {
|
|||||||
.irq_unmask = ks_pcie_msi_unmask,
|
.irq_unmask = ks_pcie_msi_unmask,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ks_pcie_set_dbi_mode() - Set DBI mode to access overlaid BAR mask registers
|
||||||
|
* @ks_pcie: A pointer to the keystone_pcie structure which holds the KeyStone
|
||||||
|
* PCIe host controller driver information.
|
||||||
|
*
|
||||||
|
* Since modification of dbi_cs2 involves different clock domain, read the
|
||||||
|
* status back to ensure the transition is complete.
|
||||||
|
*/
|
||||||
|
static void ks_pcie_set_dbi_mode(struct keystone_pcie *ks_pcie)
|
||||||
|
{
|
||||||
|
u32 val;
|
||||||
|
|
||||||
|
val = ks_pcie_app_readl(ks_pcie, CMD_STATUS);
|
||||||
|
val |= DBI_CS2;
|
||||||
|
ks_pcie_app_writel(ks_pcie, CMD_STATUS, val);
|
||||||
|
|
||||||
|
do {
|
||||||
|
val = ks_pcie_app_readl(ks_pcie, CMD_STATUS);
|
||||||
|
} while (!(val & DBI_CS2));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ks_pcie_clear_dbi_mode() - Disable DBI mode
|
||||||
|
* @ks_pcie: A pointer to the keystone_pcie structure which holds the KeyStone
|
||||||
|
* PCIe host controller driver information.
|
||||||
|
*
|
||||||
|
* Since modification of dbi_cs2 involves different clock domain, read the
|
||||||
|
* status back to ensure the transition is complete.
|
||||||
|
*/
|
||||||
|
static void ks_pcie_clear_dbi_mode(struct keystone_pcie *ks_pcie)
|
||||||
|
{
|
||||||
|
u32 val;
|
||||||
|
|
||||||
|
val = ks_pcie_app_readl(ks_pcie, CMD_STATUS);
|
||||||
|
val &= ~DBI_CS2;
|
||||||
|
ks_pcie_app_writel(ks_pcie, CMD_STATUS, val);
|
||||||
|
|
||||||
|
do {
|
||||||
|
val = ks_pcie_app_readl(ks_pcie, CMD_STATUS);
|
||||||
|
} while (val & DBI_CS2);
|
||||||
|
}
|
||||||
|
|
||||||
static int ks_pcie_msi_host_init(struct dw_pcie_rp *pp)
|
static int ks_pcie_msi_host_init(struct dw_pcie_rp *pp)
|
||||||
{
|
{
|
||||||
pp->msi_irq_chip = &ks_pcie_msi_irq_chip;
|
pp->msi_irq_chip = &ks_pcie_msi_irq_chip;
|
||||||
@@ -343,48 +385,6 @@ static const struct irq_domain_ops ks_pcie_legacy_irq_domain_ops = {
|
|||||||
.xlate = irq_domain_xlate_onetwocell,
|
.xlate = irq_domain_xlate_onetwocell,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* ks_pcie_set_dbi_mode() - Set DBI mode to access overlaid BAR mask registers
|
|
||||||
* @ks_pcie: A pointer to the keystone_pcie structure which holds the KeyStone
|
|
||||||
* PCIe host controller driver information.
|
|
||||||
*
|
|
||||||
* Since modification of dbi_cs2 involves different clock domain, read the
|
|
||||||
* status back to ensure the transition is complete.
|
|
||||||
*/
|
|
||||||
static void ks_pcie_set_dbi_mode(struct keystone_pcie *ks_pcie)
|
|
||||||
{
|
|
||||||
u32 val;
|
|
||||||
|
|
||||||
val = ks_pcie_app_readl(ks_pcie, CMD_STATUS);
|
|
||||||
val |= DBI_CS2;
|
|
||||||
ks_pcie_app_writel(ks_pcie, CMD_STATUS, val);
|
|
||||||
|
|
||||||
do {
|
|
||||||
val = ks_pcie_app_readl(ks_pcie, CMD_STATUS);
|
|
||||||
} while (!(val & DBI_CS2));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ks_pcie_clear_dbi_mode() - Disable DBI mode
|
|
||||||
* @ks_pcie: A pointer to the keystone_pcie structure which holds the KeyStone
|
|
||||||
* PCIe host controller driver information.
|
|
||||||
*
|
|
||||||
* Since modification of dbi_cs2 involves different clock domain, read the
|
|
||||||
* status back to ensure the transition is complete.
|
|
||||||
*/
|
|
||||||
static void ks_pcie_clear_dbi_mode(struct keystone_pcie *ks_pcie)
|
|
||||||
{
|
|
||||||
u32 val;
|
|
||||||
|
|
||||||
val = ks_pcie_app_readl(ks_pcie, CMD_STATUS);
|
|
||||||
val &= ~DBI_CS2;
|
|
||||||
ks_pcie_app_writel(ks_pcie, CMD_STATUS, val);
|
|
||||||
|
|
||||||
do {
|
|
||||||
val = ks_pcie_app_readl(ks_pcie, CMD_STATUS);
|
|
||||||
} while (val & DBI_CS2);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void ks_pcie_setup_rc_app_regs(struct keystone_pcie *ks_pcie)
|
static void ks_pcie_setup_rc_app_regs(struct keystone_pcie *ks_pcie)
|
||||||
{
|
{
|
||||||
u32 val;
|
u32 val;
|
||||||
|
|||||||
Reference in New Issue
Block a user