drivers/iommu/fsl_pamu.c
Source file repositories/reference/linux-study-clean/drivers/iommu/fsl_pamu.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/iommu/fsl_pamu.c- Extension
.c- Size
- 26168 bytes
- Lines
- 1005
- Domain
- Driver Families
- Bucket
- drivers/iommu
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
fsl_pamu.hlinux/fsl/guts.hlinux/interrupt.hlinux/genalloc.hlinux/of_address.hlinux/of_irq.hlinux/platform_device.hasm/mpc85xx.h
Detected Declarations
struct pamu_isr_datastruct ccsr_lawfunction pamu_get_ppaacefunction pamu_enable_liodnfunction pamu_disable_liodnfunction map_addrspace_size_to_wsefunction pamu_init_ppaacefunction pamu_update_paace_stashfunction pamu_config_ppaacefunction get_ome_indexfunction get_stash_idfunction for_each_of_cpu_nodefunction setup_qbman_paacefunction setup_omtfunction get_pamu_cap_valuesfunction setup_one_pamufunction setup_liodnsfunction for_each_node_with_propertyfunction pamu_av_isrfunction create_csdfunction fsl_pamu_probefunction fsl_pamu_init
Annotated Snippet
struct pamu_isr_data {
void __iomem *pamu_reg_base; /* Base address of PAMU regs */
unsigned int count; /* The number of PAMUs */
};
static struct paace *ppaact;
static struct paace *spaact;
static bool probed; /* Has PAMU been probed? */
/*
* Table for matching compatible strings, for device tree
* guts node, for QorIQ SOCs.
* "fsl,qoriq-device-config-2.0" corresponds to T4 & B4
* SOCs. For the older SOCs "fsl,qoriq-device-config-1.0"
* string would be used.
*/
static const struct of_device_id guts_device_ids[] = {
{ .compatible = "fsl,qoriq-device-config-1.0", },
{ .compatible = "fsl,qoriq-device-config-2.0", },
{}
};
/*
* Table for matching compatible strings, for device tree
* L3 cache controller node.
* "fsl,t4240-l3-cache-controller" corresponds to T4,
* "fsl,b4860-l3-cache-controller" corresponds to B4 &
* "fsl,p4080-l3-cache-controller" corresponds to other,
* SOCs.
*/
static const struct of_device_id l3_device_ids[] = {
{ .compatible = "fsl,t4240-l3-cache-controller", },
{ .compatible = "fsl,b4860-l3-cache-controller", },
{ .compatible = "fsl,p4080-l3-cache-controller", },
{}
};
/* maximum subwindows permitted per liodn */
static u32 max_subwindow_count;
/**
* pamu_get_ppaace() - Return the primary PACCE
* @liodn: liodn PAACT index for desired PAACE
*
* Returns the ppace pointer upon success else return
* null.
*/
static struct paace *pamu_get_ppaace(int liodn)
{
if (!ppaact || liodn >= PAACE_NUMBER_ENTRIES) {
pr_debug("PPAACT doesn't exist\n");
return NULL;
}
return &ppaact[liodn];
}
/**
* pamu_enable_liodn() - Set valid bit of PACCE
* @liodn: liodn PAACT index for desired PAACE
*
* Returns 0 upon success else error code < 0 returned
*/
int pamu_enable_liodn(int liodn)
{
struct paace *ppaace;
ppaace = pamu_get_ppaace(liodn);
if (!ppaace) {
pr_debug("Invalid primary paace entry\n");
return -ENOENT;
}
if (!get_bf(ppaace->addr_bitfields, PPAACE_AF_WSE)) {
pr_debug("liodn %d not configured\n", liodn);
return -EINVAL;
}
/* Ensure that all other stores to the ppaace complete first */
mb();
set_bf(ppaace->addr_bitfields, PAACE_AF_V, PAACE_V_VALID);
mb();
return 0;
}
/**
* pamu_disable_liodn() - Clears valid bit of PACCE
Annotation
- Immediate include surface: `fsl_pamu.h`, `linux/fsl/guts.h`, `linux/interrupt.h`, `linux/genalloc.h`, `linux/of_address.h`, `linux/of_irq.h`, `linux/platform_device.h`, `asm/mpc85xx.h`.
- Detected declarations: `struct pamu_isr_data`, `struct ccsr_law`, `function pamu_get_ppaace`, `function pamu_enable_liodn`, `function pamu_disable_liodn`, `function map_addrspace_size_to_wse`, `function pamu_init_ppaace`, `function pamu_update_paace_stash`, `function pamu_config_ppaace`, `function get_ome_index`.
- Atlas domain: Driver Families / drivers/iommu.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.