arch/powerpc/platforms/44x/warp.c
Source file repositories/reference/linux-study-clean/arch/powerpc/platforms/44x/warp.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/platforms/44x/warp.c- Extension
.c- Size
- 7189 bytes
- Lines
- 333
- Domain
- Architecture Layer
- Bucket
- arch/powerpc
- Inferred role
- Architecture Layer: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/err.hlinux/init.hlinux/of_platform.hlinux/platform_device.hlinux/kthread.hlinux/leds.hlinux/i2c.hlinux/interrupt.hlinux/delay.hlinux/of_address.hlinux/of_irq.hlinux/gpio/consumer.hlinux/slab.hlinux/export.hasm/machdep.hasm/udbg.hasm/time.hasm/uic.hasm/ppc4xx.hasm/dma.h
Detected Declarations
function warp_device_probefunction warp_post_infofunction temp_isrfunction pika_setup_ledsfunction for_each_child_of_nodefunction pika_setup_critical_tempfunction pika_dtm_check_fanfunction pika_dtm_threadfunction pika_dtm_start
Annotated Snippet
if (dtm_fpga) {
unsigned reset = in_be32(dtm_fpga + 0x14);
out_be32(dtm_fpga + 0x14, reset);
}
gpiod_set_value(warp_gpio_led_pins[WARP_RED_LED].gpiod, value);
value ^= 1;
mdelay(500);
}
/* Not reached */
return IRQ_HANDLED;
}
/*
* Because green and red power LEDs are normally driven by leds-gpio driver,
* but in case of critical temperature shutdown we want to drive them
* ourselves, we acquire both and then create leds-gpio platform device
* ourselves, instead of doing it through device tree. This way we can still
* keep access to the gpios and use them when needed.
*/
static int pika_setup_leds(void)
{
struct device_node *np, *child;
struct gpio_desc *gpio;
struct gpio_led *led;
int led_count = 0;
int error;
int i;
np = of_find_compatible_node(NULL, NULL, "warp-power-leds");
if (!np) {
printk(KERN_ERR __FILE__ ": Unable to find leds\n");
return -ENOENT;
}
for_each_child_of_node(np, child) {
for (i = 0; i < ARRAY_SIZE(warp_gpio_led_pins); i++) {
led = &warp_gpio_led_pins[i];
if (!of_node_name_eq(child, led->name))
continue;
if (led->gpiod) {
printk(KERN_ERR __FILE__ ": %s led has already been defined\n",
led->name);
continue;
}
gpio = fwnode_gpiod_get_index(of_fwnode_handle(child),
NULL, 0, GPIOD_ASIS,
led->name);
error = PTR_ERR_OR_ZERO(gpio);
if (error) {
printk(KERN_ERR __FILE__ ": Failed to get %s led gpio: %d\n",
led->name, error);
of_node_put(child);
goto err_cleanup_pins;
}
led->gpiod = gpio;
led_count++;
}
}
of_node_put(np);
/* Skip device registration if no leds have been defined */
if (led_count) {
error = platform_device_register(&warp_gpio_leds);
if (error) {
printk(KERN_ERR __FILE__ ": Unable to add leds-gpio: %d\n",
error);
goto err_cleanup_pins;
}
}
return 0;
err_cleanup_pins:
for (i = 0; i < ARRAY_SIZE(warp_gpio_led_pins); i++) {
led = &warp_gpio_led_pins[i];
gpiod_put(led->gpiod);
led->gpiod = NULL;
}
return error;
}
static void pika_setup_critical_temp(struct device_node *np,
struct i2c_client *client)
Annotation
- Immediate include surface: `linux/err.h`, `linux/init.h`, `linux/of_platform.h`, `linux/platform_device.h`, `linux/kthread.h`, `linux/leds.h`, `linux/i2c.h`, `linux/interrupt.h`.
- Detected declarations: `function warp_device_probe`, `function warp_post_info`, `function temp_isr`, `function pika_setup_leds`, `function for_each_child_of_node`, `function pika_setup_critical_temp`, `function pika_dtm_check_fan`, `function pika_dtm_thread`, `function pika_dtm_start`.
- Atlas domain: Architecture Layer / arch/powerpc.
- Implementation status: integration 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.