| 93 | } |
| 94 | |
| 95 | static int |
| 96 | mv_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 | |
| 137 | static device_method_t mv_ic_methods[] = { |
| 138 | DEVMETHOD(device_probe, mv_ic_probe), |
nothing calls this directly
no test coverage detected