aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r--arch/powerpc/kernel/align.c63
-rw-r--r--arch/powerpc/kernel/cputable.c6
-rw-r--r--arch/powerpc/kernel/head_32.S25
-rw-r--r--arch/powerpc/kernel/iommu.c4
-rw-r--r--arch/powerpc/kernel/traps.c9
-rw-r--r--arch/powerpc/kernel/udbg.c2
-rw-r--r--arch/powerpc/kernel/vmlinux.lds.S3
7 files changed, 90 insertions, 22 deletions
diff --git a/arch/powerpc/kernel/align.c b/arch/powerpc/kernel/align.c
index 3839839f83c7..b876e989220b 100644
--- a/arch/powerpc/kernel/align.c
+++ b/arch/powerpc/kernel/align.c
@@ -642,10 +642,14 @@ static int emulate_spe(struct pt_regs *regs, unsigned int reg,
642 */ 642 */
643static int emulate_vsx(unsigned char __user *addr, unsigned int reg, 643static int emulate_vsx(unsigned char __user *addr, unsigned int reg,
644 unsigned int areg, struct pt_regs *regs, 644 unsigned int areg, struct pt_regs *regs,
645 unsigned int flags, unsigned int length) 645 unsigned int flags, unsigned int length,
646 unsigned int elsize)
646{ 647{
647 char *ptr; 648 char *ptr;
649 unsigned long *lptr;
648 int ret = 0; 650 int ret = 0;
651 int sw = 0;
652 int i, j;
649 653
650 flush_vsx_to_thread(current); 654 flush_vsx_to_thread(current);
651 655
@@ -654,19 +658,35 @@ static int emulate_vsx(unsigned char __user *addr, unsigned int reg,
654 else 658 else
655 ptr = (char *) &current->thread.vr[reg - 32]; 659 ptr = (char *) &current->thread.vr[reg - 32];
656 660
657 if (flags & ST) 661 lptr = (unsigned long *) ptr;
658 ret = __copy_to_user(addr, ptr, length); 662
659 else { 663 if (flags & SW)
660 if (flags & SPLT){ 664 sw = elsize-1;
661 ret = __copy_from_user(ptr, addr, length); 665
662 ptr += length; 666 for (j = 0; j < length; j += elsize) {
667 for (i = 0; i < elsize; ++i) {
668 if (flags & ST)
669 ret |= __put_user(ptr[i^sw], addr + i);
670 else
671 ret |= __get_user(ptr[i^sw], addr + i);
663 } 672 }
664 ret |= __copy_from_user(ptr, addr, length); 673 ptr += elsize;
674 addr += elsize;
665 } 675 }
666 if (flags & U) 676
667 regs->gpr[areg] = regs->dar; 677 if (!ret) {
668 if (ret) 678 if (flags & U)
679 regs->gpr[areg] = regs->dar;
680
681 /* Splat load copies the same data to top and bottom 8 bytes */
682 if (flags & SPLT)
683 lptr[1] = lptr[0];
684 /* For 8 byte loads, zero the top 8 bytes */
685 else if (!(flags & ST) && (8 == length))
686 lptr[1] = 0;
687 } else
669 return -EFAULT; 688 return -EFAULT;
689
670 return 1; 690 return 1;
671} 691}
672#endif 692#endif
@@ -767,16 +787,25 @@ int fix_alignment(struct pt_regs *regs)
767 787
768#ifdef CONFIG_VSX 788#ifdef CONFIG_VSX
769 if ((instruction & 0xfc00003e) == 0x7c000018) { 789 if ((instruction & 0xfc00003e) == 0x7c000018) {
770 /* Additional register addressing bit (64 VSX vs 32 FPR/GPR */ 790 unsigned int elsize;
791
792 /* Additional register addressing bit (64 VSX vs 32 FPR/GPR) */
771 reg |= (instruction & 0x1) << 5; 793 reg |= (instruction & 0x1) << 5;
772 /* Simple inline decoder instead of a table */ 794 /* Simple inline decoder instead of a table */
795 /* VSX has only 8 and 16 byte memory accesses */
796 nb = 8;
773 if (instruction & 0x200) 797 if (instruction & 0x200)
774 nb = 16; 798 nb = 16;
775 else if (instruction & 0x080) 799
776 nb = 8; 800 /* Vector stores in little-endian mode swap individual
777 else 801 elements, so process them separately */
778 nb = 4; 802 elsize = 4;
803 if (instruction & 0x80)
804 elsize = 8;
805
779 flags = 0; 806 flags = 0;
807 if (regs->msr & MSR_LE)
808 flags |= SW;
780 if (instruction & 0x100) 809 if (instruction & 0x100)
781 flags |= ST; 810 flags |= ST;
782 if (instruction & 0x040) 811 if (instruction & 0x040)
@@ -787,7 +816,7 @@ int fix_alignment(struct pt_regs *regs)
787 nb = 8; 816 nb = 8;
788 } 817 }
789 PPC_WARN_ALIGNMENT(vsx, regs); 818 PPC_WARN_ALIGNMENT(vsx, regs);
790 return emulate_vsx(addr, reg, areg, regs, flags, nb); 819 return emulate_vsx(addr, reg, areg, regs, flags, nb, elsize);
791 } 820 }
792#endif 821#endif
793 /* A size of 0 indicates an instruction we don't support, with 822 /* A size of 0 indicates an instruction we don't support, with
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index 03c862b6a9c4..2fc82bac3bbc 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -697,9 +697,9 @@ static struct cpu_spec __initdata cpu_specs[] = {
697 .machine_check = machine_check_generic, 697 .machine_check = machine_check_generic,
698 .platform = "ppc750", 698 .platform = "ppc750",
699 }, 699 },
700 { /* 750CL */ 700 { /* 750CL (and "Broadway") */
701 .pvr_mask = 0xfffff0f0, 701 .pvr_mask = 0xfffff0e0,
702 .pvr_value = 0x00087010, 702 .pvr_value = 0x00087000,
703 .cpu_name = "750CL", 703 .cpu_name = "750CL",
704 .cpu_features = CPU_FTRS_750CL, 704 .cpu_features = CPU_FTRS_750CL,
705 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE, 705 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S
index 829c3fe7c5a2..e025e89fe93e 100644
--- a/arch/powerpc/kernel/head_32.S
+++ b/arch/powerpc/kernel/head_32.S
@@ -164,6 +164,9 @@ __after_mmu_off:
164#ifdef CONFIG_PPC_EARLY_DEBUG_CPM 164#ifdef CONFIG_PPC_EARLY_DEBUG_CPM
165 bl setup_cpm_bat 165 bl setup_cpm_bat
166#endif 166#endif
167#ifdef CONFIG_PPC_EARLY_DEBUG_USBGECKO
168 bl setup_usbgecko_bat
169#endif
167 170
168/* 171/*
169 * Call setup_cpu for CPU 0 and initialize 6xx Idle 172 * Call setup_cpu for CPU 0 and initialize 6xx Idle
@@ -1203,6 +1206,28 @@ setup_cpm_bat:
1203 blr 1206 blr
1204#endif 1207#endif
1205 1208
1209#ifdef CONFIG_PPC_EARLY_DEBUG_USBGECKO
1210setup_usbgecko_bat:
1211 /* prepare a BAT for early io */
1212#if defined(CONFIG_GAMECUBE)
1213 lis r8, 0x0c00
1214#elif defined(CONFIG_WII)
1215 lis r8, 0x0d00
1216#else
1217#error Invalid platform for USB Gecko based early debugging.
1218#endif
1219 /*
1220 * The virtual address used must match the virtual address
1221 * associated to the fixmap entry FIX_EARLY_DEBUG_BASE.
1222 */
1223 lis r11, 0xfffe /* top 128K */
1224 ori r8, r8, 0x002a /* uncached, guarded ,rw */
1225 ori r11, r11, 0x2 /* 128K, Vs=1, Vp=0 */
1226 mtspr SPRN_DBAT1L, r8
1227 mtspr SPRN_DBAT1U, r11
1228 blr
1229#endif
1230
1206#ifdef CONFIG_8260 1231#ifdef CONFIG_8260
1207/* Jump into the system reset for the rom. 1232/* Jump into the system reset for the rom.
1208 * We first disable the MMU, and then jump to the ROM reset address. 1233 * We first disable the MMU, and then jump to the ROM reset address.
diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c
index fd51578e29dd..5547ae6e6b0b 100644
--- a/arch/powerpc/kernel/iommu.c
+++ b/arch/powerpc/kernel/iommu.c
@@ -30,7 +30,7 @@
30#include <linux/spinlock.h> 30#include <linux/spinlock.h>
31#include <linux/string.h> 31#include <linux/string.h>
32#include <linux/dma-mapping.h> 32#include <linux/dma-mapping.h>
33#include <linux/bitops.h> 33#include <linux/bitmap.h>
34#include <linux/iommu-helper.h> 34#include <linux/iommu-helper.h>
35#include <linux/crash_dump.h> 35#include <linux/crash_dump.h>
36#include <asm/io.h> 36#include <asm/io.h>
@@ -251,7 +251,7 @@ static void __iommu_free(struct iommu_table *tbl, dma_addr_t dma_addr,
251 } 251 }
252 252
253 ppc_md.tce_free(tbl, entry, npages); 253 ppc_md.tce_free(tbl, entry, npages);
254 iommu_area_free(tbl->it_map, free_entry, npages); 254 bitmap_clear(tbl->it_map, free_entry, npages);
255} 255}
256 256
257static void iommu_free(struct iommu_table *tbl, dma_addr_t dma_addr, 257static void iommu_free(struct iommu_table *tbl, dma_addr_t dma_addr,
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 804f0f30f227..d069ff8a7e03 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -174,6 +174,15 @@ int die(const char *str, struct pt_regs *regs, long err)
174 return 0; 174 return 0;
175} 175}
176 176
177void user_single_step_siginfo(struct task_struct *tsk,
178 struct pt_regs *regs, siginfo_t *info)
179{
180 memset(info, 0, sizeof(*info));
181 info->si_signo = SIGTRAP;
182 info->si_code = TRAP_TRACE;
183 info->si_addr = (void __user *)regs->nip;
184}
185
177void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr) 186void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr)
178{ 187{
179 siginfo_t info; 188 siginfo_t info;
diff --git a/arch/powerpc/kernel/udbg.c b/arch/powerpc/kernel/udbg.c
index fc9af47e2128..e39cad83c884 100644
--- a/arch/powerpc/kernel/udbg.c
+++ b/arch/powerpc/kernel/udbg.c
@@ -60,6 +60,8 @@ void __init udbg_early_init(void)
60 udbg_init_40x_realmode(); 60 udbg_init_40x_realmode();
61#elif defined(CONFIG_PPC_EARLY_DEBUG_CPM) 61#elif defined(CONFIG_PPC_EARLY_DEBUG_CPM)
62 udbg_init_cpm(); 62 udbg_init_cpm();
63#elif defined(CONFIG_PPC_EARLY_DEBUG_USBGECKO)
64 udbg_init_usbgecko();
63#endif 65#endif
64 66
65#ifdef CONFIG_PPC_EARLY_DEBUG 67#ifdef CONFIG_PPC_EARLY_DEBUG
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index 27735a7ac12b..dcd01c82e701 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -38,6 +38,9 @@ jiffies = jiffies_64 + 4;
38#endif 38#endif
39SECTIONS 39SECTIONS
40{ 40{
41 . = 0;
42 reloc_start = .;
43
41 . = KERNELBASE; 44 . = KERNELBASE;
42 45
43/* 46/*