Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1 | /* |
| 2 | * File: arch/blackfin/mach-common/cacheinit.S |
| 3 | * Based on: |
| 4 | * Author: LG Soft India |
| 5 | * |
| 6 | * Created: ? |
| 7 | * Description: cache initialization |
| 8 | * |
| 9 | * Modified: |
| 10 | * Copyright 2004-2006 Analog Devices Inc. |
| 11 | * |
| 12 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ |
| 13 | * |
| 14 | * This program is free software; you can redistribute it and/or modify |
| 15 | * it under the terms of the GNU General Public License as published by |
| 16 | * the Free Software Foundation; either version 2 of the License, or |
| 17 | * (at your option) any later version. |
| 18 | * |
| 19 | * This program is distributed in the hope that it will be useful, |
| 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 22 | * GNU General Public License for more details. |
| 23 | * |
| 24 | * You should have received a copy of the GNU General Public License |
| 25 | * along with this program; if not, see the file COPYING, or write |
| 26 | * to the Free Software Foundation, Inc., |
| 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 28 | */ |
| 29 | |
| 30 | /* This function sets up the data and instruction cache. The |
| 31 | * tables like icplb table, dcplb table and Page Descriptor table |
| 32 | * are defined in cplbtab.h. You can configure those tables for |
| 33 | * your suitable requirements |
| 34 | */ |
| 35 | |
| 36 | #include <linux/linkage.h> |
| 37 | #include <asm/blackfin.h> |
| 38 | |
| 39 | .text |
| 40 | |
Mike Frysinger | 1aafd90 | 2007-07-25 11:19:14 +0800 | [diff] [blame] | 41 | #if ANOMALY_05000125 |
Robin Getz | 3bebca2 | 2007-10-10 23:55:26 +0800 | [diff] [blame] | 42 | #if defined(CONFIG_BFIN_ICACHE) |
Bernd Schmidt | 29440a2 | 2007-07-12 16:25:29 +0800 | [diff] [blame] | 43 | ENTRY(_bfin_write_IMEM_CONTROL) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 44 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 45 | /* Enable Instruction Cache */ |
Mike Frysinger | e208f83 | 2007-07-25 10:11:42 +0800 | [diff] [blame] | 46 | P0.l = LO(IMEM_CONTROL); |
| 47 | P0.h = HI(IMEM_CONTROL); |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 48 | |
| 49 | /* Anomaly 05000125 */ |
Bernd Schmidt | 29440a2 | 2007-07-12 16:25:29 +0800 | [diff] [blame] | 50 | CLI R1; |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 51 | SSYNC; /* SSYNC required before writing to IMEM_CONTROL. */ |
| 52 | .align 8; |
| 53 | [P0] = R0; |
| 54 | SSYNC; |
Bernd Schmidt | 29440a2 | 2007-07-12 16:25:29 +0800 | [diff] [blame] | 55 | STI R1; |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 56 | RTS; |
Mike Frysinger | 51be24c | 2007-06-11 15:31:30 +0800 | [diff] [blame] | 57 | |
Bernd Schmidt | 29440a2 | 2007-07-12 16:25:29 +0800 | [diff] [blame] | 58 | ENDPROC(_bfin_write_IMEM_CONTROL) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 59 | #endif |
| 60 | |
Robin Getz | 3bebca2 | 2007-10-10 23:55:26 +0800 | [diff] [blame] | 61 | #if defined(CONFIG_BFIN_DCACHE) |
Bernd Schmidt | 29440a2 | 2007-07-12 16:25:29 +0800 | [diff] [blame] | 62 | ENTRY(_bfin_write_DMEM_CONTROL) |
Robin Getz | 3bebca2 | 2007-10-10 23:55:26 +0800 | [diff] [blame] | 63 | P0.l = LO(DMEM_CONTROL); |
| 64 | P0.h = HI(DMEM_CONTROL); |
Bernd Schmidt | f1b927d | 2007-07-24 18:17:15 +0800 | [diff] [blame] | 65 | |
Bernd Schmidt | 29440a2 | 2007-07-12 16:25:29 +0800 | [diff] [blame] | 66 | CLI R1; |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 67 | SSYNC; /* SSYNC required before writing to DMEM_CONTROL. */ |
| 68 | .align 8; |
| 69 | [P0] = R0; |
| 70 | SSYNC; |
Bernd Schmidt | 29440a2 | 2007-07-12 16:25:29 +0800 | [diff] [blame] | 71 | STI R1; |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 72 | RTS; |
Mike Frysinger | 51be24c | 2007-06-11 15:31:30 +0800 | [diff] [blame] | 73 | |
Bernd Schmidt | 29440a2 | 2007-07-12 16:25:29 +0800 | [diff] [blame] | 74 | ENDPROC(_bfin_write_DMEM_CONTROL) |
| 75 | #endif |
| 76 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 77 | #endif |