Merge branch 'master' of git://oak/home/sfr/kernels/iseries/work
authorPaul Mackerras <paulus@samba.org>
Wed, 4 Oct 2006 05:02:27 +0000 (15:02 +1000)
committerPaul Mackerras <paulus@samba.org>
Wed, 4 Oct 2006 05:02:27 +0000 (15:02 +1000)
1  2 
arch/powerpc/Kconfig
arch/powerpc/kernel/misc_64.S
drivers/char/hvc_iseries.c

diff --combined arch/powerpc/Kconfig
index 032e6ab5d3c4f314a68bcefe8b4ca3417e8cd138,0969fe89df83e20a402e4c4c2eeec1685ba57a6c..5342f3fdb0838ffea0a3f0f6e10c47b1611774c5
@@@ -338,10 -338,6 +338,6 @@@ config PPC_MULTIPLATFOR
          RS/6000 machine, an Apple machine, or a PReP, CHRP,
          Maple or Cell-based machine.
  
- config PPC_ISERIES
-       bool "IBM Legacy iSeries"
-       depends on PPC64
  config EMBEDDED6xx
        bool "Embedded 6xx/7xx/7xxx-based board"
        depends on PPC32 && (BROKEN||BROKEN_ON_SMP)
@@@ -365,6 -361,10 +361,10 @@@ config PPC_PSERIE
        select PPC_UDBG_16550
        default y
  
+ config PPC_ISERIES
+       bool "IBM Legacy iSeries"
+       depends on PPC_MULTIPLATFORM && PPC64
  config PPC_CHRP
        bool "Common Hardware Reference Platform (CHRP) based machines"
        depends on PPC_MULTIPLATFORM && PPC32
@@@ -731,10 -731,11 +731,10 @@@ config ARCH_SPARSEMEM_DEFAUL
        def_bool y
        depends on SMP && PPC_PSERIES
  
 -source "mm/Kconfig"
 -
 -config HAVE_ARCH_EARLY_PFN_TO_NID
 +config ARCH_POPULATES_NODE_MAP
        def_bool y
 -      depends on NEED_MULTIPLE_NODES
 +
 +source "mm/Kconfig"
  
  config ARCH_MEMORY_PROBE
        def_bool y
@@@ -1069,7 -1070,7 +1069,7 @@@ source "arch/powerpc/oprofile/Kconfig
  
  config KPROBES
        bool "Kprobes (EXPERIMENTAL)"
 -      depends on PPC64 && EXPERIMENTAL && MODULES
 +      depends on PPC64 && KALLSYMS && EXPERIMENTAL && MODULES
        help
          Kprobes allows you to trap at almost any kernel address and
          execute a callback function.  register_kprobe() establishes
