Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Jun 2016 16:40:57 +0200
From:      =?UTF-8?Q?Micha=C5=82_Stanek?= <mst@semihalf.com>
To:        Ian Lepore <ian@freebsd.org>
Cc:        John Baldwin <jhb@freebsd.org>, Zbigniew Bodek <zbb@semihalf.com>, Zbigniew Bodek <zbb@freebsd.org>,  src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r301220 - in head/sys: arm/mv dev/cesa
Message-ID:  <CAMiGqYjsyaob9c-EtUhJKaHF_XzhkC%2B=du30HLKbYnsK-mrQdQ@mail.gmail.com>
In-Reply-To: <1464903260.1204.191.camel@freebsd.org>
References:  <201606021831.u52IVb1O006883@repo.freebsd.org> <CAG7dG%2ByO5sBJ_4W-XcvOtjx_iAJz79WruGptM6Pe5BciB2OrHw@mail.gmail.com> <1464895468.1204.188.camel@freebsd.org> <1946366.I33PJXpI92@ralph.baldwin.cx> <1464903260.1204.191.camel@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
Thanks Ian, here's a patch correcting what you mentioned, please check if
it's OK.

Best regards,
Michal Stanek

2016-06-02 23:34 GMT+02:00 Ian Lepore <ian@freebsd.org>:

> On Thu, 2016-06-02 at 14:05 -0700, John Baldwin wrote:
> > On Thursday, June 02, 2016 01:24:28 PM Ian Lepore wrote:
> > > On Thu, 2016-06-02 at 21:03 +0200, Zbigniew Bodek wrote:
> > > > 2016-06-02 20:48 GMT+02:00 Ian Lepore <ian@freebsd.org>:
> > > >
> > > > > On Thu, 2016-06-02 at 18:31 +0000, Zbigniew Bodek wrote:
> > > > > >
> [...]
> > >
> > > I've always said that phabricator was primarily a spam-generation
> > > tool,
> > > and now that seems to be true in spades.  It apparently only
> > > delivers
> > > html-formatted mail now, and my mail client is smart enough to just
> > > route html-only messages directly to the trash.
> >
> > There's a config option to turn off the HTML bit.  A recent "upgrade"
> > of
> > phab silently turned on HTML e-mails by default.
> >
>
> I thought at first you meant an option the admins have to set, but I
> see now that it's a per-user email setting.  So now I'll be back to
> seeing all the phab stuff I don't have time to deal with, and will be
> able to feel suitably guilty about it again.
>
> -- Ian
>
>

[-- Attachment #2 --]
From 53227ebe3041a7c6354530e227cc7746973bf620 Mon Sep 17 00:00:00 2001
From: Michal Stanek <mst@semihalf.com>
Date: Fri, 3 Jun 2016 16:18:20 +0200
Subject: [PATCH 2/2] CESA ian patch

---
 sys/dev/cesa/cesa.c | 23 ++++++++++++-----------
 sys/dev/cesa/cesa.h |  2 +-
 2 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/sys/dev/cesa/cesa.c b/sys/dev/cesa/cesa.c
index 3d5523e..43ecfc3 100644
--- a/sys/dev/cesa/cesa.c
+++ b/sys/dev/cesa/cesa.c
@@ -970,29 +970,30 @@ cesa_setup_sram(struct cesa_softc *sc)
 	pcell_t sram_handle, sram_reg[2];
 	int rv;
 
-	rv = OF_getprop(ofw_bus_get_node(sc->sc_dev), "sram-handle",
+	rv = OF_getencprop(ofw_bus_get_node(sc->sc_dev), "sram-handle",
 	    (void *)&sram_handle, sizeof(sram_handle));
 	if (rv <= 0)
 		return (rv);
 
 	sram_ihandle = (ihandle_t)sram_handle;
-	sram_ihandle = fdt32_to_cpu(sram_ihandle);
 	sram_node = OF_instance_to_package(sram_ihandle);
 
-	rv = OF_getprop(sram_node, "reg", (void *)sram_reg, sizeof(sram_reg));
+	rv = OF_getencprop(sram_node, "reg", (void *)sram_reg, sizeof(sram_reg));
 	if (rv <= 0)
 		return (rv);
 
-	sc->sc_sram_base_pa = fdt32_to_cpu(sram_reg[0]);
+	sc->sc_sram_base_pa = sram_reg[0];
 	/* Store SRAM size to be able to unmap in detach() */
-	sc->sc_sram_size = fdt32_to_cpu(sram_reg[1]);
+	sc->sc_sram_size = sram_reg[1];
 
 #if defined(SOC_MV_ARMADA38X)
+	void *sram_va;
+
 	/* SRAM memory was not mapped in platform_sram_devmap(), map it now */
-	rv = bus_space_map(fdtbus_bs_tag, sc->sc_sram_base_pa, sc->sc_sram_size,
-	    0, &(sc->sc_sram_base_va));
-	if (rv != 0)
-		return (rv);
+	sram_va = pmap_mapdev(sc->sc_sram_base_pa, sc->sc_sram_size);
+	if (sram_va == NULL)
+		return (ENOMEM);
+	sc->sc_sram_base_va = (vm_offset_t)sram_va;
 #endif
 	return (0);
 }
@@ -1240,7 +1241,7 @@ err3:
 	bus_teardown_intr(dev, sc->sc_res[RES_CESA_IRQ], sc->sc_icookie);
 err2:
 #if defined(SOC_MV_ARMADA38X)
-	bus_space_unmap(fdtbus_bs_tag, sc->sc_sram_base_va, sc->sc_sram_size);
+	pmap_unmapdev(sc->sc_sram_base_va, sc->sc_sram_size);
 #endif
 err1:
 	bus_release_resources(dev, cesa_res_spec, sc->sc_res);
@@ -1291,7 +1292,7 @@ cesa_detach(device_t dev)
 
 #if defined(SOC_MV_ARMADA38X)
 	/* Unmap SRAM memory */
-	bus_space_unmap(fdtbus_bs_tag, sc->sc_sram_base_va, sc->sc_sram_size);
+	pmap_unmapdev(sc->sc_sram_base_va, sc->sc_sram_size);
 #endif
 	/* Destory mutexes */
 	mtx_destroy(&sc->sc_sessions_lock);
diff --git a/sys/dev/cesa/cesa.h b/sys/dev/cesa/cesa.h
index 4819d3d..e8f6372 100644
--- a/sys/dev/cesa/cesa.h
+++ b/sys/dev/cesa/cesa.h
@@ -267,7 +267,7 @@ struct cesa_softc {
 
 	/* CESA SRAM Address */
 	bus_addr_t			sc_sram_base_pa;
-	bus_space_handle_t		sc_sram_base_va;
+	vm_offset_t			sc_sram_base_va;
 	bus_size_t			sc_sram_size;
 };
 
-- 
2.4.6


Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAMiGqYjsyaob9c-EtUhJKaHF_XzhkC%2B=du30HLKbYnsK-mrQdQ>