lpc32xxcdl-2.11-delete_redundant_files.patch 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969
  1. Remove duplicated files to stop the linker from complaining about duplicate
  2. symbols
  3. Signed-off-by: Alexandre Belloni <abelloni@adeneo-embedded.com>
  4. ---
  5. --- a/csps/lpc32xx/bsps/fdi3250/startup/examples/s1l/sysapi_timer.c 2011-10-05 19:10:37.000000000 +0200
  6. +++ /dev/null 2012-01-01 16:39:47.918907000 +0100
  7. @@ -1,212 +0,0 @@
  8. -/***********************************************************************
  9. - * $Id:: sysapi_timer.c 3394 2010-05-06 17:56:27Z usb10132 $
  10. - *
  11. - * Project: Time support functions
  12. - *
  13. - * Description:
  14. - * Implements the following functions required for the S1L API
  15. - * time_init
  16. - * time_reset
  17. - * time_start
  18. - * time_stop
  19. - * time_get
  20. - * time_get_rate
  21. - *
  22. - ***********************************************************************
  23. - * Software that is described herein is for illustrative purposes only
  24. - * which provides customers with programming information regarding the
  25. - * products. This software is supplied "AS IS" without any warranties.
  26. - * NXP Semiconductors assumes no responsibility or liability for the
  27. - * use of the software, conveys no license or title under any patent,
  28. - * copyright, or mask work right to the product. NXP Semiconductors
  29. - * reserves the right to make changes in the software without
  30. - * notification. NXP Semiconductors also make no representation or
  31. - * warranty that such application will be suitable for the specified
  32. - * use without further testing or modification.
  33. - **********************************************************************/
  34. -
  35. -#include "s1l_sys_inf.h"
  36. -#include "lpc32xx_intc_driver.h"
  37. -#include "lpc32xx_timer_driver.h"
  38. -
  39. -static UNS_64 base_rate;
  40. -static INT_32 tdev = 0;
  41. -
  42. -/***********************************************************************
  43. - *
  44. - * Function: time_init
  45. - *
  46. - * Purpose: Initializes time system
  47. - *
  48. - * Processing: Initializes the system timer.
  49. - *
  50. - * Parameters: None
  51. - *
  52. - * Outputs: None
  53. - *
  54. - * Returns: 0 if the init failed, otherwise non-zero
  55. - *
  56. - * Notes: None
  57. - *
  58. - **********************************************************************/
  59. -INT_32 time_init(void)
  60. -{
  61. - TMR_PSCALE_SETUP_T pscale;
  62. -
  63. - /* Open timer driver */
  64. - if (tdev == 0)
  65. - {
  66. - tdev = timer_open((void *) TIMER_CNTR0, 0);
  67. - if (tdev != 0)
  68. - {
  69. - /* Use a prescale count to 100000 */
  70. - pscale.ps_tick_val = 100000;
  71. - pscale.ps_us_val = 0; /* Not needed when ps_tick_val != 0 */
  72. - timer_ioctl(tdev, TMR_SETUP_PSCALE, (INT_32) &pscale);
  73. -
  74. - /* Get timer clock rate */
  75. - base_rate = (UNS_64) timer_ioctl(tdev, TMR_GET_STATUS,
  76. - TMR_GET_CLOCK);
  77. - }
  78. - }
  79. -
  80. - return tdev;
  81. -}
  82. -
  83. -/***********************************************************************
  84. - *
  85. - * Function: time_reset
  86. - *
  87. - * Purpose: Resets system timer
  88. - *
  89. - * Processing:
  90. - * See function.
  91. - *
  92. - * Parameters: None
  93. - *
  94. - * Outputs: None
  95. - *
  96. - * Returns: Nothing
  97. - *
  98. - * Notes: None
  99. - *
  100. - **********************************************************************/
  101. -void time_reset(void)
  102. -{
  103. - if (tdev != 0)
  104. - {
  105. - timer_ioctl(tdev, TMR_RESET, 1);
  106. - }
  107. -}
  108. -
  109. -/***********************************************************************
  110. - *
  111. - * Function: time_start
  112. - *
  113. - * Purpose: Starts system timer
  114. - *
  115. - * Processing:
  116. - * See function.
  117. - *
  118. - * Parameters: None
  119. - *
  120. - * Outputs: None
  121. - *
  122. - * Returns: Nothing
  123. - *
  124. - * Notes: None
  125. - *
  126. - **********************************************************************/
  127. -void time_start(void)
  128. -{
  129. - if (tdev != 0)
  130. - {
  131. - timer_ioctl(tdev, TMR_ENABLE, 1);
  132. - }
  133. -}
  134. -
  135. -/***********************************************************************
  136. - *
  137. - * Function: time_stop
  138. - *
  139. - * Purpose: Stops system timer
  140. - *
  141. - * Processing:
  142. - * See function.
  143. - *
  144. - * Parameters: None
  145. - *
  146. - * Outputs: None
  147. - *
  148. - * Returns: Nothing
  149. - *
  150. - * Notes: None
  151. - *
  152. - **********************************************************************/
  153. -void time_stop(void)
  154. -{
  155. - if (tdev != 0)
  156. - {
  157. - timer_ioctl(tdev, TMR_ENABLE, 0);
  158. - }
  159. -}
  160. -
  161. -/***********************************************************************
  162. - *
  163. - * Function: time_get
  164. - *
  165. - * Purpose: Returns current system time value
  166. - *
  167. - * Processing:
  168. - * See function.
  169. - *
  170. - * Parameters: None
  171. - *
  172. - * Outputs: None
  173. - *
  174. - * Returns: The number of ticks of the timer counter
  175. - *
  176. - * Notes: None
  177. - *
  178. - **********************************************************************/
  179. -UNS_64 time_get(void)
  180. -{
  181. - TMR_COUNTS_T tcounts;
  182. - UNS_64 ticks = 0;
  183. -
  184. - if (tdev != 0)
  185. - {
  186. - timer_ioctl(tdev, TMR_GET_COUNTS, (INT_32) &tcounts);
  187. -
  188. - /* Compute number of timer ticks */
  189. - ticks = (UNS_64) tcounts.count_val * 100000;
  190. - ticks = ticks + (UNS_64) tcounts.ps_count_val;
  191. - }
  192. -
  193. - return ticks;
  194. -}
  195. -
  196. -/***********************************************************************
  197. - *
  198. - * Function: time_get_rate
  199. - *
  200. - * Purpose:
  201. - * Returns base tick rate (ticks per second) of the time counter
  202. - *
  203. - * Processing:
  204. - * See function.
  205. - *
  206. - * Parameters: None
  207. - *
  208. - * Outputs: None
  209. - *
  210. - * Returns: The timer tick rate (in ticks per second)
  211. - *
  212. - * Notes: None
  213. - *
  214. - **********************************************************************/
  215. -UNS_64 time_get_rate(void)
  216. -{
  217. - return base_rate;
  218. -}
  219. -
  220. --- a/csps/lpc32xx/bsps/fdi3250/startup/examples/s1l/sys_mmu_cmd_group.c 2011-10-05 19:10:37.000000000 +0200
  221. +++ /dev/null 2012-01-01 16:39:47.918907000 +0100
  222. @@ -1,746 +0,0 @@
  223. -/***********************************************************************
  224. - * $Id:: sys_mmu_cmd_group.c 3430 2010-05-07 17:39:08Z usb10132 $
  225. - *
  226. - * Project: Command processor for peek, poke, dump, and fill
  227. - *
  228. - * Description:
  229. - * Processes commands from the command prompt
  230. - *
  231. - ***********************************************************************
  232. - * Software that is described herein is for illustrative purposes only
  233. - * which provides customers with programming information regarding the
  234. - * products. This software is supplied "AS IS" without any warranties.
  235. - * NXP Semiconductors assumes no responsibility or liability for the
  236. - * use of the software, conveys no license or title under any patent,
  237. - * copyright, or mask work right to the product. NXP Semiconductors
  238. - * reserves the right to make changes in the software without
  239. - * notification. NXP Semiconductors also make no representation or
  240. - * warranty that such application will be suitable for the specified
  241. - * use without further testing or modification.
  242. - **********************************************************************/
  243. -
  244. -#include "lpc_arm922t_cp15_driver.h"
  245. -#include "lpc_string.h"
  246. -#include "startup.h"
  247. -#include "s1l_cmds.h"
  248. -#include "s1l_sys_inf.h"
  249. -
  250. -/* dcache command */
  251. -BOOL_32 cmd_dcache(void);
  252. -static UNS_32 cmd_dcache_plist[] =
  253. -{
  254. - (PARSE_TYPE_STR), /* The "dcache" command */
  255. - (PARSE_TYPE_DEC | PARSE_TYPE_END)
  256. -};
  257. -static CMD_ROUTE_T core_dcache_cmd =
  258. -{
  259. - (UNS_8 *) "dcache",
  260. - cmd_dcache,
  261. - (UNS_8 *) "Enables, disables, or flushes data cache",
  262. - (UNS_8 *) "dcache [0(disable), 1(enable), 2(flush)]",
  263. - cmd_dcache_plist,
  264. - NULL
  265. -};
  266. -
  267. -/* icache command */
  268. -BOOL_32 cmd_icache(void);
  269. -static UNS_32 cmd_icache_plist[] =
  270. -{
  271. - (PARSE_TYPE_STR), /* The "icache" command */
  272. - (PARSE_TYPE_DEC | PARSE_TYPE_END)
  273. -};
  274. -static CMD_ROUTE_T core_icache_cmd =
  275. -{
  276. - (UNS_8 *) "icache",
  277. - cmd_icache,
  278. - (UNS_8 *) "Enables or disables instruction cache",
  279. - (UNS_8 *) "icache [0(disable), 1(enable)]",
  280. - cmd_icache_plist,
  281. - NULL
  282. -};
  283. -
  284. -/* inval command */
  285. -BOOL_32 cmd_inval(void);
  286. -static UNS_32 cmd_inval_plist[] =
  287. -{
  288. - (PARSE_TYPE_STR | PARSE_TYPE_END) /* The "inval" command */
  289. -};
  290. -static CMD_ROUTE_T core_inval_cmd =
  291. -{
  292. - (UNS_8 *) "inval",
  293. - cmd_inval,
  294. - (UNS_8 *) "Flushes data cache and invalidates instruction cache",
  295. - (UNS_8 *) "inval",
  296. - cmd_inval_plist,
  297. - NULL
  298. -};
  299. -
  300. -/* mmuenab command */
  301. -BOOL_32 cmd_mmuenab(void);
  302. -static UNS_32 cmd_mmuenab_plist[] =
  303. -{
  304. - (PARSE_TYPE_STR), /* The "mmuenab" command */
  305. - (PARSE_TYPE_DEC | PARSE_TYPE_END)
  306. -};
  307. -static CMD_ROUTE_T core_mmuenab_cmd =
  308. -{
  309. - (UNS_8 *) "mmuenab",
  310. - cmd_mmuenab,
  311. - (UNS_8 *) "Enables or disables the MMU",
  312. - (UNS_8 *) "mmuenab [0(disable), 1(enable)]",
  313. - cmd_mmuenab_plist,
  314. - NULL
  315. -};
  316. -
  317. -/* map command */
  318. -BOOL_32 cmd_map(void);
  319. -static UNS_32 cmd_map_plist[] =
  320. -{
  321. - (PARSE_TYPE_STR), /* The "map" command */
  322. - (PARSE_TYPE_HEX),
  323. - (PARSE_TYPE_HEX),
  324. - (PARSE_TYPE_DEC),
  325. - (PARSE_TYPE_DEC | PARSE_TYPE_END),
  326. -};
  327. -static CMD_ROUTE_T core_map_cmd =
  328. -{
  329. - (UNS_8 *) "map",
  330. - cmd_map,
  331. - (UNS_8 *) "Maps a range of physical address sections to virtual addresses",
  332. - (UNS_8 *) "map [virt hex addr][phy hex addr][sections][0(uncached), 1(cached), 2(unmap)]",
  333. - cmd_map_plist,
  334. - NULL
  335. -};
  336. -
  337. -/* mmuinfo command */
  338. -static BOOL_32 cmd_mmuinfo(void);
  339. -static UNS_32 cmd_mmuinfo_plist[] =
  340. -{
  341. - (PARSE_TYPE_STR | PARSE_TYPE_END) /* The "mmuinfo" command */
  342. -};
  343. -static CMD_ROUTE_T core_mmuinfo_cmd =
  344. -{
  345. - (UNS_8 *) "mmuinfo",
  346. - cmd_mmuinfo,
  347. - (UNS_8 *) "Dumps page table and MMU info",
  348. - (UNS_8 *) "mmuinfo",
  349. - cmd_mmuinfo_plist,
  350. - NULL
  351. -};
  352. -
  353. -/* MMU group */
  354. -static GROUP_LIST_T mmu_group =
  355. -{
  356. - (UNS_8 *) "mmu", /* mmu group */
  357. - (UNS_8 *) "MMU command group",
  358. - NULL,
  359. - NULL
  360. -};
  361. -
  362. -static UNS_8 enabled_msg [] =" enabled";
  363. -static UNS_8 disabled_msg [] =" disabled";
  364. -static UNS_8 dcache_msg[] = "Data cache";
  365. -static UNS_8 icache_msg[] = "Instruction cache";
  366. -static UNS_8 pagetab_msg[] = "Page table at address: ";
  367. -static UNS_8 slist_msg[] = "Type Virt Phy fl Size";
  368. -static UNS_8 mmu_msg [] ="MMU";
  369. -static UNS_8 cpage_msg[] = "Coarse page:";
  370. -static UNS_8 fpage_msg[] = "Fine page :";
  371. -static UNS_8 sect_msg[] = "Section :";
  372. -static UNS_8 mbytes_msg[] = "M";
  373. -static UNS_8 map1_err_msg[] =
  374. - "Error : section addresses must be aligned on a 32-bit boundary";
  375. -static UNS_8 map2_err_msg[] =
  376. - "Error : Number of sections exceeds address range of device";
  377. -static UNS_8 phya_msg[] = "Virtual address ";
  378. -static UNS_8 mapped_msg[] = " mapped to physical address ";
  379. -static UNS_8 unmapped_msg[] = " unmapped from physical address ";
  380. -static UNS_8 cached_msg[] = " (cached)";
  381. -static UNS_8 inval_msg[] = " invalidated";
  382. -static UNS_8 caches_msg [] ="Caches";
  383. -static UNS_8 flushed_msg[] = " flushed";
  384. -
  385. -/***********************************************************************
  386. - *
  387. - * Function: show_section
  388. - *
  389. - * Purpose: Display section information
  390. - *
  391. - * Processing:
  392. - * See function.
  393. - *
  394. - * Parameters:
  395. - * mmu_reg : MMU settings for this section
  396. - * virt_addr : Starting virtual address for this section
  397. - * segs : Number of 1M segments for this section
  398. - *
  399. - * Outputs: None
  400. - *
  401. - * Returns: Nothing
  402. - *
  403. - * Notes: None
  404. - *
  405. - **********************************************************************/
  406. -static void show_section(UNS_32 mmu_reg,
  407. - UNS_32 virt_addr,
  408. - UNS_32 segs)
  409. -{
  410. - UNS_8 straddr [16];
  411. - UNS_32 mmu_phy;
  412. -
  413. - if ((mmu_reg & ARM922T_L1D_TYPE_PG_SN_MASK) !=
  414. - ARM922T_L1D_TYPE_FAULT)
  415. - {
  416. - if ((mmu_reg & ARM922T_L1D_TYPE_PG_SN_MASK) ==
  417. - ARM922T_L1D_TYPE_CPAGE)
  418. - {
  419. - term_dat_out(cpage_msg);
  420. - }
  421. - else if ((mmu_reg & ARM922T_L1D_TYPE_PG_SN_MASK) ==
  422. - ARM922T_L1D_TYPE_FPAGE)
  423. - {
  424. - term_dat_out(fpage_msg);
  425. - }
  426. - else
  427. - {
  428. - term_dat_out(sect_msg);
  429. - }
  430. -
  431. - /* Compute virtual address */
  432. - str_makehex(straddr, virt_addr, 8);
  433. - term_dat_out(straddr);
  434. - term_dat_out((UNS_8 *) " ");
  435. -
  436. - /* Compute mapped physical address */
  437. - if ((mmu_reg & ARM922T_L1D_TYPE_PG_SN_MASK) ==
  438. - ARM922T_L1D_TYPE_SECTION)
  439. - {
  440. - mmu_phy = mmu_reg & 0xFFF00000;
  441. - }
  442. - else
  443. - {
  444. - /* Don't compute addresses for non-sections */
  445. - mmu_phy = 0;
  446. - }
  447. - str_makehex(straddr, mmu_phy, 8);
  448. - term_dat_out(straddr);
  449. - term_dat_out((UNS_8 *) " ");
  450. -
  451. - /* MMU flags */
  452. - if ((mmu_reg & ARM922T_L1D_BUFFERABLE) != 0)
  453. - {
  454. - term_dat_out((UNS_8 *) "b");
  455. - }
  456. - else
  457. - {
  458. - term_dat_out((UNS_8 *) " ");
  459. - }
  460. - if ((mmu_reg & ARM922T_L1D_CACHEABLE) != 0)
  461. - {
  462. - term_dat_out((UNS_8 *) "c");
  463. - }
  464. - else
  465. - {
  466. - term_dat_out((UNS_8 *) " ");
  467. - }
  468. - term_dat_out((UNS_8 *) " ");
  469. -
  470. - /* Displays used megabytes */
  471. - str_makedec(straddr, segs);
  472. - term_dat_out(straddr);
  473. - term_dat_out_crlf(mbytes_msg);
  474. - }
  475. -}
  476. -
  477. -/***********************************************************************
  478. - *
  479. - * Function: mmu_dumpinfo
  480. - *
  481. - * Purpose: Display MMU info
  482. - *
  483. - * Processing:
  484. - * Display the MMU information, including enable status, cache
  485. - * status, and page table.
  486. - *
  487. - * Parameters: None
  488. - *
  489. - * Outputs: None
  490. - *
  491. - * Returns: TRUE if the command was processed, otherwise FALSE
  492. - *
  493. - * Notes: None
  494. - *
  495. - **********************************************************************/
  496. -static BOOL_32 mmu_dumpinfo(void)
  497. -{
  498. - UNS_32 segsz, last_mmu_reg, mmu_vrt, mmu_reg, mmu_vrtsav = 0, *pt;
  499. - UNS_32 mlast_mmu_reg, mmmu_reg;
  500. - int idx;
  501. - UNS_8 hexaddr [16];
  502. -
  503. - term_dat_out(mmu_msg);
  504. - if (cp15_mmu_enabled() == FALSE)
  505. - {
  506. - term_dat_out_crlf(disabled_msg);
  507. - }
  508. - else
  509. - {
  510. - term_dat_out_crlf(enabled_msg);
  511. -
  512. - /* Get MMU control register word */
  513. - mmu_reg = cp15_get_mmu_control_reg();
  514. -
  515. - /* Instruction cache status */
  516. - term_dat_out(icache_msg);
  517. - if ((mmu_reg & ARM922T_MMU_CONTROL_I) == 0)
  518. - {
  519. - term_dat_out_crlf(disabled_msg);
  520. - }
  521. - else
  522. - {
  523. - term_dat_out_crlf(enabled_msg);
  524. - }
  525. -
  526. - /* Data cache status */
  527. - term_dat_out(dcache_msg);
  528. - if ((mmu_reg & ARM922T_MMU_CONTROL_C) == 0)
  529. - {
  530. - term_dat_out_crlf(disabled_msg);
  531. - }
  532. - else
  533. - {
  534. - term_dat_out_crlf(enabled_msg);
  535. - }
  536. -
  537. - term_dat_out(pagetab_msg);
  538. - mmu_reg = (UNS_32) cp15_get_ttb();
  539. - str_makehex(hexaddr, mmu_reg, 8);
  540. - term_dat_out_crlf(hexaddr);
  541. - term_dat_out_crlf(slist_msg);
  542. -
  543. - /* Process MMU table - assume that the physical and
  544. - virtual locations of table are the same */
  545. - pt = (UNS_32 *) mmu_reg;
  546. - mmu_vrt = 0x0;
  547. - segsz = 0xFFFFFFFF;
  548. - last_mmu_reg = mlast_mmu_reg = 0xFFFFFFFF;
  549. - for (idx = 0; idx < 4096; idx++)
  550. - {
  551. - mmu_reg = *pt;
  552. - mmmu_reg = (mmu_reg & (ARM922T_L1D_TYPE_PG_SN_MASK |
  553. - ARM922T_L1D_BUFFERABLE | ARM922T_L1D_CACHEABLE));
  554. - segsz = segsz + 1;
  555. -
  556. - if ((last_mmu_reg != 0xFFFFFFFF) &&
  557. - (mlast_mmu_reg != mmmu_reg))
  558. - {
  559. - show_section(last_mmu_reg, mmu_vrtsav, segsz);
  560. - segsz = 0;
  561. - }
  562. -
  563. - if (mlast_mmu_reg != mmmu_reg)
  564. - {
  565. - mmu_vrtsav = mmu_vrt;
  566. - last_mmu_reg = mmu_reg;
  567. - mlast_mmu_reg = mmmu_reg;
  568. - }
  569. -
  570. - pt++;
  571. - mmu_vrt += 0x00100000;
  572. - }
  573. - }
  574. -
  575. - return TRUE;
  576. -}
  577. -
  578. -/***********************************************************************
  579. - *
  580. - * Function: mmu_dumpmap
  581. - *
  582. - * Purpose: Map a virtual address range to a physical range
  583. - *
  584. - * Processing:
  585. - * From the input addresses and number of sections, generate the
  586. - * appropriate entries in the page table.
  587. - *
  588. - * Parameters: None
  589. - *
  590. - * Outputs: None
  591. - *
  592. - * Returns: TRUE if the command was processed, otherwise FALSE
  593. - *
  594. - * Notes: None
  595. - *
  596. - **********************************************************************/
  597. -static BOOL_32 mmu_dumpmap(UNS_32 vrt,
  598. - UNS_32 phy,
  599. - UNS_32 sections,
  600. - UNS_32 cache)
  601. -{
  602. - BOOL_32 processed = FALSE;
  603. - UNS_32 mmu_phy, mmu_vrt, tmp1 = 0, tmp2, *pt;
  604. - UNS_8 hexaddr [16];
  605. -
  606. - /* Verify address boundaries are sectional */
  607. - mmu_vrt = vrt & ~ARM922T_L2D_SN_BASE_MASK;
  608. - mmu_phy = phy & ~ARM922T_L2D_SN_BASE_MASK;
  609. - if ((mmu_vrt != 0) || (mmu_phy != 0))
  610. - {
  611. - term_dat_out_crlf(map1_err_msg);
  612. - }
  613. - else
  614. - {
  615. - /* Verify that address range and section count will not
  616. - exceed address range of device */
  617. - tmp1 = vrt >> 20;
  618. - tmp1 = (tmp1 + sections) - 1;
  619. - tmp2 = phy >> 20;
  620. - tmp2 = (tmp2 + sections) - 1;
  621. - if ((tmp1 < 4096) && (tmp2 < 4096))
  622. - {
  623. - /* Good address range and good section count */
  624. - processed = TRUE;
  625. - }
  626. - else
  627. - {
  628. - term_dat_out_crlf(map2_err_msg);
  629. - }
  630. - }
  631. -
  632. - /* Generate static part of MMU word */
  633. - if (cache == 0)
  634. - {
  635. - /* Section mapped with cache disabled */
  636. - tmp1 = ARM922T_L1D_TYPE_SECTION;
  637. - }
  638. - else if (cache == 1)
  639. - {
  640. - /* Section mapped with cache enabled */
  641. - tmp1 = (ARM922T_L1D_BUFFERABLE | ARM922T_L1D_CACHEABLE |
  642. - ARM922T_L1D_TYPE_SECTION);
  643. - }
  644. - else if (cache == 2)
  645. - {
  646. - /* Section unmapped */
  647. - tmp1 = ARM922T_L1D_TYPE_FAULT;
  648. - }
  649. - tmp1 |= ARM922T_L1D_AP_ALL;
  650. -
  651. - /* Offset into page table for virtual address */
  652. - tmp2 = (vrt >> 20);
  653. - pt = cp15_get_ttb() + tmp2;
  654. -
  655. - /* Loop until all sections are complete */
  656. - while ((sections > 0) && (processed == TRUE))
  657. - {
  658. - /* Add in physical address */
  659. - tmp2 = tmp1 | (phy & ARM922T_L2D_SN_BASE_MASK);
  660. -
  661. - /* Save new section descriptor for virtual address */
  662. - *pt = tmp2;
  663. -
  664. - /* Output message shown the map */
  665. - term_dat_out(phya_msg);
  666. - str_makehex(hexaddr, phy, 8);
  667. - term_dat_out(hexaddr);
  668. - if (cache == 2)
  669. - {
  670. - term_dat_out(unmapped_msg);
  671. - }
  672. - else
  673. - {
  674. - term_dat_out(mapped_msg);
  675. - }
  676. - str_makehex(hexaddr, vrt, 8);
  677. - term_dat_out(hexaddr);
  678. - if (cache == 1)
  679. - {
  680. - term_dat_out(cached_msg);
  681. - }
  682. - term_dat_out_crlf((UNS_8 *) "");
  683. -
  684. - /* Next section and page table entry*/
  685. - phy += 0x00100000;
  686. - vrt += 0x00100000;
  687. - pt++;
  688. - sections--;
  689. - }
  690. -
  691. - return processed;
  692. -}
  693. -
  694. -/***********************************************************************
  695. - *
  696. - * Function: cmd_mmuinfo
  697. - *
  698. - * Purpose: Display MMU information
  699. - *
  700. - * Processing:
  701. - * See function.
  702. - *
  703. - * Parameters: None
  704. - *
  705. - * Outputs: None
  706. - *
  707. - * Returns: TRUE if the command was processed, otherwise FALSE
  708. - *
  709. - * Notes: None
  710. - *
  711. - **********************************************************************/
  712. -static BOOL_32 cmd_mmuinfo(void)
  713. -{
  714. - mmu_dumpinfo();
  715. -
  716. - return TRUE;
  717. -}
  718. -
  719. -/***********************************************************************
  720. - *
  721. - * Function: cmd_map
  722. - *
  723. - * Purpose: Map a physical address region to a virtual region
  724. - *
  725. - * Processing:
  726. - * See function.
  727. - *
  728. - * Parameters: None
  729. - *
  730. - * Outputs: None
  731. - *
  732. - * Returns: TRUE if the command was processed, otherwise FALSE
  733. - *
  734. - * Notes: None
  735. - *
  736. - **********************************************************************/
  737. -BOOL_32 cmd_map(void)
  738. -{
  739. - UNS_32 phy, virt, sects, ce = 0;
  740. -
  741. - /* Get arguments */
  742. - virt = cmd_get_field_val(1);
  743. - phy = cmd_get_field_val(2);
  744. - sects = cmd_get_field_val(3);
  745. - ce = cmd_get_field_val(4);
  746. -
  747. - if (ce <= 2)
  748. - {
  749. - mmu_dumpmap(virt, phy, sects, ce);
  750. - }
  751. -
  752. - return TRUE;
  753. -}
  754. -
  755. -/***********************************************************************
  756. - *
  757. - * Function: cmd_inval
  758. - *
  759. - * Purpose: MMU cache flush and invalidate
  760. - *
  761. - * Processing:
  762. - * See function.
  763. - *
  764. - * Parameters: None
  765. - *
  766. - * Outputs: None
  767. - *
  768. - * Returns: TRUE if the command was processed, otherwise FALSE
  769. - *
  770. - * Notes: None
  771. - *
  772. - **********************************************************************/
  773. -BOOL_32 cmd_inval(void)
  774. -{
  775. - dcache_flush();
  776. - icache_inval();
  777. - term_dat_out(caches_msg);
  778. - term_dat_out(inval_msg);
  779. -
  780. - return TRUE;
  781. -}
  782. -
  783. -/***********************************************************************
  784. - *
  785. - * Function: cmd_dcache
  786. - *
  787. - * Purpose: MMU data cache enable and disable
  788. - *
  789. - * Processing:
  790. - * If the value passed in the parser is 1, enable the data cache,
  791. - * otherwise disable the data cache.
  792. - *
  793. - * Parameters: None
  794. - *
  795. - * Outputs: None
  796. - *
  797. - * Returns: TRUE if the command was processed, otherwise FALSE
  798. - *
  799. - * Notes: None
  800. - *
  801. - **********************************************************************/
  802. -BOOL_32 cmd_dcache(void)
  803. -{
  804. - UNS_32 cenable;
  805. - UNS_8 *ppar;
  806. -
  807. - /* Get argument */
  808. - cenable = cmd_get_field_val(1);
  809. -
  810. - switch (cenable)
  811. - {
  812. - case 0:
  813. - dcache_flush();
  814. - cp15_set_dcache(0);
  815. - ppar = disabled_msg;
  816. - break;
  817. -
  818. - case 1:
  819. - cp15_invalidate_cache();
  820. - cp15_set_dcache(1);
  821. - ppar = enabled_msg;
  822. - break;
  823. -
  824. - case 2:
  825. - default:
  826. - dcache_flush();
  827. - ppar = flushed_msg;
  828. - break;
  829. - }
  830. -
  831. - term_dat_out(dcache_msg);
  832. - term_dat_out_crlf(ppar);
  833. -
  834. - return TRUE;
  835. -}
  836. -
  837. -/***********************************************************************
  838. - *
  839. - * Function: cmd_icache
  840. - *
  841. - * Purpose: MMU instruction cache enable and disable
  842. - *
  843. - * Processing:
  844. - * If the value passed in the parser is 1, enable the instruction
  845. - * cache, otherwise disable the instruction cache.
  846. - *
  847. - * Parameters: None
  848. - *
  849. - * Outputs: None
  850. - *
  851. - * Returns: TRUE if the command was processed, otherwise FALSE
  852. - *
  853. - * Notes: None
  854. - *
  855. - **********************************************************************/
  856. -BOOL_32 cmd_icache(void)
  857. -{
  858. - UNS_32 cenable;
  859. - UNS_8 *ppar;
  860. -
  861. - /* Get argument */
  862. - cenable = cmd_get_field_val(1);
  863. -
  864. - if (cenable == 1)
  865. - {
  866. - dcache_flush();
  867. - cp15_invalidate_cache();
  868. - cp15_set_icache(1);
  869. - ppar = enabled_msg;
  870. - }
  871. - else
  872. - {
  873. - cp15_set_icache(0);
  874. - ppar = disabled_msg;
  875. - }
  876. -
  877. - term_dat_out(icache_msg);
  878. - term_dat_out_crlf(ppar);
  879. -
  880. - return TRUE;
  881. -}
  882. -
  883. -
  884. -/***********************************************************************
  885. - *
  886. - * Function: cmd_mmuenab
  887. - *
  888. - * Purpose: Enable or disable MMU
  889. - *
  890. - * Processing:
  891. - * See function.
  892. - *
  893. - * Parameters: None
  894. - *
  895. - * Outputs: None
  896. - *
  897. - * Returns: TRUE if the command was processed, otherwise FALSE
  898. - *
  899. - * Notes: None
  900. - *
  901. - **********************************************************************/
  902. -BOOL_32 cmd_mmuenab(void)
  903. -{
  904. - UNS_8 *ppar;
  905. - UNS_32 cenable;
  906. -
  907. - term_dat_out_crlf((UNS_8 *) "Warning: Changing MMU status on "
  908. - " cached and buffered code can cause system crashes.");
  909. -
  910. - /* Get argument */
  911. - cenable = cmd_get_field_val(1);
  912. -
  913. - if (cenable == 1)
  914. - {
  915. - if ((cp15_get_mmu_control_reg() & ARM922T_MMU_CONTROL_C) != 0)
  916. - {
  917. - cp15_invalidate_cache();
  918. - }
  919. -
  920. - cp15_set_mmu(1);
  921. - ppar = enabled_msg;
  922. - }
  923. - else
  924. - {
  925. - cp15_dcache_flush();
  926. - cp15_write_buffer_flush();
  927. - cp15_invalidate_cache();
  928. - cp15_set_mmu(0);
  929. - ppar = disabled_msg;
  930. - }
  931. -
  932. - term_dat_out(mmu_msg);
  933. - term_dat_out_crlf(ppar);
  934. -
  935. - return TRUE;
  936. -}
  937. -
  938. -/***********************************************************************
  939. - *
  940. - * Function: mmu_cmd_group_init
  941. - *
  942. - * Purpose: Initialize MMU command group
  943. - *
  944. - * Processing:
  945. - * See function.
  946. - *
  947. - * Parameters: None
  948. - *
  949. - * Outputs: None
  950. - *
  951. - * Returns: Nothin
  952. - *
  953. - * Notes: None
  954. - *
  955. - **********************************************************************/
  956. -void mmu_cmd_group_init(void)
  957. -{
  958. - /* Add MMU group */
  959. - cmd_add_group(&mmu_group);
  960. -
  961. - /* Add commands to the MMU group */
  962. - cmd_add_new_command(&mmu_group, &core_dcache_cmd);
  963. - cmd_add_new_command(&mmu_group, &core_icache_cmd);
  964. - cmd_add_new_command(&mmu_group, &core_inval_cmd);
  965. - cmd_add_new_command(&mmu_group, &core_mmuenab_cmd);
  966. - cmd_add_new_command(&mmu_group, &core_map_cmd);
  967. - cmd_add_new_command(&mmu_group, &core_mmuinfo_cmd);
  968. -}