drivers/misc/ibmasm/lowlevel.h
Source file repositories/reference/linux-study-clean/drivers/misc/ibmasm/lowlevel.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/misc/ibmasm/lowlevel.h- Extension
.h- Size
- 3063 bytes
- Lines
- 124
- Domain
- Driver Families
- Bucket
- drivers/misc
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
asm/io.h
Detected Declarations
function Copyrightfunction uart_interrupt_pendingfunction ibmasm_enable_interruptsfunction ibmasm_disable_interruptsfunction enable_sp_interruptsfunction disable_sp_interruptsfunction enable_uart_interruptsfunction disable_uart_interruptsfunction get_mfa_outboundfunction set_mfa_outboundfunction get_mfa_inboundfunction set_mfa_inbound
Annotated Snippet
#ifndef __IBMASM_CONDOR_H__
#define __IBMASM_CONDOR_H__
#include <asm/io.h>
#define VENDORID_IBM 0x1014
#define DEVICEID_RSA 0x010F
#define GET_MFA_ADDR(x) (x & 0xFFFFFF00)
#define MAILBOX_FULL(x) (x & 0x00000001)
#define NO_MFAS_AVAILABLE 0xFFFFFFFF
#define INBOUND_QUEUE_PORT 0x40 /* contains address of next free MFA */
#define OUTBOUND_QUEUE_PORT 0x44 /* contains address of posted MFA */
#define SP_INTR_MASK 0x00000008
#define UART_INTR_MASK 0x00000010
#define INTR_STATUS_REGISTER 0x13A0
#define INTR_CONTROL_REGISTER 0x13A4
#define SCOUT_COM_A_BASE 0x0000
#define SCOUT_COM_B_BASE 0x0100
#define SCOUT_COM_C_BASE 0x0200
#define SCOUT_COM_D_BASE 0x0300
static inline int sp_interrupt_pending(void __iomem *base_address)
{
return SP_INTR_MASK & readl(base_address + INTR_STATUS_REGISTER);
}
static inline int uart_interrupt_pending(void __iomem *base_address)
{
return UART_INTR_MASK & readl(base_address + INTR_STATUS_REGISTER);
}
static inline void ibmasm_enable_interrupts(void __iomem *base_address, int mask)
{
void __iomem *ctrl_reg = base_address + INTR_CONTROL_REGISTER;
writel( readl(ctrl_reg) & ~mask, ctrl_reg);
}
static inline void ibmasm_disable_interrupts(void __iomem *base_address, int mask)
{
void __iomem *ctrl_reg = base_address + INTR_CONTROL_REGISTER;
writel( readl(ctrl_reg) | mask, ctrl_reg);
}
static inline void enable_sp_interrupts(void __iomem *base_address)
{
ibmasm_enable_interrupts(base_address, SP_INTR_MASK);
}
static inline void disable_sp_interrupts(void __iomem *base_address)
{
ibmasm_disable_interrupts(base_address, SP_INTR_MASK);
}
static inline void enable_uart_interrupts(void __iomem *base_address)
{
ibmasm_enable_interrupts(base_address, UART_INTR_MASK);
}
static inline void disable_uart_interrupts(void __iomem *base_address)
{
ibmasm_disable_interrupts(base_address, UART_INTR_MASK);
}
#define valid_mfa(mfa) ( (mfa) != NO_MFAS_AVAILABLE )
static inline u32 get_mfa_outbound(void __iomem *base_address)
{
int retry;
u32 mfa;
for (retry=0; retry<=10; retry++) {
mfa = readl(base_address + OUTBOUND_QUEUE_PORT);
if (valid_mfa(mfa))
break;
}
return mfa;
}
static inline void set_mfa_outbound(void __iomem *base_address, u32 mfa)
{
writel(mfa, base_address + OUTBOUND_QUEUE_PORT);
}
Annotation
- Immediate include surface: `asm/io.h`.
- Detected declarations: `function Copyright`, `function uart_interrupt_pending`, `function ibmasm_enable_interrupts`, `function ibmasm_disable_interrupts`, `function enable_sp_interrupts`, `function disable_sp_interrupts`, `function enable_uart_interrupts`, `function disable_uart_interrupts`, `function get_mfa_outbound`, `function set_mfa_outbound`.
- Atlas domain: Driver Families / drivers/misc.
- Implementation status: source implementation candidate.
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.