Lines Matching +full:0 +full:xbf8

51 #define	TMU_TMR		0x00
52 #define TMU_TSR 0x04
53 #define TMUV1_TMTMIR 0x08
54 #define TMUV2_TMSR 0x08
55 #define TMUV2_TMTMIR 0x0C
56 #define TMU_TIER 0x20
57 #define TMU_TTCFGR 0x80
58 #define TMU_TSCFGR 0x84
59 #define TMU_TRITSR(x) (0x100 + (16 * (x)))
61 #define TMUV2_TMSAR(x) (0x304 + (16 * (x)))
62 #define TMU_VERSION 0xBF8 /* not in TRM */
63 #define TMUV2_TEUMR(x) (0xF00 + (4 * (x)))
64 #define TMU_TTRCR(x) (0xF10 + (4 * (x)))
89 { 0, "site0", 0 },
109 { 0, "cpu", 0 },
116 { 0, "cpu-thermal", 0 },
121 { 0, "ddr-controller", 0 },
127 { 0, "ddr-controller", 0 },
135 { 0, "ddr-controller", 0 },
144 { 0, "core-cluster", 0 },
148 /* Note: tmu[1..7] not [0..6]. */
151 { 1, "ddr-controller1", 0 },
162 { 0, "cluster6-7", 0 },
185 { NULL, NULL, 0 }
192 {NULL, 0},
220 for (timeout = 1000; timeout > 0; timeout--) { in qoriq_therm_read_temp()
226 if (timeout <= 0) in qoriq_therm_read_temp()
229 *temp = (int)(val & 0x1FF) * 1000; in qoriq_therm_read_temp()
231 *temp = (int)(val & 0xFF) * 1000; in qoriq_therm_read_temp()
233 *temp = (int)(val & 0x1FF) * 1000 - 273100; in qoriq_therm_read_temp()
235 return (0); in qoriq_therm_read_temp()
267 if (rv != 0) in qoriq_therm_sysctl_temperature()
272 rv = sysctl_handle_int(oidp, &val, 0, req); in qoriq_therm_sysctl_temperature()
290 for (i = sc->ntsensors - 1; i >= 0; i--) { in qoriq_therm_init_sysctl()
298 return (0); in qoriq_therm_init_sysctl()
314 for (i = 0; i < nranges; i++) { in qoriq_therm_fdt_calib()
321 if (ncalibs <= 0 || (ncalibs % 2) != 0) { in qoriq_therm_fdt_calib()
325 for (i = 0; i < ncalibs; i +=2) { in qoriq_therm_fdt_calib()
330 return (0); in qoriq_therm_fdt_calib()
340 if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) in qoriq_therm_probe()
363 rid = 0; in qoriq_therm_attach()
371 rid = 0; in qoriq_therm_attach()
386 rv = clk_get_by_ofw_index(dev, 0, 0, &sc->clk); in qoriq_therm_attach()
387 if (rv != 0 && rv != ENOENT) { in qoriq_therm_attach()
393 if (rv != 0) { in qoriq_therm_attach()
399 sc->ver = (RD4(sc, TMU_VERSION) >> 8) & 0xFF; in qoriq_therm_attach()
403 if (root < 0) { in qoriq_therm_attach()
423 WR4(sc, TMU_TMR, 0); in qoriq_therm_attach()
427 WR4(sc, TMU_TIER, 0); in qoriq_therm_attach()
431 WR4(sc, TMUV1_TMTMIR, 0x0F); in qoriq_therm_attach()
433 WR4(sc, TMUV2_TMTMIR, 0x0F); /* disable */ in qoriq_therm_attach()
435 WR4(sc, TMUV2_TEUMR(0), 0x51009c00); in qoriq_therm_attach()
436 for (int i = 0; i < sc->ntsensors; i++) in qoriq_therm_attach()
437 WR4(sc, TMUV2_TMSAR(sc->tsensors[i].site_id), 0xE); in qoriq_therm_attach()
442 if (rv != 0) { in qoriq_therm_attach()
448 sites = 0; in qoriq_therm_attach()
450 for (int i = 0; i < sc->ntsensors; i++) in qoriq_therm_attach()
452 WR4(sc, TMU_TMR, 0x8C000000 | sites); in qoriq_therm_attach()
454 for (int i = 0; i < sc->ntsensors; i++) in qoriq_therm_attach()
457 WR4(sc, TMU_TMR, 0x83000000); in qoriq_therm_attach()
461 if (rv != 0) { in qoriq_therm_attach()
468 return (0); in qoriq_therm_attach()
477 bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq_res); in qoriq_therm_attach()
479 bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); in qoriq_therm_attach()
496 bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq_res); in qoriq_therm_detach()
498 bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); in qoriq_therm_detach()
500 return (0); in qoriq_therm_detach()