mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nicolas Ferre <nicolas.ferre@atmel.com>
To: Harini Katakam <harinikatakamlinux@gmail.com>,
	Rafal Ozieblo <rafalo@cadence.com>
Cc: "harini.katakam@xilinx.com" <harini.katakam@xilinx.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH 2/2] net: macb: Add 64 bit addressing support for GEM
Date: Thu, 17 Nov 2016 14:28:49 +0100	[thread overview]
Message-ID: <e6773b4e-a633-4754-893d-fd2351d07459@atmel.com> (raw)
In-Reply-To: <CAFcVECJ-ZYjGg-3CbWD2Ka8yKzOokUxS8ZHHOJXa2Z6anuTr7Q@mail.gmail.com>

Le 17/11/2016 à 13:21, Harini Katakam a écrit :
> Hi Rafal,
> 
> On Thu, Nov 17, 2016 at 5:20 PM, Rafal Ozieblo <rafalo@cadence.com> wrote:
>> Hello,
>> I think, there could a bug in your patch.
>>
>>> +
>>> +#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
>>> +             dmacfg |= GEM_BIT(ADDR64);
>>> +#endif
>>
>> You enable 64 bit addressing (64b dma bus width) always when appropriate architecture config option is enabled.
>> But there are some legacy controllers which do not support that feature. According Cadence hardware team:
>> "64 bit addressing was added in July 2013. Earlier version do not have it.
>> This feature was enhanced in release August 2014 to have separate upper address values for transmit and receive."
>>
>>> /* Bitfields in NSR */
>>> @@ -474,6 +479,10 @@
>>>  struct macb_dma_desc {
>>  >      u32     addr;
>>>       u32     ctrl;
>>> +#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
>>> +     u32     addrh;
>>> +     u32     resvd;
>>> +#endif
>>>  };
>>
>> It will not work for legacy hardware. Old descriptor is 2 words wide, the new one is 4 words wide.
>> If you enable CONFIG_ARCH_DMA_ADDR_T_64BIT but hardware doesn't support it at all,
>> you will miss every second descriptor.
>>
> 
> True, this feature is not available in all of Cadence IP versions.
> In fact, the IP version Zynq does not support this. But the one in ZynqMP does.
> So, we enable kernel config for 64 bit DMA addressing for this SoC and hence
> the driver picks it up. My assumption was that if the legacy IP does not support
> 64 bit addressing, then this DMA option wouldn't be enabled.
> 
> There is a design config register in Cadence IP which is being read to
> check for 64 bit address support - DMA mask is set based on that.
> But the addition of two descriptor words cannot be based on this runtime check.
> For this reason, all the static changes were placed under this check.

We have quite a bunch of options in this driver to determinate what is
the real capacity of the underlying hardware.
If HW configuration registers are not appropriate, and it seems they are
not, I would advice to simply use the DT compatibility string.

Best regards,
-- 
Nicolas Ferre

  parent reply	other threads:[~2016-11-17 14:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-17 11:50 Rafal Ozieblo
2016-11-17 12:21 ` Harini Katakam
2016-11-17 12:57   ` Rafal Ozieblo
2016-11-17 13:28   ` Nicolas Ferre [this message]
2016-11-17 13:35     ` Rafal Ozieblo
2016-11-18  4:29       ` Harini Katakam
2016-11-18  8:59         ` Rafal Ozieblo
2016-11-18  9:10           ` Nicolas Ferre
2016-11-18  9:30             ` Rafal Ozieblo
2016-11-18  9:43               ` Harini Katakam
2016-11-18  9:59                 ` Rafal Ozieblo
2016-11-18 10:03                   ` Harini Katakam
2016-11-18 10:14                   ` Nicolas Ferre
2016-11-18 10:07                 ` Andrei Pistirica
2016-11-18 10:32                   ` Harini Katakam
2016-11-18  9:58           ` Harini Katakam
2016-11-18 11:28             ` Rafal Ozieblo
  -- strict thread matches above, loose matches on Subject: below --
2016-08-01  7:20 [RFC PATCH 1/2] net: macb: Correct CAPS mask Harini Katakam
2016-08-01  7:20 ` [RFC PATCH 2/2] net: macb: Add 64 bit addressing support for GEM Harini Katakam

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=e6773b4e-a633-4754-893d-fd2351d07459@atmel.com \
    --to=nicolas.ferre@atmel.com \
    --cc=harini.katakam@xilinx.com \
    --cc=harinikatakamlinux@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rafalo@cadence.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®