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

Function mv_ic_attach

freebsd/arm/mv/ic.c:95–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95static int
96mv_ic_attach(device_t dev)
97{
98 struct mv_ic_softc *sc;
99 uint32_t dev_id, rev_id;
100 int error;
101
102 sc = (struct mv_ic_softc *)device_get_softc(dev);
103
104 if (mv_ic_sc != NULL)
105 return (ENXIO);
106 mv_ic_sc = sc;
107
108 soc_id(&dev_id, &rev_id);
109
110 sc->ic_high_regs = 0;
111 sc->ic_error_regs = 0;
112
113 if (dev_id == MV_DEV_88F6281 ||
114 dev_id == MV_DEV_88F6282 ||
115 dev_id == MV_DEV_MV78100 ||
116 dev_id == MV_DEV_MV78100_Z0)
117 sc->ic_high_regs = 1;
118
119 if (dev_id == MV_DEV_MV78100 || dev_id == MV_DEV_MV78100_Z0)
120 sc->ic_error_regs = 1;
121
122 error = bus_alloc_resources(dev, mv_ic_spec, sc->ic_res);
123 if (error) {
124 device_printf(dev, "could not allocate resources\n");
125 return (ENXIO);
126 }
127
128 sc->ic_bst = rman_get_bustag(sc->ic_res[0]);
129 sc->ic_bsh = rman_get_bushandle(sc->ic_res[0]);
130
131 /* Mask all interrupts */
132 arm_mask_irq_all();
133
134 return (0);
135}
136
137static device_method_t mv_ic_methods[] = {
138 DEVMETHOD(device_probe, mv_ic_probe),

Callers

nothing calls this directly

Calls 7

device_get_softcFunction · 0.85
soc_idFunction · 0.85
bus_alloc_resourcesFunction · 0.85
device_printfFunction · 0.85
rman_get_bustagFunction · 0.85
rman_get_bushandleFunction · 0.85
arm_mask_irq_allFunction · 0.85

Tested by

no test coverage detected