Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 02 Dec 2019 17:04:58 -0700
From:      Ian Lepore <ian@freebsd.org>
To:        Nick Kostirya <nikolay.kostirya@i11.co>
Cc:        Milan Obuch <milan@obuch.sk>, freebsd-arm@freebsd.org
Subject:   Re: gpioiic FDT overlays for sun8i-h3
Message-ID:  <ee0593a31a64ba264d579f7a4548f6b1b6e948fe.camel@freebsd.org>
In-Reply-To: <20191129201244.0bc85b09@thinkpad>
References:  <20191128152901.39dbeb4d@thinkpad> <20191128062149.577be86eb7dc15ae5805f31a@bidouilliste.com> <20191129153754.28fb5763@thinkpad> <20191129144316.739c8664@zeta.dino.sk> <20191129155431.05d4e14f@thinkpad> <20191129150944.67a2b723a6724c46f7559f96@bidouilliste.com> <0ce78262af1dd3b404b9a85a780933d7e11f008e.camel@freebsd.org> <20191129201244.0bc85b09@thinkpad>

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

--=-MzQpjdwgpxxGsx/on2aO
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit

On Fri, 2019-11-29 at 20:12 +0200, Nick Kostirya via freebsd-arm wrote:
> On Fri, 29 Nov 2019 09:23:31 -0700
> Ian Lepore <ian@freebsd.org> wrote:
> 
> > [...]
> > 
> > I am working on this, though.  I'm thinking we should have something
> > usable later today, or at worst by the end of the weekend if it turns
> > complicated.
> > 
> > -- Ian
> 
> Thank you very match!!!
> 
> I hope the new driver can be used in FreeBSD 12.
> 
> 

Well, it did turn complicated, but I got it all worked out.

Are you building an image from source code, or using a downloaded
snapshot or release image, or what?

If you are building from source, apply the attached patch to your
source tree and rebuild the kernel.

If you are using a prebuilt image, then I'll get these changes merged
to the stable-12 tree this week, and the next stable-12 snapshot images
will include what you need.  I think those images get built every
Thursday.

-- Ian

--=-MzQpjdwgpxxGsx/on2aO
Content-Disposition: attachment; filename="gpioiic_for_stable-12.diff"
Content-Type: text/x-patch; name="gpioiic_for_stable-12.diff"; charset="UTF-8"
Content-Transfer-Encoding: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LS0gLgkocmV2aXNpb24gMzU1MzE1KQorKysgLgkod29ya2luZyBjb3B5KQoKUHJv
cGVydHkgY2hhbmdlcyBvbjogLgpfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCk1vZGlmaWVkOiBzdm46bWVyZ2VpbmZvCiMj
IC0wLDAgKzAsMSAjIwogICBNZXJnZWQgL2hlYWQ6cjM1NTIxNCwzNTUyMzksMzU1Mjc0LDM1NTI3
Ni0zNTUyNzcsMzU1Mjk1LDM1NTI5OAo=


--=-MzQpjdwgpxxGsx/on2aO--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ee0593a31a64ba264d579f7a4548f6b1b6e948fe.camel>