All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yunzhi Li <lyz-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
To: John Youn <John.Youn-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>,
	"jwerner-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org"
	<jwerner-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
	"dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org"
	<dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Cc: "huangtao-TNX95d0MmH7DzftRWevZcw@public.gmane.org"
	<huangtao-TNX95d0MmH7DzftRWevZcw@public.gmane.org>,
	"cf-TNX95d0MmH7DzftRWevZcw@public.gmane.org"
	<cf-TNX95d0MmH7DzftRWevZcw@public.gmane.org>,
	"hl-TNX95d0MmH7DzftRWevZcw@public.gmane.org"
	<hl-TNX95d0MmH7DzftRWevZcw@public.gmane.org>,
	"wulf-TNX95d0MmH7DzftRWevZcw@public.gmane.org"
	<wulf-TNX95d0MmH7DzftRWevZcw@public.gmane.org>,
	"gregory.herrero-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org"
	<gregory.herrero-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	"linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	Greg Kroah-Hartman
	<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
	"linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH v1 1/3] usb: dwc2: reset AHB hclk domain before init
Date: Fri, 14 Aug 2015 11:28:56 +0800	[thread overview]
Message-ID: <55CD6078.8010502@rock-chips.com> (raw)
In-Reply-To: <2B3535C5ECE8B5419E3ECBE300772909017528DC44-Yu2iAY70zvrYN67daEjeMPufCSb+aD3WLzEdoUbNIic@public.gmane.org>



在 2015/8/14 8:09, John Youn 写道:
> On 8/11/2015 12:57 AM, Yunzhi Li wrote:
>> We initiate dwc2 usb controller in BIOS, when kernel driver
>> start-up we should reset AHB hclk domain to reset all AHB
>> interface registers to default. Without this the FIFO value
>> setting might be incorrect because calculating FIFO size need the
>> power-on value of GRXFSIZ/GNPTXFSIZ/HPTXFSIZ registers.
>>
>> This patch could avoid warnning massage like in rk3288 platform:
>> [    2.074764] dwc2 ff580000.usb: 256 invalid for
>> host_perio_tx_fifo_size. Check HW configuration.
>>
>> ......
> I didn't receive the other two patches in this series so I was
> confused about where the "ahb_reset" was coming from when I
> replied to your other patch.
>
> I see you changed the name and documented the DT so never mind.
>
> Another thing is that there probably shouldn't be a debug
> message on the IS_ERR condition since that is the common case
> and of no interest to other platforms.
>
> The other two resets you added aren't used by the driver
> anywhere right? Maybe those should be left out until they are.
>
> John
>
Hi John ,

   Here is the other two patches :
     https://patchwork.kernel.org/patch/6989541/
     https://patchwork.kernel.org/patch/6989531/

   ahb_reset is hreset_n signal of dwc2 IP. Our rk3288 SoC implement 
connect this signal to a special
register in clock ang reset unit (CRU) module, set this register will 
reset dwc2 control and status registers(CSR)
to default value. You could find more info in <<DesignWare Cores USB 2.0 
Hi Speed On-TheGo (OTG) Databook 3.10a>>
4.4.1 System Clock and Reset Signals.

   Our problem is that dwc2_get_hwparams() reads fifo size registers and 
reguards it as the power-on reset value,
then dwc2_set_param_host_perio_tx_fifo_size() will check this value and 
make sure the new fifo size value is no bigger
than the power-on reset value. But we init and set these fifo registers 
in BIOS, so here hw->xxx_fifo_size is not the
real power-on reset vaule. So we hope to reset CSR before 
dwc2_get_hwparams().

I have another ideal: we might use GRSTCTL.CSftRst instead of hreset_n 
to reset dwc2 CSR.


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Yunzhi Li <lyz@rock-chips.com>
To: John Youn <John.Youn@synopsys.com>,
	"jwerner@chromium.org" <jwerner@chromium.org>,
	"dianders@chromium.org" <dianders@chromium.org>
Cc: "huangtao@rock-chips.com" <huangtao@rock-chips.com>,
	"cf@rock-chips.com" <cf@rock-chips.com>,
	"hl@rock-chips.com" <hl@rock-chips.com>,
	"wulf@rock-chips.com" <wulf@rock-chips.com>,
	"gregory.herrero@intel.com" <gregory.herrero@intel.com>,
	"linux-rockchip@lists.infradead.org" 
	<linux-rockchip@lists.infradead.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v1 1/3] usb: dwc2: reset AHB hclk domain before init
