arch/powerpc/platforms/powermac/feature.c
Source file repositories/reference/linux-study-clean/arch/powerpc/platforms/powermac/feature.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/platforms/powermac/feature.c- Extension
.c- Size
- 81071 bytes
- Lines
- 3022
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.hlinux/init.hlinux/delay.hlinux/kernel.hlinux/sched.hlinux/of.hlinux/of_address.hlinux/spinlock.hlinux/adb.hlinux/pmu.hlinux/ioport.hlinux/export.hlinux/pci.hasm/sections.hasm/errno.hasm/ohare.hasm/heathrow.hasm/keylargo.hasm/uninorth.hasm/io.hasm/machdep.hasm/pmac_feature.hasm/dbdma.hasm/pci-bridge.hasm/pmac_low_i2c.hpmac.h
Detected Declarations
struct feature_table_entrystruct pmac_mb_deffunction simple_feature_tweakfunction ohare_htw_scc_enablefunction ohare_floppy_enablefunction ohare_mesh_enablefunction ohare_ide_enablefunction ohare_ide_resetfunction ohare_sleep_statefunction heathrow_modem_enablefunction heathrow_floppy_enablefunction heathrow_mesh_enablefunction heathrow_ide_enablefunction heathrow_ide_resetfunction heathrow_bmac_enablefunction heathrow_sound_enablefunction dbdma_savefunction dbdma_restorefunction heathrow_sleepfunction heathrow_wakeupfunction heathrow_sleep_statefunction core99_scc_enablefunction core99_modem_enablefunction pangea_modem_enablefunction core99_ata100_enablefunction core99_ide_enablefunction core99_ide_resetfunction core99_gmac_enablefunction core99_gmac_phy_resetfunction core99_sound_chip_enablefunction core99_airport_enablefunction core99_reset_cpufunction for_each_of_cpu_nodefunction core99_usb_enablefunction core99_firewire_enablefunction core99_firewire_cable_powerfunction intrepid_aack_delay_enablefunction core99_read_gpiofunction core99_write_gpiofunction g5_gmac_enablefunction g5_fw_enablefunction g5_mpic_enablefunction g5_eth_phy_resetfunction g5_i2s_enablefunction g5_reset_cpufunction for_each_of_cpu_nodefunction g5_phy_disable_cpu1function keylargo_shutdown
Annotated Snippet
struct feature_table_entry {
unsigned int selector;
feature_call function;
};
struct pmac_mb_def
{
const char* model_string;
const char* model_name;
int model_id;
struct feature_table_entry* features;
unsigned long board_flags;
};
static struct pmac_mb_def pmac_mb;
/*
* Here are the chip specific feature functions
*/
#ifndef CONFIG_PPC64
static int simple_feature_tweak(struct device_node *node, int type, int reg,
u32 mask, int value)
{
struct macio_chip* macio;
unsigned long flags;
macio = macio_find(node, type);
if (!macio)
return -ENODEV;
LOCK(flags);
if (value)
MACIO_BIS(reg, mask);
else
MACIO_BIC(reg, mask);
(void)MACIO_IN32(reg);
UNLOCK(flags);
return 0;
}
static long ohare_htw_scc_enable(struct device_node *node, long param,
long value)
{
struct macio_chip* macio;
unsigned long chan_mask;
unsigned long fcr;
unsigned long flags;
int htw, trans;
unsigned long rmask;
macio = macio_find(node, 0);
if (!macio)
return -ENODEV;
if (of_node_name_eq(node, "ch-a"))
chan_mask = MACIO_FLAG_SCCA_ON;
else if (of_node_name_eq(node, "ch-b"))
chan_mask = MACIO_FLAG_SCCB_ON;
else
return -ENODEV;
htw = (macio->type == macio_heathrow || macio->type == macio_paddington
|| macio->type == macio_gatwick);
/* On these machines, the HRW_SCC_TRANS_EN_N bit mustn't be touched */
trans = (pmac_mb.model_id != PMAC_TYPE_YOSEMITE &&
pmac_mb.model_id != PMAC_TYPE_YIKES);
if (value) {
#ifdef CONFIG_ADB_PMU
if ((param & 0xfff) == PMAC_SCC_IRDA)
pmu_enable_irled(1);
#endif /* CONFIG_ADB_PMU */
LOCK(flags);
fcr = MACIO_IN32(OHARE_FCR);
/* Check if scc cell need enabling */
if (!(fcr & OH_SCC_ENABLE)) {
fcr |= OH_SCC_ENABLE;
if (htw) {
/* Side effect: this will also power up the
* modem, but it's too messy to figure out on which
* ports this controls the transceiver and on which
* it controls the modem
*/
if (trans)
fcr &= ~HRW_SCC_TRANS_EN_N;
MACIO_OUT32(OHARE_FCR, fcr);
fcr |= (rmask = HRW_RESET_SCC);
MACIO_OUT32(OHARE_FCR, fcr);
} else {
fcr |= (rmask = OH_SCC_RESET);
MACIO_OUT32(OHARE_FCR, fcr);
Annotation
- Immediate include surface: `linux/types.h`, `linux/init.h`, `linux/delay.h`, `linux/kernel.h`, `linux/sched.h`, `linux/of.h`, `linux/of_address.h`, `linux/spinlock.h`.
- Detected declarations: `struct feature_table_entry`, `struct pmac_mb_def`, `function simple_feature_tweak`, `function ohare_htw_scc_enable`, `function ohare_floppy_enable`, `function ohare_mesh_enable`, `function ohare_ide_enable`, `function ohare_ide_reset`, `function ohare_sleep_state`, `function heathrow_modem_enable`.
- Atlas domain: Architecture Layer / arch/powerpc.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.