[PATCH v4 10/16] reset: Add a reset controller driver for the Lantiq XWAY based SoCs

Hauke Mehrtens hauke at hauke-m.de
Tue Jun 20 15:17:04 PDT 2017


On 06/20/2017 01:29 AM, Andy Shevchenko wrote:
> On Tue, Jun 20, 2017 at 1:26 AM, Hauke Mehrtens <hauke at hauke-m.de> wrote:
>> From: Martin Blumenstingl <martin.blumenstingl at googlemail.com>
>>
>> The reset controllers (on xRX200 and newer SoCs have two of them) are
>> provided by the RCU module. This was initially implemented as a simple
>> reset controller. However, the RCU module provides more functionality
>> (ethernet GPHYs, USB PHY, etc.), which makes it a MFD device.
>> The old reset controller driver implementation from
>> arch/mips/lantiq/xway/reset.c did not honor this fact.
>>
>> For some devices the request and the status bits are different.
>>
> 
> FWIW,
> Reviewed-by: Andy Shevchenko <andy.shevchenko at gmail.com>
> 
> One nit below.
> 
>> Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
>> Cc: Philipp Zabel <p.zabel at pengutronix.de>
>> ---
>>  .../devicetree/bindings/reset/lantiq,reset.txt     |  29 +++
>>  drivers/reset/Kconfig                              |   6 +
>>  drivers/reset/Makefile                             |   1 +
>>  drivers/reset/reset-lantiq.c                       | 215 +++++++++++++++++++++
>>  4 files changed, 251 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/reset/lantiq,reset.txt
>>  create mode 100644 drivers/reset/reset-lantiq.c

......

>> +static int lantiq_rcu_reset_status_timeout(struct reset_controller_dev *rcdev,
>> +                                          unsigned long id, bool assert)
>> +{
>> +       int ret;
>> +       int retry = LANTIQ_RCU_RESET_TIMEOUT;
>> +
>> +       do {
>> +               ret = lantiq_rcu_reset_status(rcdev, id);
>> +               if (ret < 0)
>> +                       return ret;
> 
>> +               if (ret == assert)
>> +                       break;
> 
> return 0;
> 
>> +               usleep_range(20, 40);
>> +       } while (--retry);
>> +
> 
>> +       return retry ? 0 : -ETIMEDOUT;
> 
> return -ETIMEDOUT;
> 
Changed

...

Hauke





More information about the linux-mtd mailing list