Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/dist/drm/i915 i915: readl/writel -> bu...



details:   https://anonhg.NetBSD.org/src/rev/19595c2bde1e
branches:  trunk
changeset: 1028511:19595c2bde1e
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 11:12:59 2021 +0000

description:
i915: readl/writel -> bus_space

diffstat:

 sys/external/bsd/drm2/dist/drm/i915/intel_uncore.c |  30 ++++++++++++++++++++-
 sys/external/bsd/drm2/dist/drm/i915/intel_uncore.h |   7 ++++-
 2 files changed, 34 insertions(+), 3 deletions(-)

diffs (86 lines):

diff -r b9755802f3a9 -r 19595c2bde1e sys/external/bsd/drm2/dist/drm/i915/intel_uncore.c
--- a/sys/external/bsd/drm2/dist/drm/i915/intel_uncore.c        Sun Dec 19 11:12:51 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/intel_uncore.c        Sun Dec 19 11:12:59 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intel_uncore.c,v 1.15 2021/12/19 10:28:31 riastradh Exp $      */
+/*     $NetBSD: intel_uncore.c,v 1.16 2021/12/19 11:12:59 riastradh Exp $      */
 
 /*
  * Copyright © 2013 Intel Corporation
@@ -24,7 +24,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intel_uncore.c,v 1.15 2021/12/19 10:28:31 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_uncore.c,v 1.16 2021/12/19 11:12:59 riastradh Exp $");
 
 #include <linux/pm_runtime.h>
 #include <asm/iosf_mbi.h>
@@ -90,9 +90,30 @@
        return "unknown";
 }
 
+#ifdef __NetBSD__
+static inline u32
+fw_ack(struct intel_uncore_forcewake_domain *d)
+{
+       return bus_space_read_4(d->uncore->regs_bst, d->uncore->regs_bsh,
+           d->reg_ack);
+}
+static inline void
+fw_set(struct intel_uncore_forcewake_domain *d, u32 val)
+{
+       bus_space_write_4(d->uncore->regs_bst, d->uncore->regs_bsh, d->reg_set,
+           _MASKED_BIT_ENABLE(val));
+}
+static inline void
+fw_clear(struct intel_uncore_forcewake_domain *d, u32 val)
+{
+       bus_space_write_4(d->uncore->regs_bst, d->uncore->regs_bsh, d->reg_set,
+           _MASKED_BIT_DISABLE(val));
+}
+#else
 #define fw_ack(d) readl((d)->reg_ack)
 #define fw_set(d, val) writel(_MASKED_BIT_ENABLE((val)), (d)->reg_set)
 #define fw_clear(d, val) writel(_MASKED_BIT_DISABLE((val)), (d)->reg_set)
+#endif
 
 static inline void
 fw_domain_reset(const struct intel_uncore_forcewake_domain *d)
@@ -1446,8 +1467,13 @@
 
        d->uncore = uncore;
        d->wake_count = 0;
+#ifdef __NetBSD__
+       d->reg_set = i915_mmio_reg_offset(reg_set);
+       d->reg_ack = i915_mmio_reg_offset(reg_ack);
+#else
        d->reg_set = uncore->regs + i915_mmio_reg_offset(reg_set);
        d->reg_ack = uncore->regs + i915_mmio_reg_offset(reg_ack);
+#endif
 
        d->id = domain_id;
 
diff -r b9755802f3a9 -r 19595c2bde1e sys/external/bsd/drm2/dist/drm/i915/intel_uncore.h
--- a/sys/external/bsd/drm2/dist/drm/i915/intel_uncore.h        Sun Dec 19 11:12:51 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/intel_uncore.h        Sun Dec 19 11:12:59 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intel_uncore.h,v 1.5 2021/12/19 11:10:25 riastradh Exp $       */
+/*     $NetBSD: intel_uncore.h,v 1.6 2021/12/19 11:12:59 riastradh Exp $       */
 
 /*
  * Copyright © 2017 Intel Corporation
@@ -147,8 +147,13 @@
                unsigned int wake_count;
                bool active;
                struct hrtimer timer;
+#ifdef __NetBSD__
+               bus_size_t reg_set;
+               bus_size_t reg_ack;
+#else
                u32 __iomem *reg_set;
                u32 __iomem *reg_ack;
+#endif
        } *fw_domain[FW_DOMAIN_ID_COUNT];
 
        unsigned int user_forcewake_count;



Home | Main Index | Thread Index | Old Index