• Home
  • Raw
  • Download

Lines Matching refs:gdev

140 static u32 gisb_read(struct brcmstb_gisb_arb_device *gdev, int reg)  in gisb_read()  argument
142 int offset = gdev->gisb_offsets[reg]; in gisb_read()
152 if (gdev->big_endian) in gisb_read()
153 return ioread32be(gdev->base + offset); in gisb_read()
155 return ioread32(gdev->base + offset); in gisb_read()
158 static u64 gisb_read_address(struct brcmstb_gisb_arb_device *gdev) in gisb_read_address() argument
162 value = gisb_read(gdev, ARB_ERR_CAP_ADDR); in gisb_read_address()
163 value |= (u64)gisb_read(gdev, ARB_ERR_CAP_HI_ADDR) << 32; in gisb_read_address()
168 static u64 gisb_read_bp_address(struct brcmstb_gisb_arb_device *gdev) in gisb_read_bp_address() argument
172 value = gisb_read(gdev, ARB_BP_CAP_ADDR); in gisb_read_bp_address()
173 value |= (u64)gisb_read(gdev, ARB_BP_CAP_HI_ADDR) << 32; in gisb_read_bp_address()
178 static void gisb_write(struct brcmstb_gisb_arb_device *gdev, u32 val, int reg) in gisb_write() argument
180 int offset = gdev->gisb_offsets[reg]; in gisb_write()
185 if (gdev->big_endian) in gisb_write()
186 iowrite32be(val, gdev->base + offset); in gisb_write()
188 iowrite32(val, gdev->base + offset); in gisb_write()
195 struct brcmstb_gisb_arb_device *gdev = dev_get_drvdata(dev); in gisb_arb_get_timeout() local
198 mutex_lock(&gdev->lock); in gisb_arb_get_timeout()
199 timeout = gisb_read(gdev, ARB_TIMER); in gisb_arb_get_timeout()
200 mutex_unlock(&gdev->lock); in gisb_arb_get_timeout()
209 struct brcmstb_gisb_arb_device *gdev = dev_get_drvdata(dev); in gisb_arb_set_timeout() local
219 mutex_lock(&gdev->lock); in gisb_arb_set_timeout()
220 gisb_write(gdev, val, ARB_TIMER); in gisb_arb_set_timeout()
221 mutex_unlock(&gdev->lock); in gisb_arb_set_timeout()
227 brcmstb_gisb_master_to_str(struct brcmstb_gisb_arb_device *gdev, in brcmstb_gisb_master_to_str() argument
230 u32 mask = gdev->valid_mask & masters; in brcmstb_gisb_master_to_str()
235 return gdev->master_names[ffs(mask) - 1]; in brcmstb_gisb_master_to_str()
238 static int brcmstb_gisb_arb_decode_addr(struct brcmstb_gisb_arb_device *gdev, in brcmstb_gisb_arb_decode_addr() argument
247 cap_status = gisb_read(gdev, ARB_ERR_CAP_STATUS); in brcmstb_gisb_arb_decode_addr()
254 arb_addr = gisb_read_address(gdev); in brcmstb_gisb_arb_decode_addr()
255 master = gisb_read(gdev, ARB_ERR_CAP_MASTER); in brcmstb_gisb_arb_decode_addr()
257 m_name = brcmstb_gisb_master_to_str(gdev, master); in brcmstb_gisb_arb_decode_addr()
270 gisb_write(gdev, ARB_ERR_CAP_CLEAR, ARB_ERR_CAP_CLR); in brcmstb_gisb_arb_decode_addr()
279 struct brcmstb_gisb_arb_device *gdev; in brcmstb_bus_error_handler() local
282 list_for_each_entry(gdev, &brcmstb_gisb_arb_device_list, next) { in brcmstb_bus_error_handler()
283 cap_status = gisb_read(gdev, ARB_ERR_CAP_STATUS); in brcmstb_bus_error_handler()
291 ret |= brcmstb_gisb_arb_decode_addr(gdev, "bus error"); in brcmstb_bus_error_handler()
314 struct brcmstb_gisb_arb_device *gdev = dev_id; in brcmstb_gisb_bp_handler() local
321 bp_status = gisb_read(gdev, ARB_BP_CAP_STATUS); in brcmstb_gisb_bp_handler()
328 arb_addr = gisb_read_bp_address(gdev); in brcmstb_gisb_bp_handler()
329 master = gisb_read(gdev, ARB_BP_CAP_MASTER); in brcmstb_gisb_bp_handler()
331 m_name = brcmstb_gisb_master_to_str(gdev, master); in brcmstb_gisb_bp_handler()
342 gisb_write(gdev, ARB_ERR_CAP_CLEAR, ARB_ERR_CAP_CLR); in brcmstb_gisb_bp_handler()
364 struct brcmstb_gisb_arb_device *gdev; in dump_gisb_error() local
371 list_for_each_entry(gdev, &brcmstb_gisb_arb_device_list, next) in dump_gisb_error()
372 brcmstb_gisb_arb_decode_addr(gdev, reason); in dump_gisb_error()
402 struct brcmstb_gisb_arb_device *gdev; in brcmstb_gisb_arb_probe() local
412 gdev = devm_kzalloc(&pdev->dev, sizeof(*gdev), GFP_KERNEL); in brcmstb_gisb_arb_probe()
413 if (!gdev) in brcmstb_gisb_arb_probe()
416 mutex_init(&gdev->lock); in brcmstb_gisb_arb_probe()
417 INIT_LIST_HEAD(&gdev->next); in brcmstb_gisb_arb_probe()
419 gdev->base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL); in brcmstb_gisb_arb_probe()
420 if (IS_ERR(gdev->base)) in brcmstb_gisb_arb_probe()
421 return PTR_ERR(gdev->base); in brcmstb_gisb_arb_probe()
428 gdev->gisb_offsets = of_id->data; in brcmstb_gisb_arb_probe()
429 gdev->big_endian = of_device_is_big_endian(dn); in brcmstb_gisb_arb_probe()
433 gdev); in brcmstb_gisb_arb_probe()
439 gdev); in brcmstb_gisb_arb_probe()
447 gdev); in brcmstb_gisb_arb_probe()
454 &gdev->valid_mask)) in brcmstb_gisb_arb_probe()
455 gdev->valid_mask = 0xffffffff; in brcmstb_gisb_arb_probe()
462 if (hweight_long(gdev->valid_mask) == num_masters) { in brcmstb_gisb_arb_probe()
463 first = ffs(gdev->valid_mask) - 1; in brcmstb_gisb_arb_probe()
464 last = fls(gdev->valid_mask) - 1; in brcmstb_gisb_arb_probe()
467 if (!(gdev->valid_mask & BIT(i))) in brcmstb_gisb_arb_probe()
472 &gdev->master_names[i]); in brcmstb_gisb_arb_probe()
481 platform_set_drvdata(pdev, gdev); in brcmstb_gisb_arb_probe()
483 list_add_tail(&gdev->next, &brcmstb_gisb_arb_device_list); in brcmstb_gisb_arb_probe()
504 struct brcmstb_gisb_arb_device *gdev = dev_get_drvdata(dev); in brcmstb_gisb_arb_suspend() local
506 gdev->saved_timeout = gisb_read(gdev, ARB_TIMER); in brcmstb_gisb_arb_suspend()
516 struct brcmstb_gisb_arb_device *gdev = dev_get_drvdata(dev); in brcmstb_gisb_arb_resume_noirq() local
518 gisb_write(gdev, gdev->saved_timeout, ARB_TIMER); in brcmstb_gisb_arb_resume_noirq()