Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3680495imm; Sun, 10 Jun 2018 23:11:06 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLIcpzd/+aFkmN/6wUDdQIRIvUX5nm00f+INFnBBsK/C6ih4H7SXBMxaom8nEEtUimZgTvc X-Received: by 2002:a17:902:b48f:: with SMTP id y15-v6mr17149526plr.261.1528697466333; Sun, 10 Jun 2018 23:11:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528697466; cv=none; d=google.com; s=arc-20160816; b=aPxje3dmKBo2PcsmX1uuQIHz72pz3kwDVKrHp1/qiP4e377MPeOCN8YFAKeRjeqXrD hOa3tq1ratF3Md0vs6athIHj22tEUGMRg+nqNx5FCPCWD/MnPnUUIVrmWpjUYmqWeNZS HcyM5XiHsnKogapbRx7OAK9cf9avcqt3wZbRkIEO3NBZBjBbyEs2yhgQEzCyEOKIKpgy kYQH/5bsAbo3YMNi7vA6ud7Vhy6rudERKWWJQltrY8Adizf+V4AxmCwcE4XWQ2Wvzfsw mCoDthaOqaAYdAmPfzsBHcWZMkId1exkV+PiLCjjoLXtAjeZbBLZoRvvuUrCIGrVTykn vFiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=8euphD3K0+ChQBTS0/W+WBYIYS3WCEG2yCxuyQdwzIA=; b=Zbh/gjtsRL7X9avaf2ldVIIR2sBVV1UMENxGcDpDk95Y7W5/9TJ6hJWb++4Q8NlDtI d7HGiv4Eug0qj8KFpKXmOwEeH4Dh3jrkP20RXwW86MV8KDC7stI8z8jeDRB4I3jgvdJA UyWRsTNdkPNtulJZo10oH46DTtpKNuZWXrRSyCH8rnRiJmMX1ZLq4hWJBAbX41bOMdwb WDiZN1txFgAOLtuztWoP8HetroG9jBcyI/Sn7vkkApJ4zsOrtOfTX7S1hyz3ZK5FMEkq 0x/KmuCvvFKbh0w3cR43nu83yOMutjX1aM9cEeGjPn9DBr+LU66vECNrR58hZap/0WCV Q3oA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r11-v6si40269543pfd.193.2018.06.10.23.10.52; Sun, 10 Jun 2018 23:11:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754100AbeFKGKE (ORCPT + 99 others); Mon, 11 Jun 2018 02:10:04 -0400 Received: from muru.com ([72.249.23.125]:46544 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754001AbeFKGKB (ORCPT ); Mon, 11 Jun 2018 02:10:01 -0400 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 4F065802B; Mon, 11 Jun 2018 06:12:34 +0000 (UTC) Date: Sun, 10 Jun 2018 23:09:57 -0700 From: Tony Lindgren To: Faiz Abbas Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, mark.rutland@arm.com, paul@pwsan.com, t-kristo@ti.com, robh+dt@kernel.org, bcousson@baylibre.com Subject: Re: [PATCH v3 4/6] bus: ti-sysc: Add support for software reset Message-ID: <20180611060957.GN5738@atomide.com> References: <20180606060826.14671-1-faiz_abbas@ti.com> <20180606060826.14671-5-faiz_abbas@ti.com> <20180607073530.GH5738@atomide.com> <20180608062158.GI5738@atomide.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Faiz Abbas [180611 06:09]: > Hi Tony, > > On Friday 08 June 2018 11:51 AM, Tony Lindgren wrote: > > * Faiz Abbas [180607 10:24]: > >> Hi, > >> > >> On Thursday 07 June 2018 01:05 PM, Tony Lindgren wrote: > >>> * Faiz Abbas [180606 06:14]: > >>>> +static int sysc_reset(struct sysc *ddata) > >>>> +{ > >>>> + int offset = ddata->offsets[SYSC_SYSCONFIG]; > >>>> + int val = sysc_read(ddata, offset); > >>>> + > >>>> + val |= (0x1 << ddata->cap->regbits->srst_shift); > >>>> + sysc_write(ddata, offset, val); > >>>> + > >>>> + /* Poll on reset status */ > >>>> + if (ddata->cfg.quirks & SYSC_QUIRK_RESET_STATUS) { > >>>> + offset = ddata->offsets[SYSC_SYSSTATUS]; > >>>> + > >>>> + return readl_poll_timeout(ddata->module_va + offset, val, > >>>> + (val & ddata->cfg.syss_mask) == 0x0, > >>>> + 100, MAX_MODULE_SOFTRESET_WAIT); > >>>> + } > >>>> + > >>>> + return 0; > >>>> +} > >>> > >>> I wonder if we should also add SYSS_QUIRK_RESET_STATUS in > >>> addition to SYSC_QUIRK_RESET status to make it easy to > >>> read the right register? > >> > >> I assumed SYSC_QUIRK is the prefix to indicate the ti-sysc driver not > >> the register. Are there layouts in which the reset status bit is in the > >> sysconfig register rather than the sysstatus register? > > > > Yes we can have reset status bit in either syss or syssconfig register. > > You mean sysstatus and sysconfig right? Yup. > > We detect that in sysc_init_syss_mask() but we should also set something > > at that point to make it clear which reset to use. But as we don't need > > the quirk flag, it's probably set a function pointer after the detection. > > So how about let's have two functions sysc_reset() and sysc_syss_reset() > > and then we can implement sysc_syss_reset() in a separate patch after > > testing it when we have a non-platform data using example for > > sysc_syss_reset(). > > > > Shouldn't the function I add be called sysc_syss_reset()? The reset > status bit is in the sysstatus. Yes Tony