Skip to content

Commit 4d3190f

Browse files
amachronicspeachy
authored andcommitted
arm: split ARM cache maintenance functions to separate header
Cortex-M processors don't have an MMU, but can still have caches that need software management, so on those platforms we don't want to include the MMU related functions. While here, remove an outdated section of a comment referring to deprecated cache maintenance functions which no longer exist. Change-Id: I6f0fe694560bdee25ed7c69a846bf46e3e544cb1
1 parent bfa76dc commit 4d3190f

File tree

22 files changed

+75
-51
lines changed

22 files changed

+75
-51
lines changed

bootloader/gigabeat.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
#include "loader_strerror.h"
4545
#include "rbunicode.h"
4646
#include "usb.h"
47-
#include "mmu-arm.h"
4847
#include "rtc.h"
4948
#include "version.h"
5049

firmware/target/arm/as3525/pcm-as3525.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "as3514.h"
3030
#include "audiohw.h"
3131
#include "mmu-arm.h"
32+
#include "cpucache-arm.h"
3233
#include "pcm-internal.h"
3334

3435
#define MAX_TRANSFER (4*((1<<11)-1)) /* maximum data we can transfer via DMA

firmware/target/arm/as3525/system-target.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
#include "system-arm.h"
2828
#include "mmu-arm.h"
29+
#include "cpucache-arm.h"
2930
#include "panic.h"
3031

3132
#include "clock-target.h" /* CPUFREQ_* are defined here */

firmware/target/arm/cpucache-arm.h

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/***************************************************************************
2+
* __________ __ ___.
3+
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
4+
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5+
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6+
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7+
* \/ \/ \/ \/ \/
8+
* $Id$
9+
*
10+
* Copyright (C) 2006,2007 by Greg White
11+
*
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.
16+
*
17+
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18+
* KIND, either express or implied.
19+
*
20+
****************************************************************************/
21+
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).
24+
*/
25+
26+
#ifndef CPUCACHE_ARM_H
27+
#define CPUCACHE_ARM_H
28+
29+
/* Note for the function names
30+
*
31+
* ARM refers to the cache coherency functions as (in the CPU manuals):
32+
* clean (write-back)
33+
* clean and invalidate (write-back and removing the line from cache)
34+
* invalidate (removing from cache without write-back)
35+
*
36+
* This names have been proven to cause confusion, therefore we use:
37+
* commit
38+
* commit and discard
39+
* discard
40+
*/
41+
42+
/* Commits entire DCache */
43+
void commit_dcache(void);
44+
45+
/* Commit and discard entire DCache, will do writeback */
46+
void commit_discard_dcache(void);
47+
48+
/* Write DCache back to RAM for the given range and remove cache lines
49+
* from DCache afterwards */
50+
void commit_discard_dcache_range(const void *base, unsigned int size);
51+
52+
/* Write DCache back to RAM for the given range */
53+
void commit_dcache_range(const void *base, unsigned int size);
54+
55+
/*
56+
* Remove cache lines for the given range from DCache
57+
* will *NOT* do write back except for buffer edges not on a line boundary
58+
*/
59+
void discard_dcache_range(const void *base, unsigned int size);
60+
61+
/* Discards the entire ICache, and commit+discards the entire DCache */
62+
void commit_discard_idcache(void);
63+
64+
#endif /* CPUCACHE_ARM_H */

firmware/target/arm/imx233/system-target.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
#include "system-arm.h"
2525
#include "mmu-arm.h"
26+
#include "cpucache-arm.h"
2627
#include "panic.h"
2728
#include "clkctrl-imx233.h"
2829
#include "icoll-imx233.h"

firmware/target/arm/imx31/gigabeat-s/system-target.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
#include "system-arm.h"
2525
#include "mmu-arm.h"
26+
#include "cpucache-arm.h"
2627

2728
/* High enough for most tasks but low enough for reduced voltage */
2829
#define CPUFREQ_DEFAULT 264000000

firmware/target/arm/mmu-arm.h

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@
1919
*
2020
****************************************************************************/
2121

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).
24-
*/
25-
2622
#ifndef MMU_ARM_H
2723
#define MMU_ARM_H
2824

@@ -35,42 +31,4 @@ void ttb_init(void);
3531
void enable_mmu(void);
3632
void map_section(unsigned int pa, unsigned int va, int mb, int flags);
3733

38-
/* Note for the function names
39-
*
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)
44-
*
45-
* The deprecated functions below don't follow the above (which is why
46-
* they're deprecated).
47-
*
48-
* This names have been proven to cause confusion, therefore we use:
49-
* commit
50-
* commit and discard
51-
* discard
52-
*/
53-
54-
/* Commits entire DCache */
55-
void commit_dcache(void);
56-
57-
/* Commit and discard entire DCache, will do writeback */
58-
void commit_discard_dcache(void);
59-
60-
/* Write DCache back to RAM for the given range and remove cache lines
61-
* from DCache afterwards */
62-
void commit_discard_dcache_range(const void *base, unsigned int size);
63-
64-
/* Write DCache back to RAM for the given range */
65-
void commit_dcache_range(const void *base, unsigned int size);
66-
67-
/*
68-
* Remove cache lines for the given range from DCache
69-
* will *NOT* do write back except for buffer edges not on a line boundary
70-
*/
71-
void discard_dcache_range(const void *base, unsigned int size);
72-
73-
/* Discards the entire ICache, and commit+discards the entire DCache */
74-
void commit_discard_idcache(void);
75-
7634
#endif /* MMU_ARM_H */

firmware/target/arm/s3c2440/dma-s3c2440.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include "config.h"
2424
#include "panic.h"
2525
#include "system.h"
26-
#include "mmu-arm.h"
2726
#include "s3c2440.h"
2827
#include "dma-target.h"
2928
#include "system-target.h"

firmware/target/arm/s3c2440/system-s3c2440.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include "kernel.h"
2222
#include "system.h"
2323
#include "panic.h"
24-
#include "mmu-arm.h"
2524
#include "cpu.h"
2625
#include "gcc_extensions.h"
2726

firmware/target/arm/s3c2440/system-target.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
#include "system-arm.h"
2525
#include "mmu-arm.h"
26+
#include "cpucache-arm.h"
2627

2728
/* NB: These values must match the register settings in s3c2440/crt0.S */
2829

0 commit comments

Comments
 (0)