Lines Matching defs:throt
214 /* get THROT_PSKIP_xxx offset per LIGHT/HEAVY throt and CPU/GPU dev */
216 #define THROT_PSKIP_CTRL(throt, dev) (THROT_PSKIP_CTRL_LITE_CPU + \
217 (THROT_OFFSET * throt) + (8 * dev))
218 #define THROT_PSKIP_RAMP(throt, dev) (THROT_PSKIP_RAMP_LITE_CPU + \
219 (THROT_OFFSET * throt) + (8 * dev))
221 /* get THROT_xxx_CTRL offset per LIGHT/HEAVY throt */
222 #define THROT_PRIORITY_CTRL(throt) (THROT_PRIORITY_LITE + \
223 (THROT_OFFSET * throt))
224 #define THROT_DELAY_CTRL(throt) (THROT_DELAY_LITE + \
225 (THROT_OFFSET * throt))
228 #define ALARM_CFG(throt) (OC1_CFG + \
229 (ALARM_OFFSET * (throt - THROTTLE_OC1)))
231 #define ALARM_CNT_THRESHOLD(throt) (OC1_CNT_THRESHOLD + \
232 (ALARM_OFFSET * (throt - THROTTLE_OC1)))
234 #define ALARM_THROTTLE_PERIOD(throt) (OC1_THROTTLE_PERIOD + \
235 (ALARM_OFFSET * (throt - THROTTLE_OC1)))
237 #define ALARM_ALARM_COUNT(throt) (OC1_ALARM_COUNT + \
238 (ALARM_OFFSET * (throt - THROTTLE_OC1)))
240 #define ALARM_FILTER(throt) (OC1_FILTER + \
241 (ALARM_OFFSET * (throt - THROTTLE_OC1)))
243 #define ALARM_STATS(throt) (OC1_STATS + \
244 (4 * (throt - THROTTLE_OC1)))
520 unsigned int throt;
529 throt = stc->id;
530 reg_off = THERMCTL_LVL_REG(sg->thermctl_lvl0_offset, throt + 1);
532 if (throt == THROTTLE_LIGHT) {
538 if (throt != THROTTLE_HEAVY)
540 "invalid throt id %d - assuming HEAVY",
541 throt);
1620 "nvidia,cpu-throt-level" :
1621 "nvidia,cpu-throt-percent", &val);
1634 ret = of_property_read_u32(np, "nvidia,gpu-throt-level", &val);
1643 dev_err(dev, "throttle-cfg: %s: no throt prop or invalid prop\n",
1771 * @throt: the LIGHT/HEAVY of throttle event id
1774 * function programs the pulse skippers based on @throt and platform
1781 enum soctherm_throttle_id throt)
1786 switch (ts->throt_cfgs[throt].cpu_throt_level) {
1801 r = readl(ts->regs + THROT_PSKIP_CTRL(throt, THROTTLE_DEV_CPU));
1805 writel(r, ts->regs + THROT_PSKIP_CTRL(throt, THROTTLE_DEV_CPU));
1809 writel(r, ts->regs + THROT_PSKIP_RAMP(throt, THROTTLE_DEV_CPU));
1815 * @throt: the LIGHT/HEAVY of throttle event id
1818 * function programs the pulse skippers based on @throt and platform
1825 enum soctherm_throttle_id throt)
1831 depth = ts->throt_cfgs[throt].cpu_throt_depth;
1834 r = readl(ts->regs + THROT_PSKIP_CTRL(throt, THROTTLE_DEV_CPU));
1838 writel(r, ts->regs + THROT_PSKIP_CTRL(throt, THROTTLE_DEV_CPU));
1840 r = readl(ts->regs + THROT_PSKIP_RAMP(throt, THROTTLE_DEV_CPU));
1843 writel(r, ts->regs + THROT_PSKIP_RAMP(throt, THROTTLE_DEV_CPU));
1849 * @throt: the LIGHT/HEAVY of throttle event id
1857 enum soctherm_throttle_id throt)
1861 level = ts->throt_cfgs[throt].gpu_throt_level;
1863 r = readl(ts->regs + THROT_PSKIP_CTRL(throt, THROTTLE_DEV_GPU));
1866 writel(r, ts->regs + THROT_PSKIP_CTRL(throt, THROTTLE_DEV_GPU));
1870 enum soctherm_throttle_id throt)
1873 struct soctherm_oc_cfg *oc = &ts->throt_cfgs[throt].oc_cfg;
1882 writel(r, ts->regs + ALARM_CFG(throt));
1883 writel(oc->throt_period, ts->regs + ALARM_THROTTLE_PERIOD(throt));
1884 writel(oc->alarm_cnt_thresh, ts->regs + ALARM_CNT_THRESHOLD(throt));
1885 writel(oc->alarm_filter, ts->regs + ALARM_FILTER(throt));
1886 soctherm_oc_intr_enable(ts, throt, oc->intr_en);
1894 * @throt: the LIGHT/HEAVY of the throttle event id.
1900 enum soctherm_throttle_id throt)
1903 struct soctherm_throt_cfg stc = ts->throt_cfgs[throt];
1908 if ((throt >= THROTTLE_OC1) && (soctherm_oc_cfg_program(ts, throt)))
1913 throttlectl_cpu_level_select(ts, throt);
1915 throttlectl_cpu_mn(ts, throt);
1917 throttlectl_gpu_level_select(ts, throt);
1920 writel(r, ts->regs + THROT_PRIORITY_CTRL(throt));
1923 writel(r, ts->regs + THROT_DELAY_CTRL(throt));