Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751524AbdFGNU2 (ORCPT ); Wed, 7 Jun 2017 09:20:28 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:6909 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751203AbdFGNU0 (ORCPT ); Wed, 7 Jun 2017 09:20:26 -0400 Message-ID: <1496841619.30833.5.camel@mtkswgap22> Subject: Re: [PATCH 1/4] dt-bindings: rng: add generic bindings for MediaTek SoCs From: Sean Wang To: Matthias Brugger CC: , , , , , , , , , , , , , , Date: Wed, 7 Jun 2017 21:20:19 +0800 In-Reply-To: <9eb87222-ca89-0abb-4532-3887008f6e7a@gmail.com> References: <1d9c981e1b45bf2f04732a02d90e6857cc203ce5.1496255334.git.sean.wang@mediatek.com> <9eb87222-ca89-0abb-4532-3887008f6e7a@gmail.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3003 Lines: 80 On Tue, 2017-06-06 at 13:07 +0200, Matthias Brugger wrote: > > On 31/05/17 20:44, sean.wang@mediatek.com wrote: > > From: Sean Wang > > > > Add the generic binding for allowing the support of RNG on MediaTek SoCs > > such as MT7622. > > > > Signed-off-by: Sean Wang > > --- > > Documentation/devicetree/bindings/rng/mtk-rng.txt | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/Documentation/devicetree/bindings/rng/mtk-rng.txt b/Documentation/devicetree/bindings/rng/mtk-rng.txt > > index a6d62a2..0772913 100644 > > --- a/Documentation/devicetree/bindings/rng/mtk-rng.txt > > +++ b/Documentation/devicetree/bindings/rng/mtk-rng.txt > > @@ -2,7 +2,8 @@ Device-Tree bindings for Mediatek random number generator > > found in Mediatek SoC family > > > > Required properties: > > -- compatible : Should be "mediatek,mt7623-rng" > > +- compatible : Should be "mediatek,generic-rng" or > > + "mediatek,mt7623-rng". > > What does generic-rng mean. Is it for all mt7xxx, or also for mt6xxx and > mt8xxx based SoCs? I think we should stick with SoC specific bindings, > as we don't know if Mediatek won't publish a new IP block next year > which is differnet. > Yes, what I mean is generic-rng can be applied to all platform MediaTek provides. > Just in case we should add a binding for the actual SoC + a fallback. > For example. > - compatible " Should be > "mediatek,mt7622-rng", "mediatek,mt7623-rng" for SoC mt7622 > "mediatek,mt7623-rng" for SoC mt7623 > > This will also eliminate the need of adding mt6722-rng to the driver, as > it will use mt7623-rng as fallback. If in the future we realize that > mt7622-rng has a extra feature/bug, we can still work around it, without > breaking the bindings. > I knew the fallback rules you said here because I saw them being used in many drivers such as sysirq and uart driver, such kind of basic drivers. These drivers are basic enough, various following chipsets almost fall back into the oldest one. So the clues let me think the hardware interface shouldn't have too much differences among them. If there is string used like generic-uart or generic-sysirq, it can stop we blindly add new string into the binding document when a new platform is introduced. And they easily allows users unfamiliar MediaTek platform (they didn't know what the oldest MediaTek chipset is) pick up the right compatible string to start bring up the new platform. The specific one can be added after new feature required is added or critical hardware bug is found. Otherwise the generic one can fit all generic needs for those. Those are only opinions, if you don't like it, I still can accept the original way as you suggest :) > Makes sense? > > Regards, > Matthias > > > - clocks : list of clock specifiers, corresponding to > > entries in clock-names property; > > - clock-names : Should contain "rng" entries; > >