Lines Matching +full:0 +full:x160
55 /* Per sensors registers - base is 0x0c0*/
56 #define TSENSOR_CONFIG0 0x000
57 #define TSENSOR_CONFIG0_TALL(x) (((x) & 0xFFFFF) << 8)
63 #define TSENSOR_CONFIG0_STOP (1 << 0)
65 #define TSENSOR_CONFIG1 0x004
67 #define TSENSOR_CONFIG1_TEN_COUNT(x) (((x) & 0x3F) << 24)
68 #define TSENSOR_CONFIG1_TIDDQ_EN(x) (((x) & 0x3F) << 15)
69 #define TSENSOR_CONFIG1_TSAMPLE(x) (((x) & 0x3FF) << 0)
71 #define TSENSOR_CONFIG2 0x008
72 #define TSENSOR_CONFIG2_THERMA(x) (((x) & 0xFFFF) << 16)
73 #define TSENSOR_CONFIG2_THERMB(x) (((x) & 0xFFFF) << 0)
75 #define TSENSOR_STATUS0 0x00c
77 #define TSENSOR_STATUS0_CAPTURE(x) (((x) >> 0) & 0xffff)
79 #define TSENSOR_STATUS1 0x010
81 #define TSENSOR_STATUS1_TEMP(x) (((x) >> 0) & 0xffff)
83 #define TSENSOR_STATUS2 0x014
84 #define TSENSOR_STATUS2_TEMP_MAX(x) (((x) >> 16) & 0xffff)
85 #define TSENSOR_STATUS2_TEMP_MIN(x) (((x) >> 0) & 0xffff)
89 #define READBACK_VALUE(x) (((x) >> 8) & 0xff)
91 #define READBACK_NEGATE (1 << 0)
94 #define TSENSOR_PDIV 0x1c0
95 #define TSENSOR_HOTSPOT_OFF 0x1c4
96 #define TSENSOR_TEMP1 0x1c8
97 #define TSENSOR_TEMP2 0x1cc
100 #define FUSE_TSENSOR_CALIB_CP_TS_BASE_SHIFT 0
106 #define FUSE_TSENSOR_COMMON 0x180
107 #define TEGRA124_FUSE_COMMON_CP_TS_BASE(x) (((x) >> 0) & 0x3ff)
108 #define TEGRA124_FUSE_COMMON_FT_TS_BASE(x) (((x) >> 10) & 0x7ff)
112 #define TEGRA210_FUSE_COMMON_CP_TS_BASE(x) (((x) >> 11) & 0x3ff)
113 #define TEGRA210_FUSE_COMMON_FT_TS_BASE(x) (((x) >> 21) & 0x7ff)
114 #define TEGRA210_FUSE_COMMON_SHIFT_CP_SHIFT 0
121 #define FUSE_SPARE_REALIGNMENT_REG 0x1fc
122 #define FUSE_SPARE_REALIGNMENT_REG_SHIFT_CP_SHIFT 0
205 .sensor_base = 0x0c0,
206 .calib_fuse = 0x098,
213 .sensor_base = 0x0e0,
214 .calib_fuse = 0x084,
221 .sensor_base = 0x100,
222 .calib_fuse = 0x088,
229 .sensor_base = 0x120,
230 .calib_fuse = 0x12c,
237 .sensor_base = 0x140,
238 .calib_fuse = 0x158,
245 .sensor_base = 0x160,
246 .calib_fuse = 0x15c,
253 .sensor_base = 0x180,
254 .calib_fuse = 0x154,
261 .sensor_base = 0x1a0,
262 .calib_fuse = 0x160,
272 .tsensor_pdiv = 0x8888,
273 .tsensor_hotspot_off = 0x00060600 ,
294 .sensor_base = 0x0c0,
295 .calib_fuse = 0x098,
302 .sensor_base = 0x0e0,
303 .calib_fuse = 0x084,
310 .sensor_base = 0x100,
311 .calib_fuse = 0x088,
318 .sensor_base = 0x120,
319 .calib_fuse = 0x12c,
326 .sensor_base = 0x140,
327 .calib_fuse = 0x158,
334 .sensor_base = 0x160,
335 .calib_fuse = 0x15c,
342 .sensor_base = 0x180,
343 .calib_fuse = 0x154,
350 .sensor_base = 0x1a0,
351 .calib_fuse = 0x160,
361 .tsensor_pdiv = 0x8888,
362 .tsensor_hotspot_off = 0x000A0500 ,
371 {NULL, 0},
502 printf("%s: sensor %s fuse: 0x%08X (0x%04X, 0x%04X)" in tsensor_calibration()
503 " calib_cp: %d(0x%04X), calib_ft: %d(0x%04X)\n", in tsensor_calibration()
504 __func__, sensor->name, val, val & 0x1FFF, (val >> 13) & 0x1FFF, in tsensor_calibration()
506 printf("therma: 0x%04X(%d), thermb: 0x%04X(%d)\n", in tsensor_calibration()
544 printf(" Sensor: %s cfg:0x%08X, 0x%08X, 0x%08X," in soctherm_init_tsensor()
545 " sts:0x%08X, 0x%08X, 0x%08X\n", sensor->name, in soctherm_init_tsensor()
577 for (timeout = 100; timeout > 0; timeout--) { in soctherm_read_temp()
579 if ((val & TSENSOR_STATUS1_TEMP_VALID) != 0) in soctherm_read_temp()
583 if (timeout <= 0) in soctherm_read_temp()
587 printf("%s: Raw: 0x%08X, temp: %d\n", __func__, val, *temp); in soctherm_read_temp()
588 printf(" Sensor: %s cfg:0x%08X, 0x%08X, 0x%08X," in soctherm_read_temp()
589 " sts:0x%08X, 0x%08X, 0x%08X\n", sensor->name, in soctherm_read_temp()
598 return (0); in soctherm_read_temp()
608 /* The direct sensor map starts at 0x100 */ in soctherm_get_temp()
609 if (id >= 0x100) { in soctherm_get_temp()
610 id -= 0x100; in soctherm_get_temp()
616 for (i = 0; i < sc->soc->ntsensors; i++) { in soctherm_get_temp()
643 if (rv != 0) in soctherm_sysctl_temperature()
648 rv = sysctl_handle_int(oidp, &val, 0, req); in soctherm_sysctl_temperature()
667 for (i = sc->soc->ntsensors - 1; i >= 0; i--) { in soctherm_init_sysctl()
676 return (0); in soctherm_init_sysctl()
686 if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) in soctherm_probe()
706 rid = 0; in soctherm_attach()
714 rid = 0; in soctherm_attach()
731 rv = hwreset_get_by_ofw_name(dev, 0, "soctherm", &sc->reset); in soctherm_attach()
732 if (rv != 0) { in soctherm_attach()
736 rv = clk_get_by_ofw_name(dev, 0, "tsensor", &sc->tsensor_clk); in soctherm_attach()
737 if (rv != 0) { in soctherm_attach()
741 rv = clk_get_by_ofw_name(dev, 0, "soctherm", &sc->soctherm_clk); in soctherm_attach()
742 if (rv != 0) { in soctherm_attach()
748 if (rv != 0) { in soctherm_attach()
753 if (rv != 0) { in soctherm_attach()
758 if (rv != 0) { in soctherm_attach()
763 if (rv != 0) { in soctherm_attach()
773 for (i = 0; i < sc->soc->ntsensors; i++) in soctherm_attach()
777 if (rv != 0) { in soctherm_attach()
784 return (0); in soctherm_attach()
797 bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq_res); in soctherm_attach()
799 bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); in soctherm_attach()
820 bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq_res); in soctherm_detach()
822 bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); in soctherm_detach()