Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932068AbcCCMF1 (ORCPT ); Thu, 3 Mar 2016 07:05:27 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:55458 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751247AbcCCMFY (ORCPT ); Thu, 3 Mar 2016 07:05:24 -0500 From: Arnd Bergmann To: Joao Pinto Cc: vinholikatti@gmail.com, julian.calaby@gmail.com, akinobu.mita@gmail.com, hch@infradead.org, mark.rutland@arm.com, robh@kernel.org, gbroner@codeaurora.org, subhashj@codeaurora.org, CARLOS.PALMINHA@synopsys.com, ijc+devicetree@hellion.org.uk, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH v9 3/3] add support for DWC UFS Host Controller Date: Thu, 03 Mar 2016 13:04:40 +0100 Message-ID: <10452689.JXS9XIs74z@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <56D82259.3020907@synopsys.com> References: <5606371.ipFvUUmgV9@wuerfel> <56D82259.3020907@synopsys.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:Tq4Is6ZbKv6qiAbI+vGZtLUGADFptNEl/azWbRkEMaiJrHCjef1 96yTngUAnPiPgLw4rY2MGZcXSiU7DRhB2BKUDAbypeRpVKNVHs8k+NGHfzlIZ2M8W6g0OU8 8Qj869bswssL/q384QRVFyrtzAcJeL4WBt6B4WX8VWCXsRDNAYpUB6+LtEwicsKczzm7Q+Y 4iZ1U/zqAzuOcCvMj+ODg== X-UI-Out-Filterresults: notjunk:1;V01:K0:Vn+GJzNbkPw=:0GUSqV4+5TOQ9/MUYyET0b OhOTKNElBxsGnwvcpBv1tQXQVkOgfIjVqDJkLi0/UIEO2Msnc05T6EvvacK1uuzTZBCow/3BH a+OeZQWM8N3wE/K9riQ3Zh8rTfj5OtQMV0DwNy1bhmfcszr6MMEVo5yl87E2mmFr7d5+cBTKs 8B3VumjuUjBCRq631jYG+dVHzO+poYdRJINMc8xb0iR7nJHhgoDgaZzxmqZlfLlEOq0i3HyqF Mf8QvzSdV/jvYEiharsJZu7loyDs9SbNFhzF/F18xmB9ME+itVV6cs2f0QjorT+PBqxgmhOGH 1xCxpQFGFWJi49JQaIDrpYRnLR7KlIOX16eFiVaPYOGS4DQ9yk6BP047FVwJIRmi2koMzt5qb 3SqWxQU7OGtuB5yS4SF+dsJTZOq08joPT90Y2LgN7N0yJsVPh/LqkHCQfcUO4cMVXtsCYAWzF 09WDwOK6Q9nmKHVVT82RIrOllfPFB0/uUbeC/Xw/qn8yTe5bX6qBFQR4Vv5ipO0DknZBpdKYT KNw+TJw6Px08bpKlROIj1B43xvSeM6T3r1hJsfH0t5NTcF98cmJLOeKSABcTHn7V/LdtFtYVw TihFI9830AoRk90OUw01C4K0NJ9gTDhVcKOMACshmd3WwhvUUrTQ++x0t4bmzA0AVh+MaghBS 07ME3O+MzHbonzZSEOiWAYVxYy3+iptRFKBDhyO5TTMmwLasPDGhs0eeznhDj8cu310Wx5+yk t6haGyxjWmLLurBd Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3366 Lines: 105 On Thursday 03 March 2016 11:39:05 Joao Pinto wrote: > Hi Arnd, > > On 3/2/2016 7:55 PM, Arnd Bergmann wrote: > > On Wednesday 02 March 2016 16:46:47 Joao Pinto wrote: > >> On 2/19/2016 3:03 PM, Arnd Bergmann wrote: > >>> On Thursday 18 February 2016 17:20:27 Joao Pinto wrote: > > Facts: > > - Test Chip type are currently not detectable in runtime through the controller > - In the future the Test Chip version will be available in the controller > - Test Chip initialization is different for each type > - The IP Core version is 1.40a > - Test Chip version is 6.00 > - Teh UFS version is 2.0 Ok. > Suggested driver architecture: > > Platform setup: > tc-dwc-g210-pltfrm --> tc-dwc-g210 --> ufshcd-dwc-pltfrm --> ufshcd-dwc --> ufs > > The test chip platform driver could be called through 2 compatibility strings. > indicating the chip's version and bit type: > "snps, g210-tc-6.00-20bit" > "snps, g210-tc-6.00-40bit" Yes, this sounds good. We can probably skip one of the middle layers, but basically that is what I was looking for. > The device tree node would have additional info compatibility strings as the DWC > IP core version and UFS version: > "snps, dwc-ufshcd-1.40a" > "jedec, ufs-2.0" > > PCI based setup: > tc-dwc-g210-pci --> tc-dwc-g210 --> ufshcd-dwc-pci --> ufshcd-dwc --> ufs The tc-dwc-g210 portion probably shouldn't depend on both ufshcd-dwc-pltfrm and ufshcd-dwc-pci here, so how about leaving those two out? Then it becomes tc-dwc-g210-pci ---> tc-dwc-g210 --> ufshcd-dwc --> ufs tc-dwc-g210-pltfrm --/ > The test chip type would be configured by a parameter to be passed in the kernel > boot args: tc_type = 20 (20-bit) or tc_type = 40 (40-bit) Right. With module_param() helper, this will be either a boot command line option, or a module load option, depending on whether the driver is built-on or not. modprobe tc-dwc-g210-pci tc_type=20 command line: tc-dwc-g210-pci.tc_type=20 > Having this in mind the KConfig would be: > > "config SCSI_UFS_DWC_HOOKS > bool I think we can now remove the config option for the hooks as well. > config SCSI_UFS_DWC_PLAT > tristate "DesignWare UFS controller platform glue driver" > depends on SCSI_UFSHCD_PLATFORM > select SCSI_UFS_DWC_HOOKS > help > This selects the DesignWare UFS host controller platform glue driver. > > Select this if you have a DesignWare UFS controller on Platform bus. > If unsure, say N. > > config SCSI_UFS_DWC_PCI > tristate "DesignWare UFS controller pci glue driver" > depends on SCSI_UFSHCD_PCI > select SCSI_UFS_DWC_HOOKS > help > This selects the DesignWare UFS host controller pci glue driver. > > Select this if you have a DesignWare UFS controller on pci bus. > If unsure, say N. > > config SCSI_UFS_DWC_TC > bool "Support for the Synopsys Test Chip" > depends on SCSI_UFS_DWC_HOOKS && (SCSI_UFSHCD_PCI || SCSI_UFS_DWC_PLAT) > ---help--- > Synopsys Test Chip is a Phy for prototyping purposes. > This selects the support for the Synopsys Test Chip. > > Select this if you have a Synopsys Test Chip. > If unsure, say N." > > Agree with the approach? This would work, but I think it's better to define the options in terms of the top-level drivers, i.e. SCSI_UFS_DWC_TC_PCI and SCSI_UFS_DWC_TC_PLATFORM, and then make the other options hidden and implicitly turned out by them. Arnd