-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sh: Support fixed 32-bit PMB mappings from bootloader.
This provides a method for supporting fixed PMB mappings inherited from the bootloader, as an alternative to the dynamic PMB mapping currently used by the kernel. In the future these methods will be combined. P1/P2 area is handled like a regular 29-bit physical address, and local bus device are assigned P3 area addresses. Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
- Loading branch information
Yoshihiro Shimoda
authored and
Paul Mundt
committed
Mar 10, 2009
1 parent
a29b99e
commit 2f47f44
Showing
9 changed files
with
104 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* arch/sh/mm/fixed_pmb.c | ||
* | ||
* Copyright (C) 2009 Renesas Solutions Corp. | ||
* | ||
* This file is subject to the terms and conditions of the GNU General Public | ||
* License. See the file "COPYING" in the main directory of this archive | ||
* for more details. | ||
*/ | ||
#include <linux/init.h> | ||
#include <linux/mm.h> | ||
#include <linux/io.h> | ||
#include <asm/mmu.h> | ||
#include <asm/mmu_context.h> | ||
|
||
static int __uses_jump_to_uncached fixed_pmb_init(void) | ||
{ | ||
int i; | ||
unsigned long addr, data; | ||
|
||
jump_to_uncached(); | ||
|
||
for (i = 0; i < PMB_ENTRY_MAX; i++) { | ||
addr = PMB_DATA + (i << PMB_E_SHIFT); | ||
data = ctrl_inl(addr); | ||
if (!(data & PMB_V)) | ||
continue; | ||
|
||
if (data & PMB_C) { | ||
#if defined(CONFIG_CACHE_WRITETHROUGH) | ||
data |= PMB_WT; | ||
#elif defined(CONFIG_CACHE_WRITEBACK) | ||
data &= ~PMB_WT; | ||
#else | ||
data &= ~(PMB_C | PMB_WT); | ||
#endif | ||
} | ||
ctrl_outl(data, addr); | ||
} | ||
|
||
back_to_cached(); | ||
|
||
return 0; | ||
} | ||
arch_initcall(fixed_pmb_init); |