Date: Fri, 14 Aug 2015 11:28:56 +0800	[thread overview]
Message-ID: <55CD6078.8010502@rock-chips.com> (raw)
In-Reply-To: <2B3535C5ECE8B5419E3ECBE300772909017528DC44@US01WEMBX2.internal.synopsys.com>



在 2015/8/14 8:09, John Youn 写道:
> On 8/11/2015 12:57 AM, Yunzhi Li wrote:
>> We initiate dwc2 usb controller in BIOS, when kernel driver
>> start-up we should reset AHB hclk domain to reset all AHB
>> interface registers to default. Without this the FIFO value
>> setting might be incorrect because calculating FIFO size need the
>> power-on value of GRXFSIZ/GNPTXFSIZ/HPTXFSIZ registers.
>>
>> This patch could avoid warnning massage like in rk3288 platform:
>> [    2.074764] dwc2 ff580000.usb: 256 invalid for
>> host_perio_tx_fifo_size. Check HW configuration.
>>
>> ......
> I didn't receive the other two patches in this series so I was
> confused about where the "ahb_reset" was coming from when I
> replied to your other patch.
>
> I see you changed the name and documented the DT so never mind.
>
> Another thing is that there probably shouldn't be a debug
> message on the IS_ERR condition since that is the common case
> and of no interest to other platforms.
>
> The other two resets you added aren't used by the driver
> anywhere right? Maybe those should be left out until they are.
>
> John
>
Hi John ,

   Here is the other two patches :
     https://patchwork.kernel.org/patch/6989541/
     https://patchwork.kernel.org/patch/6989531/

   ahb_reset is hreset_n signal of dwc2 IP. Our rk3288 SoC implement 
connect this signal to a special
register in clock ang reset unit (CRU) module, set this register will 
reset dwc2 control and status registers(CSR)
to default value. You could find more info in <<DesignWare Cores USB 2.0 
Hi Speed On-TheGo (OTG) Databook 3.10a>>
4.4.1 System Clock and Reset Signals.

   Our problem is that dwc2_get_hwparams() reads fifo size registers and 
reguards it as the power-on reset value,
then dwc2_set_param_host_perio_tx_fifo_size() will check this value and 
make sure the new fifo size value is no bigger
than the power-on reset value. But we init and set these fifo registers 
in BIOS, so here hw->xxx_fifo_size is not the
real power-on reset vaule. So we hope to reset CSR before 
dwc2_get_hwparams().

I have another ideal: we might use GRSTCTL.CSftRst instead of hreset_n 
to reset dwc2 CSR.



  parent reply	other threads:[~2015-08-14  3:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-11  7:56 [PATCH v1 1/3] usb: dwc2: reset AHB hclk domain before init Yunzhi Li
2015-08-11  7:56 ` Yunzhi Li
2015-08-11  7:56 ` [PATCH v1 2/3] Documentation: dt-bindings: add dt binding info for dwc2 reset control Yunzhi Li
     [not found]   ` <1439279787-26674-2-git-send-email-lyz-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2015-08-11 15:20     ` Doug Anderson
2015-08-11 15:20       ` Doug Anderson
2015-08-11  7:56 ` [PATCH v1 3/3] ARM: dts: rockchip: add dwc2 ahb reset property for rk3288 Yunzhi Li
2015-08-14  0:09 ` [PATCH v1 1/3] usb: dwc2: reset AHB hclk domain before init John Youn
     [not found]   ` <2B3535C5ECE8B5419E3ECBE300772909017528DC44-Yu2iAY70zvrYN67daEjeMPufCSb+aD3WLzEdoUbNIic@public.gmane.org>
2015-08-14  3:28     ` Yunzhi Li [this message]
2015-08-14  3:28       ` Yunzhi Li
2015-08-14 19:41       ` John Youn
2015-08-14 19:41         ` John Youn
2015-08-18  9:44         ` Yunzhi Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55CD6078.8010502@rock-chips.com \
    --to=lyz-tnx95d0mmh7dzftrwevzcw@public.gmane.org \
    --cc=John.Youn-HKixBCOQz3hWk0Htik3J/w@public.gmane.org \
    --cc=cf-TNX95d0MmH7DzftRWevZcw@public.gmane.org \
    --cc=dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=gregory.herrero-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=hl-TNX95d0MmH7DzftRWevZcw@public.gmane.org \
    --cc=huangtao-TNX95d0MmH7DzftRWevZcw@public.gmane.org \
    --cc=jwerner-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=wulf-TNX95d0MmH7DzftRWevZcw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.