drivers/reset/reset-tenstorrent-atlantis.c
Source file repositories/reference/linux-study-clean/drivers/reset/reset-tenstorrent-atlantis.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/reset/reset-tenstorrent-atlantis.c- Extension
.c- Size
- 5590 bytes
- Lines
- 174
- Domain
- Driver Families
- Bucket
- drivers/reset
- 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.
- 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
dt-bindings/clock/tenstorrent,atlantis-prcm-rcpu.hlinux/auxiliary_bus.hlinux/reset-controller.hlinux/regmap.h
Detected Declarations
struct atlantis_reset_datastruct atlantis_reset_controller_datastruct atlantis_reset_controllerfunction to_atlantis_reset_controllerfunction atlantis_reset_updatefunction atlantis_reset_assertfunction atlantis_reset_deassertfunction atlantis_reset_controller_registerfunction atlantis_reset_probe
Annotated Snippet
struct atlantis_reset_data {
u8 bit;
u16 reg;
bool active_low;
};
struct atlantis_reset_controller_data {
const struct atlantis_reset_data *reset_data;
size_t count;
};
struct atlantis_reset_controller {
struct reset_controller_dev rcdev;
const struct atlantis_reset_controller_data *data;
struct regmap *regmap;
};
static inline struct atlantis_reset_controller *
to_atlantis_reset_controller(struct reset_controller_dev *rcdev)
{
return container_of(rcdev, struct atlantis_reset_controller, rcdev);
}
#define RESET_DATA(_reg, _bit, _active_low) \
{ \
.bit = _bit, .reg = _reg, .active_low = _active_low, \
}
static const struct atlantis_reset_data atlantis_rcpu_resets[] = {
[RST_SMNDMA0] = RESET_DATA(RCPU_BLK_RST_REG, 0, true),
[RST_SMNDMA1] = RESET_DATA(RCPU_BLK_RST_REG, 1, true),
[RST_WDT0] = RESET_DATA(RCPU_BLK_RST_REG, 2, true),
[RST_WDT1] = RESET_DATA(RCPU_BLK_RST_REG, 3, true),
[RST_TMR] = RESET_DATA(RCPU_BLK_RST_REG, 4, true),
[RST_PVTC] = RESET_DATA(RCPU_BLK_RST_REG, 12, true),
[RST_PMU] = RESET_DATA(RCPU_BLK_RST_REG, 13, true),
[RST_MAILBOX] = RESET_DATA(RCPU_BLK_RST_REG, 14, true),
[RST_SPACC] = RESET_DATA(RCPU_BLK_RST_REG, 26, true),
[RST_OTP] = RESET_DATA(RCPU_BLK_RST_REG, 28, true),
[RST_TRNG] = RESET_DATA(RCPU_BLK_RST_REG, 29, true),
[RST_CRC] = RESET_DATA(RCPU_BLK_RST_REG, 30, true),
[RST_QSPI] = RESET_DATA(LSIO_BLK_RST_REG, 0, true),
[RST_I2C0] = RESET_DATA(LSIO_BLK_RST_REG, 1, true),
[RST_I2C1] = RESET_DATA(LSIO_BLK_RST_REG, 2, true),
[RST_I2C2] = RESET_DATA(LSIO_BLK_RST_REG, 3, true),
[RST_I2C3] = RESET_DATA(LSIO_BLK_RST_REG, 4, true),
[RST_I2C4] = RESET_DATA(LSIO_BLK_RST_REG, 5, true),
[RST_UART0] = RESET_DATA(LSIO_BLK_RST_REG, 6, true),
[RST_UART1] = RESET_DATA(LSIO_BLK_RST_REG, 7, true),
[RST_UART2] = RESET_DATA(LSIO_BLK_RST_REG, 8, true),
[RST_UART3] = RESET_DATA(LSIO_BLK_RST_REG, 9, true),
[RST_UART4] = RESET_DATA(LSIO_BLK_RST_REG, 10, true),
[RST_SPI0] = RESET_DATA(LSIO_BLK_RST_REG, 11, true),
[RST_SPI1] = RESET_DATA(LSIO_BLK_RST_REG, 12, true),
[RST_SPI2] = RESET_DATA(LSIO_BLK_RST_REG, 13, true),
[RST_SPI3] = RESET_DATA(LSIO_BLK_RST_REG, 14, true),
[RST_GPIO] = RESET_DATA(LSIO_BLK_RST_REG, 15, true),
[RST_CAN0] = RESET_DATA(LSIO_BLK_RST_REG, 17, true),
[RST_CAN1] = RESET_DATA(LSIO_BLK_RST_REG, 18, true),
[RST_I2S0] = RESET_DATA(LSIO_BLK_RST_REG, 19, true),
[RST_I2S1] = RESET_DATA(LSIO_BLK_RST_REG, 20, true),
};
static const struct atlantis_reset_controller_data atlantis_rcpu_reset_data = {
.reset_data = atlantis_rcpu_resets,
.count = ARRAY_SIZE(atlantis_rcpu_resets),
};
static int atlantis_reset_update(struct reset_controller_dev *rcdev,
unsigned long id, bool assert)
{
unsigned int val;
struct atlantis_reset_controller *rst =
to_atlantis_reset_controller(rcdev);
const struct atlantis_reset_data *data = &rst->data->reset_data[id];
unsigned int mask = BIT(data->bit);
struct regmap *regmap = rst->regmap;
if (data->active_low ^ assert)
val = mask;
else
val = 0;
return regmap_update_bits(regmap, data->reg, mask, val);
}
static int atlantis_reset_assert(struct reset_controller_dev *rcdev,
unsigned long id)
{
Annotation
- Immediate include surface: `dt-bindings/clock/tenstorrent,atlantis-prcm-rcpu.h`, `linux/auxiliary_bus.h`, `linux/reset-controller.h`, `linux/regmap.h`.
- Detected declarations: `struct atlantis_reset_data`, `struct atlantis_reset_controller_data`, `struct atlantis_reset_controller`, `function to_atlantis_reset_controller`, `function atlantis_reset_update`, `function atlantis_reset_assert`, `function atlantis_reset_deassert`, `function atlantis_reset_controller_register`, `function atlantis_reset_probe`.
- Atlas domain: Driver Families / drivers/reset.
- 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.