From: Greg Kroah-Hartman Date: Sun, 18 Aug 2013 18:28:19 +0000 (-0700) Subject: 3.0-stable patches X-Git-Tag: v3.0.92~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=548ce6da5d24d913329a4ecd32b4a90455cc7ac5;p=thirdparty%2Fkernel%2Fstable-queue.git 3.0-stable patches added patches: arm-7080-1-l2x0-make-sure-i-d-are-not-locked-down-on-init.patch vm-add-no-mmu-vm_iomap_memory-stub.patch --- diff --git a/queue-3.0/arm-7080-1-l2x0-make-sure-i-d-are-not-locked-down-on-init.patch b/queue-3.0/arm-7080-1-l2x0-make-sure-i-d-are-not-locked-down-on-init.patch new file mode 100644 index 00000000000..69aa1ed69c2 --- /dev/null +++ b/queue-3.0/arm-7080-1-l2x0-make-sure-i-d-are-not-locked-down-on-init.patch @@ -0,0 +1,88 @@ +From bac7e6ecf60933b68af910eb4c83a775a8b20b19 Mon Sep 17 00:00:00 2001 +From: Linus Walleij +Date: Tue, 6 Sep 2011 07:45:46 +0100 +Subject: ARM: 7080/1: l2x0: make sure I&D are not locked down on init + +From: Linus Walleij + +commit bac7e6ecf60933b68af910eb4c83a775a8b20b19 upstream. + +Fighting unfixed U-Boots and other beasts that may the cache in +a locked-down state when starting the kernel, we make sure to +disable all cache lock-down when initializing the l2x0 so we +are in a known state. + +Reviewed-by: Santosh Shilimkar +Reported-by: Jan Rinze +Cc: Srinidhi Kasagar +Cc: Rabin Vincent +Cc: Adrian Bunk +Cc: Rob Herring +Cc: Catalin Marinas +Cc: Will Deacon +Tested-by: Robert Marklund +Signed-off-by: Linus Walleij +Signed-off-by: Russell King +Cc: Guenter Roeck +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/include/asm/hardware/cache-l2x0.h | 9 +++++++-- + arch/arm/mm/cache-l2x0.c | 21 +++++++++++++++++++++ + 2 files changed, 28 insertions(+), 2 deletions(-) + +--- a/arch/arm/include/asm/hardware/cache-l2x0.h ++++ b/arch/arm/include/asm/hardware/cache-l2x0.h +@@ -45,8 +45,13 @@ + #define L2X0_CLEAN_INV_LINE_PA 0x7F0 + #define L2X0_CLEAN_INV_LINE_IDX 0x7F8 + #define L2X0_CLEAN_INV_WAY 0x7FC +-#define L2X0_LOCKDOWN_WAY_D 0x900 +-#define L2X0_LOCKDOWN_WAY_I 0x904 ++/* ++ * The lockdown registers repeat 8 times for L310, the L210 has only one ++ * D and one I lockdown register at 0x0900 and 0x0904. ++ */ ++#define L2X0_LOCKDOWN_WAY_D_BASE 0x900 ++#define L2X0_LOCKDOWN_WAY_I_BASE 0x904 ++#define L2X0_LOCKDOWN_STRIDE 0x08 + #define L2X0_TEST_OPERATION 0xF00 + #define L2X0_LINE_DATA 0xF10 + #define L2X0_LINE_TAG 0xF30 +--- a/arch/arm/mm/cache-l2x0.c ++++ b/arch/arm/mm/cache-l2x0.c +@@ -277,6 +277,25 @@ static void l2x0_disable(void) + spin_unlock_irqrestore(&l2x0_lock, flags); + } + ++static void __init l2x0_unlock(__u32 cache_id) ++{ ++ int lockregs; ++ int i; ++ ++ if (cache_id == L2X0_CACHE_ID_PART_L310) ++ lockregs = 8; ++ else ++ /* L210 and unknown types */ ++ lockregs = 1; ++ ++ for (i = 0; i < lockregs; i++) { ++ writel_relaxed(0x0, l2x0_base + L2X0_LOCKDOWN_WAY_D_BASE + ++ i * L2X0_LOCKDOWN_STRIDE); ++ writel_relaxed(0x0, l2x0_base + L2X0_LOCKDOWN_WAY_I_BASE + ++ i * L2X0_LOCKDOWN_STRIDE); ++ } ++} ++ + void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask) + { + __u32 aux; +@@ -328,6 +347,8 @@ void __init l2x0_init(void __iomem *base + * accessing the below registers will fault. + */ + if (!(readl_relaxed(l2x0_base + L2X0_CTRL) & 1)) { ++ /* Make sure that I&D is not locked down when starting */ ++ l2x0_unlock(cache_id); + + /* l2x0 controller is disabled */ + writel_relaxed(aux, l2x0_base + L2X0_AUX_CTRL); diff --git a/queue-3.0/series b/queue-3.0/series index a31a648f9e7..108465b5192 100644 --- a/queue-3.0/series +++ b/queue-3.0/series @@ -8,3 +8,5 @@ sparc32-add-ucmpdi2.patch sparc32-add-ucmpdi2.o-to-obj-y-instead-of-lib-y.patch powerpc-use-mtraceback-no.patch m68k-atari-aranym-fix-natfeat-module-support.patch +arm-7080-1-l2x0-make-sure-i-d-are-not-locked-down-on-init.patch +vm-add-no-mmu-vm_iomap_memory-stub.patch diff --git a/queue-3.0/vm-add-no-mmu-vm_iomap_memory-stub.patch b/queue-3.0/vm-add-no-mmu-vm_iomap_memory-stub.patch new file mode 100644 index 00000000000..daabb00fa0e --- /dev/null +++ b/queue-3.0/vm-add-no-mmu-vm_iomap_memory-stub.patch @@ -0,0 +1,44 @@ +From 3c0b9de6d37a481673e81001c57ca0e410c72346 Mon Sep 17 00:00:00 2001 +From: Linus Torvalds +Date: Sat, 27 Apr 2013 13:25:38 -0700 +Subject: vm: add no-mmu vm_iomap_memory() stub + +From: Linus Torvalds + +commit 3c0b9de6d37a481673e81001c57ca0e410c72346 upstream. + +I think we could just move the full vm_iomap_memory() function into +util.h or similar, but I didn't get any reply from anybody actually +using nommu even to this trivial patch, so I'm not going to touch it any +more than required. + +Here's the fairly minimal stub to make the nommu case at least +potentially work. It doesn't seem like anybody cares, though. + +Signed-off-by: Linus Torvalds +Cc: Guenter Roeck +Signed-off-by: Greg Kroah-Hartman + +--- + mm/nommu.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +--- a/mm/nommu.c ++++ b/mm/nommu.c +@@ -1826,6 +1826,16 @@ int remap_pfn_range(struct vm_area_struc + } + EXPORT_SYMBOL(remap_pfn_range); + ++int vm_iomap_memory(struct vm_area_struct *vma, phys_addr_t start, unsigned long len) ++{ ++ unsigned long pfn = start >> PAGE_SHIFT; ++ unsigned long vm_len = vma->vm_end - vma->vm_start; ++ ++ pfn += vma->vm_pgoff; ++ return io_remap_pfn_range(vma, vma->vm_start, pfn, vm_len, vma->vm_page_prot); ++} ++EXPORT_SYMBOL(vm_iomap_memory); ++ + int remap_vmalloc_range(struct vm_area_struct *vma, void *addr, + unsigned long pgoff) + {