cvp.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
  4. */
  5. #include <linux/debugfs.h>
  6. #include <linux/dma-mapping.h>
  7. #include <linux/init.h>
  8. #include <linux/ioctl.h>
  9. #include <linux/list.h>
  10. #include <linux/module.h>
  11. #include <linux/of_platform.h>
  12. #include <linux/platform_device.h>
  13. #include <linux/slab.h>
  14. #include <linux/types.h>
  15. #include <linux/version.h>
  16. #include <linux/io.h>
  17. #include "msm_cvp_core.h"
  18. #include "msm_cvp_common.h"
  19. #include "msm_cvp_debug.h"
  20. #include "msm_cvp_internal.h"
  21. #include "msm_cvp_res_parse.h"
  22. #include "msm_cvp_resources.h"
  23. #include "cvp_hfi_api.h"
  24. #include "cvp_private.h"
  25. #include "msm_cvp_clocks.h"
  26. #include "msm_cvp_dsp.h"
  27. #include "msm_cvp.h"
  28. #define CLASS_NAME "cvp"
  29. #define DRIVER_NAME "cvp"
  30. struct msm_cvp_drv *cvp_driver;
  31. static int cvp_open(struct inode *inode, struct file *filp)
  32. {
  33. struct msm_cvp_core *core = container_of(inode->i_cdev,
  34. struct msm_cvp_core, cdev);
  35. struct msm_cvp_inst *inst;
  36. dprintk(CVP_SESS, "%s: core->id: %d\n", __func__, core->id);
  37. inst = msm_cvp_open(core->id, MSM_CVP_USER);
  38. if (!inst) {
  39. dprintk(CVP_ERR, "Failed to create cvp instance\n");
  40. return -ENOMEM;
  41. }
  42. filp->private_data = inst;
  43. return 0;
  44. }
  45. static int cvp_close(struct inode *inode, struct file *filp)
  46. {
  47. int rc = 0;
  48. struct msm_cvp_inst *inst = filp->private_data;
  49. rc = msm_cvp_close(inst);
  50. filp->private_data = NULL;
  51. return rc;
  52. }
  53. static unsigned int cvp_poll(struct file *filp, struct poll_table_struct *p)
  54. {
  55. int rc = 0;
  56. struct msm_cvp_inst *inst = filp->private_data;
  57. unsigned long flags = 0;
  58. poll_wait(filp, &inst->event_handler.wq, p);
  59. spin_lock_irqsave(&inst->event_handler.lock, flags);
  60. if (inst->event_handler.event == CVP_SSR_EVENT)
  61. rc |= POLLPRI;
  62. spin_unlock_irqrestore(&inst->event_handler.lock, flags);
  63. return rc;
  64. }
  65. static const struct file_operations cvp_fops = {
  66. .owner = THIS_MODULE,
  67. .open = cvp_open,
  68. .release = cvp_close,
  69. .unlocked_ioctl = cvp_unblocked_ioctl,
  70. .compat_ioctl = cvp_compat_ioctl,
  71. .poll = cvp_poll,
  72. };
  73. static int read_platform_resources(struct msm_cvp_core *core,
  74. struct platform_device *pdev)
  75. {
  76. int rc = 0;
  77. if (!core || !pdev) {
  78. dprintk(CVP_ERR, "%s: Invalid params %pK %pK\n",
  79. __func__, core, pdev);
  80. return -EINVAL;
  81. }
  82. core->hfi_type = CVP_HFI_IRIS;
  83. core->resources.pdev = pdev;
  84. if (pdev->dev.of_node) {
  85. /* Target supports DT, parse from it */
  86. rc = cvp_read_platform_resources_from_drv_data(core);
  87. rc = cvp_read_platform_resources_from_dt(&core->resources);
  88. } else {
  89. dprintk(CVP_ERR, "pdev node is NULL\n");
  90. rc = -EINVAL;
  91. }
  92. return rc;
  93. }
  94. static void init_cycle_info(struct cvp_cycle_info *info)
  95. {
  96. memset(info->sum_fps, 0, HFI_MAX_HW_THREADS*sizeof(u32));
  97. memset(info->hi_ctrl_lim, 0, HFI_MAX_HW_THREADS*sizeof(u32));
  98. memset(info->lo_ctrl_lim, 0, HFI_MAX_HW_THREADS*sizeof(u32));
  99. memset(info->cycle, 0,
  100. HFI_MAX_HW_THREADS*sizeof(struct cvp_cycle_stat));
  101. info->conf_freq = 0;
  102. }
  103. static int msm_cvp_initialize_core(struct platform_device *pdev,
  104. struct msm_cvp_core *core)
  105. {
  106. int i = 0;
  107. int rc = 0;
  108. if (!core)
  109. return -EINVAL;
  110. rc = read_platform_resources(core, pdev);
  111. if (rc) {
  112. dprintk(CVP_ERR, "Failed to get platform resources\n");
  113. return rc;
  114. }
  115. INIT_LIST_HEAD(&core->instances);
  116. mutex_init(&core->lock);
  117. mutex_init(&core->clk_lock);
  118. core->state = CVP_CORE_UNINIT;
  119. for (i = SYS_MSG_INDEX(SYS_MSG_START);
  120. i <= SYS_MSG_INDEX(SYS_MSG_END); i++) {
  121. init_completion(&core->completions[i]);
  122. }
  123. INIT_DELAYED_WORK(&core->fw_unload_work, msm_cvp_fw_unload_handler);
  124. INIT_WORK(&core->ssr_work, msm_cvp_ssr_handler);
  125. init_cycle_info(&core->dyn_clk);
  126. return rc;
  127. }
  128. static ssize_t link_name_show(struct device *dev,
  129. struct device_attribute *attr,
  130. char *buf)
  131. {
  132. struct msm_cvp_core *core = dev_get_drvdata(dev);
  133. if (core)
  134. if (dev == core->dev)
  135. return snprintf(buf, PAGE_SIZE, "msm_cvp\n");
  136. else
  137. return 0;
  138. else
  139. return 0;
  140. }
  141. static DEVICE_ATTR_RO(link_name);
  142. static ssize_t pwr_collapse_delay_store(struct device *dev,
  143. struct device_attribute *attr,
  144. const char *buf, size_t count)
  145. {
  146. unsigned long val = 0;
  147. int rc = 0;
  148. struct msm_cvp_core *core = NULL;
  149. rc = kstrtoul(buf, 0, &val);
  150. if (rc)
  151. return rc;
  152. else if (!val)
  153. return -EINVAL;
  154. core = get_cvp_core(MSM_CORE_CVP);
  155. if (!core)
  156. return -EINVAL;
  157. core->resources.msm_cvp_pwr_collapse_delay = val;
  158. return count;
  159. }
  160. static ssize_t pwr_collapse_delay_show(struct device *dev,
  161. struct device_attribute *attr,
  162. char *buf)
  163. {
  164. struct msm_cvp_core *core = NULL;
  165. core = get_cvp_core(MSM_CORE_CVP);
  166. if (!core)
  167. return -EINVAL;
  168. return snprintf(buf, PAGE_SIZE, "%u\n",
  169. core->resources.msm_cvp_pwr_collapse_delay);
  170. }
  171. static DEVICE_ATTR_RW(pwr_collapse_delay);
  172. static ssize_t thermal_level_show(struct device *dev,
  173. struct device_attribute *attr,
  174. char *buf)
  175. {
  176. return snprintf(buf, PAGE_SIZE, "%d\n", cvp_driver->thermal_level);
  177. }
  178. static ssize_t thermal_level_store(struct device *dev,
  179. struct device_attribute *attr,
  180. const char *buf, size_t count)
  181. {
  182. int rc = 0, val = 0;
  183. rc = kstrtoint(buf, 0, &val);
  184. if (rc || val < 0) {
  185. dprintk(CVP_WARN,
  186. "Invalid thermal level value: %s\n", buf);
  187. return -EINVAL;
  188. }
  189. dprintk(CVP_PWR, "Thermal level old %d new %d\n",
  190. cvp_driver->thermal_level, val);
  191. if (val == cvp_driver->thermal_level)
  192. return count;
  193. cvp_driver->thermal_level = val;
  194. msm_cvp_comm_handle_thermal_event();
  195. return count;
  196. }
  197. static DEVICE_ATTR_RW(thermal_level);
  198. static ssize_t sku_version_show(struct device *dev,
  199. struct device_attribute *attr, char *buf)
  200. {
  201. return scnprintf(buf, PAGE_SIZE, "%d",
  202. cvp_driver->sku_version);
  203. }
  204. static DEVICE_ATTR_RO(sku_version);
  205. static ssize_t boot_store(struct device *dev,
  206. struct device_attribute *attr,
  207. const char *buf, size_t count)
  208. {
  209. int rc = 0, val = 0;
  210. static int booted;
  211. rc = kstrtoint(buf, 0, &val);
  212. if (rc || val < 0) {
  213. dprintk(CVP_WARN,
  214. "Invalid boot value: %s\n", buf);
  215. return -EINVAL;
  216. }
  217. if (val > 0 && booted == 0) {
  218. struct msm_cvp_inst *inst;
  219. inst = msm_cvp_open(MSM_CORE_CVP, MSM_CVP_BOOT);
  220. if (!inst) {
  221. dprintk(CVP_ERR,
  222. "Failed to create cvp instance\n");
  223. return -ENOMEM;
  224. }
  225. rc = msm_cvp_close(inst);
  226. if (rc) {
  227. dprintk(CVP_ERR,
  228. "Failed to close cvp instance\n");
  229. return rc;
  230. }
  231. } else if ((val == 2) && booted) {
  232. struct msm_cvp_inst *inst;
  233. inst = msm_cvp_open(MSM_CORE_CVP, MSM_CVP_USER);
  234. if (!inst) {
  235. dprintk(CVP_ERR,
  236. "Failed to create eva instance\n");
  237. return -ENOMEM;
  238. }
  239. rc = msm_cvp_session_create(inst);
  240. if (rc)
  241. dprintk(CVP_ERR, "Failed to create eva session\n");
  242. rc = msm_cvp_close(inst);
  243. if (rc) {
  244. dprintk(CVP_ERR,
  245. "Failed to close eva instance\n");
  246. return rc;
  247. }
  248. }
  249. booted = 1;
  250. return count;
  251. }
  252. static DEVICE_ATTR_WO(boot);
  253. static struct attribute *msm_cvp_core_attrs[] = {
  254. &dev_attr_pwr_collapse_delay.attr,
  255. &dev_attr_thermal_level.attr,
  256. &dev_attr_sku_version.attr,
  257. &dev_attr_link_name.attr,
  258. &dev_attr_boot.attr,
  259. NULL
  260. };
  261. static struct attribute_group msm_cvp_core_attr_group = {
  262. .attrs = msm_cvp_core_attrs,
  263. };
  264. static const struct of_device_id msm_cvp_plat_match[] = {
  265. {.compatible = "qcom,msm-cvp"},
  266. {.compatible = "qcom,msm-cvp,context-bank"},
  267. {.compatible = "qcom,msm-cvp,bus"},
  268. {.compatible = "qcom,msm-cvp,mem-cdsp"},
  269. {}
  270. };
  271. static int msm_probe_cvp_device(struct platform_device *pdev)
  272. {
  273. int rc = 0;
  274. struct msm_cvp_core *core;
  275. if (!cvp_driver) {
  276. dprintk(CVP_ERR, "Invalid cvp driver\n");
  277. return -EINVAL;
  278. }
  279. core = kzalloc(sizeof(*core), GFP_KERNEL);
  280. if (!core)
  281. return -ENOMEM;
  282. core->platform_data = cvp_get_drv_data(&pdev->dev);
  283. dev_set_drvdata(&pdev->dev, core);
  284. rc = msm_cvp_initialize_core(pdev, core);
  285. if (rc) {
  286. dprintk(CVP_ERR, "Failed to init core\n");
  287. goto err_core_init;
  288. }
  289. core->id = MSM_CORE_CVP;
  290. rc = alloc_chrdev_region(&core->dev_num, 0, 1, DRIVER_NAME);
  291. if (rc < 0) {
  292. dprintk(CVP_ERR, "alloc_chrdev_region failed: %d\n",
  293. rc);
  294. goto err_alloc_chrdev;
  295. }
  296. core->class = class_create(THIS_MODULE, CLASS_NAME);
  297. if (IS_ERR(core->class)) {
  298. rc = PTR_ERR(core->class);
  299. dprintk(CVP_ERR, "class_create failed: %d\n",
  300. rc);
  301. goto err_class_create;
  302. }
  303. core->dev = device_create(core->class, NULL,
  304. core->dev_num, NULL, DRIVER_NAME);
  305. if (IS_ERR(core->dev)) {
  306. rc = PTR_ERR(core->dev);
  307. dprintk(CVP_ERR, "device_create failed: %d\n",
  308. rc);
  309. goto err_device_create;
  310. }
  311. dev_set_drvdata(core->dev, core);
  312. cdev_init(&core->cdev, &cvp_fops);
  313. rc = cdev_add(&core->cdev,
  314. MKDEV(MAJOR(core->dev_num), 0), 1);
  315. if (rc < 0) {
  316. dprintk(CVP_ERR, "cdev_add failed: %d\n",
  317. rc);
  318. goto error_cdev_add;
  319. }
  320. /* finish setting up the 'core' */
  321. mutex_lock(&cvp_driver->lock);
  322. if (cvp_driver->num_cores + 1 > MSM_CVP_CORES_MAX) {
  323. mutex_unlock(&cvp_driver->lock);
  324. dprintk(CVP_ERR, "Maximum cores already exist, core_no = %d\n",
  325. cvp_driver->num_cores);
  326. goto err_cores_exceeded;
  327. }
  328. cvp_driver->num_cores++;
  329. mutex_unlock(&cvp_driver->lock);
  330. rc = sysfs_create_group(&core->dev->kobj, &msm_cvp_core_attr_group);
  331. if (rc) {
  332. dprintk(CVP_ERR,
  333. "Failed to create attributes\n");
  334. goto err_cores_exceeded;
  335. }
  336. core->device = cvp_hfi_initialize(core->hfi_type, core->id,
  337. &core->resources, &cvp_handle_cmd_response);
  338. if (IS_ERR_OR_NULL(core->device)) {
  339. mutex_lock(&cvp_driver->lock);
  340. cvp_driver->num_cores--;
  341. mutex_unlock(&cvp_driver->lock);
  342. rc = PTR_ERR(core->device) ?: -EBADHANDLE;
  343. if (rc != -EPROBE_DEFER)
  344. dprintk(CVP_ERR, "Failed to create HFI device\n");
  345. else
  346. dprintk(CVP_CORE, "msm_cvp: request probe defer\n");
  347. goto err_hfi_initialize;
  348. }
  349. mutex_lock(&cvp_driver->lock);
  350. list_add_tail(&core->list, &cvp_driver->cores);
  351. mutex_unlock(&cvp_driver->lock);
  352. core->debugfs_root = msm_cvp_debugfs_init_core(
  353. core, cvp_driver->debugfs_root);
  354. cvp_driver->sku_version = core->resources.sku_version;
  355. dprintk(CVP_CORE, "populating sub devices\n");
  356. /*
  357. * Trigger probe for each sub-device i.e. qcom,msm-cvp,context-bank.
  358. * When msm_cvp_probe is called for each sub-device, parse the
  359. * context-bank details and store it in core->resources.context_banks
  360. * list.
  361. */
  362. rc = of_platform_populate(pdev->dev.of_node, msm_cvp_plat_match, NULL,
  363. &pdev->dev);
  364. if (rc) {
  365. dprintk(CVP_ERR, "Failed to trigger probe for sub-devices\n");
  366. goto err_fail_sub_device_probe;
  367. }
  368. atomic64_set(&core->kernel_trans_id, 0);
  369. if (core->resources.dsp_enabled) {
  370. rc = cvp_dsp_device_init();
  371. if (rc)
  372. dprintk(CVP_WARN, "Failed to initialize DSP driver\n");
  373. } else {
  374. dprintk(CVP_DSP, "DSP interface not enabled\n");
  375. }
  376. return rc;
  377. err_fail_sub_device_probe:
  378. cvp_hfi_deinitialize(core->hfi_type, core->device);
  379. err_hfi_initialize:
  380. err_cores_exceeded:
  381. cdev_del(&core->cdev);
  382. error_cdev_add:
  383. device_destroy(core->class, core->dev_num);
  384. err_device_create:
  385. class_destroy(core->class);
  386. err_class_create:
  387. unregister_chrdev_region(core->dev_num, 1);
  388. err_alloc_chrdev:
  389. sysfs_remove_group(&pdev->dev.kobj, &msm_cvp_core_attr_group);
  390. err_core_init:
  391. dev_set_drvdata(&pdev->dev, NULL);
  392. kfree(core);
  393. return rc;
  394. }
  395. static int msm_cvp_probe_mem_cdsp(struct platform_device *pdev)
  396. {
  397. return cvp_read_mem_cdsp_resources_from_dt(pdev);
  398. }
  399. static int msm_cvp_probe_context_bank(struct platform_device *pdev)
  400. {
  401. return cvp_read_context_bank_resources_from_dt(pdev);
  402. }
  403. static int msm_cvp_probe_bus(struct platform_device *pdev)
  404. {
  405. return cvp_read_bus_resources_from_dt(pdev);
  406. }
  407. static int msm_cvp_probe(struct platform_device *pdev)
  408. {
  409. /*
  410. * Sub devices probe will be triggered by of_platform_populate() towards
  411. * the end of the probe function after msm-cvp device probe is
  412. * completed. Return immediately after completing sub-device probe.
  413. */
  414. if (of_device_is_compatible(pdev->dev.of_node, "qcom,msm-cvp")) {
  415. return msm_probe_cvp_device(pdev);
  416. } else if (of_device_is_compatible(pdev->dev.of_node,
  417. "qcom,msm-cvp,bus")) {
  418. return msm_cvp_probe_bus(pdev);
  419. } else if (of_device_is_compatible(pdev->dev.of_node,
  420. "qcom,msm-cvp,context-bank")) {
  421. return msm_cvp_probe_context_bank(pdev);
  422. } else if (of_device_is_compatible(pdev->dev.of_node,
  423. "qcom,msm-cvp,mem-cdsp")) {
  424. return msm_cvp_probe_mem_cdsp(pdev);
  425. }
  426. /* How did we end up here? */
  427. MSM_CVP_ERROR(1);
  428. return -EINVAL;
  429. }
  430. static int msm_cvp_remove(struct platform_device *pdev)
  431. {
  432. int rc = 0;
  433. struct msm_cvp_core *core;
  434. if (!pdev) {
  435. dprintk(CVP_ERR, "%s invalid input %pK", __func__, pdev);
  436. return -EINVAL;
  437. }
  438. core = dev_get_drvdata(&pdev->dev);
  439. if (!core) {
  440. dprintk(CVP_ERR, "%s invalid core", __func__);
  441. return -EINVAL;
  442. }
  443. cvp_hfi_deinitialize(core->hfi_type, core->device);
  444. msm_cvp_free_platform_resources(&core->resources);
  445. sysfs_remove_group(&pdev->dev.kobj, &msm_cvp_core_attr_group);
  446. dev_set_drvdata(&pdev->dev, NULL);
  447. mutex_destroy(&core->lock);
  448. mutex_destroy(&core->clk_lock);
  449. kfree(core);
  450. return rc;
  451. }
  452. static int msm_cvp_pm_suspend(struct device *dev)
  453. {
  454. int rc = 0;
  455. struct msm_cvp_core *core;
  456. /*
  457. * Bail out if
  458. * - driver possibly not probed yet
  459. * - not the main device. We don't support power management on
  460. * subdevices (e.g. context banks)
  461. */
  462. if (!dev || !dev->driver ||
  463. !of_device_is_compatible(dev->of_node, "qcom,msm-cvp"))
  464. return 0;
  465. core = dev_get_drvdata(dev);
  466. if (!core) {
  467. dprintk(CVP_ERR, "%s invalid core\n", __func__);
  468. return -EINVAL;
  469. }
  470. rc = msm_cvp_suspend(core->id);
  471. if (rc == -ENOTSUPP)
  472. rc = 0;
  473. else if (rc)
  474. dprintk(CVP_WARN, "Failed to suspend: %d\n", rc);
  475. return rc;
  476. }
  477. static int msm_cvp_pm_resume(struct device *dev)
  478. {
  479. dprintk(CVP_INFO, "%s\n", __func__);
  480. return 0;
  481. }
  482. static const struct dev_pm_ops msm_cvp_pm_ops = {
  483. SET_SYSTEM_SLEEP_PM_OPS(msm_cvp_pm_suspend, msm_cvp_pm_resume)
  484. };
  485. MODULE_DEVICE_TABLE(of, msm_cvp_plat_match);
  486. static struct platform_driver msm_cvp_driver = {
  487. .probe = msm_cvp_probe,
  488. .remove = msm_cvp_remove,
  489. .driver = {
  490. .name = "msm_cvp",
  491. .of_match_table = msm_cvp_plat_match,
  492. .pm = &msm_cvp_pm_ops,
  493. },
  494. };
  495. static int __init msm_cvp_init(void)
  496. {
  497. int rc = 0;
  498. cvp_driver = kzalloc(sizeof(*cvp_driver), GFP_KERNEL);
  499. if (!cvp_driver) {
  500. dprintk(CVP_ERR,
  501. "Failed to allocate memroy for msm_cvp_drv\n");
  502. return -ENOMEM;
  503. }
  504. INIT_LIST_HEAD(&cvp_driver->cores);
  505. mutex_init(&cvp_driver->lock);
  506. cvp_driver->debugfs_root = msm_cvp_debugfs_init_drv();
  507. if (!cvp_driver->debugfs_root)
  508. dprintk(CVP_ERR,
  509. "Failed to create debugfs for msm_cvp\n");
  510. rc = platform_driver_register(&msm_cvp_driver);
  511. if (rc) {
  512. dprintk(CVP_ERR,
  513. "Failed to register platform driver\n");
  514. debugfs_remove_recursive(cvp_driver->debugfs_root);
  515. kfree(cvp_driver);
  516. cvp_driver = NULL;
  517. return rc;
  518. }
  519. cvp_driver->msg_cache = KMEM_CACHE(cvp_session_msg, 0);
  520. cvp_driver->frame_cache = KMEM_CACHE(msm_cvp_frame, 0);
  521. cvp_driver->buf_cache = KMEM_CACHE(cvp_internal_buf, 0);
  522. cvp_driver->smem_cache = KMEM_CACHE(msm_cvp_smem, 0);
  523. return rc;
  524. }
  525. static void __exit msm_cvp_exit(void)
  526. {
  527. cvp_dsp_device_exit();
  528. kmem_cache_destroy(cvp_driver->msg_cache);
  529. kmem_cache_destroy(cvp_driver->frame_cache);
  530. kmem_cache_destroy(cvp_driver->buf_cache);
  531. kmem_cache_destroy(cvp_driver->smem_cache);
  532. platform_driver_unregister(&msm_cvp_driver);
  533. debugfs_remove_recursive(cvp_driver->debugfs_root);
  534. mutex_destroy(&cvp_driver->lock);
  535. kfree(cvp_driver);
  536. cvp_driver = NULL;
  537. }
  538. module_init(msm_cvp_init);
  539. module_exit(msm_cvp_exit);
  540. MODULE_LICENSE("GPL v2");