arch/powerpc/sysdev/tsi108_dev.c
Source file repositories/reference/linux-study-clean/arch/powerpc/sysdev/tsi108_dev.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/sysdev/tsi108_dev.c- Extension
.c- Size
- 3596 bytes
- Lines
- 154
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/stddef.hlinux/kernel.hlinux/init.hlinux/errno.hlinux/major.hlinux/delay.hlinux/irq.hlinux/export.hlinux/device.hlinux/etherdevice.hlinux/platform_device.hlinux/of_address.hlinux/of_irq.hlinux/of_net.hasm/tsi108.hlinux/atomic.hasm/io.hasm/irq.hmm/mmu_decl.h
Detected Declarations
function get_csrbasefunction get_vir_csrbasefunction tsi108_eth_of_initfunction for_each_compatible_nodeexport get_csrbaseexport get_vir_csrbase
Annotated Snippet
if (IS_ERR(tsi_eth_dev)) {
ret = PTR_ERR(tsi_eth_dev);
goto err;
}
of_get_mac_address(np, tsi_eth_data.mac_addr);
ph = of_get_property(np, "mdio-handle", NULL);
mdio = of_find_node_by_phandle(*ph);
ret = of_address_to_resource(mdio, 0, &res);
of_node_put(mdio);
if (ret)
goto unreg;
ph = of_get_property(np, "phy-handle", NULL);
phy = of_find_node_by_phandle(*ph);
if (phy == NULL) {
ret = -ENODEV;
goto unreg;
}
phy_id = of_get_property(phy, "reg", NULL);
tsi_eth_data.regs = r[0].start;
tsi_eth_data.phyregs = res.start;
tsi_eth_data.phy = *phy_id;
tsi_eth_data.irq_num = irq_of_parse_and_map(np, 0);
/* Some boards with the TSI108 bridge (e.g. Holly)
* have a miswiring of the ethernet PHYs which
* requires a workaround. The special
* "txc-rxc-delay-disable" property enables this
* workaround. FIXME: Need to port the tsi108_eth
* driver itself to phylib and use a non-misleading
* name for the workaround flag - it's not actually to
* do with the model of PHY in use */
if (of_property_read_bool(phy, "txc-rxc-delay-disable"))
tsi_eth_data.phy_type = TSI108_PHY_BCM54XX;
of_node_put(phy);
ret =
platform_device_add_data(tsi_eth_dev, &tsi_eth_data,
sizeof(hw_info));
if (ret)
goto unreg;
}
return 0;
unreg:
platform_device_unregister(tsi_eth_dev);
err:
of_node_put(np);
return ret;
}
arch_initcall(tsi108_eth_of_init);
Annotation
- Immediate include surface: `linux/stddef.h`, `linux/kernel.h`, `linux/init.h`, `linux/errno.h`, `linux/major.h`, `linux/delay.h`, `linux/irq.h`, `linux/export.h`.
- Detected declarations: `function get_csrbase`, `function get_vir_csrbase`, `function tsi108_eth_of_init`, `function for_each_compatible_node`, `export get_csrbase`, `export get_vir_csrbase`.
- Atlas domain: Architecture Layer / arch/powerpc.
- 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.