ARM: 6214/2: driver for the character LCD found in ARM refdesigns
[linux-2.6.git] / drivers / misc / sgi-xp / xp_uv.c
index 1e61f8a..a0d0932 100644 (file)
@@ -42,11 +42,34 @@ xp_socket_pa_uv(unsigned long gpa)
 }
 
 static enum xp_retval
+xp_remote_mmr_read(unsigned long dst_gpa, const unsigned long src_gpa,
+                  size_t len)
+{
+       int ret;
+       unsigned long *dst_va = __va(uv_gpa_to_soc_phys_ram(dst_gpa));
+
+       BUG_ON(!uv_gpa_in_mmr_space(src_gpa));
+       BUG_ON(len != 8);
+
+       ret = gru_read_gpa(dst_va, src_gpa);
+       if (ret == 0)
+               return xpSuccess;
+
+       dev_err(xp, "gru_read_gpa() failed, dst_gpa=0x%016lx src_gpa=0x%016lx "
+               "len=%ld\n", dst_gpa, src_gpa, len);
+       return xpGruCopyError;
+}
+
+
+static enum xp_retval
 xp_remote_memcpy_uv(unsigned long dst_gpa, const unsigned long src_gpa,
                    size_t len)
 {
        int ret;
 
+       if (uv_gpa_in_mmr_space(src_gpa))
+               return xp_remote_mmr_read(dst_gpa, src_gpa, len);
+
        ret = gru_copy_gpa(dst_gpa, src_gpa, len);
        if (ret == 0)
                return xpSuccess;