static struct dmc_monitor *dmc_mon;
+static unsigned long init_dev_mask __initdata;
+static unsigned long init_start_addr __initdata;
+static unsigned long init_end_addr __initdata;
+
+static int __init early_dmc_param(char *buf)
+{
+ unsigned long s_addr, e_addr, mask;
+ /*
+ * Patten: dmc_montiro=[start_addr],[end_addr],[mask]
+ * Example: dmc_monitor=0x00000000,0x20000000,0x7fce
+ */
+ if (!buf)
+ return -EINVAL;
+
+ if (sscanf(buf, "%lx,%lx,%lx", &s_addr, &e_addr, &mask) != 3)
+ return -EINVAL;
+
+ init_start_addr = s_addr;
+ init_end_addr = e_addr;
+ init_dev_mask = mask;
+
+ pr_info("%s, buf:%s, %lx-%lx, %lx\n",
+ __func__, buf, s_addr, e_addr, mask);
+
+ return 0;
+}
+early_param("dmc_monitor", early_dmc_param);
+
unsigned long dmc_rw(unsigned long addr, unsigned long value, int rw)
{
struct arm_smccc_res smccc;
INIT_DELAYED_WORK(&dmc_mon->work, clear_irq_work);
schedule_delayed_work(&dmc_mon->work, HZ);
+ if (init_dev_mask)
+ dmc_set_monitor(init_start_addr,
+ init_end_addr, init_dev_mask, 1);
+
return 0;
inval:
kfree(dmc_mon);