MCPcopy Create free account
hub / github.com/F-Stack/f-stack / bcm_mips74k_timer_init

Function bcm_mips74k_timer_init

freebsd/mips/broadcom/bcm_mips74k.c:88–122  ·  view source on GitHub ↗

Early routing of the CPU timer interrupt is required */

Source from the content-addressed store, hash-verified

86
87/* Early routing of the CPU timer interrupt is required */
88static void
89bcm_mips74k_timer_init(void *unused)
90{
91 struct bcm_platform *bp;
92 u_int irq;
93 uint32_t mask;
94
95 bp = bcm_get_platform();
96
97 /* Must be a MIPS74K core attached to a BCMA interconnect */
98 if (!bhnd_core_matches(&bp->cpu_id, &(struct bhnd_core_match) {
99 BHND_MATCH_CORE(BHND_MFGID_MIPS, BHND_COREID_MIPS74K)
100 })) {
101 if (bootverbose) {
102 BCM_ERR("not a MIPS74K core: %s %s\n",
103 bhnd_vendor_name(bp->cpu_id.vendor),
104 bhnd_core_name(&bp->cpu_id));
105 }
106
107 return;
108 }
109
110 if (!BHND_CHIPTYPE_IS_BCMA_COMPATIBLE(bp->cid.chip_type)) {
111 if (bootverbose)
112 BCM_ERR("not a BCMA device\n");
113 return;
114 }
115
116 /* Route the timer bus ivec to the CPU's timer IRQ, and disable any
117 * other vectors assigned to the IRQ. */
118 irq = BCM_MIPS74K_GET_TIMER_IRQ();
119 mask = BCM_MIPS74K_INTR_SEL_FLAG(BCM_MIPS74K_TIMER_IVEC);
120
121 BCM_CPU_WRITE_4(bp, BCM_MIPS74K_INTR_SEL(irq), mask);
122}
123
124static int
125bcm_mips74k_probe(device_t dev)

Callers

nothing calls this directly

Calls 1

bcm_get_platformFunction · 0.85

Tested by

no test coverage detected