i.MX31: Add a debug menu to play around with DVFS/DPTC settings for fun, testing...
[kugel-rb.git] / firmware / target / arm / mmu-arm.h
blob92a81c0c34f7c928c22a33d66f6e1dad4363383d
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2006,2007 by Greg White
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
22 /* This file MUST be included in your system-target.h file if you want arm
23 * cache coherence functions to be called (I.E. during codec load, etc).
26 #ifndef MMU_ARM_H
27 #define MMU_ARM_H
29 #define CACHE_ALL 0x0C
30 #define CACHE_NONE 0
31 #define BUFFERED 0x04
33 void memory_init(void);
34 void ttb_init(void);
35 void enable_mmu(void);
36 void map_section(unsigned int pa, unsigned int va, int mb, int flags);
38 /* Note for the function names
40 * ARM refers to the cache coherency functions as (in the CPU manuals):
41 * clean (write-back)
42 * clean and invalidate (write-back and removing the line from cache)
43 * invalidate (removing from cache without write-back)
45 * The deprecated functions below don't follow the above (which is why
46 * they're deprecated).
48 * This names have been proven to cause confusion, therefore we use:
49 * commit
50 * commit and discard
51 * discard
54 /* Commits entire DCache */
55 void commit_dcache(void);
56 /* deprecated alias */
57 void clean_dcache(void);
59 /* Commit and discard entire DCache, will do writeback */
60 void commit_discard_dcache(void);
61 /* deprecated alias */
62 void invalidate_dcache(void);
64 /* Write DCache back to RAM for the given range and remove cache lines
65 * from DCache afterwards */
66 void commit_discard_dcache_range(const void *base, unsigned int size);
67 /* deprecated alias */
68 void invalidate_dcache_range(const void *base, unsigned int size);
70 /* Write DCache back to RAM for the given range */
71 void commit_dcache_range(const void *base, unsigned int size);
72 /* deprecated alias */
73 void clean_dcache_range(const void *base, unsigned int size);
76 * Remove cache lines for the given range from DCache
77 * will *NOT* do write back except for buffer edges not on a line boundary
79 void discard_dcache_range(const void *base, unsigned int size);
80 /* deprecated alias */
81 void dump_dcache_range(const void *base, unsigned int size);
83 /* Discards the entire ICache, and commit+discards the entire DCache */
84 void commit_discard_idcache(void);
85 /* deprecated alias */
86 void invalidate_idcache(void);
88 #define HAVE_CPUCACHE_COMMIT_DISCARD
89 #define HAVE_CPUCACHE_COMMIT
90 /* deprecated alias */
91 #define HAVE_CPUCACHE_INVALIDATE
92 #define HAVE_CPUCACHE_FLUSH
94 #endif /* MMU_ARM_H */