]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/alpha/kernel/core_marvel.c
smp_call_function: get rid of the unused nonatomic/retry argument
[linux-2.6-omap-h63xx.git] / arch / alpha / kernel / core_marvel.c
index 7f6a98455e74e52f666893b457f138a0eedc3cda..04dcc5e5d4c1c4954d8c80186ac3390d1a9074cc 100644 (file)
@@ -25,6 +25,7 @@
 #include <asm/pgalloc.h>
 #include <asm/tlbflush.h>
 #include <asm/rtc.h>
+#include <asm/vga.h>
 
 #include "proto.h"
 #include "pci_impl.h"
@@ -367,9 +368,8 @@ marvel_io7_present(gct6_node *node)
 }
 
 static void __init
-marvel_init_vga_hose(void)
+marvel_find_console_vga_hose(void)
 {
-#ifdef CONFIG_VGA_HOSE
        u64 *pu64 = (u64 *)((u64)hwrpb + hwrpb->ctbt_offset);
 
        if (pu64[7] == 3) {     /* TERM_TYPE == graphics */
@@ -403,7 +403,6 @@ marvel_init_vga_hose(void)
                        pci_vga_hose = hose;
                }
        }
-#endif /* CONFIG_VGA_HOSE */
 }
 
 gct6_search_struct gct_wanted_node_list[] = {
@@ -459,7 +458,7 @@ marvel_init_arch(void)
                marvel_init_io7(io7);
 
        /* Check for graphic console location (if any).  */
-       marvel_init_vga_hose();
+       marvel_find_console_vga_hose();
 }
 
 void
@@ -661,9 +660,9 @@ __marvel_rtc_io(u8 b, unsigned long addr, int write)
 
 #ifdef CONFIG_SMP
                if (smp_processor_id() != boot_cpuid)
-                       smp_call_function_on_cpu(__marvel_access_rtc,
-                                                &rtc_access, 1, 1,
-                                                cpumask_of_cpu(boot_cpuid));
+                       smp_call_function_single(boot_cpuid,
+                                                __marvel_access_rtc,
+                                                &rtc_access, 1);
                else
                        __marvel_access_rtc(&rtc_access);
 #else
@@ -684,9 +683,6 @@ __marvel_rtc_io(u8 b, unsigned long addr, int write)
 /*
  * IO map support.
  */
-
-#define __marvel_is_mem_vga(a) (((a) >= 0xa0000) && ((a) <= 0xc0000))
-
 void __iomem *
 marvel_ioremap(unsigned long addr, unsigned long size)
 {
@@ -698,13 +694,9 @@ marvel_ioremap(unsigned long addr, unsigned long size)
        unsigned long pfn;
 
        /*
-        * Adjust the addr.
+        * Adjust the address.
         */ 
-#ifdef CONFIG_VGA_HOSE
-       if (pci_vga_hose && __marvel_is_mem_vga(addr)) {
-               addr += pci_vga_hose->mem_space->start;
-       }
-#endif
+       FIXUP_MEMADDR_VGA(addr);
 
        /*
         * Find the hose.
@@ -781,7 +773,9 @@ marvel_ioremap(unsigned long addr, unsigned long size)
                return (void __iomem *) vaddr;
        }
 
-       return NULL;
+       /* Assume it was already a reasonable address */
+       vaddr = baddr + hose->mem_space->start;
+       return (void __iomem *) vaddr;
 }
 
 void
@@ -803,21 +797,12 @@ marvel_is_mmio(const volatile void __iomem *xaddr)
                return (addr & 0xFF000000UL) == 0;
 }
 
-#define __marvel_is_port_vga(a)        \
-  (((a) >= 0x3b0) && ((a) < 0x3e0) && ((a) != 0x3b3) && ((a) != 0x3d3))
 #define __marvel_is_port_kbd(a)        (((a) == 0x60) || ((a) == 0x64))
 #define __marvel_is_port_rtc(a)        (((a) == 0x70) || ((a) == 0x71))
 
 void __iomem *marvel_ioportmap (unsigned long addr)
 {
-       if (__marvel_is_port_rtc (addr) || __marvel_is_port_kbd(addr))
-               ;
-#ifdef CONFIG_VGA_HOSE
-       else if (__marvel_is_port_vga (addr) && pci_vga_hose)
-               addr += pci_vga_hose->io_space->start;
-#endif
-       else
-               return NULL;
+       FIXUP_IOADDR_VGA(addr);
        return (void __iomem *)addr;
 }
 
@@ -829,8 +814,14 @@ marvel_ioread8(void __iomem *xaddr)
                return 0;
        else if (__marvel_is_port_rtc(addr))
                return __marvel_rtc_io(0, addr, 0);
-       else
+       else if (marvel_is_ioaddr(addr))
                return __kernel_ldbu(*(vucp)addr);
+       else
+               /* this should catch other legacy addresses
+                  that would normally fail on MARVEL,
+                  because there really is nothing there...
+               */
+               return ~0;
 }
 
 void
@@ -841,7 +832,7 @@ marvel_iowrite8(u8 b, void __iomem *xaddr)
                return;
        else if (__marvel_is_port_rtc(addr)) 
                __marvel_rtc_io(b, addr, 1);
-       else
+       else if (marvel_is_ioaddr(addr))
                __kernel_stb(b, *(vucp)addr);
 }
 
@@ -1003,7 +994,7 @@ marvel_agp_configure(alpha_agp_info *agp)
                 * rate, but warn the user.
                 */
                printk("%s: unknown PLL setting RNGB=%lx (PLL6_CTL=%016lx)\n",
-                      __FUNCTION__, IO7_PLL_RNGB(agp_pll), agp_pll);
+                      __func__, IO7_PLL_RNGB(agp_pll), agp_pll);
                break;
        }
 
@@ -1053,13 +1044,13 @@ marvel_agp_translate(alpha_agp_info *agp, dma_addr_t addr)
 
        if (addr < agp->aperture.bus_base ||
            addr >= agp->aperture.bus_base + agp->aperture.size) {
-               printk("%s: addr out of range\n", __FUNCTION__);
+               printk("%s: addr out of range\n", __func__);
                return -EINVAL;
        }
 
        pte = aper->arena->ptes[baddr >> PAGE_SHIFT];
        if (!(pte & 1)) {
-               printk("%s: pte not valid\n", __FUNCTION__);
+               printk("%s: pte not valid\n", __func__);
                return -EINVAL;
        } 
        return (pte >> 1) << PAGE_SHIFT;