Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1325458
| From | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v6] SATA: OCTEON: support SATA on OCTEON platform |
| Date | 2016-02-03 14:50 +0100 |
| Message-ID | <qY5YK-2CV-9@gated-at.bofh.it> (permalink) |
| References | <qXNSa-72M-15@gated-at.bofh.it> <qXQ3E-93-1@gated-at.bofh.it> <qY5Fq-2vi-63@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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;
Arnd
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v6] SATA: OCTEON: support SATA on OCTEON platform Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com> - 2016-02-02 19:30 +0100
Re: [PATCH v6] SATA: OCTEON: support SATA on OCTEON platform David Daney <ddaney@caviumnetworks.com> - 2016-02-02 19:40 +0100
Re: [PATCH v6] SATA: OCTEON: support SATA on OCTEON platform Arnd Bergmann <arnd@arndb.de> - 2016-02-02 21:50 +0100
Re: [PATCH v6] SATA: OCTEON: support SATA on OCTEON platform Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com> - 2016-02-03 14:30 +0100
Re: [PATCH v6] SATA: OCTEON: support SATA on OCTEON platform Arnd Bergmann <arnd@arndb.de> - 2016-02-03 14:50 +0100
Re: [PATCH v6] SATA: OCTEON: support SATA on OCTEON platform Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com> - 2016-02-03 15:50 +0100
Re: [PATCH v6] SATA: OCTEON: support SATA on OCTEON platform Arnd Bergmann <arnd@arndb.de> - 2016-02-03 16:40 +0100
Re: [PATCH v6] SATA: OCTEON: support SATA on OCTEON platform Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com> - 2016-02-03 17:10 +0100
Re: [PATCH v6] SATA: OCTEON: support SATA on OCTEON platform Arnd Bergmann <arnd@arndb.de> - 2016-02-03 17:30 +0100
Re: [PATCH v6] SATA: OCTEON: support SATA on OCTEON platform Arnd Bergmann <arnd@arndb.de> - 2016-02-03 14:50 +0100
Re: [PATCH v6] SATA: OCTEON: support SATA on OCTEON platform Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com> - 2016-02-03 15:50 +0100
csiph-web