Merge branch 'drm-forlinus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
[pandora-kernel.git] / arch / powerpc / platforms / iseries / setup.c
index 6a29f30..c6bbe5c 100644 (file)
@@ -39,7 +39,6 @@
 #include <asm/sections.h>
 #include <asm/iommu.h>
 #include <asm/firmware.h>
-#include <asm/systemcfg.h>
 #include <asm/system.h>
 #include <asm/time.h>
 #include <asm/paca.h>
@@ -53,6 +52,7 @@
 #include <asm/iseries/mf.h>
 #include <asm/iseries/hv_lp_event.h>
 #include <asm/iseries/lpar_map.h>
+#include <asm/udbg.h>
 
 #include "naca.h"
 #include "setup.h"
 #include "call_sm.h"
 #include "call_hpt.h"
 
-extern void hvlog(char *fmt, ...);
-
 #ifdef DEBUG
-#define DBG(fmt...) hvlog(fmt)
+#define DBG(fmt...) udbg_printf(fmt)
 #else
 #define DBG(fmt...)
 #endif
@@ -475,14 +473,6 @@ static unsigned long __init build_iSeries_Memory_Map(void)
        printk("HPT absolute addr = %016lx, size = %dK\n",
                        chunk_to_addr(hptFirstChunk), hptSizeChunks * 256);
 
-       ppc64_pft_size = __ilog2(hptSizePages * HW_PAGE_SIZE);
-
-       /*
-        * The actual hashed page table is in the hypervisor,
-        * we have no direct access
-        */
-       htab_address = NULL;
-
        /*
         * Determine if absolute memory has any
         * holes so that we can interpret the
@@ -548,8 +538,6 @@ static unsigned long __init build_iSeries_Memory_Map(void)
  */
 static void __init iSeries_setup_arch(void)
 {
-       unsigned procIx = get_paca()->lppaca.dyn_hv_phys_proc_index;
-
        if (get_paca()->lppaca.shared_proc) {
                ppc_md.idle_loop = iseries_shared_idle;
                printk(KERN_INFO "Using shared processor idle loop\n");
@@ -565,9 +553,6 @@ static void __init iSeries_setup_arch(void)
                        itVpdAreas.xSlicMaxLogicalProcs);
        printk("Max physical processors = %d\n",
                        itVpdAreas.xSlicMaxPhysicalProcs);
-
-       _systemcfg->processor = xIoHriProcessorVpd[procIx].xPVR;
-       printk("Processor version = %x\n", _systemcfg->processor);
 }
 
 static void iSeries_show_cpuinfo(struct seq_file *m)
@@ -575,16 +560,6 @@ static void iSeries_show_cpuinfo(struct seq_file *m)
        seq_printf(m, "machine\t\t: 64-bit iSeries Logical Partition\n");
 }
 
-/*
- * Document me.
- * and Implement me.
- */
-static int iSeries_get_irq(struct pt_regs *regs)
-{
-       /* -2 means ignore this interrupt */
-       return -2;
-}
-
 /*
  * Document me.
  */
@@ -877,6 +852,11 @@ void dt_prop_u64_list(struct iseries_flat_dt *dt, char *name, u64 *data, int n)
        dt_prop(dt, name, (char *)data, sizeof(u64) * n);
 }
 
+void dt_prop_u32_list(struct iseries_flat_dt *dt, char *name, u32 *data, int n)
+{
+       dt_prop(dt, name, (char *)data, sizeof(u32) * n);
+}
+
 void dt_prop_empty(struct iseries_flat_dt *dt, char *name)
 {
        dt_prop(dt, name, NULL, 0);
@@ -888,6 +868,7 @@ void dt_cpus(struct iseries_flat_dt *dt)
        unsigned char *p;
        unsigned int i, index;
        struct IoHriProcessorVpd *d;
+       u32 pft_size[2];
 
        /* yuck */
        snprintf(buf, 32, "PowerPC,%s", cur_cpu_spec->cpu_name);
@@ -898,6 +879,9 @@ void dt_cpus(struct iseries_flat_dt *dt)
        dt_prop_u32(dt, "#address-cells", 1);
        dt_prop_u32(dt, "#size-cells", 0);
 
+       pft_size[0] = 0; /* NUMA CEC cookie, 0 for non NUMA  */
+       pft_size[1] = __ilog2(HvCallHpt_getHptPages() * HW_PAGE_SIZE);
+
        for (i = 0; i < NR_CPUS; i++) {
                if (paca[i].lppaca.dyn_proc_status >= 2)
                        continue;
@@ -924,6 +908,8 @@ void dt_cpus(struct iseries_flat_dt *dt)
 
                dt_prop_u32(dt, "reg", i);
 
+               dt_prop_u32_list(dt, "ibm,pft-size", pft_size, 2);
+
                dt_end_node(dt);
        }
 
@@ -1000,3 +986,16 @@ static int __init early_parsemem(char *p)
        return 0;
 }
 early_param("mem", early_parsemem);
+
+static void hvputc(char c)
+{
+       if (c == '\n')
+               hvputc('\r');
+
+       HvCall_writeLogBuffer(&c, 1);
+}
+
+void __init udbg_init_iseries(void)
+{
+       udbg_putc = hvputc;
+}