Michal Jaegermann <[EMAIL PROTECTED]> writes:

> Looking at the code it appears to me that these patches are not
> limited to 2.3.99-pre8 but are equally valid (or invalid, as the
> case may be) for 2.2 kernels as well.  No, I did not check how they
> would fit into an existing sources.

It looks like pci_set_master() became architecture specific between
pre6 and pre8.  The previous arch-indep version of it did the same
thing as the version in the patch, so that part of the diff is not
necessary for 2.2.

For your convenience, here is a version of that patch for 2.2.14,
which should also work in 2.2.15.  It seems to work on Miata, but I
don't have a net-accessible SX164 at the moment.

diff --exclude=*~ -urN linux-2.2-vanilla/arch/alpha/kernel/core_pyxis.c 
linux-2.2/arch/alpha/kernel/core_pyxis.c
--- linux-2.2-vanilla/arch/alpha/kernel/core_pyxis.c    Tue Jan  4 13:12:11 2000
+++ linux-2.2/arch/alpha/kernel/core_pyxis.c    Tue May 23 12:17:15 2000
@@ -15,6 +15,7 @@
 
 #include <asm/ptrace.h>
 #include <asm/system.h>
+#include <asm/hwrpb.h>
 
 #define __EXTERN_INLINE inline
 #include <asm/io.h>
@@ -514,6 +515,23 @@
 void __init
 pyxis_init_arch(unsigned long *mem_start, unsigned long *mem_end)
 {
+       unsigned int cc0, cc1;
+       unsigned long pyxis_cc;
+
+       /* On pyxis machines we can precisely calculate the
+          CPU clock frequency using pyxis real time counter.
+          Especially it's useful for SX164 with broken RTC.
+          Both CPU and chipset are driven by the single 16.666M
+          or 16.667M crystal oscillator. PYXIS_RT_COUNT clock is
+          66.66 MHz. -ink */
+
+       __asm__ __volatile__ ("rpcc %0" : "=r"(cc0));
+       pyxis_cc = *(vulp)PYXIS_RT_COUNT;
+       do { } while(*(vulp)PYXIS_RT_COUNT - pyxis_cc < 4096);
+       __asm__ __volatile__ ("rpcc %0" : "=r"(cc1));
+       cc1 -= cc0;
+       hwrpb->cycle_freq = ((cc1 >> 11) * 100000000UL) / 3;
+
        pyxis_enable_errors();
        if (!pyxis_srm_window_setup())
                pyxis_native_window_setup();
diff --exclude=*~ -urN linux-2.2-vanilla/arch/alpha/kernel/sys_sx164.c 
linux-2.2/arch/alpha/kernel/sys_sx164.c
--- linux-2.2-vanilla/arch/alpha/kernel/sys_sx164.c     Sun Feb 21 22:06:36 1999
+++ linux-2.2/arch/alpha/kernel/sys_sx164.c     Tue May 23 12:21:19 2000
@@ -24,6 +24,7 @@
 #include <asm/io.h>
 #include <asm/pgtable.h>
 #include <asm/core_pyxis.h>
+#include <asm/hwrpb.h>
 
 #include "proto.h"
 #include "irq.h"
@@ -186,6 +187,35 @@
        SMC669_Init(0);
 }
 
+static void __init
+sx164_init_arch(unsigned long *mem_start, unsigned long *mem_end)
+{
+       /*
+        * OSF palcode v1.23 forgets to enable PCA56 Motion Video
+        * Instructions. Let's enable it.
+        * We have to check palcode revision because CSERVE interface
+        * is subject to change without notice. For example, it
+        * has been changed completely since v1.16 (found in MILO
+        * distribution). -ink
+        */
+       struct percpu_struct *cpu = (struct percpu_struct*)
+                               ((char*)hwrpb + hwrpb->processor_offset);
+
+       if (alpha_using_srm && (cpu->pal_revision & 0xffff) == 0x117) {
+               __asm__ __volatile__(
+               "lda    $16,8($31)\n"
+               "call_pal 9\n"          /* Allow PALRES insns in kernel mode */
+               "pal19  0x118\n"        /* hw_mfpr $0,icsr */
+               "ldah   $16,(1<<(19-16))($31)\n"
+               "or     $0,$16,$0\n"    /* set MVE bit */
+               "pal1d  0x118\n"        /* hw_mtpr $0,icsr */
+               "lda    $16,9($31)\n"
+               "call_pal 9"            /* Disable PALRES insns */
+               : : : "$0", "$16");
+               printk("PCA56 MVI set enabled\n");
+       }
+       pyxis_init_arch(mem_start, mem_end);
+}
 
 /*
  * The System Vector
@@ -206,7 +236,7 @@
        ack_irq:                generic_ack_irq,
        device_interrupt:       sx164_device_interrupt,
 
-       init_arch:              pyxis_init_arch,
+       init_arch:              sx164_init_arch,
        init_irq:               sx164_init_irq,
        init_pit:               generic_init_pit,
        pci_fixup:              sx164_pci_fixup,


-- 
David Huggins-Daines, Senior GNU/Linux Consultant, Linuxcare, Inc.
613.562.1239 desk, 613.223.0225 mobile
[EMAIL PROTECTED], http://www.linuxcare.com/
Linuxcare. Support for the revolution.

Reply via email to