ide: move ->failed_pc to ide_drive_t
[linux-ginger.git] / arch / sh / mm / pmb-fixed.c
blob43c8eac4d8a150a8414e50ad00f1d10d34e872c3
1 /*
2 * arch/sh/mm/fixed_pmb.c
4 * Copyright (C) 2009 Renesas Solutions Corp.
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10 #include <linux/init.h>
11 #include <linux/mm.h>
12 #include <linux/io.h>
13 #include <asm/mmu.h>
14 #include <asm/mmu_context.h>
16 static int __uses_jump_to_uncached fixed_pmb_init(void)
18 int i;
19 unsigned long addr, data;
21 jump_to_uncached();
23 for (i = 0; i < PMB_ENTRY_MAX; i++) {
24 addr = PMB_DATA + (i << PMB_E_SHIFT);
25 data = ctrl_inl(addr);
26 if (!(data & PMB_V))
27 continue;
29 if (data & PMB_C) {
30 #if defined(CONFIG_CACHE_WRITETHROUGH)
31 data |= PMB_WT;
32 #elif defined(CONFIG_CACHE_WRITEBACK)
33 data &= ~PMB_WT;
34 #else
35 data &= ~(PMB_C | PMB_WT);
36 #endif
38 ctrl_outl(data, addr);
41 back_to_cached();
43 return 0;
45 arch_initcall(fixed_pmb_init);