drivers/memory/renesas-rpc-if.c
Source file repositories/reference/linux-study-clean/drivers/memory/renesas-rpc-if.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/memory/renesas-rpc-if.c- Extension
.c- Size
- 30121 bytes
- Lines
- 1170
- Domain
- Driver Families
- Bucket
- drivers/memory
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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
linux/bitops.hlinux/clk.hlinux/io.hlinux/module.hlinux/platform_device.hlinux/of.hlinux/regmap.hlinux/reset.hmemory/renesas-rpc-if.hrenesas-rpc-if-regs.hrenesas-xspi-if-regs.h
Detected Declarations
struct rpcif_privstruct rpcif_implstruct rpcif_infostruct rpcif_privfunction rpcif_reg_readfunction rpcif_reg_writefunction xspi_reg_readfunction xspi_reg_writefunction rpcif_sw_initfunction rpcif_rzg2l_timing_adjust_sdrfunction rpcif_hw_init_implfunction xspi_hw_init_implfunction rpcif_hw_initfunction wait_msg_xfer_endfunction rpcif_bits_setfunction rpcif_bit_sizefunction rpcif_prepare_implfunction xspi_prepare_implfunction rpcif_preparefunction rpcif_manual_xfer_implfunction phasefunction xspi_manual_xfer_implfunction rpcif_manual_xferfunction memcpy_fromio_readwfunction rpcif_dirmap_read_implfunction xspi_dirmap_read_implfunction rpcif_dirmap_readfunction xspi_dirmap_writefunction rpcif_probefunction rpcif_removefunction rpcif_suspendfunction rpcif_resumeexport rpcif_sw_initexport rpcif_hw_initexport rpcif_prepareexport rpcif_manual_xferexport rpcif_dirmap_readexport xspi_dirmap_write
Annotated Snippet
struct rpcif_impl {
int (*hw_init)(struct rpcif_priv *rpc, bool hyperflash);
void (*prepare)(struct rpcif_priv *rpc, const struct rpcif_op *op,
u64 *offs, size_t *len);
int (*manual_xfer)(struct rpcif_priv *rpc);
size_t (*dirmap_read)(struct rpcif_priv *rpc, u64 offs, size_t len,
void *buf);
u32 status_reg;
u32 status_mask;
};
struct rpcif_info {
const struct regmap_config *regmap_config;
const struct rpcif_impl *impl;
enum rpcif_type type;
u8 strtim;
};
struct rpcif_priv {
struct device *dev;
void __iomem *base;
void __iomem *dirmap;
struct regmap *regmap;
struct reset_control *rstc;
struct clk *spi_clk;
struct clk *spix2_clk;
struct platform_device *vdev;
size_t size;
const struct rpcif_info *info;
enum rpcif_data_dir dir;
u8 bus_size;
u8 xfer_size;
u8 addr_nbytes; /* Specified for xSPI */
u32 proto; /* Specified for xSPI */
void *buffer;
u32 xferlen;
u32 smcr;
u32 smadr;
u32 command; /* DRCMR or SMCMR */
u32 option; /* DROPR or SMOPR */
u32 enable; /* DRENR or SMENR */
u32 dummy; /* DRDMCR or SMDMCR */
u32 ddr; /* DRDRENR or SMDRENR */
};
/*
* Custom accessor functions to ensure SM[RW]DR[01] are always accessed with
* proper width. Requires rpcif_priv.xfer_size to be correctly set before!
*/
static int rpcif_reg_read(void *context, unsigned int reg, unsigned int *val)
{
struct rpcif_priv *rpc = context;
switch (reg) {
case RPCIF_SMRDR0:
case RPCIF_SMWDR0:
switch (rpc->xfer_size) {
case 1:
*val = readb(rpc->base + reg);
return 0;
case 2:
*val = readw(rpc->base + reg);
return 0;
case 4:
case 8:
*val = readl(rpc->base + reg);
return 0;
default:
return -EILSEQ;
}
case RPCIF_SMRDR1:
case RPCIF_SMWDR1:
if (rpc->xfer_size != 8)
return -EILSEQ;
break;
}
*val = readl(rpc->base + reg);
return 0;
}
static int rpcif_reg_write(void *context, unsigned int reg, unsigned int val)
{
struct rpcif_priv *rpc = context;
switch (reg) {
Annotation
- Immediate include surface: `linux/bitops.h`, `linux/clk.h`, `linux/io.h`, `linux/module.h`, `linux/platform_device.h`, `linux/of.h`, `linux/regmap.h`, `linux/reset.h`.
- Detected declarations: `struct rpcif_priv`, `struct rpcif_impl`, `struct rpcif_info`, `struct rpcif_priv`, `function rpcif_reg_read`, `function rpcif_reg_write`, `function xspi_reg_read`, `function xspi_reg_write`, `function rpcif_sw_init`, `function rpcif_rzg2l_timing_adjust_sdr`.
- Atlas domain: Driver Families / drivers/memory.
- Implementation status: integration 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.