Lines Matching refs:mp
49 struct mctrl_info *mp; member
123 struct mctrl_info *mp = in find_bank() local
134 bp = &mp->logical_banks[bank_no]; in find_bank()
165 prop = &bp->mp->layout_prop; in chmc_getunumber()
239 static u64 read_mcreg(struct mctrl_info *mp, unsigned long offset) in read_mcreg() argument
243 if (mp->portid == smp_processor_id()) { in read_mcreg()
250 : "r" (mp->regs + offset), in read_mcreg()
257 static void write_mcreg(struct mctrl_info *mp, unsigned long offset, u64 val)
259 if (mp->portid == smp_processor_id()) {
266 "r" (mp->regs + offset),
272 static void interpret_one_decode_reg(struct mctrl_info *mp, int which_bank, u64 val) in interpret_one_decode_reg() argument
274 struct bank_info *p = &mp->logical_banks[which_bank]; in interpret_one_decode_reg()
276 p->mp = mp; in interpret_one_decode_reg()
277 p->bank_id = (CHMCTRL_NBANKS * mp->portid) + which_bank; in interpret_one_decode_reg()
320 static void fetch_decode_regs(struct mctrl_info *mp) in fetch_decode_regs() argument
322 if (mp->layout_size == 0) in fetch_decode_regs()
325 interpret_one_decode_reg(mp, 0, in fetch_decode_regs()
326 read_mcreg(mp, CHMCTRL_DECODE1)); in fetch_decode_regs()
327 interpret_one_decode_reg(mp, 1, in fetch_decode_regs()
328 read_mcreg(mp, CHMCTRL_DECODE2)); in fetch_decode_regs()
329 interpret_one_decode_reg(mp, 2, in fetch_decode_regs()
330 read_mcreg(mp, CHMCTRL_DECODE3)); in fetch_decode_regs()
331 interpret_one_decode_reg(mp, 3, in fetch_decode_regs()
332 read_mcreg(mp, CHMCTRL_DECODE4)); in fetch_decode_regs()
337 struct mctrl_info *mp = kmalloc(sizeof(*mp), GFP_KERNEL); in init_one_mctrl() local
342 if (!mp) in init_one_mctrl()
344 memset(mp, 0, sizeof(*mp)); in init_one_mctrl()
348 mp->portid = portid; in init_one_mctrl()
349 mp->layout_size = prom_getproplen(node, "memory-layout"); in init_one_mctrl()
350 if (mp->layout_size < 0) in init_one_mctrl()
351 mp->layout_size = 0; in init_one_mctrl()
352 if (mp->layout_size > sizeof(mp->layout_prop)) in init_one_mctrl()
355 if (mp->layout_size > 0) in init_one_mctrl()
357 (char *) &mp->layout_prop, in init_one_mctrl()
358 mp->layout_size); in init_one_mctrl()
366 mp->regs = ioremap(p_reg_prop.phys_addr, p_reg_prop.reg_size); in init_one_mctrl()
367 if (mp->regs == NULL) in init_one_mctrl()
370 if (mp->layout_size != 0UL) { in init_one_mctrl()
371 mp->timing_control1 = read_mcreg(mp, CHMCTRL_TCTRL1); in init_one_mctrl()
372 mp->timing_control2 = read_mcreg(mp, CHMCTRL_TCTRL2); in init_one_mctrl()
373 mp->timing_control3 = read_mcreg(mp, CHMCTRL_TCTRL3); in init_one_mctrl()
374 mp->timing_control4 = read_mcreg(mp, CHMCTRL_TCTRL4); in init_one_mctrl()
375 mp->memaddr_control = read_mcreg(mp, CHMCTRL_MACTRL); in init_one_mctrl()
378 fetch_decode_regs(mp); in init_one_mctrl()
380 mp->index = index; in init_one_mctrl()
382 list_add(&mp->list, &mctrl_list); in init_one_mctrl()
386 mp->index, in init_one_mctrl()
387 mp->regs, (mp->layout_size ? "ACTIVE" : "INACTIVE")); in init_one_mctrl()
392 if (mp) { in init_one_mctrl()
393 if (mp->regs != NULL) in init_one_mctrl()
394 iounmap(mp->regs); in init_one_mctrl()
395 kfree(mp); in init_one_mctrl()