Lines Matching refs:lmb
31 static u32 drmem_lmb_flags(struct drmem_lmb *lmb) in drmem_lmb_flags() argument
37 return lmb->flags & ~DRMEM_LMB_RESERVED; in drmem_lmb_flags()
69 struct drmem_lmb *lmb; in drmem_update_dt_v1() local
81 for_each_drmem_lmb(lmb) { in drmem_update_dt_v1()
82 dr_cell->base_addr = cpu_to_be64(lmb->base_addr); in drmem_update_dt_v1()
83 dr_cell->drc_index = cpu_to_be32(lmb->drc_index); in drmem_update_dt_v1()
84 dr_cell->aa_index = cpu_to_be32(lmb->aa_index); in drmem_update_dt_v1()
85 dr_cell->flags = cpu_to_be32(drmem_lmb_flags(lmb)); in drmem_update_dt_v1()
95 struct drmem_lmb *lmb) in init_drconf_v2_cell() argument
97 dr_cell->base_addr = cpu_to_be64(lmb->base_addr); in init_drconf_v2_cell()
98 dr_cell->drc_index = cpu_to_be32(lmb->drc_index); in init_drconf_v2_cell()
99 dr_cell->aa_index = cpu_to_be32(lmb->aa_index); in init_drconf_v2_cell()
100 dr_cell->flags = cpu_to_be32(drmem_lmb_flags(lmb)); in init_drconf_v2_cell()
108 struct drmem_lmb *lmb, *prev_lmb; in drmem_update_dt_v2() local
115 for_each_drmem_lmb(lmb) { in drmem_update_dt_v2()
117 prev_lmb = lmb; in drmem_update_dt_v2()
122 if (prev_lmb->aa_index != lmb->aa_index || in drmem_update_dt_v2()
123 drmem_lmb_flags(prev_lmb) != drmem_lmb_flags(lmb)) in drmem_update_dt_v2()
126 prev_lmb = lmb; in drmem_update_dt_v2()
142 for_each_drmem_lmb(lmb) { in drmem_update_dt_v2()
145 prev_lmb = lmb; in drmem_update_dt_v2()
146 init_drconf_v2_cell(dr_cell, lmb); in drmem_update_dt_v2()
151 if (prev_lmb->aa_index != lmb->aa_index || in drmem_update_dt_v2()
152 drmem_lmb_flags(prev_lmb) != drmem_lmb_flags(lmb)) { in drmem_update_dt_v2()
157 init_drconf_v2_cell(dr_cell, lmb); in drmem_update_dt_v2()
163 prev_lmb = lmb; in drmem_update_dt_v2()
201 static void read_drconf_v1_cell(struct drmem_lmb *lmb, in read_drconf_v1_cell() argument
206 lmb->base_addr = of_read_number(p, n_root_addr_cells); in read_drconf_v1_cell()
208 lmb->drc_index = of_read_number(p++, 1); in read_drconf_v1_cell()
212 lmb->aa_index = of_read_number(p++, 1); in read_drconf_v1_cell()
213 lmb->flags = of_read_number(p++, 1); in read_drconf_v1_cell()
222 struct drmem_lmb lmb; in __walk_drmem_v1_lmbs() local
228 read_drconf_v1_cell(&lmb, &prop); in __walk_drmem_v1_lmbs()
229 ret = func(&lmb, &usm, data); in __walk_drmem_v1_lmbs()
257 struct drmem_lmb lmb; in __walk_drmem_v2_lmbs() local
266 lmb.base_addr = dr_cell.base_addr; in __walk_drmem_v2_lmbs()
269 lmb.drc_index = dr_cell.drc_index; in __walk_drmem_v2_lmbs()
272 lmb.aa_index = dr_cell.aa_index; in __walk_drmem_v2_lmbs()
273 lmb.flags = dr_cell.flags; in __walk_drmem_v2_lmbs()
275 ret = func(&lmb, &usm, data); in __walk_drmem_v2_lmbs()
324 struct drmem_lmb *lmb; in update_lmb() local
326 for_each_drmem_lmb(lmb) { in update_lmb()
327 if (lmb->drc_index != updated_lmb->drc_index) in update_lmb()
330 lmb->aa_index = updated_lmb->aa_index; in update_lmb()
427 struct drmem_lmb *lmb; in init_drmem_v1_lmbs() local
433 drmem_info->lmbs = kcalloc(drmem_info->n_lmbs, sizeof(*lmb), in init_drmem_v1_lmbs()
438 for_each_drmem_lmb(lmb) in init_drmem_v1_lmbs()
439 read_drconf_v1_cell(lmb, &prop); in init_drmem_v1_lmbs()
444 struct drmem_lmb *lmb; in init_drmem_v2_lmbs() local
461 drmem_info->lmbs = kcalloc(drmem_info->n_lmbs, sizeof(*lmb), in init_drmem_v2_lmbs()
474 lmb = &drmem_info->lmbs[lmb_index++]; in init_drmem_v2_lmbs()
476 lmb->base_addr = dr_cell.base_addr; in init_drmem_v2_lmbs()
479 lmb->drc_index = dr_cell.drc_index; in init_drmem_v2_lmbs()
482 lmb->aa_index = dr_cell.aa_index; in init_drmem_v2_lmbs()
483 lmb->flags = dr_cell.flags; in init_drmem_v2_lmbs()