sh_tmu.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * SuperH Timer Support - TMU
  4. *
  5. * Copyright (C) 2009 Magnus Damm
  6. */
  7. #include <linux/clk.h>
  8. #include <linux/clockchips.h>
  9. #include <linux/clocksource.h>
  10. #include <linux/delay.h>
  11. #include <linux/err.h>
  12. #include <linux/init.h>
  13. #include <linux/interrupt.h>
  14. #include <linux/io.h>
  15. #include <linux/ioport.h>
  16. #include <linux/irq.h>
  17. #include <linux/module.h>
  18. #include <linux/of.h>
  19. #include <linux/platform_device.h>
  20. #include <linux/pm_domain.h>
  21. #include <linux/pm_runtime.h>
  22. #include <linux/sh_timer.h>
  23. #include <linux/slab.h>
  24. #include <linux/spinlock.h>
  25. enum sh_tmu_model {
  26. SH_TMU,
  27. SH_TMU_SH3,
  28. };
  29. struct sh_tmu_device;
  30. struct sh_tmu_channel {
  31. struct sh_tmu_device *tmu;
  32. unsigned int index;
  33. void __iomem *base;
  34. int irq;
  35. unsigned long periodic;
  36. struct clock_event_device ced;
  37. struct clocksource cs;
  38. bool cs_enabled;
  39. unsigned int enable_count;
  40. };
  41. struct sh_tmu_device {
  42. struct platform_device *pdev;
  43. void __iomem *mapbase;
  44. struct clk *clk;
  45. unsigned long rate;
  46. enum sh_tmu_model model;
  47. raw_spinlock_t lock; /* Protect the shared start/stop register */
  48. struct sh_tmu_channel *channels;
  49. unsigned int num_channels;
  50. bool has_clockevent;
  51. bool has_clocksource;
  52. };
  53. #define TSTR -1 /* shared register */
  54. #define TCOR 0 /* channel register */
  55. #define TCNT 1 /* channel register */
  56. #define TCR 2 /* channel register */
  57. #define TCR_UNF (1 << 8)
  58. #define TCR_UNIE (1 << 5)
  59. #define TCR_TPSC_CLK4 (0 << 0)
  60. #define TCR_TPSC_CLK16 (1 << 0)
  61. #define TCR_TPSC_CLK64 (2 << 0)
  62. #define TCR_TPSC_CLK256 (3 << 0)
  63. #define TCR_TPSC_CLK1024 (4 << 0)
  64. #define TCR_TPSC_MASK (7 << 0)
  65. static inline unsigned long sh_tmu_read(struct sh_tmu_channel *ch, int reg_nr)
  66. {
  67. unsigned long offs;
  68. if (reg_nr == TSTR) {
  69. switch (ch->tmu->model) {
  70. case SH_TMU_SH3:
  71. return ioread8(ch->tmu->mapbase + 2);
  72. case SH_TMU:
  73. return ioread8(ch->tmu->mapbase + 4);
  74. }
  75. }
  76. offs = reg_nr << 2;
  77. if (reg_nr == TCR)
  78. return ioread16(ch->base + offs);
  79. else
  80. return ioread32(ch->base + offs);
  81. }
  82. static inline void sh_tmu_write(struct sh_tmu_channel *ch, int reg_nr,
  83. unsigned long value)
  84. {
  85. unsigned long offs;
  86. if (reg_nr == TSTR) {
  87. switch (ch->tmu->model) {
  88. case SH_TMU_SH3:
  89. return iowrite8(value, ch->tmu->mapbase + 2);
  90. case SH_TMU:
  91. return iowrite8(value, ch->tmu->mapbase + 4);
  92. }
  93. }
  94. offs = reg_nr << 2;
  95. if (reg_nr == TCR)
  96. iowrite16(value, ch->base + offs);
  97. else
  98. iowrite32(value, ch->base + offs);
  99. }
  100. static void sh_tmu_start_stop_ch(struct sh_tmu_channel *ch, int start)
  101. {
  102. unsigned long flags, value;
  103. /* start stop register shared by multiple timer channels */
  104. raw_spin_lock_irqsave(&ch->tmu->lock, flags);
  105. value = sh_tmu_read(ch, TSTR);
  106. if (start)
  107. value |= 1 << ch->index;
  108. else
  109. value &= ~(1 << ch->index);
  110. sh_tmu_write(ch, TSTR, value);
  111. raw_spin_unlock_irqrestore(&ch->tmu->lock, flags);
  112. }
  113. static int __sh_tmu_enable(struct sh_tmu_channel *ch)
  114. {
  115. int ret;
  116. /* enable clock */
  117. ret = clk_enable(ch->tmu->clk);
  118. if (ret) {
  119. dev_err(&ch->tmu->pdev->dev, "ch%u: cannot enable clock\n",
  120. ch->index);
  121. return ret;
  122. }
  123. /* make sure channel is disabled */
  124. sh_tmu_start_stop_ch(ch, 0);
  125. /* maximum timeout */
  126. sh_tmu_write(ch, TCOR, 0xffffffff);
  127. sh_tmu_write(ch, TCNT, 0xffffffff);
  128. /* configure channel to parent clock / 4, irq off */
  129. sh_tmu_write(ch, TCR, TCR_TPSC_CLK4);
  130. /* enable channel */
  131. sh_tmu_start_stop_ch(ch, 1);
  132. return 0;
  133. }
  134. static int sh_tmu_enable(struct sh_tmu_channel *ch)
  135. {
  136. if (ch->enable_count++ > 0)
  137. return 0;
  138. pm_runtime_get_sync(&ch->tmu->pdev->dev);
  139. dev_pm_syscore_device(&ch->tmu->pdev->dev, true);
  140. return __sh_tmu_enable(ch);
  141. }
  142. static void __sh_tmu_disable(struct sh_tmu_channel *ch)
  143. {
  144. /* disable channel */
  145. sh_tmu_start_stop_ch(ch, 0);
  146. /* disable interrupts in TMU block */
  147. sh_tmu_write(ch, TCR, TCR_TPSC_CLK4);
  148. /* stop clock */
  149. clk_disable(ch->tmu->clk);
  150. }
  151. static void sh_tmu_disable(struct sh_tmu_channel *ch)
  152. {
  153. if (WARN_ON(ch->enable_count == 0))
  154. return;
  155. if (--ch->enable_count > 0)
  156. return;
  157. __sh_tmu_disable(ch);
  158. dev_pm_syscore_device(&ch->tmu->pdev->dev, false);
  159. pm_runtime_put(&ch->tmu->pdev->dev);
  160. }
  161. static void sh_tmu_set_next(struct sh_tmu_channel *ch, unsigned long delta,
  162. int periodic)
  163. {
  164. /* stop timer */
  165. sh_tmu_start_stop_ch(ch, 0);
  166. /* acknowledge interrupt */
  167. sh_tmu_read(ch, TCR);
  168. /* enable interrupt */
  169. sh_tmu_write(ch, TCR, TCR_UNIE | TCR_TPSC_CLK4);
  170. /* reload delta value in case of periodic timer */
  171. if (periodic)
  172. sh_tmu_write(ch, TCOR, delta);
  173. else
  174. sh_tmu_write(ch, TCOR, 0xffffffff);
  175. sh_tmu_write(ch, TCNT, delta);
  176. /* start timer */
  177. sh_tmu_start_stop_ch(ch, 1);
  178. }
  179. static irqreturn_t sh_tmu_interrupt(int irq, void *dev_id)
  180. {
  181. struct sh_tmu_channel *ch = dev_id;
  182. /* disable or acknowledge interrupt */
  183. if (clockevent_state_oneshot(&ch->ced))
  184. sh_tmu_write(ch, TCR, TCR_TPSC_CLK4);
  185. else
  186. sh_tmu_write(ch, TCR, TCR_UNIE | TCR_TPSC_CLK4);
  187. /* notify clockevent layer */
  188. ch->ced.event_handler(&ch->ced);
  189. return IRQ_HANDLED;
  190. }
  191. static struct sh_tmu_channel *cs_to_sh_tmu(struct clocksource *cs)
  192. {
  193. return container_of(cs, struct sh_tmu_channel, cs);
  194. }
  195. static u64 sh_tmu_clocksource_read(struct clocksource *cs)
  196. {
  197. struct sh_tmu_channel *ch = cs_to_sh_tmu(cs);
  198. return sh_tmu_read(ch, TCNT) ^ 0xffffffff;
  199. }
  200. static int sh_tmu_clocksource_enable(struct clocksource *cs)
  201. {
  202. struct sh_tmu_channel *ch = cs_to_sh_tmu(cs);
  203. int ret;
  204. if (WARN_ON(ch->cs_enabled))
  205. return 0;
  206. ret = sh_tmu_enable(ch);
  207. if (!ret)
  208. ch->cs_enabled = true;
  209. return ret;
  210. }
  211. static void sh_tmu_clocksource_disable(struct clocksource *cs)
  212. {
  213. struct sh_tmu_channel *ch = cs_to_sh_tmu(cs);
  214. if (WARN_ON(!ch->cs_enabled))
  215. return;
  216. sh_tmu_disable(ch);
  217. ch->cs_enabled = false;
  218. }
  219. static void sh_tmu_clocksource_suspend(struct clocksource *cs)
  220. {
  221. struct sh_tmu_channel *ch = cs_to_sh_tmu(cs);
  222. if (!ch->cs_enabled)
  223. return;
  224. if (--ch->enable_count == 0) {
  225. __sh_tmu_disable(ch);
  226. pm_genpd_syscore_poweroff(&ch->tmu->pdev->dev);
  227. }
  228. }
  229. static void sh_tmu_clocksource_resume(struct clocksource *cs)
  230. {
  231. struct sh_tmu_channel *ch = cs_to_sh_tmu(cs);
  232. if (!ch->cs_enabled)
  233. return;
  234. if (ch->enable_count++ == 0) {
  235. pm_genpd_syscore_poweron(&ch->tmu->pdev->dev);
  236. __sh_tmu_enable(ch);
  237. }
  238. }
  239. static int sh_tmu_register_clocksource(struct sh_tmu_channel *ch,
  240. const char *name)
  241. {
  242. struct clocksource *cs = &ch->cs;
  243. cs->name = name;
  244. cs->rating = 200;
  245. cs->read = sh_tmu_clocksource_read;
  246. cs->enable = sh_tmu_clocksource_enable;
  247. cs->disable = sh_tmu_clocksource_disable;
  248. cs->suspend = sh_tmu_clocksource_suspend;
  249. cs->resume = sh_tmu_clocksource_resume;
  250. cs->mask = CLOCKSOURCE_MASK(32);
  251. cs->flags = CLOCK_SOURCE_IS_CONTINUOUS;
  252. dev_info(&ch->tmu->pdev->dev, "ch%u: used as clock source\n",
  253. ch->index);
  254. clocksource_register_hz(cs, ch->tmu->rate);
  255. return 0;
  256. }
  257. static struct sh_tmu_channel *ced_to_sh_tmu(struct clock_event_device *ced)
  258. {
  259. return container_of(ced, struct sh_tmu_channel, ced);
  260. }
  261. static void sh_tmu_clock_event_start(struct sh_tmu_channel *ch, int periodic)
  262. {
  263. sh_tmu_enable(ch);
  264. if (periodic) {
  265. ch->periodic = (ch->tmu->rate + HZ/2) / HZ;
  266. sh_tmu_set_next(ch, ch->periodic, 1);
  267. }
  268. }
  269. static int sh_tmu_clock_event_shutdown(struct clock_event_device *ced)
  270. {
  271. struct sh_tmu_channel *ch = ced_to_sh_tmu(ced);
  272. if (clockevent_state_oneshot(ced) || clockevent_state_periodic(ced))
  273. sh_tmu_disable(ch);
  274. return 0;
  275. }
  276. static int sh_tmu_clock_event_set_state(struct clock_event_device *ced,
  277. int periodic)
  278. {
  279. struct sh_tmu_channel *ch = ced_to_sh_tmu(ced);
  280. /* deal with old setting first */
  281. if (clockevent_state_oneshot(ced) || clockevent_state_periodic(ced))
  282. sh_tmu_disable(ch);
  283. dev_info(&ch->tmu->pdev->dev, "ch%u: used for %s clock events\n",
  284. ch->index, periodic ? "periodic" : "oneshot");
  285. sh_tmu_clock_event_start(ch, periodic);
  286. return 0;
  287. }
  288. static int sh_tmu_clock_event_set_oneshot(struct clock_event_device *ced)
  289. {
  290. return sh_tmu_clock_event_set_state(ced, 0);
  291. }
  292. static int sh_tmu_clock_event_set_periodic(struct clock_event_device *ced)
  293. {
  294. return sh_tmu_clock_event_set_state(ced, 1);
  295. }
  296. static int sh_tmu_clock_event_next(unsigned long delta,
  297. struct clock_event_device *ced)
  298. {
  299. struct sh_tmu_channel *ch = ced_to_sh_tmu(ced);
  300. BUG_ON(!clockevent_state_oneshot(ced));
  301. /* program new delta value */
  302. sh_tmu_set_next(ch, delta, 0);
  303. return 0;
  304. }
  305. static void sh_tmu_clock_event_suspend(struct clock_event_device *ced)
  306. {
  307. pm_genpd_syscore_poweroff(&ced_to_sh_tmu(ced)->tmu->pdev->dev);
  308. }
  309. static void sh_tmu_clock_event_resume(struct clock_event_device *ced)
  310. {
  311. pm_genpd_syscore_poweron(&ced_to_sh_tmu(ced)->tmu->pdev->dev);
  312. }
  313. static void sh_tmu_register_clockevent(struct sh_tmu_channel *ch,
  314. const char *name)
  315. {
  316. struct clock_event_device *ced = &ch->ced;
  317. int ret;
  318. ced->name = name;
  319. ced->features = CLOCK_EVT_FEAT_PERIODIC;
  320. ced->features |= CLOCK_EVT_FEAT_ONESHOT;
  321. ced->rating = 200;
  322. ced->cpumask = cpu_possible_mask;
  323. ced->set_next_event = sh_tmu_clock_event_next;
  324. ced->set_state_shutdown = sh_tmu_clock_event_shutdown;
  325. ced->set_state_periodic = sh_tmu_clock_event_set_periodic;
  326. ced->set_state_oneshot = sh_tmu_clock_event_set_oneshot;
  327. ced->suspend = sh_tmu_clock_event_suspend;
  328. ced->resume = sh_tmu_clock_event_resume;
  329. dev_info(&ch->tmu->pdev->dev, "ch%u: used for clock events\n",
  330. ch->index);
  331. clockevents_config_and_register(ced, ch->tmu->rate, 0x300, 0xffffffff);
  332. ret = request_irq(ch->irq, sh_tmu_interrupt,
  333. IRQF_TIMER | IRQF_IRQPOLL | IRQF_NOBALANCING,
  334. dev_name(&ch->tmu->pdev->dev), ch);
  335. if (ret) {
  336. dev_err(&ch->tmu->pdev->dev, "ch%u: failed to request irq %d\n",
  337. ch->index, ch->irq);
  338. return;
  339. }
  340. }
  341. static int sh_tmu_register(struct sh_tmu_channel *ch, const char *name,
  342. bool clockevent, bool clocksource)
  343. {
  344. if (clockevent) {
  345. ch->tmu->has_clockevent = true;
  346. sh_tmu_register_clockevent(ch, name);
  347. } else if (clocksource) {
  348. ch->tmu->has_clocksource = true;
  349. sh_tmu_register_clocksource(ch, name);
  350. }
  351. return 0;
  352. }
  353. static int sh_tmu_channel_setup(struct sh_tmu_channel *ch, unsigned int index,
  354. bool clockevent, bool clocksource,
  355. struct sh_tmu_device *tmu)
  356. {
  357. /* Skip unused channels. */
  358. if (!clockevent && !clocksource)
  359. return 0;
  360. ch->tmu = tmu;
  361. ch->index = index;
  362. if (tmu->model == SH_TMU_SH3)
  363. ch->base = tmu->mapbase + 4 + ch->index * 12;
  364. else
  365. ch->base = tmu->mapbase + 8 + ch->index * 12;
  366. ch->irq = platform_get_irq(tmu->pdev, index);
  367. if (ch->irq < 0) {
  368. dev_err(&tmu->pdev->dev, "ch%u: failed to get irq\n",
  369. ch->index);
  370. return ch->irq;
  371. }
  372. ch->cs_enabled = false;
  373. ch->enable_count = 0;
  374. return sh_tmu_register(ch, dev_name(&tmu->pdev->dev),
  375. clockevent, clocksource);
  376. }
  377. static int sh_tmu_map_memory(struct sh_tmu_device *tmu)
  378. {
  379. struct resource *res;
  380. res = platform_get_resource(tmu->pdev, IORESOURCE_MEM, 0);
  381. if (!res) {
  382. dev_err(&tmu->pdev->dev, "failed to get I/O memory\n");
  383. return -ENXIO;
  384. }
  385. tmu->mapbase = ioremap_nocache(res->start, resource_size(res));
  386. if (tmu->mapbase == NULL)
  387. return -ENXIO;
  388. return 0;
  389. }
  390. static int sh_tmu_parse_dt(struct sh_tmu_device *tmu)
  391. {
  392. struct device_node *np = tmu->pdev->dev.of_node;
  393. tmu->model = SH_TMU;
  394. tmu->num_channels = 3;
  395. of_property_read_u32(np, "#renesas,channels", &tmu->num_channels);
  396. if (tmu->num_channels != 2 && tmu->num_channels != 3) {
  397. dev_err(&tmu->pdev->dev, "invalid number of channels %u\n",
  398. tmu->num_channels);
  399. return -EINVAL;
  400. }
  401. return 0;
  402. }
  403. static int sh_tmu_setup(struct sh_tmu_device *tmu, struct platform_device *pdev)
  404. {
  405. unsigned int i;
  406. int ret;
  407. tmu->pdev = pdev;
  408. raw_spin_lock_init(&tmu->lock);
  409. if (IS_ENABLED(CONFIG_OF) && pdev->dev.of_node) {
  410. ret = sh_tmu_parse_dt(tmu);
  411. if (ret < 0)
  412. return ret;
  413. } else if (pdev->dev.platform_data) {
  414. const struct platform_device_id *id = pdev->id_entry;
  415. struct sh_timer_config *cfg = pdev->dev.platform_data;
  416. tmu->model = id->driver_data;
  417. tmu->num_channels = hweight8(cfg->channels_mask);
  418. } else {
  419. dev_err(&tmu->pdev->dev, "missing platform data\n");
  420. return -ENXIO;
  421. }
  422. /* Get hold of clock. */
  423. tmu->clk = clk_get(&tmu->pdev->dev, "fck");
  424. if (IS_ERR(tmu->clk)) {
  425. dev_err(&tmu->pdev->dev, "cannot get clock\n");
  426. return PTR_ERR(tmu->clk);
  427. }
  428. ret = clk_prepare(tmu->clk);
  429. if (ret < 0)
  430. goto err_clk_put;
  431. /* Determine clock rate. */
  432. ret = clk_enable(tmu->clk);
  433. if (ret < 0)
  434. goto err_clk_unprepare;
  435. tmu->rate = clk_get_rate(tmu->clk) / 4;
  436. clk_disable(tmu->clk);
  437. /* Map the memory resource. */
  438. ret = sh_tmu_map_memory(tmu);
  439. if (ret < 0) {
  440. dev_err(&tmu->pdev->dev, "failed to remap I/O memory\n");
  441. goto err_clk_unprepare;
  442. }
  443. /* Allocate and setup the channels. */
  444. tmu->channels = kcalloc(tmu->num_channels, sizeof(*tmu->channels),
  445. GFP_KERNEL);
  446. if (tmu->channels == NULL) {
  447. ret = -ENOMEM;
  448. goto err_unmap;
  449. }
  450. /*
  451. * Use the first channel as a clock event device and the second channel
  452. * as a clock source.
  453. */
  454. for (i = 0; i < tmu->num_channels; ++i) {
  455. ret = sh_tmu_channel_setup(&tmu->channels[i], i,
  456. i == 0, i == 1, tmu);
  457. if (ret < 0)
  458. goto err_unmap;
  459. }
  460. platform_set_drvdata(pdev, tmu);
  461. return 0;
  462. err_unmap:
  463. kfree(tmu->channels);
  464. iounmap(tmu->mapbase);
  465. err_clk_unprepare:
  466. clk_unprepare(tmu->clk);
  467. err_clk_put:
  468. clk_put(tmu->clk);
  469. return ret;
  470. }
  471. static int sh_tmu_probe(struct platform_device *pdev)
  472. {
  473. struct sh_tmu_device *tmu = platform_get_drvdata(pdev);
  474. int ret;
  475. if (!is_early_platform_device(pdev)) {
  476. pm_runtime_set_active(&pdev->dev);
  477. pm_runtime_enable(&pdev->dev);
  478. }
  479. if (tmu) {
  480. dev_info(&pdev->dev, "kept as earlytimer\n");
  481. goto out;
  482. }
  483. tmu = kzalloc(sizeof(*tmu), GFP_KERNEL);
  484. if (tmu == NULL)
  485. return -ENOMEM;
  486. ret = sh_tmu_setup(tmu, pdev);
  487. if (ret) {
  488. kfree(tmu);
  489. pm_runtime_idle(&pdev->dev);
  490. return ret;
  491. }
  492. if (is_early_platform_device(pdev))
  493. return 0;
  494. out:
  495. if (tmu->has_clockevent || tmu->has_clocksource)
  496. pm_runtime_irq_safe(&pdev->dev);
  497. else
  498. pm_runtime_idle(&pdev->dev);
  499. return 0;
  500. }
  501. static int sh_tmu_remove(struct platform_device *pdev)
  502. {
  503. return -EBUSY; /* cannot unregister clockevent and clocksource */
  504. }
  505. static const struct platform_device_id sh_tmu_id_table[] = {
  506. { "sh-tmu", SH_TMU },
  507. { "sh-tmu-sh3", SH_TMU_SH3 },
  508. { }
  509. };
  510. MODULE_DEVICE_TABLE(platform, sh_tmu_id_table);
  511. static const struct of_device_id sh_tmu_of_table[] __maybe_unused = {
  512. { .compatible = "renesas,tmu" },
  513. { }
  514. };
  515. MODULE_DEVICE_TABLE(of, sh_tmu_of_table);
  516. static struct platform_driver sh_tmu_device_driver = {
  517. .probe = sh_tmu_probe,
  518. .remove = sh_tmu_remove,
  519. .driver = {
  520. .name = "sh_tmu",
  521. .of_match_table = of_match_ptr(sh_tmu_of_table),
  522. },
  523. .id_table = sh_tmu_id_table,
  524. };
  525. static int __init sh_tmu_init(void)
  526. {
  527. return platform_driver_register(&sh_tmu_device_driver);
  528. }
  529. static void __exit sh_tmu_exit(void)
  530. {
  531. platform_driver_unregister(&sh_tmu_device_driver);
  532. }
  533. early_platform_init("earlytimer", &sh_tmu_device_driver);
  534. subsys_initcall(sh_tmu_init);
  535. module_exit(sh_tmu_exit);
  536. MODULE_AUTHOR("Magnus Damm");
  537. MODULE_DESCRIPTION("SuperH TMU Timer Driver");
  538. MODULE_LICENSE("GPL v2");