From owner-freebsd-mips@freebsd.org Sat Jan 23 08:28:17 2016 Return-Path: Delivered-To: freebsd-mips@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B670A8D32F; Sat, 23 Jan 2016 08:28:17 +0000 (UTC) (envelope-from sgalabov@gmail.com) Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 86F071ED7; Sat, 23 Jan 2016 08:28:16 +0000 (UTC) (envelope-from sgalabov@gmail.com) Received: by mail-wm0-x243.google.com with SMTP id b14so1891227wmb.1; Sat, 23 Jan 2016 00:28:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=QAz5vVYnKlVpsYaYuaP0gQf11qxhLOzLpu5LpLeDrSQ=; b=toPOp44YYSwCvwGlNATfoMxaHGjjFMlVpFAZXTgWgkXNDPdjviJEHTA7HzHc9u9h2L RLhzSd9O0Z/wrBInKd9JTWzUPv93sRltCUW81rQwq6VjG5lHdBvxthWUtMeO+kVWG743 eHqiPGRXW/nQ5/Vk4Ceugamgg3NP05W9Txd0PCf5FEPMoTz7JhZ/fekN3h2Z8jscNRHK CViVjrQZdtLoMdj25xOt7KsVisAN4A8/ZbXdadl9suBeoEahUGc5r6vLjH/ZP9GpLFTN 1bsqiot6uIc9A3Ut1vIHmab/JlPc/utQ1TxfFNEbu4EiD/CNY1UyZqnqiDDtuG5EdCzu IKKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=QAz5vVYnKlVpsYaYuaP0gQf11qxhLOzLpu5LpLeDrSQ=; b=BCwvvHNkZSRSY4xuWt3LjpwT4OUXEyHfF/bv1foMrRfy/xaXzydpei6rd9iVytWfV3 KZMWPMI+HiJWi0wC+C9S908/BMrj5yCNG5spzAHnp++B/SAwg/MG9XV9muFLs9AkfppS 7wwl6eoR3Rk6o40sEgAOiUTZ3XxOHc0zo5yHokeuih3ZShN34UTN20yq56kdjDaw90AY feC3REj3/RQ+SzYrqYfTk5E/8JCCt2VQzI31lBymqC5gvAHEvYodilrFaz67q6WnsoHE UZM0onWUDZwde4/yAb2g3FjVC+UEHnYBEIJAtCqRGCwCFNzkFEtEiOxep73LYhwyjz8r 3k+Q== X-Gm-Message-State: AG10YORN9OpwjKehC/wr74Q1XWVeNdMnbwCNLT1peynMletq7/emr4i8mGoJDdxSZIMs0A== X-Received: by 10.194.58.235 with SMTP id u11mr7393265wjq.52.1453537694791; Sat, 23 Jan 2016 00:28:14 -0800 (PST) Received: from [10.190.99.221] (85-118-68-209.mtel.net. [85.118.68.209]) by smtp.gmail.com with ESMTPSA id 75sm6284554wmo.22.2016.01.23.00.28.13 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 23 Jan 2016 00:28:13 -0800 (PST) Mime-Version: 1.0 (1.0) Subject: Re: SPI geom_flashmap/fdt_slicer support, FDT 'resets=' support and a move of ohci_fdt.c From: Stanislav Galabov X-Mailer: iPhone Mail (12B440) In-Reply-To: <56A1BFBB.8050204@freebsd.org> Date: Sat, 23 Jan 2016 10:28:16 +0200 Cc: "freebsd-arm@freebsd.org" , "freebsd-mips@freebsd.org" Message-Id: <57E542F6-FCF2-4E51-9FE5-8EDD85DA2102@gmail.com> References: <2AB9D6E1-BFF8-4EEE-B366-C980B72C4779@gmail.com> <56A1BFBB.8050204@freebsd.org> To: Michal Meloun Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jan 2016 08:28:17 -0000 > On Jan 22, 2016, at 07:35, Michal Meloun wrote: >=20 > Dne 22.01.2016 v 5:43 Warner Losh napsal(a): >> On Thu, Jan 21, 2016 at 8:35 PM, Adrian Chadd >> wrote: >>=20 >>>> On 18 January 2016 at 06:49, Stanislav Galabov wro= te: >>>> Hi Warner, >>>>=20 >>>> I was thinking resets could help in general, not specifically in the >>> case of trying to implement a generic ohci_fdt driver. >>>>=20 >>>> As I already mentioned to you off-list (and in order for this message t= o >>> possibly make some more sense), I saw that Linux makes use of the =E2=80= =98resets=E2=80=99 >>> property and looked at the documentation for it: >>> https://github.com/torvalds/linux/blob/master/Documentation/devicetree/b= indings/reset/reset.txt >>> < >>> https://github.com/torvalds/linux/blob/master/Documentation/devicetree/b= indings/reset/reset.txt >>>>=20 >>>>=20 >>>> For example, with the work I am currently doing on Ralink/Mediatek >>> support, I have over 10 different chips in the same family, that have ve= ry >>> similar peripheral blocks, but their clocks and resets are controlled vi= a >>> different bits in one of the SysCtl registers (the register itself is at= >>> the same offset within the SysCtl block of each chip). So I may have chi= p X >>> which has its USB (for example) reset controlled by bit 10 and chip Y wi= th >>> USB reset controlled by bit 12. >>>>=20 >>>> So being able to write something like: >>>> resets =3D <&sysctl 10>; >>>> or >>>> resets =3D <&sysctl 11>; >>>>=20 >>>> in my dts/dtsi files helps me immensely, instead of having to check wha= t >>> chip I am running on and based on that use a different register layout=E2= =80=A6 >>>> Then, if I wanted to (de)assert reset for a peripheral block that has >>> this property defined I=E2=80=99d just do fdt_reset_(de)assert_all(dev),= where dev >>> is the device_t for the peripheral in question. This would (de)assert al= l >>> reset pins associated with the peripheral. >>>>=20 >>>> The same is the case for clock control (gating) in the Ralink/Mediatek >>> SoCs and this is the main reason I used fdt_clock that is already in >>> sys/dev/fdt and then thought about implementing the fdt_reset based on i= t. >>>>=20 >>>> I hope this clarifies a bit my reason for submitting the fdt_reset patc= h. >>>=20 >>> This seems fine to me. Hm. Ian? Any comments? >>=20 >> I want to check on a few things before we head down this path. I've been >> traveling so haven't had a chance to look through it to see if Atmel uses= >> this, and who else does... >>=20 >> Warner > I think that i have more complete implementation of reset framework > ready to commit. Just waiting for mentor approval. > Please see https://github.com/strejda/tegra/tree/master/sys/dev/reset >=20 > Michal I have no objections to using Michal's framework, especially if the patch fr= om PR 206516 is applied: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D206516 His framework is really more complete than what I did. Best wishes, Stanislav >>> -a >>>=20 >>>> Best wishes >>>> Stanislav >>>>=20 >>>>> On Jan 18, 2016, at 02:04, Warner Losh wrote: >>>>>=20 >>>>> I don't see how resets help. Maybe I missed where it was documented, >>> could you send that to me? >>>>>=20 >>>>> Even with that, it seems that a generic ohci_fdt driver isn't possible= . >>>>>=20 >>>>> Warner >>>>>=20 >>>>> On Thu, Jan 14, 2016 at 2:01 AM, Stanislav Galabov >> > wrote: >>>>> Hi all, >>>>>=20 >>>>> First off, sorry for the cross-post, I wasn=E2=80=99t very sure where t= his >>> should go=E2=80=A6 >>>>>=20 >>>>> I=E2=80=99ve created 3 PRs, which enable some functionality that my wo= rk on >>> Ralink/Mediatek SoCs would benefit from. >>>>>=20 >>>>> 1. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D206227 < >>> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D206227> >>>>> - This enables geom_flashmap and fdt_slicer support for SPI flash chip= s >>> supported by the mx25l driver (sys/dev/flash/mx25l.c) >>>>>=20 >>>>> 2. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D206228 < >>> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D206228> >>>>> - This adds support for FDT =E2=80=98resets=3D=E2=80=99 property in mu= ch the same way as >>> ian@=E2=80=99s sys/dev/fdt/fdt_clock* supports FDT =E2=80=98clocks=3D=E2= =80=98 property. In fact >>> this work is basically a modified version of fdt_clock* :-) >>>>>=20 >>>>> 3. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D206229 < >>> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D206229> >>>>> - This simply moves the at91 specific sys/dev/usb/controller/ohci_fdt.= c >>> to sys/dev/usb/controller/at91ohci_fdt.c (and changes the filename in >>> sys/arm/at91/files.at91 as well). The current naming is misleading IMHO a= nd >>> also, I have some (vague-ish) plans to see if I can implement generic >>> ohci_fdt and ehci_fdt based on dwc_otg_fdt, so that systems with standar= d >>> ehci/ohci controllers can reuse these. >>>>>=20 >>>>> Patches are attached to the PRs. >>>>>=20 >>>>> I would appreciate any feedback on the PRs and would also appreciate i= t >>> if someone could commit these if the proposed changes are appropriate. >>>>>=20 >>>>> Best wishes, >>>>> Stanislav >>>>> _______________________________________________ >>>>> freebsd-arm@freebsd.org mailing list >>>>> https://lists.freebsd.org/mailman/listinfo/freebsd-arm < >>> https://lists.freebsd.org/mailman/listinfo/freebsd-arm> >>>>> To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org >>> " >>>>=20 >>>> _______________________________________________ >>>> freebsd-arm@freebsd.org mailing list >>>> https://lists.freebsd.org/mailman/listinfo/freebsd-arm >>>> To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org" >> _______________________________________________ >> freebsd-arm@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/freebsd-arm >> To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org" >=20 > _______________________________________________ > freebsd-mips@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-mips > To unsubscribe, send any mail to "freebsd-mips-unsubscribe@freebsd.org"