2007-01-04 02:50:45 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
* $Id$
|
|
|
|
*
|
2007-01-04 11:10:46 +00:00
|
|
|
* Copyright (C) 2006,2007 by Greg White
|
2007-01-04 02:50:45 +00:00
|
|
|
*
|
2008-06-28 18:10:04 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2007-01-04 02:50:45 +00:00
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
2009-07-05 01:17:25 +00:00
|
|
|
|
|
|
|
/* This file MUST be included in your system-target.h file if you want arm
|
|
|
|
* cache coherence functions to be called (I.E. during codec load, etc).
|
|
|
|
*/
|
|
|
|
|
2009-02-11 23:56:00 +00:00
|
|
|
#ifndef MMU_ARM_H
|
2009-02-12 00:09:12 +00:00
|
|
|
#define MMU_ARM_H
|
2007-01-04 02:50:45 +00:00
|
|
|
|
2008-04-22 04:34:25 +00:00
|
|
|
#define CACHE_ALL 0x0C
|
|
|
|
#define CACHE_NONE 0
|
|
|
|
#define BUFFERED 0x04
|
2007-10-23 03:29:15 +00:00
|
|
|
|
2009-02-11 23:56:00 +00:00
|
|
|
void memory_init(void);
|
2007-10-23 03:29:15 +00:00
|
|
|
void ttb_init(void);
|
|
|
|
void enable_mmu(void);
|
2008-04-22 04:34:25 +00:00
|
|
|
void map_section(unsigned int pa, unsigned int va, int mb, int flags);
|
|
|
|
|
2010-09-08 17:05:49 +00:00
|
|
|
/* Note for the function names
|
|
|
|
*
|
|
|
|
* ARM refers to the cache coherency functions as (in the CPU manuals):
|
|
|
|
* clean (write-back)
|
|
|
|
* clean and invalidate (write-back and removing the line from cache)
|
|
|
|
* invalidate (removing from cache without write-back)
|
|
|
|
*
|
|
|
|
* The deprecated functions below don't follow the above (which is why
|
|
|
|
* they're deprecated).
|
|
|
|
*
|
|
|
|
* This names have been proven to cause confusion, therefore we use:
|
|
|
|
* commit
|
|
|
|
* commit and discard
|
|
|
|
* discard
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Commits entire DCache */
|
|
|
|
void commit_dcache(void);
|
2007-10-23 03:29:15 +00:00
|
|
|
|
2010-09-08 17:05:49 +00:00
|
|
|
/* Commit and discard entire DCache, will do writeback */
|
|
|
|
void commit_discard_dcache(void);
|
2009-02-11 23:56:00 +00:00
|
|
|
|
2010-09-08 17:05:49 +00:00
|
|
|
/* Write DCache back to RAM for the given range and remove cache lines
|
|
|
|
* from DCache afterwards */
|
|
|
|
void commit_discard_dcache_range(const void *base, unsigned int size);
|
2007-01-04 02:50:45 +00:00
|
|
|
|
2010-09-08 17:05:49 +00:00
|
|
|
/* Write DCache back to RAM for the given range */
|
|
|
|
void commit_dcache_range(const void *base, unsigned int size);
|
2007-01-04 02:50:45 +00:00
|
|
|
|
2010-09-08 17:05:49 +00:00
|
|
|
/*
|
|
|
|
* Remove cache lines for the given range from DCache
|
|
|
|
* will *NOT* do write back except for buffer edges not on a line boundary
|
|
|
|
*/
|
|
|
|
void discard_dcache_range(const void *base, unsigned int size);
|
2007-01-04 02:50:45 +00:00
|
|
|
|
2010-09-08 17:05:49 +00:00
|
|
|
/* Discards the entire ICache, and commit+discards the entire DCache */
|
|
|
|
void commit_discard_idcache(void);
|
2009-02-11 23:56:00 +00:00
|
|
|
|
|
|
|
#endif /* MMU_ARM_H */
|