From: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: <tj@kernel.org>, <hdegoede@redhat.com>, <david.daney@cavium.com>,
<aleksey.makarov@caviumnetworks.com>,
<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-ide@vger.kernel.org>
Subject: Re: [PATCH v6] SATA: OCTEON: support SATA on OCTEON platform
Date: Wed, 3 Feb 2016 14:44:50 +0000 [thread overview]
Message-ID: <56B21262.6080109@imgtec.com> (raw)
In-Reply-To: <3554031.r9sGg8j827@wuerfel>
On 03/02/16 13:41, Arnd Bergmann wrote:
> On Wednesday 03 February 2016 13:24:10 Zubair Lutfullah Kakakhel wrote:
>>
>> Bitfields for both endians are used and handled by mips.
>> Mainly used by cavium.
>>
>> As this is a cavium driver, would it be acceptable?
>>
>> Or should I replace with the following.
>>
>> v = cvmx_read_csr((uint64_t)base + CVMX_SATA_UCTL_SHIM_CFG);
>> v &= ~(SATA_UCTL_ENDIAN_MODE_E_MASK << DMA_ENDIAN_MODE);
>> v &= ~(SATA_UCTL_ENDIAN_MODE_E_MASK << CSR_ENDIAN_MODE);
>> #ifdef __BIG_ENDIAN
>> v |= SATA_UCTL_ENDIAN_MODE_E_BIG << DMA_ENDIAN_MODE;
>> v |= SATA_UCTL_ENDIAN_MODE_E_BIG << CSR_ENDIAN_MODE;
>> #else
>> v |= SATA_UCTL_ENDIAN_MODE_E_LITTLE << DMA_ENDIAN_MODE;
>> v |= SATA_UCTL_ENDIAN_MODE_E_LITTLE << CSR_ENDIAN_MODE;
>> #endif
>> v |= 1 << DMA_READ_CMD;
>> cvmx_write_csr((uint64_t)base + CVMX_SATA_UCTL_SHIM_CFG, v);
>
> I think something like this would be more conventional, yes. Or maybe
> define the macros so you don't have to do the shift everywhere:
>
> v &= ~SATA_UCTL_ENDIAN_MODE_E_MASK | SATA_UCTL_ENDIAN_MODE | SATA_UCTL_DMA_READ_CMD;
Sure.
Thanks
ZubairLK
>
> Arnd
>
next prev parent reply other threads:[~2016-02-03 14:45 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-02 18:24 [PATCH v6] SATA: OCTEON: support SATA on OCTEON platform Zubair Lutfullah Kakakhel
2016-02-02 18:37 ` David Daney
2016-02-02 20:48 ` Arnd Bergmann
2016-02-03 13:24 ` Zubair Lutfullah Kakakhel
2016-02-03 13:41 ` Arnd Bergmann
2016-02-03 14:44 ` Zubair Lutfullah Kakakhel [this message]
2016-02-03 13:47 ` Arnd Bergmann
2016-02-03 14:44 ` Zubair Lutfullah Kakakhel
2016-02-03 15:31 ` Arnd Bergmann
2016-02-03 16:02 ` Zubair Lutfullah Kakakhel
2016-02-03 16:23 ` Arnd Bergmann
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=56B21262.6080109@imgtec.com \
--to=zubair.kakakhel@imgtec.com \
--cc=aleksey.makarov@caviumnetworks.com \
--cc=arnd@arndb.de \
--cc=david.daney@cavium.com \
--cc=devicetree@vger.kernel.org \
--cc=hdegoede@redhat.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox