coresight-cpu-debug.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Copyright (c) 2017 Linaro Limited. All rights reserved.
  4. *
  5. * Author: Leo Yan <leo.yan@linaro.org>
  6. */
  7. #include <linux/amba/bus.h>
  8. #include <linux/coresight.h>
  9. #include <linux/cpu.h>
  10. #include <linux/debugfs.h>
  11. #include <linux/delay.h>
  12. #include <linux/device.h>
  13. #include <linux/err.h>
  14. #include <linux/init.h>
  15. #include <linux/io.h>
  16. #include <linux/iopoll.h>
  17. #include <linux/kernel.h>
  18. #include <linux/module.h>
  19. #include <linux/moduleparam.h>
  20. #include <linux/pm_qos.h>
  21. #include <linux/slab.h>
  22. #include <linux/smp.h>
  23. #include <linux/types.h>
  24. #include <linux/uaccess.h>
  25. #include "coresight-priv.h"
  26. #define EDPCSR 0x0A0
  27. #define EDCIDSR 0x0A4
  28. #define EDVIDSR 0x0A8
  29. #define EDPCSR_HI 0x0AC
  30. #define EDOSLAR 0x300
  31. #define EDPRCR 0x310
  32. #define EDPRSR 0x314
  33. #define EDDEVID1 0xFC4
  34. #define EDDEVID 0xFC8
  35. #define EDPCSR_PROHIBITED 0xFFFFFFFF
  36. /* bits definition for EDPCSR */
  37. #define EDPCSR_THUMB BIT(0)
  38. #define EDPCSR_ARM_INST_MASK GENMASK(31, 2)
  39. #define EDPCSR_THUMB_INST_MASK GENMASK(31, 1)
  40. /* bits definition for EDPRCR */
  41. #define EDPRCR_COREPURQ BIT(3)
  42. #define EDPRCR_CORENPDRQ BIT(0)
  43. /* bits definition for EDPRSR */
  44. #define EDPRSR_DLK BIT(6)
  45. #define EDPRSR_PU BIT(0)
  46. /* bits definition for EDVIDSR */
  47. #define EDVIDSR_NS BIT(31)
  48. #define EDVIDSR_E2 BIT(30)
  49. #define EDVIDSR_E3 BIT(29)
  50. #define EDVIDSR_HV BIT(28)
  51. #define EDVIDSR_VMID GENMASK(7, 0)
  52. /*
  53. * bits definition for EDDEVID1:PSCROffset
  54. *
  55. * NOTE: armv8 and armv7 have different definition for the register,
  56. * so consolidate the bits definition as below:
  57. *
  58. * 0b0000 - Sample offset applies based on the instruction state, we
  59. * rely on EDDEVID to check if EDPCSR is implemented or not
  60. * 0b0001 - No offset applies.
  61. * 0b0010 - No offset applies, but do not use in AArch32 mode
  62. *
  63. */
  64. #define EDDEVID1_PCSR_OFFSET_MASK GENMASK(3, 0)
  65. #define EDDEVID1_PCSR_OFFSET_INS_SET (0x0)
  66. #define EDDEVID1_PCSR_NO_OFFSET_DIS_AARCH32 (0x2)
  67. /* bits definition for EDDEVID */
  68. #define EDDEVID_PCSAMPLE_MODE GENMASK(3, 0)
  69. #define EDDEVID_IMPL_EDPCSR (0x1)
  70. #define EDDEVID_IMPL_EDPCSR_EDCIDSR (0x2)
  71. #define EDDEVID_IMPL_FULL (0x3)
  72. #define DEBUG_WAIT_SLEEP 1000
  73. #define DEBUG_WAIT_TIMEOUT 32000
  74. struct debug_drvdata {
  75. void __iomem *base;
  76. struct device *dev;
  77. int cpu;
  78. bool edpcsr_present;
  79. bool edcidsr_present;
  80. bool edvidsr_present;
  81. bool pc_has_offset;
  82. u32 edpcsr;
  83. u32 edpcsr_hi;
  84. u32 edprsr;
  85. u32 edvidsr;
  86. u32 edcidsr;
  87. };
  88. static DEFINE_MUTEX(debug_lock);
  89. static DEFINE_PER_CPU(struct debug_drvdata *, debug_drvdata);
  90. static int debug_count;
  91. static struct dentry *debug_debugfs_dir;
  92. static bool debug_enable;
  93. module_param_named(enable, debug_enable, bool, 0600);
  94. MODULE_PARM_DESC(enable, "Control to enable coresight CPU debug functionality");
  95. static void debug_os_unlock(struct debug_drvdata *drvdata)
  96. {
  97. /* Unlocks the debug registers */
  98. writel_relaxed(0x0, drvdata->base + EDOSLAR);
  99. /* Make sure the registers are unlocked before accessing */
  100. wmb();
  101. }
  102. /*
  103. * According to ARM DDI 0487A.k, before access external debug
  104. * registers should firstly check the access permission; if any
  105. * below condition has been met then cannot access debug
  106. * registers to avoid lockup issue:
  107. *
  108. * - CPU power domain is powered off;
  109. * - The OS Double Lock is locked;
  110. *
  111. * By checking EDPRSR can get to know if meet these conditions.
  112. */
  113. static bool debug_access_permitted(struct debug_drvdata *drvdata)
  114. {
  115. /* CPU is powered off */
  116. if (!(drvdata->edprsr & EDPRSR_PU))
  117. return false;
  118. /* The OS Double Lock is locked */
  119. if (drvdata->edprsr & EDPRSR_DLK)
  120. return false;
  121. return true;
  122. }
  123. static void debug_force_cpu_powered_up(struct debug_drvdata *drvdata)
  124. {
  125. u32 edprcr;
  126. try_again:
  127. /*
  128. * Send request to power management controller and assert
  129. * DBGPWRUPREQ signal; if power management controller has
  130. * sane implementation, it should enable CPU power domain
  131. * in case CPU is in low power state.
  132. */
  133. edprcr = readl_relaxed(drvdata->base + EDPRCR);
  134. edprcr |= EDPRCR_COREPURQ;
  135. writel_relaxed(edprcr, drvdata->base + EDPRCR);
  136. /* Wait for CPU to be powered up (timeout~=32ms) */
  137. if (readx_poll_timeout_atomic(readl_relaxed, drvdata->base + EDPRSR,
  138. drvdata->edprsr, (drvdata->edprsr & EDPRSR_PU),
  139. DEBUG_WAIT_SLEEP, DEBUG_WAIT_TIMEOUT)) {
  140. /*
  141. * Unfortunately the CPU cannot be powered up, so return
  142. * back and later has no permission to access other
  143. * registers. For this case, should disable CPU low power
  144. * states to ensure CPU power domain is enabled!
  145. */
  146. dev_err(drvdata->dev, "%s: power up request for CPU%d failed\n",
  147. __func__, drvdata->cpu);
  148. return;
  149. }
  150. /*
  151. * At this point the CPU is powered up, so set the no powerdown
  152. * request bit so we don't lose power and emulate power down.
  153. */
  154. edprcr = readl_relaxed(drvdata->base + EDPRCR);
  155. edprcr |= EDPRCR_COREPURQ | EDPRCR_CORENPDRQ;
  156. writel_relaxed(edprcr, drvdata->base + EDPRCR);
  157. drvdata->edprsr = readl_relaxed(drvdata->base + EDPRSR);
  158. /* The core power domain got switched off on use, try again */
  159. if (unlikely(!(drvdata->edprsr & EDPRSR_PU)))
  160. goto try_again;
  161. }
  162. static void debug_read_regs(struct debug_drvdata *drvdata)
  163. {
  164. u32 save_edprcr;
  165. CS_UNLOCK(drvdata->base);
  166. /* Unlock os lock */
  167. debug_os_unlock(drvdata);
  168. /* Save EDPRCR register */
  169. save_edprcr = readl_relaxed(drvdata->base + EDPRCR);
  170. /*
  171. * Ensure CPU power domain is enabled to let registers
  172. * are accessiable.
  173. */
  174. debug_force_cpu_powered_up(drvdata);
  175. if (!debug_access_permitted(drvdata))
  176. goto out;
  177. drvdata->edpcsr = readl_relaxed(drvdata->base + EDPCSR);
  178. /*
  179. * As described in ARM DDI 0487A.k, if the processing
  180. * element (PE) is in debug state, or sample-based
  181. * profiling is prohibited, EDPCSR reads as 0xFFFFFFFF;
  182. * EDCIDSR, EDVIDSR and EDPCSR_HI registers also become
  183. * UNKNOWN state. So directly bail out for this case.
  184. */
  185. if (drvdata->edpcsr == EDPCSR_PROHIBITED)
  186. goto out;
  187. /*
  188. * A read of the EDPCSR normally has the side-effect of
  189. * indirectly writing to EDCIDSR, EDVIDSR and EDPCSR_HI;
  190. * at this point it's safe to read value from them.
  191. */
  192. if (IS_ENABLED(CONFIG_64BIT))
  193. drvdata->edpcsr_hi = readl_relaxed(drvdata->base + EDPCSR_HI);
  194. if (drvdata->edcidsr_present)
  195. drvdata->edcidsr = readl_relaxed(drvdata->base + EDCIDSR);
  196. if (drvdata->edvidsr_present)
  197. drvdata->edvidsr = readl_relaxed(drvdata->base + EDVIDSR);
  198. out:
  199. /* Restore EDPRCR register */
  200. writel_relaxed(save_edprcr, drvdata->base + EDPRCR);
  201. CS_LOCK(drvdata->base);
  202. }
  203. #ifdef CONFIG_64BIT
  204. static unsigned long debug_adjust_pc(struct debug_drvdata *drvdata)
  205. {
  206. return (unsigned long)drvdata->edpcsr_hi << 32 |
  207. (unsigned long)drvdata->edpcsr;
  208. }
  209. #else
  210. static unsigned long debug_adjust_pc(struct debug_drvdata *drvdata)
  211. {
  212. unsigned long arm_inst_offset = 0, thumb_inst_offset = 0;
  213. unsigned long pc;
  214. pc = (unsigned long)drvdata->edpcsr;
  215. if (drvdata->pc_has_offset) {
  216. arm_inst_offset = 8;
  217. thumb_inst_offset = 4;
  218. }
  219. /* Handle thumb instruction */
  220. if (pc & EDPCSR_THUMB) {
  221. pc = (pc & EDPCSR_THUMB_INST_MASK) - thumb_inst_offset;
  222. return pc;
  223. }
  224. /*
  225. * Handle arm instruction offset, if the arm instruction
  226. * is not 4 byte alignment then it's possible the case
  227. * for implementation defined; keep original value for this
  228. * case and print info for notice.
  229. */
  230. if (pc & BIT(1))
  231. dev_emerg(drvdata->dev,
  232. "Instruction offset is implementation defined\n");
  233. else
  234. pc = (pc & EDPCSR_ARM_INST_MASK) - arm_inst_offset;
  235. return pc;
  236. }
  237. #endif
  238. static void debug_dump_regs(struct debug_drvdata *drvdata)
  239. {
  240. struct device *dev = drvdata->dev;
  241. unsigned long pc;
  242. dev_emerg(dev, " EDPRSR: %08x (Power:%s DLK:%s)\n",
  243. drvdata->edprsr,
  244. drvdata->edprsr & EDPRSR_PU ? "On" : "Off",
  245. drvdata->edprsr & EDPRSR_DLK ? "Lock" : "Unlock");
  246. if (!debug_access_permitted(drvdata)) {
  247. dev_emerg(dev, "No permission to access debug registers!\n");
  248. return;
  249. }
  250. if (drvdata->edpcsr == EDPCSR_PROHIBITED) {
  251. dev_emerg(dev, "CPU is in Debug state or profiling is prohibited!\n");
  252. return;
  253. }
  254. pc = debug_adjust_pc(drvdata);
  255. dev_emerg(dev, " EDPCSR: %pS\n", (void *)pc);
  256. if (drvdata->edcidsr_present)
  257. dev_emerg(dev, " EDCIDSR: %08x\n", drvdata->edcidsr);
  258. if (drvdata->edvidsr_present)
  259. dev_emerg(dev, " EDVIDSR: %08x (State:%s Mode:%s Width:%dbits VMID:%x)\n",
  260. drvdata->edvidsr,
  261. drvdata->edvidsr & EDVIDSR_NS ?
  262. "Non-secure" : "Secure",
  263. drvdata->edvidsr & EDVIDSR_E3 ? "EL3" :
  264. (drvdata->edvidsr & EDVIDSR_E2 ?
  265. "EL2" : "EL1/0"),
  266. drvdata->edvidsr & EDVIDSR_HV ? 64 : 32,
  267. drvdata->edvidsr & (u32)EDVIDSR_VMID);
  268. }
  269. static void debug_init_arch_data(void *info)
  270. {
  271. struct debug_drvdata *drvdata = info;
  272. u32 mode, pcsr_offset;
  273. u32 eddevid, eddevid1;
  274. CS_UNLOCK(drvdata->base);
  275. /* Read device info */
  276. eddevid = readl_relaxed(drvdata->base + EDDEVID);
  277. eddevid1 = readl_relaxed(drvdata->base + EDDEVID1);
  278. CS_LOCK(drvdata->base);
  279. /* Parse implementation feature */
  280. mode = eddevid & EDDEVID_PCSAMPLE_MODE;
  281. pcsr_offset = eddevid1 & EDDEVID1_PCSR_OFFSET_MASK;
  282. drvdata->edpcsr_present = false;
  283. drvdata->edcidsr_present = false;
  284. drvdata->edvidsr_present = false;
  285. drvdata->pc_has_offset = false;
  286. switch (mode) {
  287. case EDDEVID_IMPL_FULL:
  288. drvdata->edvidsr_present = true;
  289. /* Fall through */
  290. case EDDEVID_IMPL_EDPCSR_EDCIDSR:
  291. drvdata->edcidsr_present = true;
  292. /* Fall through */
  293. case EDDEVID_IMPL_EDPCSR:
  294. /*
  295. * In ARM DDI 0487A.k, the EDDEVID1.PCSROffset is used to
  296. * define if has the offset for PC sampling value; if read
  297. * back EDDEVID1.PCSROffset == 0x2, then this means the debug
  298. * module does not sample the instruction set state when
  299. * armv8 CPU in AArch32 state.
  300. */
  301. drvdata->edpcsr_present =
  302. ((IS_ENABLED(CONFIG_64BIT) && pcsr_offset != 0) ||
  303. (pcsr_offset != EDDEVID1_PCSR_NO_OFFSET_DIS_AARCH32));
  304. drvdata->pc_has_offset =
  305. (pcsr_offset == EDDEVID1_PCSR_OFFSET_INS_SET);
  306. break;
  307. default:
  308. break;
  309. }
  310. }
  311. /*
  312. * Dump out information on panic.
  313. */
  314. static int debug_notifier_call(struct notifier_block *self,
  315. unsigned long v, void *p)
  316. {
  317. int cpu;
  318. struct debug_drvdata *drvdata;
  319. mutex_lock(&debug_lock);
  320. /* Bail out if the functionality is disabled */
  321. if (!debug_enable)
  322. goto skip_dump;
  323. pr_emerg("ARM external debug module:\n");
  324. for_each_possible_cpu(cpu) {
  325. drvdata = per_cpu(debug_drvdata, cpu);
  326. if (!drvdata)
  327. continue;
  328. dev_emerg(drvdata->dev, "CPU[%d]:\n", drvdata->cpu);
  329. debug_read_regs(drvdata);
  330. debug_dump_regs(drvdata);
  331. }
  332. skip_dump:
  333. mutex_unlock(&debug_lock);
  334. return 0;
  335. }
  336. static struct notifier_block debug_notifier = {
  337. .notifier_call = debug_notifier_call,
  338. };
  339. static int debug_enable_func(void)
  340. {
  341. struct debug_drvdata *drvdata;
  342. int cpu, ret = 0;
  343. cpumask_t mask;
  344. /*
  345. * Use cpumask to track which debug power domains have
  346. * been powered on and use it to handle failure case.
  347. */
  348. cpumask_clear(&mask);
  349. for_each_possible_cpu(cpu) {
  350. drvdata = per_cpu(debug_drvdata, cpu);
  351. if (!drvdata)
  352. continue;
  353. ret = pm_runtime_get_sync(drvdata->dev);
  354. if (ret < 0)
  355. goto err;
  356. else
  357. cpumask_set_cpu(cpu, &mask);
  358. }
  359. return 0;
  360. err:
  361. /*
  362. * If pm_runtime_get_sync() has failed, need rollback on
  363. * all the other CPUs that have been enabled before that.
  364. */
  365. for_each_cpu(cpu, &mask) {
  366. drvdata = per_cpu(debug_drvdata, cpu);
  367. pm_runtime_put_noidle(drvdata->dev);
  368. }
  369. return ret;
  370. }
  371. static int debug_disable_func(void)
  372. {
  373. struct debug_drvdata *drvdata;
  374. int cpu, ret, err = 0;
  375. /*
  376. * Disable debug power domains, records the error and keep
  377. * circling through all other CPUs when an error has been
  378. * encountered.
  379. */
  380. for_each_possible_cpu(cpu) {
  381. drvdata = per_cpu(debug_drvdata, cpu);
  382. if (!drvdata)
  383. continue;
  384. ret = pm_runtime_put(drvdata->dev);
  385. if (ret < 0)
  386. err = ret;
  387. }
  388. return err;
  389. }
  390. static ssize_t debug_func_knob_write(struct file *f,
  391. const char __user *buf, size_t count, loff_t *ppos)
  392. {
  393. u8 val;
  394. int ret;
  395. ret = kstrtou8_from_user(buf, count, 2, &val);
  396. if (ret)
  397. return ret;
  398. mutex_lock(&debug_lock);
  399. if (val == debug_enable)
  400. goto out;
  401. if (val)
  402. ret = debug_enable_func();
  403. else
  404. ret = debug_disable_func();
  405. if (ret) {
  406. pr_err("%s: unable to %s debug function: %d\n",
  407. __func__, val ? "enable" : "disable", ret);
  408. goto err;
  409. }
  410. debug_enable = val;
  411. out:
  412. ret = count;
  413. err:
  414. mutex_unlock(&debug_lock);
  415. return ret;
  416. }
  417. static ssize_t debug_func_knob_read(struct file *f,
  418. char __user *ubuf, size_t count, loff_t *ppos)
  419. {
  420. ssize_t ret;
  421. char buf[3];
  422. mutex_lock(&debug_lock);
  423. snprintf(buf, sizeof(buf), "%d\n", debug_enable);
  424. mutex_unlock(&debug_lock);
  425. ret = simple_read_from_buffer(ubuf, count, ppos, buf, sizeof(buf));
  426. return ret;
  427. }
  428. static const struct file_operations debug_func_knob_fops = {
  429. .open = simple_open,
  430. .read = debug_func_knob_read,
  431. .write = debug_func_knob_write,
  432. };
  433. static int debug_func_init(void)
  434. {
  435. struct dentry *file;
  436. int ret;
  437. /* Create debugfs node */
  438. debug_debugfs_dir = debugfs_create_dir("coresight_cpu_debug", NULL);
  439. if (!debug_debugfs_dir) {
  440. pr_err("%s: unable to create debugfs directory\n", __func__);
  441. return -ENOMEM;
  442. }
  443. file = debugfs_create_file("enable", 0644, debug_debugfs_dir, NULL,
  444. &debug_func_knob_fops);
  445. if (!file) {
  446. pr_err("%s: unable to create enable knob file\n", __func__);
  447. ret = -ENOMEM;
  448. goto err;
  449. }
  450. /* Register function to be called for panic */
  451. ret = atomic_notifier_chain_register(&panic_notifier_list,
  452. &debug_notifier);
  453. if (ret) {
  454. pr_err("%s: unable to register notifier: %d\n",
  455. __func__, ret);
  456. goto err;
  457. }
  458. return 0;
  459. err:
  460. debugfs_remove_recursive(debug_debugfs_dir);
  461. return ret;
  462. }
  463. static void debug_func_exit(void)
  464. {
  465. atomic_notifier_chain_unregister(&panic_notifier_list,
  466. &debug_notifier);
  467. debugfs_remove_recursive(debug_debugfs_dir);
  468. }
  469. static int debug_probe(struct amba_device *adev, const struct amba_id *id)
  470. {
  471. void __iomem *base;
  472. struct device *dev = &adev->dev;
  473. struct debug_drvdata *drvdata;
  474. struct resource *res = &adev->res;
  475. struct device_node *np = adev->dev.of_node;
  476. int ret;
  477. drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL);
  478. if (!drvdata)
  479. return -ENOMEM;
  480. drvdata->cpu = np ? of_coresight_get_cpu(np) : 0;
  481. if (per_cpu(debug_drvdata, drvdata->cpu)) {
  482. dev_err(dev, "CPU%d drvdata has already been initialized\n",
  483. drvdata->cpu);
  484. return -EBUSY;
  485. }
  486. drvdata->dev = &adev->dev;
  487. amba_set_drvdata(adev, drvdata);
  488. /* Validity for the resource is already checked by the AMBA core */
  489. base = devm_ioremap_resource(dev, res);
  490. if (IS_ERR(base))
  491. return PTR_ERR(base);
  492. drvdata->base = base;
  493. get_online_cpus();
  494. per_cpu(debug_drvdata, drvdata->cpu) = drvdata;
  495. ret = smp_call_function_single(drvdata->cpu, debug_init_arch_data,
  496. drvdata, 1);
  497. put_online_cpus();
  498. if (ret) {
  499. dev_err(dev, "CPU%d debug arch init failed\n", drvdata->cpu);
  500. goto err;
  501. }
  502. if (!drvdata->edpcsr_present) {
  503. dev_err(dev, "CPU%d sample-based profiling isn't implemented\n",
  504. drvdata->cpu);
  505. ret = -ENXIO;
  506. goto err;
  507. }
  508. if (!debug_count++) {
  509. ret = debug_func_init();
  510. if (ret)
  511. goto err_func_init;
  512. }
  513. mutex_lock(&debug_lock);
  514. /* Turn off debug power domain if debugging is disabled */
  515. if (!debug_enable)
  516. pm_runtime_put(dev);
  517. mutex_unlock(&debug_lock);
  518. dev_info(dev, "Coresight debug-CPU%d initialized\n", drvdata->cpu);
  519. return 0;
  520. err_func_init:
  521. debug_count--;
  522. err:
  523. per_cpu(debug_drvdata, drvdata->cpu) = NULL;
  524. return ret;
  525. }
  526. static int debug_remove(struct amba_device *adev)
  527. {
  528. struct device *dev = &adev->dev;
  529. struct debug_drvdata *drvdata = amba_get_drvdata(adev);
  530. per_cpu(debug_drvdata, drvdata->cpu) = NULL;
  531. mutex_lock(&debug_lock);
  532. /* Turn off debug power domain before rmmod the module */
  533. if (debug_enable)
  534. pm_runtime_put(dev);
  535. mutex_unlock(&debug_lock);
  536. if (!--debug_count)
  537. debug_func_exit();
  538. return 0;
  539. }
  540. static const struct amba_id debug_ids[] = {
  541. { /* Debug for Cortex-A53 */
  542. .id = 0x000bbd03,
  543. .mask = 0x000fffff,
  544. },
  545. { /* Debug for Cortex-A57 */
  546. .id = 0x000bbd07,
  547. .mask = 0x000fffff,
  548. },
  549. { /* Debug for Cortex-A72 */
  550. .id = 0x000bbd08,
  551. .mask = 0x000fffff,
  552. },
  553. { /* Debug for Cortex-A73 */
  554. .id = 0x000bbd09,
  555. .mask = 0x000fffff,
  556. },
  557. { 0, 0 },
  558. };
  559. static struct amba_driver debug_driver = {
  560. .drv = {
  561. .name = "coresight-cpu-debug",
  562. .suppress_bind_attrs = true,
  563. },
  564. .probe = debug_probe,
  565. .remove = debug_remove,
  566. .id_table = debug_ids,
  567. };
  568. module_amba_driver(debug_driver);
  569. MODULE_AUTHOR("Leo Yan <leo.yan@linaro.org>");
  570. MODULE_DESCRIPTION("ARM Coresight CPU Debug Driver");
  571. MODULE_LICENSE("GPL");