Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753388AbcKHPKP (ORCPT ); Tue, 8 Nov 2016 10:10:15 -0500 Received: from mout.kundenserver.de ([217.72.192.75]:64007 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752068AbcKHPJu (ORCPT ); Tue, 8 Nov 2016 10:09:50 -0500 From: Arnd Bergmann To: Anurup M Cc: linux-arm-kernel@lists.infradead.org, Tan Xiaojun , anurup.m@huawei.com, linux-kernel@vger.kernel.org, mark.rutland@arm.com, shyju.pv@huawei.com, gabriele.paoloni@huawei.com, john.garry@huawei.com, will.deacon@arm.com, linuxarm@huawei.com, xuwei5@hisilicon.com, zhangshaokun@hisilicon.com, sanil.kumar@hisilicon.com, shiju.jose@huawei.com Subject: Re: [PATCH v1 03/11] drivers: soc: hisi: Add support for Hisilicon Djtag driver Date: Tue, 08 Nov 2016 16:08:58 +0100 Message-ID: <4657586.c5MJoh65Ux@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-34-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <5821D736.7080803@gmail.com> References: <1478101374-18778-1-git-send-email-anurup.m@huawei.com> <22120038.dbaYpsQoUH@wuerfel> <5821D736.7080803@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:oRMXA7X+nbTwx65QU4zEpy3sQvDfcXOIMzuXPOrKMazeiFzmDl7 aIOhJHZCKRtd97RYjeatl+iqRTinwDWXXWhKiTD7rxHE9dLmWivtxzR4qYQIDUf07sFb9Xd lyGQaBeBtz2gpdAUxVLsoLLPbTLcmbaXQv6MEEJHxwb/ho7+MwO9fJbQuzBvhY0loNVuLQC D8lsrnJ4UhdTorHg4+nvg== X-UI-Out-Filterresults: notjunk:1;V01:K0:pucCn9+XWrI=:P5Weo3JfsTCbxxYXj301Cr BfLN1Snk1CZRK1GoZHw0VGXu428c/7cD7HZHapi2wvyNYBqZkI+3hWuiDwnBi5FkX4TaY4+lE D3YhWZuKFuB42G6G1YTOSljG/Cn2I1OUGabOOItNwrU5AKfMB3MoKjykrwbO+mye38gl4sggz yZBVoZIswxmqaRXkWI+qZBqhNUaes1hK5GwMhdQ8pDX1T54N4WTJAK9m+A2rwXaVDT46C8F/e VPguDx0dP+ve+SJ3QlCRrf6pzCSmIVtEKJlNQxp6HahYi4YRm3eyBQU0x/9kqs61qLyIgMlCP v8NflNXVaMhCf7VkWT2taUbNgbGda6blHsVXDmKjbUU2/mL+1m8KbPidWASxVQrDMyHCL8rk9 Mt6LTf7bPs+Cq33cf6gUew4Tl4KN+ha25VSkVeflR9/4Lba4/7I5HoJ5ET6YuvinF892TqUcr tNpZ+Fnrhgc4be4v7ROi7F/04zkP2epRmCrAtFtnbGlFv+btXapDnuXA5ZtjvNwj0s4Ginsc7 fb0isX9YHcbRi7fHTCZbXUcw7WOopetto4HRQLwdVvnf1zk5nshuqsWCiKys9GRoBt7eAU6+z qR5tx09pEITQPioEoeQeqV9aHsNrephJVIM0+kuX801Tk8ClxwPFWuTVaBgiCpL+zN8zzlHne PypvJQtBoi7EykyLFuRgjXaQ+NH0vd2HLkzpBn6h4FpaTFsnVEVK6E4NbiLUnjlPoY3HJykdI FHkYFsWzrptOAT+w Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2154 Lines: 48 On Tuesday, November 8, 2016 7:16:30 PM CET Anurup M wrote: > >>>> If these are backwards compatible, just mark them as compatible in DT, > >>>> e.g. hip06 can use > >>>> > >>>> compatible = "hisilicon,hip06-cpu-djtag-v1", "hisilicon,hip05-cpu-djtag-v1"; > >>>> > >>>> so you can tell the difference if you need to, but the driver only has to > >>>> list the oldest one here. > >>>> > >>>> What is the difference between the cpu and io djtag interfaces? > >> On some chips like hip06, the djtag version is different for IO die. > > In what way? The driver doesn't seem to care about the difference. > There is a difference in djtag version of CPU and IO die (in some chips). > For ex: in hip06 djtag for CPU is v1 and for IO is v2. > so they use different readwrite handlers djtag_readwrite_(v1/2). > > + /* for hip06(D03) cpu die */ > + { .compatible = "hisilicon,hip06-cpu-djtag-v1", > + .data = (void *)djtag_readwrite_v1 }, > + /* for hip06(D03) io die */ > + { .compatible = "hisilicon,hip06-io-djtag-v2", > + .data = (void *)djtag_readwrite_v2 }, > > > For the same djtag version, there is no difference in handling in the > driver. Right, but my point was about the compatibility with the older chips using the same IP block, marking the ones as compatible that actually use the same interface. I also see that the compatible strings have the version included in them, and you can probably drop them by requiring them only in the fallback: compatible = "hisilicon,hip05-cpu-djtag", "hisilicon,djtag-v1"; compatible = "hisilicon,hip05-io-djtag", "hisilicon,djtag-v1"; compatible = "hisilicon,hip06-cpu-djtag", "hisilicon,djtag-v1"; compatible = "hisilicon,hip06-io-djtag", "hisilicon,djtag-v2"; compatible = "hisilicon,hip07-cpu-djtag", "hisilicon,djtag-v2"; compatible = "hisilicon,hip07-io-djtag", "hisilicon,djtag-v2"; We want to have the first entry be as specific as possible, but the last (second) entry is the one that can be used by the driver for matching. When a future hip08/hip09/... chip uses an existing interface, you then don't have to update the driver. Arnd