python-dataproperty: bump version to 0.17.0
[buildroot-gz.git] / boot / lpc32xxcdl / lpc32xxcdl-2.11-delete_redundant_files.patch
blob39966f01e9f01533b497f923f687736f225b2edd
1 Remove duplicated files to stop the linker from complaining about duplicate
2 symbols
4 Signed-off-by: Alexandre Belloni <abelloni@adeneo-embedded.com>
5 ---
6 --- a/csps/lpc32xx/bsps/fdi3250/startup/examples/s1l/sysapi_timer.c 2011-10-05 19:10:37.000000000 +0200
7 +++ /dev/null 2012-01-01 16:39:47.918907000 +0100
8 @@ -1,212 +0,0 @@
9 -/***********************************************************************
10 - * $Id:: sysapi_timer.c 3394 2010-05-06 17:56:27Z usb10132 $
11 - *
12 - * Project: Time support functions
13 - *
14 - * Description:
15 - * Implements the following functions required for the S1L API
16 - * time_init
17 - * time_reset
18 - * time_start
19 - * time_stop
20 - * time_get
21 - * time_get_rate
22 - *
23 - ***********************************************************************
24 - * Software that is described herein is for illustrative purposes only
25 - * which provides customers with programming information regarding the
26 - * products. This software is supplied "AS IS" without any warranties.
27 - * NXP Semiconductors assumes no responsibility or liability for the
28 - * use of the software, conveys no license or title under any patent,
29 - * copyright, or mask work right to the product. NXP Semiconductors
30 - * reserves the right to make changes in the software without
31 - * notification. NXP Semiconductors also make no representation or
32 - * warranty that such application will be suitable for the specified
33 - * use without further testing or modification.
34 - **********************************************************************/
36 -#include "s1l_sys_inf.h"
37 -#include "lpc32xx_intc_driver.h"
38 -#include "lpc32xx_timer_driver.h"
40 -static UNS_64 base_rate;
41 -static INT_32 tdev = 0;
43 -/***********************************************************************
44 - *
45 - * Function: time_init
46 - *
47 - * Purpose: Initializes time system
48 - *
49 - * Processing: Initializes the system timer.
50 - *
51 - * Parameters: None
52 - *
53 - * Outputs: None
54 - *
55 - * Returns: 0 if the init failed, otherwise non-zero
56 - *
57 - * Notes: None
58 - *
59 - **********************************************************************/
60 -INT_32 time_init(void)
62 - TMR_PSCALE_SETUP_T pscale;
64 - /* Open timer driver */
65 - if (tdev == 0)
66 - {
67 - tdev = timer_open((void *) TIMER_CNTR0, 0);
68 - if (tdev != 0)
69 - {
70 - /* Use a prescale count to 100000 */
71 - pscale.ps_tick_val = 100000;
72 - pscale.ps_us_val = 0; /* Not needed when ps_tick_val != 0 */
73 - timer_ioctl(tdev, TMR_SETUP_PSCALE, (INT_32) &pscale);
75 - /* Get timer clock rate */
76 - base_rate = (UNS_64) timer_ioctl(tdev, TMR_GET_STATUS,
77 - TMR_GET_CLOCK);
78 - }
79 - }
81 - return tdev;
84 -/***********************************************************************
85 - *
86 - * Function: time_reset
87 - *
88 - * Purpose: Resets system timer
89 - *
90 - * Processing:
91 - * See function.
92 - *
93 - * Parameters: None
94 - *
95 - * Outputs: None
96 - *
97 - * Returns: Nothing
98 - *
99 - * Notes: None
101 - **********************************************************************/
102 -void time_reset(void)
104 - if (tdev != 0)
106 - timer_ioctl(tdev, TMR_RESET, 1);
110 -/***********************************************************************
112 - * Function: time_start
114 - * Purpose: Starts system timer
116 - * Processing:
117 - * See function.
119 - * Parameters: None
121 - * Outputs: None
123 - * Returns: Nothing
125 - * Notes: None
127 - **********************************************************************/
128 -void time_start(void)
130 - if (tdev != 0)
132 - timer_ioctl(tdev, TMR_ENABLE, 1);
136 -/***********************************************************************
138 - * Function: time_stop
140 - * Purpose: Stops system timer
142 - * Processing:
143 - * See function.
145 - * Parameters: None
147 - * Outputs: None
149 - * Returns: Nothing
151 - * Notes: None
153 - **********************************************************************/
154 -void time_stop(void)
156 - if (tdev != 0)
158 - timer_ioctl(tdev, TMR_ENABLE, 0);
162 -/***********************************************************************
164 - * Function: time_get
166 - * Purpose: Returns current system time value
168 - * Processing:
169 - * See function.
171 - * Parameters: None
173 - * Outputs: None
175 - * Returns: The number of ticks of the timer counter
177 - * Notes: None
179 - **********************************************************************/
180 -UNS_64 time_get(void)
182 - TMR_COUNTS_T tcounts;
183 - UNS_64 ticks = 0;
185 - if (tdev != 0)
187 - timer_ioctl(tdev, TMR_GET_COUNTS, (INT_32) &tcounts);
189 - /* Compute number of timer ticks */
190 - ticks = (UNS_64) tcounts.count_val * 100000;
191 - ticks = ticks + (UNS_64) tcounts.ps_count_val;
194 - return ticks;
197 -/***********************************************************************
199 - * Function: time_get_rate
201 - * Purpose:
202 - * Returns base tick rate (ticks per second) of the time counter
204 - * Processing:
205 - * See function.
207 - * Parameters: None
209 - * Outputs: None
211 - * Returns: The timer tick rate (in ticks per second)
213 - * Notes: None
215 - **********************************************************************/
216 -UNS_64 time_get_rate(void)
218 - return base_rate;
221 --- a/csps/lpc32xx/bsps/fdi3250/startup/examples/s1l/sys_mmu_cmd_group.c 2011-10-05 19:10:37.000000000 +0200
222 +++ /dev/null 2012-01-01 16:39:47.918907000 +0100
223 @@ -1,746 +0,0 @@
224 -/***********************************************************************
225 - * $Id:: sys_mmu_cmd_group.c 3430 2010-05-07 17:39:08Z usb10132 $
227 - * Project: Command processor for peek, poke, dump, and fill
229 - * Description:
230 - * Processes commands from the command prompt
232 - ***********************************************************************
233 - * Software that is described herein is for illustrative purposes only
234 - * which provides customers with programming information regarding the
235 - * products. This software is supplied "AS IS" without any warranties.
236 - * NXP Semiconductors assumes no responsibility or liability for the
237 - * use of the software, conveys no license or title under any patent,
238 - * copyright, or mask work right to the product. NXP Semiconductors
239 - * reserves the right to make changes in the software without
240 - * notification. NXP Semiconductors also make no representation or
241 - * warranty that such application will be suitable for the specified
242 - * use without further testing or modification.
243 - **********************************************************************/
245 -#include "lpc_arm922t_cp15_driver.h"
246 -#include "lpc_string.h"
247 -#include "startup.h"
248 -#include "s1l_cmds.h"
249 -#include "s1l_sys_inf.h"
251 -/* dcache command */
252 -BOOL_32 cmd_dcache(void);
253 -static UNS_32 cmd_dcache_plist[] =
255 - (PARSE_TYPE_STR), /* The "dcache" command */
256 - (PARSE_TYPE_DEC | PARSE_TYPE_END)
258 -static CMD_ROUTE_T core_dcache_cmd =
260 - (UNS_8 *) "dcache",
261 - cmd_dcache,
262 - (UNS_8 *) "Enables, disables, or flushes data cache",
263 - (UNS_8 *) "dcache [0(disable), 1(enable), 2(flush)]",
264 - cmd_dcache_plist,
265 - NULL
268 -/* icache command */
269 -BOOL_32 cmd_icache(void);
270 -static UNS_32 cmd_icache_plist[] =
272 - (PARSE_TYPE_STR), /* The "icache" command */
273 - (PARSE_TYPE_DEC | PARSE_TYPE_END)
275 -static CMD_ROUTE_T core_icache_cmd =
277 - (UNS_8 *) "icache",
278 - cmd_icache,
279 - (UNS_8 *) "Enables or disables instruction cache",
280 - (UNS_8 *) "icache [0(disable), 1(enable)]",
281 - cmd_icache_plist,
282 - NULL
285 -/* inval command */
286 -BOOL_32 cmd_inval(void);
287 -static UNS_32 cmd_inval_plist[] =
289 - (PARSE_TYPE_STR | PARSE_TYPE_END) /* The "inval" command */
291 -static CMD_ROUTE_T core_inval_cmd =
293 - (UNS_8 *) "inval",
294 - cmd_inval,
295 - (UNS_8 *) "Flushes data cache and invalidates instruction cache",
296 - (UNS_8 *) "inval",
297 - cmd_inval_plist,
298 - NULL
301 -/* mmuenab command */
302 -BOOL_32 cmd_mmuenab(void);
303 -static UNS_32 cmd_mmuenab_plist[] =
305 - (PARSE_TYPE_STR), /* The "mmuenab" command */
306 - (PARSE_TYPE_DEC | PARSE_TYPE_END)
308 -static CMD_ROUTE_T core_mmuenab_cmd =
310 - (UNS_8 *) "mmuenab",
311 - cmd_mmuenab,
312 - (UNS_8 *) "Enables or disables the MMU",
313 - (UNS_8 *) "mmuenab [0(disable), 1(enable)]",
314 - cmd_mmuenab_plist,
315 - NULL
318 -/* map command */
319 -BOOL_32 cmd_map(void);
320 -static UNS_32 cmd_map_plist[] =
322 - (PARSE_TYPE_STR), /* The "map" command */
323 - (PARSE_TYPE_HEX),
324 - (PARSE_TYPE_HEX),
325 - (PARSE_TYPE_DEC),
326 - (PARSE_TYPE_DEC | PARSE_TYPE_END),
328 -static CMD_ROUTE_T core_map_cmd =
330 - (UNS_8 *) "map",
331 - cmd_map,
332 - (UNS_8 *) "Maps a range of physical address sections to virtual addresses",
333 - (UNS_8 *) "map [virt hex addr][phy hex addr][sections][0(uncached), 1(cached), 2(unmap)]",
334 - cmd_map_plist,
335 - NULL
338 -/* mmuinfo command */
339 -static BOOL_32 cmd_mmuinfo(void);
340 -static UNS_32 cmd_mmuinfo_plist[] =
342 - (PARSE_TYPE_STR | PARSE_TYPE_END) /* The "mmuinfo" command */
344 -static CMD_ROUTE_T core_mmuinfo_cmd =
346 - (UNS_8 *) "mmuinfo",
347 - cmd_mmuinfo,
348 - (UNS_8 *) "Dumps page table and MMU info",
349 - (UNS_8 *) "mmuinfo",
350 - cmd_mmuinfo_plist,
351 - NULL
354 -/* MMU group */
355 -static GROUP_LIST_T mmu_group =
357 - (UNS_8 *) "mmu", /* mmu group */
358 - (UNS_8 *) "MMU command group",
359 - NULL,
360 - NULL
363 -static UNS_8 enabled_msg [] =" enabled";
364 -static UNS_8 disabled_msg [] =" disabled";
365 -static UNS_8 dcache_msg[] = "Data cache";
366 -static UNS_8 icache_msg[] = "Instruction cache";
367 -static UNS_8 pagetab_msg[] = "Page table at address: ";
368 -static UNS_8 slist_msg[] = "Type Virt Phy fl Size";
369 -static UNS_8 mmu_msg [] ="MMU";
370 -static UNS_8 cpage_msg[] = "Coarse page:";
371 -static UNS_8 fpage_msg[] = "Fine page :";
372 -static UNS_8 sect_msg[] = "Section :";
373 -static UNS_8 mbytes_msg[] = "M";
374 -static UNS_8 map1_err_msg[] =
375 - "Error : section addresses must be aligned on a 32-bit boundary";
376 -static UNS_8 map2_err_msg[] =
377 - "Error : Number of sections exceeds address range of device";
378 -static UNS_8 phya_msg[] = "Virtual address ";
379 -static UNS_8 mapped_msg[] = " mapped to physical address ";
380 -static UNS_8 unmapped_msg[] = " unmapped from physical address ";
381 -static UNS_8 cached_msg[] = " (cached)";
382 -static UNS_8 inval_msg[] = " invalidated";
383 -static UNS_8 caches_msg [] ="Caches";
384 -static UNS_8 flushed_msg[] = " flushed";
386 -/***********************************************************************
388 - * Function: show_section
390 - * Purpose: Display section information
392 - * Processing:
393 - * See function.
395 - * Parameters:
396 - * mmu_reg : MMU settings for this section
397 - * virt_addr : Starting virtual address for this section
398 - * segs : Number of 1M segments for this section
400 - * Outputs: None
402 - * Returns: Nothing
404 - * Notes: None
406 - **********************************************************************/
407 -static void show_section(UNS_32 mmu_reg,
408 - UNS_32 virt_addr,
409 - UNS_32 segs)
411 - UNS_8 straddr [16];
412 - UNS_32 mmu_phy;
414 - if ((mmu_reg & ARM922T_L1D_TYPE_PG_SN_MASK) !=
415 - ARM922T_L1D_TYPE_FAULT)
417 - if ((mmu_reg & ARM922T_L1D_TYPE_PG_SN_MASK) ==
418 - ARM922T_L1D_TYPE_CPAGE)
420 - term_dat_out(cpage_msg);
422 - else if ((mmu_reg & ARM922T_L1D_TYPE_PG_SN_MASK) ==
423 - ARM922T_L1D_TYPE_FPAGE)
425 - term_dat_out(fpage_msg);
427 - else
429 - term_dat_out(sect_msg);
432 - /* Compute virtual address */
433 - str_makehex(straddr, virt_addr, 8);
434 - term_dat_out(straddr);
435 - term_dat_out((UNS_8 *) " ");
437 - /* Compute mapped physical address */
438 - if ((mmu_reg & ARM922T_L1D_TYPE_PG_SN_MASK) ==
439 - ARM922T_L1D_TYPE_SECTION)
441 - mmu_phy = mmu_reg & 0xFFF00000;
443 - else
445 - /* Don't compute addresses for non-sections */
446 - mmu_phy = 0;
448 - str_makehex(straddr, mmu_phy, 8);
449 - term_dat_out(straddr);
450 - term_dat_out((UNS_8 *) " ");
452 - /* MMU flags */
453 - if ((mmu_reg & ARM922T_L1D_BUFFERABLE) != 0)
455 - term_dat_out((UNS_8 *) "b");
457 - else
459 - term_dat_out((UNS_8 *) " ");
461 - if ((mmu_reg & ARM922T_L1D_CACHEABLE) != 0)
463 - term_dat_out((UNS_8 *) "c");
465 - else
467 - term_dat_out((UNS_8 *) " ");
469 - term_dat_out((UNS_8 *) " ");
471 - /* Displays used megabytes */
472 - str_makedec(straddr, segs);
473 - term_dat_out(straddr);
474 - term_dat_out_crlf(mbytes_msg);
478 -/***********************************************************************
480 - * Function: mmu_dumpinfo
482 - * Purpose: Display MMU info
484 - * Processing:
485 - * Display the MMU information, including enable status, cache
486 - * status, and page table.
488 - * Parameters: None
490 - * Outputs: None
492 - * Returns: TRUE if the command was processed, otherwise FALSE
494 - * Notes: None
496 - **********************************************************************/
497 -static BOOL_32 mmu_dumpinfo(void)
499 - UNS_32 segsz, last_mmu_reg, mmu_vrt, mmu_reg, mmu_vrtsav = 0, *pt;
500 - UNS_32 mlast_mmu_reg, mmmu_reg;
501 - int idx;
502 - UNS_8 hexaddr [16];
504 - term_dat_out(mmu_msg);
505 - if (cp15_mmu_enabled() == FALSE)
507 - term_dat_out_crlf(disabled_msg);
509 - else
511 - term_dat_out_crlf(enabled_msg);
513 - /* Get MMU control register word */
514 - mmu_reg = cp15_get_mmu_control_reg();
516 - /* Instruction cache status */
517 - term_dat_out(icache_msg);
518 - if ((mmu_reg & ARM922T_MMU_CONTROL_I) == 0)
520 - term_dat_out_crlf(disabled_msg);
522 - else
524 - term_dat_out_crlf(enabled_msg);
527 - /* Data cache status */
528 - term_dat_out(dcache_msg);
529 - if ((mmu_reg & ARM922T_MMU_CONTROL_C) == 0)
531 - term_dat_out_crlf(disabled_msg);
533 - else
535 - term_dat_out_crlf(enabled_msg);
538 - term_dat_out(pagetab_msg);
539 - mmu_reg = (UNS_32) cp15_get_ttb();
540 - str_makehex(hexaddr, mmu_reg, 8);
541 - term_dat_out_crlf(hexaddr);
542 - term_dat_out_crlf(slist_msg);
544 - /* Process MMU table - assume that the physical and
545 - virtual locations of table are the same */
546 - pt = (UNS_32 *) mmu_reg;
547 - mmu_vrt = 0x0;
548 - segsz = 0xFFFFFFFF;
549 - last_mmu_reg = mlast_mmu_reg = 0xFFFFFFFF;
550 - for (idx = 0; idx < 4096; idx++)
552 - mmu_reg = *pt;
553 - mmmu_reg = (mmu_reg & (ARM922T_L1D_TYPE_PG_SN_MASK |
554 - ARM922T_L1D_BUFFERABLE | ARM922T_L1D_CACHEABLE));
555 - segsz = segsz + 1;
557 - if ((last_mmu_reg != 0xFFFFFFFF) &&
558 - (mlast_mmu_reg != mmmu_reg))
560 - show_section(last_mmu_reg, mmu_vrtsav, segsz);
561 - segsz = 0;
564 - if (mlast_mmu_reg != mmmu_reg)
566 - mmu_vrtsav = mmu_vrt;
567 - last_mmu_reg = mmu_reg;
568 - mlast_mmu_reg = mmmu_reg;
571 - pt++;
572 - mmu_vrt += 0x00100000;
576 - return TRUE;
579 -/***********************************************************************
581 - * Function: mmu_dumpmap
583 - * Purpose: Map a virtual address range to a physical range
585 - * Processing:
586 - * From the input addresses and number of sections, generate the
587 - * appropriate entries in the page table.
589 - * Parameters: None
591 - * Outputs: None
593 - * Returns: TRUE if the command was processed, otherwise FALSE
595 - * Notes: None
597 - **********************************************************************/
598 -static BOOL_32 mmu_dumpmap(UNS_32 vrt,
599 - UNS_32 phy,
600 - UNS_32 sections,
601 - UNS_32 cache)
603 - BOOL_32 processed = FALSE;
604 - UNS_32 mmu_phy, mmu_vrt, tmp1 = 0, tmp2, *pt;
605 - UNS_8 hexaddr [16];
607 - /* Verify address boundaries are sectional */
608 - mmu_vrt = vrt & ~ARM922T_L2D_SN_BASE_MASK;
609 - mmu_phy = phy & ~ARM922T_L2D_SN_BASE_MASK;
610 - if ((mmu_vrt != 0) || (mmu_phy != 0))
612 - term_dat_out_crlf(map1_err_msg);
614 - else
616 - /* Verify that address range and section count will not
617 - exceed address range of device */
618 - tmp1 = vrt >> 20;
619 - tmp1 = (tmp1 + sections) - 1;
620 - tmp2 = phy >> 20;
621 - tmp2 = (tmp2 + sections) - 1;
622 - if ((tmp1 < 4096) && (tmp2 < 4096))
624 - /* Good address range and good section count */
625 - processed = TRUE;
627 - else
629 - term_dat_out_crlf(map2_err_msg);
633 - /* Generate static part of MMU word */
634 - if (cache == 0)
636 - /* Section mapped with cache disabled */
637 - tmp1 = ARM922T_L1D_TYPE_SECTION;
639 - else if (cache == 1)
641 - /* Section mapped with cache enabled */
642 - tmp1 = (ARM922T_L1D_BUFFERABLE | ARM922T_L1D_CACHEABLE |
643 - ARM922T_L1D_TYPE_SECTION);
645 - else if (cache == 2)
647 - /* Section unmapped */
648 - tmp1 = ARM922T_L1D_TYPE_FAULT;
650 - tmp1 |= ARM922T_L1D_AP_ALL;
652 - /* Offset into page table for virtual address */
653 - tmp2 = (vrt >> 20);
654 - pt = cp15_get_ttb() + tmp2;
656 - /* Loop until all sections are complete */
657 - while ((sections > 0) && (processed == TRUE))
659 - /* Add in physical address */
660 - tmp2 = tmp1 | (phy & ARM922T_L2D_SN_BASE_MASK);
662 - /* Save new section descriptor for virtual address */
663 - *pt = tmp2;
665 - /* Output message shown the map */
666 - term_dat_out(phya_msg);
667 - str_makehex(hexaddr, phy, 8);
668 - term_dat_out(hexaddr);
669 - if (cache == 2)
671 - term_dat_out(unmapped_msg);
673 - else
675 - term_dat_out(mapped_msg);
677 - str_makehex(hexaddr, vrt, 8);
678 - term_dat_out(hexaddr);
679 - if (cache == 1)
681 - term_dat_out(cached_msg);
683 - term_dat_out_crlf((UNS_8 *) "");
685 - /* Next section and page table entry*/
686 - phy += 0x00100000;
687 - vrt += 0x00100000;
688 - pt++;
689 - sections--;
692 - return processed;
695 -/***********************************************************************
697 - * Function: cmd_mmuinfo
699 - * Purpose: Display MMU information
701 - * Processing:
702 - * See function.
704 - * Parameters: None
706 - * Outputs: None
708 - * Returns: TRUE if the command was processed, otherwise FALSE
710 - * Notes: None
712 - **********************************************************************/
713 -static BOOL_32 cmd_mmuinfo(void)
715 - mmu_dumpinfo();
717 - return TRUE;
720 -/***********************************************************************
722 - * Function: cmd_map
724 - * Purpose: Map a physical address region to a virtual region
726 - * Processing:
727 - * See function.
729 - * Parameters: None
731 - * Outputs: None
733 - * Returns: TRUE if the command was processed, otherwise FALSE
735 - * Notes: None
737 - **********************************************************************/
738 -BOOL_32 cmd_map(void)
740 - UNS_32 phy, virt, sects, ce = 0;
742 - /* Get arguments */
743 - virt = cmd_get_field_val(1);
744 - phy = cmd_get_field_val(2);
745 - sects = cmd_get_field_val(3);
746 - ce = cmd_get_field_val(4);
748 - if (ce <= 2)
750 - mmu_dumpmap(virt, phy, sects, ce);
753 - return TRUE;
756 -/***********************************************************************
758 - * Function: cmd_inval
760 - * Purpose: MMU cache flush and invalidate
762 - * Processing:
763 - * See function.
765 - * Parameters: None
767 - * Outputs: None
769 - * Returns: TRUE if the command was processed, otherwise FALSE
771 - * Notes: None
773 - **********************************************************************/
774 -BOOL_32 cmd_inval(void)
776 - dcache_flush();
777 - icache_inval();
778 - term_dat_out(caches_msg);
779 - term_dat_out(inval_msg);
781 - return TRUE;
784 -/***********************************************************************
786 - * Function: cmd_dcache
788 - * Purpose: MMU data cache enable and disable
790 - * Processing:
791 - * If the value passed in the parser is 1, enable the data cache,
792 - * otherwise disable the data cache.
794 - * Parameters: None
796 - * Outputs: None
798 - * Returns: TRUE if the command was processed, otherwise FALSE
800 - * Notes: None
802 - **********************************************************************/
803 -BOOL_32 cmd_dcache(void)
805 - UNS_32 cenable;
806 - UNS_8 *ppar;
808 - /* Get argument */
809 - cenable = cmd_get_field_val(1);
811 - switch (cenable)
813 - case 0:
814 - dcache_flush();
815 - cp15_set_dcache(0);
816 - ppar = disabled_msg;
817 - break;
819 - case 1:
820 - cp15_invalidate_cache();
821 - cp15_set_dcache(1);
822 - ppar = enabled_msg;
823 - break;
825 - case 2:
826 - default:
827 - dcache_flush();
828 - ppar = flushed_msg;
829 - break;
832 - term_dat_out(dcache_msg);
833 - term_dat_out_crlf(ppar);
835 - return TRUE;
838 -/***********************************************************************
840 - * Function: cmd_icache
842 - * Purpose: MMU instruction cache enable and disable
844 - * Processing:
845 - * If the value passed in the parser is 1, enable the instruction
846 - * cache, otherwise disable the instruction cache.
848 - * Parameters: None
850 - * Outputs: None
852 - * Returns: TRUE if the command was processed, otherwise FALSE
854 - * Notes: None
856 - **********************************************************************/
857 -BOOL_32 cmd_icache(void)
859 - UNS_32 cenable;
860 - UNS_8 *ppar;
862 - /* Get argument */
863 - cenable = cmd_get_field_val(1);
865 - if (cenable == 1)
867 - dcache_flush();
868 - cp15_invalidate_cache();
869 - cp15_set_icache(1);
870 - ppar = enabled_msg;
872 - else
874 - cp15_set_icache(0);
875 - ppar = disabled_msg;
878 - term_dat_out(icache_msg);
879 - term_dat_out_crlf(ppar);
881 - return TRUE;
885 -/***********************************************************************
887 - * Function: cmd_mmuenab
889 - * Purpose: Enable or disable MMU
891 - * Processing:
892 - * See function.
894 - * Parameters: None
896 - * Outputs: None
898 - * Returns: TRUE if the command was processed, otherwise FALSE
900 - * Notes: None
902 - **********************************************************************/
903 -BOOL_32 cmd_mmuenab(void)
905 - UNS_8 *ppar;
906 - UNS_32 cenable;
908 - term_dat_out_crlf((UNS_8 *) "Warning: Changing MMU status on "
909 - " cached and buffered code can cause system crashes.");
911 - /* Get argument */
912 - cenable = cmd_get_field_val(1);
914 - if (cenable == 1)
916 - if ((cp15_get_mmu_control_reg() & ARM922T_MMU_CONTROL_C) != 0)
918 - cp15_invalidate_cache();
921 - cp15_set_mmu(1);
922 - ppar = enabled_msg;
924 - else
926 - cp15_dcache_flush();
927 - cp15_write_buffer_flush();
928 - cp15_invalidate_cache();
929 - cp15_set_mmu(0);
930 - ppar = disabled_msg;
933 - term_dat_out(mmu_msg);
934 - term_dat_out_crlf(ppar);
936 - return TRUE;
939 -/***********************************************************************
941 - * Function: mmu_cmd_group_init
943 - * Purpose: Initialize MMU command group
945 - * Processing:
946 - * See function.
948 - * Parameters: None
950 - * Outputs: None
952 - * Returns: Nothin
954 - * Notes: None
956 - **********************************************************************/
957 -void mmu_cmd_group_init(void)
959 - /* Add MMU group */
960 - cmd_add_group(&mmu_group);
962 - /* Add commands to the MMU group */
963 - cmd_add_new_command(&mmu_group, &core_dcache_cmd);
964 - cmd_add_new_command(&mmu_group, &core_icache_cmd);
965 - cmd_add_new_command(&mmu_group, &core_inval_cmd);
966 - cmd_add_new_command(&mmu_group, &core_mmuenab_cmd);
967 - cmd_add_new_command(&mmu_group, &core_map_cmd);
968 - cmd_add_new_command(&mmu_group, &core_mmuinfo_cmd);