prealloc-cronus.c 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608
  1. /*
  2. * Memory pre-allocations for Cronus boxes.
  3. *
  4. * Copyright (C) 2005-2009 Scientific-Atlanta, Inc.
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  19. *
  20. * Author: Ken Eppinett
  21. * David Schleef <ds@schleef.org>
  22. */
  23. #include <linux/init.h>
  24. #include <asm/mach-powertv/asic.h>
  25. /*
  26. * DVR_CAPABLE CRONUS RESOURCES
  27. */
  28. struct resource dvr_cronus_resources[] __initdata =
  29. {
  30. /*
  31. *
  32. * VIDEO1 / LX1
  33. *
  34. */
  35. {
  36. .name = "ST231aImage", /* Delta-Mu 1 image and ram */
  37. .start = 0x24000000,
  38. .end = 0x241FFFFF, /* 2MiB */
  39. .flags = IORESOURCE_MEM,
  40. },
  41. {
  42. .name = "ST231aMonitor", /* 8KiB block ST231a monitor */
  43. .start = 0x24200000,
  44. .end = 0x24201FFF,
  45. .flags = IORESOURCE_MEM,
  46. },
  47. {
  48. .name = "MediaMemory1",
  49. .start = 0x24202000,
  50. .end = 0x25FFFFFF, /*~29.9MiB (32MiB - (2MiB + 8KiB)) */
  51. .flags = IORESOURCE_MEM,
  52. },
  53. /*
  54. *
  55. * VIDEO2 / LX2
  56. *
  57. */
  58. {
  59. .name = "ST231bImage", /* Delta-Mu 2 image and ram */
  60. .start = 0x60000000,
  61. .end = 0x601FFFFF, /* 2MiB */
  62. .flags = IORESOURCE_IO,
  63. },
  64. {
  65. .name = "ST231bMonitor", /* 8KiB block ST231b monitor */
  66. .start = 0x60200000,
  67. .end = 0x60201FFF,
  68. .flags = IORESOURCE_IO,
  69. },
  70. {
  71. .name = "MediaMemory2",
  72. .start = 0x60202000,
  73. .end = 0x61FFFFFF, /*~29.9MiB (32MiB - (2MiB + 8KiB)) */
  74. .flags = IORESOURCE_IO,
  75. },
  76. /*
  77. *
  78. * Sysaudio Driver
  79. *
  80. * This driver requires:
  81. *
  82. * Arbitrary Based Buffers:
  83. * DSP_Image_Buff - DSP code and data images (1MB)
  84. * ADSC_CPU_PCM_Buff - ADSC CPU PCM buffer (40KB)
  85. * ADSC_AUX_Buff - ADSC AUX buffer (16KB)
  86. * ADSC_Main_Buff - ADSC Main buffer (16KB)
  87. *
  88. */
  89. {
  90. .name = "DSP_Image_Buff",
  91. .start = 0x00000000,
  92. .end = 0x000FFFFF,
  93. .flags = IORESOURCE_MEM,
  94. },
  95. {
  96. .name = "ADSC_CPU_PCM_Buff",
  97. .start = 0x00000000,
  98. .end = 0x00009FFF,
  99. .flags = IORESOURCE_MEM,
  100. },
  101. {
  102. .name = "ADSC_AUX_Buff",
  103. .start = 0x00000000,
  104. .end = 0x00003FFF,
  105. .flags = IORESOURCE_MEM,
  106. },
  107. {
  108. .name = "ADSC_Main_Buff",
  109. .start = 0x00000000,
  110. .end = 0x00003FFF,
  111. .flags = IORESOURCE_MEM,
  112. },
  113. /*
  114. *
  115. * STAVEM driver/STAPI
  116. *
  117. * This driver requires:
  118. *
  119. * Arbitrary Based Buffers:
  120. * This memory area is used for allocating buffers for Video decoding
  121. * purposes. Allocation/De-allocation within this buffer is managed
  122. * by the STAVMEM driver of the STAPI. They could be Decimated
  123. * Picture Buffers, Intermediate Buffers, as deemed necessary for
  124. * video decoding purposes, for any video decoders on Zeus.
  125. *
  126. */
  127. {
  128. .name = "AVMEMPartition0",
  129. .start = 0x63580000,
  130. .end = 0x64180000 - 1, /* 12 MB total */
  131. .flags = IORESOURCE_IO,
  132. },
  133. /*
  134. *
  135. * DOCSIS Subsystem
  136. *
  137. * This driver requires:
  138. *
  139. * Arbitrary Based Buffers:
  140. * Docsis -
  141. *
  142. */
  143. {
  144. .name = "Docsis",
  145. .start = 0x62000000,
  146. .end = 0x62700000 - 1, /* 7 MB total */
  147. .flags = IORESOURCE_IO,
  148. },
  149. /*
  150. *
  151. * GHW HAL Driver
  152. *
  153. * This driver requires:
  154. *
  155. * Arbitrary Based Buffers:
  156. * GraphicsHeap - PowerTV Graphics Heap
  157. *
  158. */
  159. {
  160. .name = "GraphicsHeap",
  161. .start = 0x62700000,
  162. .end = 0x63500000 - 1, /* 14 MB total */
  163. .flags = IORESOURCE_IO,
  164. },
  165. /*
  166. *
  167. * multi com buffer area
  168. *
  169. * This driver requires:
  170. *
  171. * Arbitrary Based Buffers:
  172. * Docsis -
  173. *
  174. */
  175. {
  176. .name = "MulticomSHM",
  177. .start = 0x26000000,
  178. .end = 0x26020000 - 1,
  179. .flags = IORESOURCE_MEM,
  180. },
  181. /*
  182. *
  183. * DMA Ring buffer
  184. *
  185. * This driver requires:
  186. *
  187. * Arbitrary Based Buffers:
  188. * Docsis -
  189. *
  190. */
  191. {
  192. .name = "BMM_Buffer",
  193. .start = 0x00000000,
  194. .end = 0x00280000 - 1,
  195. .flags = IORESOURCE_MEM,
  196. },
  197. /*
  198. *
  199. * Display bins buffer for unit0
  200. *
  201. * This driver requires:
  202. *
  203. * Arbitrary Based Buffers:
  204. * Display Bins for unit0
  205. *
  206. */
  207. {
  208. .name = "DisplayBins0",
  209. .start = 0x00000000,
  210. .end = 0x00000FFF, /* 4 KB total */
  211. .flags = IORESOURCE_MEM,
  212. },
  213. /*
  214. *
  215. * Display bins buffer
  216. *
  217. * This driver requires:
  218. *
  219. * Arbitrary Based Buffers:
  220. * Display Bins for unit1
  221. *
  222. */
  223. {
  224. .name = "DisplayBins1",
  225. .start = 0x64AD4000,
  226. .end = 0x64AD5000 - 1, /* 4 KB total */
  227. .flags = IORESOURCE_IO,
  228. },
  229. /*
  230. *
  231. * ITFS
  232. *
  233. * This driver requires:
  234. *
  235. * Arbitrary Based Buffers:
  236. * Docsis -
  237. *
  238. */
  239. {
  240. .name = "ITFS",
  241. .start = 0x64180000,
  242. /* 815,104 bytes each for 2 ITFS partitions. */
  243. .end = 0x6430DFFF,
  244. .flags = IORESOURCE_IO,
  245. },
  246. /*
  247. *
  248. * AVFS
  249. *
  250. * This driver requires:
  251. *
  252. * Arbitrary Based Buffers:
  253. * Docsis -
  254. *
  255. */
  256. {
  257. .name = "AvfsDmaMem",
  258. .start = 0x6430E000,
  259. /* (945K * 8) = (128K *3) 5 playbacks / 3 server */
  260. .end = 0x64AD0000 - 1,
  261. .flags = IORESOURCE_IO,
  262. },
  263. {
  264. .name = "AvfsFileSys",
  265. .start = 0x64AD0000,
  266. .end = 0x64AD1000 - 1, /* 4K */
  267. .flags = IORESOURCE_IO,
  268. },
  269. /*
  270. *
  271. * PMEM
  272. *
  273. * This driver requires:
  274. *
  275. * Arbitrary Based Buffers:
  276. * Persistent memory for diagnostics.
  277. *
  278. */
  279. {
  280. .name = "DiagPersistentMemory",
  281. .start = 0x00000000,
  282. .end = 0x10000 - 1,
  283. .flags = IORESOURCE_MEM,
  284. },
  285. /*
  286. *
  287. * Smartcard
  288. *
  289. * This driver requires:
  290. *
  291. * Arbitrary Based Buffers:
  292. * Read and write buffers for Internal/External cards
  293. *
  294. */
  295. {
  296. .name = "SmartCardInfo",
  297. .start = 0x64AD1000,
  298. .end = 0x64AD3800 - 1,
  299. .flags = IORESOURCE_IO,
  300. },
  301. /*
  302. *
  303. * KAVNET
  304. * NP Reset Vector - must be of the form xxCxxxxx
  305. * NP Image - must be video bank 1
  306. * NP IPC - must be video bank 2
  307. */
  308. {
  309. .name = "NP_Reset_Vector",
  310. .start = 0x27c00000,
  311. .end = 0x27c01000 - 1,
  312. .flags = IORESOURCE_MEM,
  313. },
  314. {
  315. .name = "NP_Image",
  316. .start = 0x27020000,
  317. .end = 0x27060000 - 1,
  318. .flags = IORESOURCE_MEM,
  319. },
  320. {
  321. .name = "NP_IPC",
  322. .start = 0x63500000,
  323. .end = 0x63580000 - 1,
  324. .flags = IORESOURCE_IO,
  325. },
  326. /*
  327. * Add other resources here
  328. */
  329. { },
  330. };
  331. /*
  332. * NON_DVR_CAPABLE CRONUS RESOURCES
  333. */
  334. struct resource non_dvr_cronus_resources[] __initdata =
  335. {
  336. /*
  337. *
  338. * VIDEO1 / LX1
  339. *
  340. */
  341. {
  342. .name = "ST231aImage", /* Delta-Mu 1 image and ram */
  343. .start = 0x24000000,
  344. .end = 0x241FFFFF, /* 2MiB */
  345. .flags = IORESOURCE_MEM,
  346. },
  347. {
  348. .name = "ST231aMonitor", /* 8KiB block ST231a monitor */
  349. .start = 0x24200000,
  350. .end = 0x24201FFF,
  351. .flags = IORESOURCE_MEM,
  352. },
  353. {
  354. .name = "MediaMemory1",
  355. .start = 0x24202000,
  356. .end = 0x25FFFFFF, /*~29.9MiB (32MiB - (2MiB + 8KiB)) */
  357. .flags = IORESOURCE_MEM,
  358. },
  359. /*
  360. *
  361. * VIDEO2 / LX2
  362. *
  363. */
  364. {
  365. .name = "ST231bImage", /* Delta-Mu 2 image and ram */
  366. .start = 0x60000000,
  367. .end = 0x601FFFFF, /* 2MiB */
  368. .flags = IORESOURCE_IO,
  369. },
  370. {
  371. .name = "ST231bMonitor", /* 8KiB block ST231b monitor */
  372. .start = 0x60200000,
  373. .end = 0x60201FFF,
  374. .flags = IORESOURCE_IO,
  375. },
  376. {
  377. .name = "MediaMemory2",
  378. .start = 0x60202000,
  379. .end = 0x61FFFFFF, /*~29.9MiB (32MiB - (2MiB + 8KiB)) */
  380. .flags = IORESOURCE_IO,
  381. },
  382. /*
  383. *
  384. * Sysaudio Driver
  385. *
  386. * This driver requires:
  387. *
  388. * Arbitrary Based Buffers:
  389. * DSP_Image_Buff - DSP code and data images (1MB)
  390. * ADSC_CPU_PCM_Buff - ADSC CPU PCM buffer (40KB)
  391. * ADSC_AUX_Buff - ADSC AUX buffer (16KB)
  392. * ADSC_Main_Buff - ADSC Main buffer (16KB)
  393. *
  394. */
  395. {
  396. .name = "DSP_Image_Buff",
  397. .start = 0x00000000,
  398. .end = 0x000FFFFF,
  399. .flags = IORESOURCE_MEM,
  400. },
  401. {
  402. .name = "ADSC_CPU_PCM_Buff",
  403. .start = 0x00000000,
  404. .end = 0x00009FFF,
  405. .flags = IORESOURCE_MEM,
  406. },
  407. {
  408. .name = "ADSC_AUX_Buff",
  409. .start = 0x00000000,
  410. .end = 0x00003FFF,
  411. .flags = IORESOURCE_MEM,
  412. },
  413. {
  414. .name = "ADSC_Main_Buff",
  415. .start = 0x00000000,
  416. .end = 0x00003FFF,
  417. .flags = IORESOURCE_MEM,
  418. },
  419. /*
  420. *
  421. * STAVEM driver/STAPI
  422. *
  423. * This driver requires:
  424. *
  425. * Arbitrary Based Buffers:
  426. * This memory area is used for allocating buffers for Video decoding
  427. * purposes. Allocation/De-allocation within this buffer is managed
  428. * by the STAVMEM driver of the STAPI. They could be Decimated
  429. * Picture Buffers, Intermediate Buffers, as deemed necessary for
  430. * video decoding purposes, for any video decoders on Zeus.
  431. *
  432. */
  433. {
  434. .name = "AVMEMPartition0",
  435. .start = 0x63580000,
  436. .end = 0x64180000 - 1, /* 12 MB total */
  437. .flags = IORESOURCE_IO,
  438. },
  439. /*
  440. *
  441. * DOCSIS Subsystem
  442. *
  443. * This driver requires:
  444. *
  445. * Arbitrary Based Buffers:
  446. * Docsis -
  447. *
  448. */
  449. {
  450. .name = "Docsis",
  451. .start = 0x62000000,
  452. .end = 0x62700000 - 1, /* 7 MB total */
  453. .flags = IORESOURCE_IO,
  454. },
  455. /*
  456. *
  457. * GHW HAL Driver
  458. *
  459. * This driver requires:
  460. *
  461. * Arbitrary Based Buffers:
  462. * GraphicsHeap - PowerTV Graphics Heap
  463. *
  464. */
  465. {
  466. .name = "GraphicsHeap",
  467. .start = 0x62700000,
  468. .end = 0x63500000 - 1, /* 14 MB total */
  469. .flags = IORESOURCE_IO,
  470. },
  471. /*
  472. *
  473. * multi com buffer area
  474. *
  475. * This driver requires:
  476. *
  477. * Arbitrary Based Buffers:
  478. * Docsis -
  479. *
  480. */
  481. {
  482. .name = "MulticomSHM",
  483. .start = 0x26000000,
  484. .end = 0x26020000 - 1,
  485. .flags = IORESOURCE_MEM,
  486. },
  487. /*
  488. *
  489. * DMA Ring buffer
  490. *
  491. * This driver requires:
  492. *
  493. * Arbitrary Based Buffers:
  494. * Docsis -
  495. *
  496. */
  497. {
  498. .name = "BMM_Buffer",
  499. .start = 0x00000000,
  500. .end = 0x000AA000 - 1,
  501. .flags = IORESOURCE_MEM,
  502. },
  503. /*
  504. *
  505. * Display bins buffer for unit0
  506. *
  507. * This driver requires:
  508. *
  509. * Arbitrary Based Buffers:
  510. * Display Bins for unit0
  511. *
  512. */
  513. {
  514. .name = "DisplayBins0",
  515. .start = 0x00000000,
  516. .end = 0x00000FFF, /* 4 KB total */
  517. .flags = IORESOURCE_MEM,
  518. },
  519. /*
  520. *
  521. * Display bins buffer
  522. *
  523. * This driver requires:
  524. *
  525. * Arbitrary Based Buffers:
  526. * Display Bins for unit1
  527. *
  528. */
  529. {
  530. .name = "DisplayBins1",
  531. .start = 0x64AD4000,
  532. .end = 0x64AD5000 - 1, /* 4 KB total */
  533. .flags = IORESOURCE_IO,
  534. },
  535. /*
  536. *
  537. * AVFS: player HAL memory
  538. *
  539. *
  540. */
  541. {
  542. .name = "AvfsDmaMem",
  543. .start = 0x6430E000,
  544. .end = 0x645D2C00 - 1, /* 945K * 3 for playback */
  545. .flags = IORESOURCE_IO,
  546. },
  547. /*
  548. *
  549. * PMEM
  550. *
  551. * This driver requires:
  552. *
  553. * Arbitrary Based Buffers:
  554. * Persistent memory for diagnostics.
  555. *
  556. */
  557. {
  558. .name = "DiagPersistentMemory",
  559. .start = 0x00000000,
  560. .end = 0x10000 - 1,
  561. .flags = IORESOURCE_MEM,
  562. },
  563. /*
  564. *
  565. * Smartcard
  566. *
  567. * This driver requires:
  568. *
  569. * Arbitrary Based Buffers:
  570. * Read and write buffers for Internal/External cards
  571. *
  572. */
  573. {
  574. .name = "SmartCardInfo",
  575. .start = 0x64AD1000,
  576. .end = 0x64AD3800 - 1,
  577. .flags = IORESOURCE_IO,
  578. },
  579. /*
  580. *
  581. * KAVNET
  582. * NP Reset Vector - must be of the form xxCxxxxx
  583. * NP Image - must be video bank 1
  584. * NP IPC - must be video bank 2
  585. */
  586. {
  587. .name = "NP_Reset_Vector",
  588. .start = 0x27c00000,
  589. .end = 0x27c01000 - 1,
  590. .flags = IORESOURCE_MEM,
  591. },
  592. {
  593. .name = "NP_Image",
  594. .start = 0x27020000,
  595. .end = 0x27060000 - 1,
  596. .flags = IORESOURCE_MEM,
  597. },
  598. {
  599. .name = "NP_IPC",
  600. .start = 0x63500000,
  601. .end = 0x63580000 - 1,
  602. .flags = IORESOURCE_IO,
  603. },
  604. { },
  605. };