Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S937735AbcJXJAK (ORCPT ); Mon, 24 Oct 2016 05:00:10 -0400 Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:43927 "EHLO metis.ext.4.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934500AbcJXJAJ (ORCPT ); Mon, 24 Oct 2016 05:00:09 -0400 Message-ID: <1477299605.2446.11.camel@pengutronix.de> Subject: Re: Reset implementation for Zynq From: Philipp Zabel To: Moritz Fischer Cc: iztok.jeras@redpitaya.com, linux-kernel@vger.kernel.org Date: Mon, 24 Oct 2016 11:00:05 +0200 In-Reply-To: <20161021170438.GA4307@live.com> References: <20161021030847.6b4c15d01df5508dab02973c2a5944d9.645b3cfd21.mailapi@email21.godaddy.com> <20161021170438.GA4307@live.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.9-1+b1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:67c:670:100:96de:80ff:fec2:9969 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1956 Lines: 45 Hi Iztok, Moritz, Am Freitag, den 21.10.2016, 10:04 -0700 schrieb Moritz Fischer: > Iztok, > > On Fri, Oct 21, 2016 at 03:08:47AM -0700, iztok.jeras@redpitaya.com wrote: > > Hi Moritz, > > > > I was looking at your reset implementation for Zynq: > > https://github.com/Xilinx/linux-xlnx/blob/629041605b93343ad2e8971ceaac3edcef0b043b/drivers/reset/reset-zynq.c > > I went through related mailing list posts (including earlier versions of the patch) so I kind of understand what to change in the device tree. > > Please look at the upstream kernel sources and use the mailing list > (lkml) if you want to report bugs. Xilinx' vendor tree might or might > not be up to date. > > > I would like to use this driver to reset the Zynq I2C controller, since we have trouble with it getting into a lock up state. > > I plan to use function device_reset_optional() from: > > https://github.com/Xilinx/linux-xlnx/blob/629041605b93343ad2e8971ceaac3edcef0b043b/include/linux/reset.h > > > > But this function is calling the reset function pointer from the reset_control_ops structure. > > For the zynq driver this function pointer is not defined, only assert, deassert and status are. > > > > Is this a missing implementation, or is there a default implementation (I did not find one) which which performs an assert+deassert, > > or is there another set of reset APIs I should use inside the kernel. > > You could just call reset_control_assert() and reset_control_deassert(). > You're right there is currently no implementation for the 'reset' function for > zynq (and most of the other SoCs). I'll need to see if it makes sense at > all. The implementation of reset_control_reset in software really only makes sense if the reset provider driver knows about the necessary delays for all reset consumers. > Please note that you'd probably have to modify the i2c driver to > integrate reset functionality cleanly. > > Thanks, > > Moritz regards Philipp