Lines Matching full:cdmm
2 * Bus driver for MIPS Common Device Memory Map (CDMM).
21 #include <asm/cdmm.h>
122 .name = "cdmm",
132 * All the CDMM driver callbacks need to be executed on the appropriate CPU from
141 * @fn: CDMM driver callback function to call for the device.
142 * @dev: CDMM device to pass to @fn.
150 * mips_cdmm_void_work() - Call a void returning CDMM driver callback.
153 * A work_on_cpu() callback function to call an arbitrary CDMM driver callback
166 * mips_cdmm_int_work() - Call an int returning CDMM driver callback.
169 * A work_on_cpu() callback function to call an arbitrary CDMM driver callback
184 * BUILD_PERCPU_HELPER() - Helper to call a CDMM driver callback on right CPU.
186 * @_name: Name of CDMM driver callback function.
188 * Generates a specific device callback function to call a CDMM driver callback
215 * mips_cdmm_driver_register() - Register a CDMM driver. in BUILD_PERCPU_HELPER()
216 * @drv: CDMM driver information. in BUILD_PERCPU_HELPER()
218 * Register a CDMM driver with the CDMM subsystem. The driver will be informed in BUILD_PERCPU_HELPER()
239 * mips_cdmm_driver_unregister() - Unregister a CDMM driver.
240 * @drv: CDMM driver information.
242 * Unregister a CDMM driver from the CDMM subsystem.
251 /* CDMM initialisation and bus discovery */
254 * struct mips_cdmm_bus - Info about CDMM bus.
260 * @offline: Whether the CDMM bus is going offline (or very early
278 * mips_cdmm_get_bus() - Get the per-CPU CDMM bus information.
280 * Get information about the per-CPU CDMM bus, if the bus is present.
285 * Returns: Pointer to CDMM bus information for the current CPU.
320 * mips_cdmm_cur_base() - Find current physical base address of CDMM region.
322 * Returns: Physical base address of CDMM region according to cdmmbase CP0
323 * register, or 0 if the CDMM region is disabled.
337 * mips_cdmm_phys_base() - Choose a physical base address for CDMM region.
339 * Picking a suitable physical address at which to map the CDMM region is
342 * By default this method tries to find a CDMM-specific node in the system
351 np = of_find_compatible_node(NULL, NULL, "mti,mips-cdmm"); in mips_cdmm_phys_base()
363 * mips_cdmm_setup() - Ensure the CDMM bus is initialised and usable.
383 /* If CDMM region is still set up, nothing to do */ in mips_cdmm_setup()
387 * The CDMM region isn't set up as expected, so it needs in mips_cdmm_setup()
395 /* If the CDMM region is already configured, inherit that setup */ in mips_cdmm_setup()
409 * CDMM on the boot CPU, or else you need to implement in mips_cdmm_setup()
410 * mips_cdmm_phys_base() for your platform (see asm/cdmm.h). in mips_cdmm_setup()
412 pr_err("cdmm%u: Failed to choose a physical base\n", in mips_cdmm_setup()
423 pr_debug("cdmm%u: Enabling CDMM region at %pa\n", in mips_cdmm_setup()
426 /* Enable CDMM */ in mips_cdmm_setup()
446 * mips_cdmm_early_probe() - Minimally probe for a specific device on CDMM.
447 * @dev_type: CDMM type code to look for.
449 * Minimally configure the in-CPU Common Device Memory Map (CDMM) and look for a
465 void __iomem *cdmm; in mips_cdmm_early_probe() local
480 cdmm = bus->regs; in mips_cdmm_early_probe()
484 acsr = __raw_readl(cdmm + drb * CDMM_DRB_SIZE); in mips_cdmm_early_probe()
487 return cdmm + drb * CDMM_DRB_SIZE; in mips_cdmm_early_probe()
496 * mips_cdmm_release() - Release a removed CDMM device.
499 * Clean up the struct mips_cdmm_device for an unused CDMM device. This is
510 * mips_cdmm_bus_discover() - Discover the devices on the CDMM bus.
511 * @bus: CDMM bus information, must already be set up.
515 void __iomem *cdmm; in mips_cdmm_bus_discover() local
525 cdmm = bus->regs; in mips_cdmm_bus_discover()
529 pr_info("cdmm%u discovery (%u blocks)\n", cpu, bus->drbs); in mips_cdmm_bus_discover()
531 acsr = __raw_readl(cdmm + drb * CDMM_DRB_SIZE); in mips_cdmm_bus_discover()
539 pr_info("cdmm%u-%u: @%u (%#x..%#x), type 0x%02x, rev %u\n", in mips_cdmm_bus_discover()
560 dev_set_name(&dev->dev, "cdmm%u-%u", cpu, id); in mips_cdmm_bus_discover()
572 * All the CDMM driver callbacks need to be executed on the appropriate CPU from
580 * BUILD_PERDEV_HELPER() - Helper to call a CDMM driver callback if CPU matches.
581 * @_name: Name of CDMM driver callback function.
583 * Generates a bus_for_each_dev callback function to call a specific CDMM driver
614 * Tear down the CDMM bus. in BUILD_PERDEV_HELPER()
617 * This function is executed on the hotplugged CPU and calls the CDMM in BUILD_PERDEV_HELPER()
641 * mips_cdmm_cpu_online() - Callback for CPUHP ONLINE: Bring up the CDMM bus.
645 * CDMM devices on that CPU, or to call the CDMM driver cpu_up callback for all
676 * mips_cdmm_init() - Initialise CDMM bus.
678 * Initialise CDMM bus, discover CDMM devices for online CPUs, and arrange for
679 * hotplug notifications so the CDMM drivers can be kept up to date.
691 ret = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "bus/cdmm:online", in mips_cdmm_init()
694 pr_warn("cdmm: Failed to register CPU notifier\n"); in mips_cdmm_init()