Lines Matching +full:tegra124 +full:- +full:mc
1 /*-
97 #define WR4(_sc, _r, _v) bus_write_4((_sc)->mem_res, (_r), (_v))
98 #define RD4(_sc, _r) bus_read_4((_sc)->mem_res, (_r))
100 #define LOCK(_sc) mtx_lock(&(_sc)->mtx)
101 #define UNLOCK(_sc) mtx_unlock(&(_sc)->mtx)
102 #define SLEEP(_sc, timeout) mtx_sleep(sc, &sc->mtx, 0, "tegra_mc", timeout);
104 mtx_init(&_sc->mtx, device_get_nameunit(_sc->dev), "tegra_mc", MTX_DEF)
105 #define LOCK_DESTROY(_sc) mtx_destroy(&_sc->mtx)
106 #define ASSERT_LOCKED(_sc) mtx_assert(&_sc->mtx, MA_OWNED)
107 #define ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->mtx, MA_NOTOWNED)
110 {"nvidia,tegra124-mc", 1},
111 {"nvidia,tegra210-mc", 1},
152 device_printf(sc->dev, "Memory Controller Interrupt:\n"); in tegra_mc_intr()
154 printf(" - MTS carveout violation\n"); in tegra_mc_intr()
156 printf(" - SEC carveout violation\n"); in tegra_mc_intr()
158 printf(" - VPR requirements violated\n"); in tegra_mc_intr()
160 printf(" - ivalid APB ASID update\n"); in tegra_mc_intr()
162 printf(" - SMMU address translation error\n"); in tegra_mc_intr()
164 printf(" - arbitration deadlock-prevention threshold hit\n"); in tegra_mc_intr()
166 printf(" - SMMU address translation security error\n"); in tegra_mc_intr()
168 printf(" - SMMU address decode error\n"); in tegra_mc_intr()
175 printf(" at 0x%012jX [%s %s %s] - %s error.\n", in tegra_mc_intr()
200 if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) in tegra_mc_probe()
213 sc->dev = dev; in tegra_mc_attach()
219 sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, in tegra_mc_attach()
221 if (sc->mem_res == NULL) { in tegra_mc_attach()
229 sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, in tegra_mc_attach()
231 if (sc->irq_res == NULL) { in tegra_mc_attach()
238 rv = clk_get_by_ofw_name(dev, 0, "mc", &sc->clk); in tegra_mc_attach()
240 device_printf(dev, "Cannot get mc clock: %d\n", rv); in tegra_mc_attach()
243 rv = clk_enable(sc->clk); in tegra_mc_attach()
253 rv = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC | INTR_MPSAFE, in tegra_mc_attach()
254 NULL, tegra_mc_intr, sc, &sc->irq_h); in tegra_mc_attach()
267 if (sc->clk != NULL) in tegra_mc_attach()
268 clk_release(sc->clk); in tegra_mc_attach()
269 if (sc->irq_h != NULL) in tegra_mc_attach()
270 bus_teardown_intr(dev, sc->irq_res, sc->irq_h); in tegra_mc_attach()
271 if (sc->irq_res != NULL) in tegra_mc_attach()
272 bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq_res); in tegra_mc_attach()
273 if (sc->mem_res != NULL) in tegra_mc_attach()
274 bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); in tegra_mc_attach()
291 if (sc->irq_h != NULL) in tegra_mc_detach()
292 bus_teardown_intr(dev, sc->irq_res, sc->irq_h); in tegra_mc_detach()
293 if (sc->irq_res != NULL) in tegra_mc_detach()
294 bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq_res); in tegra_mc_detach()
295 if (sc->mem_res != NULL) in tegra_mc_detach()
296 bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); in tegra_mc_detach()
311 static DEFINE_CLASS_0(mc, tegra_mc_driver, tegra_mc_methods,