Lines Matching refs:p
75 struct chmc *p; member
242 struct jbusmc_obp_mem_layout *p = _prop; in get_pin_and_dimm_str() local
248 map_val = p->map.dimm_map[dimm_map_index]; in get_pin_and_dimm_str()
250 *dimm_str_p = p->dimm_labels[base_dimm_offset + map_val]; in get_pin_and_dimm_str()
251 *pin_p = p->map.pin_map[cache_line_offset]; in get_pin_and_dimm_str()
253 struct chmc_obp_mem_layout *p = _prop; in get_pin_and_dimm_str() local
258 if (p->symmetric) in get_pin_and_dimm_str()
259 mp = &p->map[0]; in get_pin_and_dimm_str()
261 mp = &p->map[1]; in get_pin_and_dimm_str()
269 *dimm_str_p = p->dimm_labels[base_dimm_offset + map_val]; in get_pin_and_dimm_str()
276 struct jbusmc *p; in jbusmc_find_dimm_group() local
278 list_for_each_entry(p, &mctrl_list, list) { in jbusmc_find_dimm_group()
281 for (i = 0; i < p->num_dimm_groups; i++) { in jbusmc_find_dimm_group()
282 struct jbusmc_dimm_group *dp = &p->dimm_groups[i]; in jbusmc_find_dimm_group()
300 struct jbusmc *p; in jbusmc_print_dimm() local
313 p = dp->controller; in jbusmc_print_dimm()
314 prop = &p->layout; in jbusmc_print_dimm()
368 static void jbusmc_construct_one_dimm_group(struct jbusmc *p, in jbusmc_construct_one_dimm_group() argument
373 struct jbusmc_dimm_group *dp = &p->dimm_groups[index]; in jbusmc_construct_one_dimm_group()
375 dp->controller = p; in jbusmc_construct_one_dimm_group()
378 dp->base_addr = (p->portid * (64UL * 1024 * 1024 * 1024)); in jbusmc_construct_one_dimm_group()
383 static void jbusmc_construct_dimm_groups(struct jbusmc *p, in jbusmc_construct_dimm_groups() argument
387 if (p->mc_reg_1 & JB_MC_REG1_DIMM1_BANK0) { in jbusmc_construct_dimm_groups()
388 jbusmc_construct_one_dimm_group(p, 0, mem_regs, num_mem_regs); in jbusmc_construct_dimm_groups()
389 p->num_dimm_groups++; in jbusmc_construct_dimm_groups()
391 if (p->mc_reg_1 & JB_MC_REG1_DIMM2_BANK2) { in jbusmc_construct_dimm_groups()
392 jbusmc_construct_one_dimm_group(p, 1, mem_regs, num_mem_regs); in jbusmc_construct_dimm_groups()
393 p->num_dimm_groups++; in jbusmc_construct_dimm_groups()
402 struct jbusmc *p; in jbusmc_probe() local
420 p = kzalloc(sizeof(*p), GFP_KERNEL); in jbusmc_probe()
421 if (!p) { in jbusmc_probe()
426 INIT_LIST_HEAD(&p->list); in jbusmc_probe()
435 p->portid = *prop; in jbusmc_probe()
443 p->mc_reg_1 = ((u64)prop[0] << 32) | (u64) prop[1]; in jbusmc_probe()
446 p->regs = of_ioremap(&op->resource[0], 0, JBUSMC_REGS_SIZE, "jbusmc"); in jbusmc_probe()
447 if (!p->regs) { in jbusmc_probe()
453 ml = of_get_property(op->dev.of_node, "memory-layout", &p->layout_len); in jbusmc_probe()
458 if (p->layout_len > sizeof(p->layout)) { in jbusmc_probe()
460 p->layout_len); in jbusmc_probe()
463 memcpy(&p->layout, ml, p->layout_len); in jbusmc_probe()
465 jbusmc_construct_dimm_groups(p, mem_regs, num_mem_regs); in jbusmc_probe()
467 mc_list_add(&p->list); in jbusmc_probe()
472 dev_set_drvdata(&op->dev, p); in jbusmc_probe()
480 of_iounmap(&op->resource[0], p->regs, JBUSMC_REGS_SIZE); in jbusmc_probe()
483 kfree(p); in jbusmc_probe()
522 struct chmc *p; in chmc_find_bank() local
524 list_for_each_entry(p, &mctrl_list, list) { in chmc_find_bank()
530 bp = &p->logical_banks[bank_no]; in chmc_find_bank()
559 prop = &bp->p->layout_prop; in chmc_print_dimm()
591 static u64 chmc_read_mcreg(struct chmc *p, unsigned long offset) in chmc_read_mcreg() argument
599 if (p->portid == this_cpu) { in chmc_read_mcreg()
606 : "r" (p->regs + offset), in chmc_read_mcreg()
616 static void chmc_write_mcreg(struct chmc *p, unsigned long offset, u64 val)
618 if (p->portid == smp_processor_id()) {
625 "r" (p->regs + offset),
631 static void chmc_interpret_one_decode_reg(struct chmc *p, int which_bank, u64 val) in chmc_interpret_one_decode_reg() argument
633 struct chmc_bank_info *bp = &p->logical_banks[which_bank]; in chmc_interpret_one_decode_reg()
635 bp->p = p; in chmc_interpret_one_decode_reg()
636 bp->bank_id = (CHMCTRL_NBANKS * p->portid) + which_bank; in chmc_interpret_one_decode_reg()
679 static void chmc_fetch_decode_regs(struct chmc *p) in chmc_fetch_decode_regs() argument
681 if (p->layout_size == 0) in chmc_fetch_decode_regs()
684 chmc_interpret_one_decode_reg(p, 0, in chmc_fetch_decode_regs()
685 chmc_read_mcreg(p, CHMCTRL_DECODE1)); in chmc_fetch_decode_regs()
686 chmc_interpret_one_decode_reg(p, 1, in chmc_fetch_decode_regs()
687 chmc_read_mcreg(p, CHMCTRL_DECODE2)); in chmc_fetch_decode_regs()
688 chmc_interpret_one_decode_reg(p, 2, in chmc_fetch_decode_regs()
689 chmc_read_mcreg(p, CHMCTRL_DECODE3)); in chmc_fetch_decode_regs()
690 chmc_interpret_one_decode_reg(p, 3, in chmc_fetch_decode_regs()
691 chmc_read_mcreg(p, CHMCTRL_DECODE4)); in chmc_fetch_decode_regs()
700 struct chmc *p; in chmc_probe() local
714 if (pval && len > sizeof(p->layout_prop)) { in chmc_probe()
721 p = kzalloc(sizeof(*p), GFP_KERNEL); in chmc_probe()
722 if (!p) { in chmc_probe()
727 p->portid = portid; in chmc_probe()
728 p->layout_size = len; in chmc_probe()
730 p->layout_size = 0; in chmc_probe()
732 memcpy(&p->layout_prop, pval, len); in chmc_probe()
734 p->regs = of_ioremap(&op->resource[0], 0, 0x48, "chmc"); in chmc_probe()
735 if (!p->regs) { in chmc_probe()
740 if (p->layout_size != 0UL) { in chmc_probe()
741 p->timing_control1 = chmc_read_mcreg(p, CHMCTRL_TCTRL1); in chmc_probe()
742 p->timing_control2 = chmc_read_mcreg(p, CHMCTRL_TCTRL2); in chmc_probe()
743 p->timing_control3 = chmc_read_mcreg(p, CHMCTRL_TCTRL3); in chmc_probe()
744 p->timing_control4 = chmc_read_mcreg(p, CHMCTRL_TCTRL4); in chmc_probe()
745 p->memaddr_control = chmc_read_mcreg(p, CHMCTRL_MACTRL); in chmc_probe()
748 chmc_fetch_decode_regs(p); in chmc_probe()
750 mc_list_add(&p->list); in chmc_probe()
754 (p->layout_size ? "ACTIVE" : "INACTIVE")); in chmc_probe()
756 dev_set_drvdata(&op->dev, p); in chmc_probe()
764 kfree(p); in chmc_probe()
777 static void chmc_destroy(struct platform_device *op, struct chmc *p) in chmc_destroy() argument
779 list_del(&p->list); in chmc_destroy()
780 of_iounmap(&op->resource[0], p->regs, 0x48); in chmc_destroy()
781 kfree(p); in chmc_destroy()
784 static void jbusmc_destroy(struct platform_device *op, struct jbusmc *p) in jbusmc_destroy() argument
786 mc_list_del(&p->list); in jbusmc_destroy()
787 of_iounmap(&op->resource[0], p->regs, JBUSMC_REGS_SIZE); in jbusmc_destroy()
788 kfree(p); in jbusmc_destroy()
793 void *p = dev_get_drvdata(&op->dev); in us3mc_remove() local
795 if (p) { in us3mc_remove()
797 chmc_destroy(op, p); in us3mc_remove()
799 jbusmc_destroy(op, p); in us3mc_remove()