index 9c54eccad9933fc71903cda34fe9090617f3d4f8,465a7641cd0fc92d51f587faf15ab26e9433472b..41521b30c3cdd36f3a369bf9c8b902b4cb6b22b3
@@@ -325,6 -325,52 +325,52 @@@ _GLOBAL(do_cpu_ftr_fixups
        isync
        b       1b
  
+ /*
+  * do_fw_ftr_fixups - goes through the list of firmware feature fixups
+  * and writes nop's over sections of code that don't apply for this firmware.
+  * r3 = data offset (not changed)
+  */
+ _GLOBAL(do_fw_ftr_fixups)
+       /* Get firmware features */
+       LOAD_REG_IMMEDIATE(r6,powerpc_firmware_features)
+       sub     r6,r6,r3
+       ld      r4,0(r6)
+       /* Get the fixup table */
+       LOAD_REG_IMMEDIATE(r6,__start___fw_ftr_fixup)
+       sub     r6,r6,r3
+       LOAD_REG_IMMEDIATE(r7,__stop___fw_ftr_fixup)
+       sub     r7,r7,r3
+       /* Do the fixup */
+ 1:    cmpld   r6,r7
+       bgelr
+       addi    r6,r6,32
+       ld      r8,-32(r6)      /* mask */
+       and     r8,r8,r4
+       ld      r9,-24(r6)      /* value */
+       cmpld   r8,r9
+       beq     1b
+       ld      r8,-16(r6)      /* section begin */
+       ld      r9,-8(r6)       /* section end */
+       subf.   r9,r8,r9
+       beq     1b
+       /* write nops over the section of code */
+       /* todo: if large section, add a branch at the start of it */
+       srwi    r9,r9,2
+       mtctr   r9
+       sub     r8,r8,r3
+       lis     r0,0x60000000@h /* nop */
+ 3:    stw     r0,0(r8)
+ BEGIN_FTR_SECTION
+       dcbst   0,r8            /* suboptimal, but simpler */
+       sync
+       icbi    0,r8
+ END_FTR_SECTION_IFSET(CPU_FTR_SPLIT_ID_CACHE)
+       addi    r8,r8,4
+       bdnz    3b
+       sync                    /* additional sync needed on g4 */
+       isync
+       b       1b
  #if defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_MAPLE)
  /*
   * Do an IO access in real mode
@@@ -556,7 -602,7 +602,7 @@@ _GLOBAL(giveup_altivec
  
  #endif /* CONFIG_ALTIVEC */
  
 -_GLOBAL(execve)
 +_GLOBAL(kernel_execve)
        li      r0,__NR_execve
        sc
        bnslr
index 8b6f197e5f8cbce32a307bec1be4d66846b43103,ea362011bd5beed49a57ae815efe6af7dee3a3d9..f144a947bd17aaa8549230e307c13def30296822
@@@ -29,6 -29,7 +29,7 @@@
  #include <asm/hvconsole.h>
  #include <asm/vio.h>
  #include <asm/prom.h>
+ #include <asm/firmware.h>
  #include <asm/iseries/vio.h>
  #include <asm/iseries/hv_call.h>
  #include <asm/iseries/hv_lp_config.h>
@@@ -153,7 -154,9 +154,7 @@@ static int put_chars(uint32_t vtermno, 
        spin_lock_irqsave(&consolelock, flags);
  
        if (viochar_is_console(pi) && !viopath_isactive(pi->lp)) {
 -              spin_lock_irqsave(&consoleloglock, flags);
                HvCall_writeLogBuffer(buf, count);
 -              spin_unlock_irqrestore(&consoleloglock, flags);
                sent = count;
                goto done;
        }
  
                len = (count > VIOCHAR_MAX_DATA) ? VIOCHAR_MAX_DATA : count;
  
 -              if (viochar_is_console(pi)) {
 -                      spin_lock_irqsave(&consoleloglock, flags);
 +              if (viochar_is_console(pi))
                        HvCall_writeLogBuffer(buf, len);
 -                      spin_unlock_irqrestore(&consoleloglock, flags);
 -              }
  
                init_data_event(viochar, pi->lp);
  
@@@ -488,6 -494,9 +489,9 @@@ static int hvc_vio_init(void
        atomic_t wait_flag;
        int rc;
  
+       if (!firmware_has_feature(FW_FEATURE_ISERIES))
+               return -EIO;
        /* +2 for fudge */
        rc = viopath_open(HvLpConfig_getPrimaryLpIndex(),
                        viomajorsubtype_chario, VIOCHAR_WINDOW + 2);
@@@ -562,7 -571,7 +566,7 @@@ static int hvc_find_vtys(void
  
        for (vty = of_find_node_by_name(NULL, "vty"); vty != NULL;
                        vty = of_find_node_by_name(vty, "vty")) {
-               uint32_t *vtermno;
+               const uint32_t *vtermno;
  
                /* We have statically defined space for only a certain number
                 * of console adapters.
                                (num_found >= VTTY_PORTS))
                        break;
  
-               vtermno = (uint32_t *)get_property(vty, "reg", NULL);
+               vtermno = get_property(vty, "reg", NULL);
                if (!vtermno)
                        continue;