Lines Matching +full:can +full:- +full:disable
7 * This program is free software; you can redistribute it and/or modify
18 * The configuration register may be used to enable (and disable in some
22 * will not be able to disable it.
60 * This describes a contiguous area of like control bits used to enable/disable
70 u8 enable_only; /* bits are write-once to enable only */
72 u8 disable; /* value used to disable device */ member
90 u8 disable; /* value indicating disabled state */ member
100 /* These are callbacks to SOC-specific code. */
178 dscr_write_locked1(reg, val, lock->lockreg, lock->key); in dscr_write()
188 * Drivers can use this interface to enable/disable SoC IP blocks.
206 ctl = info->ctl; in dscr_set_devstate()
207 stat = info->stat; in dscr_set_devstate()
212 ctl_shift = ctl->shift + ctl->nbits * (id - ctl->start_id); in dscr_set_devstate()
213 ctl_mask = ((1 << ctl->nbits) - 1) << ctl_shift; in dscr_set_devstate()
217 ctl_val = ctl->enable << ctl_shift; in dscr_set_devstate()
220 if (ctl->enable_only) in dscr_set_devstate()
222 ctl_val = ctl->disable << ctl_shift; in dscr_set_devstate()
230 val = soc_readl(dscr.base + ctl->reg); in dscr_set_devstate()
234 dscr_write(ctl->reg, val); in dscr_set_devstate()
241 ctl_shift = stat->shift + stat->nbits * (id - stat->start_id); in dscr_set_devstate()
244 ctl_val = stat->enable; in dscr_set_devstate()
246 ctl_val = stat->disable; in dscr_set_devstate()
249 val = soc_readl(dscr.base + stat->reg); in dscr_set_devstate()
251 val &= ((1 << stat->nbits) - 1); in dscr_set_devstate()
257 * Drivers can use this to reset RMII module.
269 if (r->mask == 0) in dscr_rmii_reset()
274 val = soc_readl(dscr.base + r->reg); in dscr_rmii_reset()
276 dscr_write(r->reg, val | r->mask); in dscr_rmii_reset()
278 dscr_write(r->reg, val & ~(r->mask)); in dscr_rmii_reset()
290 err = of_property_read_u32_array(node, "ti,dscr-devstat", &val, 1); in dscr_parse_devstat()
302 err = of_property_read_u32_array(node, "ti,dscr-silicon-rev", vals, 3); in dscr_parse_silicon_rev()
312 * an ethernet MAC address. The "ti,dscr-mac-fuse-regs"
316 * ti,dscr-mac-fuse-regs = <reg0 b3 b2 b1 b0
320 * b3-b0 positionally represent bytes within the fuse register.
322 * Allowable values for b3-b0 are:
325 * 1-6 = index+1 into c6x_fuse_mac[]
333 err = of_property_read_u32_array(node, "ti,dscr-mac-fuse-regs", in dscr_parse_mac_fuse()
340 for (j = (f * 5) + 1, i = 24; i >= 0; i -= 8, j++) in dscr_parse_mac_fuse()
342 c6x_fuse_mac[vals[j] - 1] = fuse >> i; in dscr_parse_mac_fuse()
353 p = of_get_property(node, "ti,dscr-rmii-resets", &size); in dscr_parse_rmii_resets()
355 /* parse all the reg/mask pairs we can handle */ in dscr_parse_rmii_resets()
374 err = of_property_read_u32_array(node, "ti,dscr-privperm", vals, 2); in dscr_parse_privperm()
381 * SoCs may have "locked" DSCR registers which can only be written
383 * regisers can be described with the "ti,dscr-locked-regs" property.
387 * ti,dscr-locked-regs = <reg0 lockreg0 key0
403 p = of_get_property(node, "ti,dscr-locked-regs", &size); in dscr_parse_locked_regs()
405 /* parse all the register descriptions we can handle */ in dscr_parse_locked_regs()
413 r->reg = be32_to_cpup(p++); in dscr_parse_locked_regs()
414 r->lockreg = be32_to_cpup(p++); in dscr_parse_locked_regs()
415 r->key = be32_to_cpup(p++); in dscr_parse_locked_regs()
423 * and the key values can be parsed from a "ti,dscr-kick-regs"
426 * ti,dscr-kick-regs = <kickreg0 key0 kickreg1 key1>
437 err = of_property_read_u32_array(node, "ti,dscr-kick-regs", vals, 4); in dscr_parse_kick_regs()
448 * SoCs may provide controls to enable/disable individual IP blocks. These
454 * The layout of these bitfields is described by the ti,dscr-devstate-ctl-regs
459 * start_id num_ids reg enable disable start_bit nbits
465 * disable is the value to disable a device (0xffffffff if cannot disable)
476 p = of_get_property(node, "ti,dscr-devstate-ctl-regs", &size); in dscr_parse_devstate_ctl_regs()
478 /* parse all the ranges we can handle */ in dscr_parse_devstate_ctl_regs()
486 r->start_id = be32_to_cpup(p++); in dscr_parse_devstate_ctl_regs()
487 r->num_ids = be32_to_cpup(p++); in dscr_parse_devstate_ctl_regs()
488 r->reg = be32_to_cpup(p++); in dscr_parse_devstate_ctl_regs()
489 r->enable = be32_to_cpup(p++); in dscr_parse_devstate_ctl_regs()
490 r->disable = be32_to_cpup(p++); in dscr_parse_devstate_ctl_regs()
491 if (r->disable == 0xffffffff) in dscr_parse_devstate_ctl_regs()
492 r->enable_only = 1; in dscr_parse_devstate_ctl_regs()
493 r->shift = be32_to_cpup(p++); in dscr_parse_devstate_ctl_regs()
494 r->nbits = be32_to_cpup(p++); in dscr_parse_devstate_ctl_regs()
496 for (j = r->start_id; in dscr_parse_devstate_ctl_regs()
497 j < (r->start_id + r->num_ids); in dscr_parse_devstate_ctl_regs()
510 * The layout of these bitfields is described by the ti,dscr-devstate-stat-regs
515 * start_id num_ids reg enable disable start_bit nbits
521 * disable is the value indicating device is disabled
532 p = of_get_property(node, "ti,dscr-devstate-stat-regs", &size); in dscr_parse_devstate_stat_regs()
534 /* parse all the ranges we can handle */ in dscr_parse_devstate_stat_regs()
542 r->start_id = be32_to_cpup(p++); in dscr_parse_devstate_stat_regs()
543 r->num_ids = be32_to_cpup(p++); in dscr_parse_devstate_stat_regs()
544 r->reg = be32_to_cpup(p++); in dscr_parse_devstate_stat_regs()
545 r->enable = be32_to_cpup(p++); in dscr_parse_devstate_stat_regs()
546 r->disable = be32_to_cpup(p++); in dscr_parse_devstate_stat_regs()
547 r->shift = be32_to_cpup(p++); in dscr_parse_devstate_stat_regs()
548 r->nbits = be32_to_cpup(p++); in dscr_parse_devstate_stat_regs()
550 for (j = r->start_id; in dscr_parse_devstate_stat_regs()
551 j < (r->start_id + r->num_ids); in dscr_parse_devstate_stat_regs()