From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [PATCH v1 07/15] mips: octeon: cpu.c: Enable AHCI/SATA support
Date: Wed, 7 Apr 2021 09:12:33 +0200 [thread overview]
Message-ID: <20210407071241.536752-8-sr@denx.de> (raw)
In-Reply-To: <20210407071241.536752-1-sr@denx.de>
For easy AHCI/ SATA integration, this patch adds board_ahci_enable()
for the MVEBU AHCI driver, which will be used by this platform. This
platform specific "enable" function will setup the proper endian
swapping in the AHCI controller so that it can be used by the common
AHCI code.
Additionally the endian swizzle entry for AHCI in
octeon_should_swizzle_table[] is removed, as this enabled the original
lowlevel code function, e.g. octeon_configure_qlm(), for the QLM setup
to work correctly.
Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
---
arch/mips/mach-octeon/cpu.c | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/arch/mips/mach-octeon/cpu.c b/arch/mips/mach-octeon/cpu.c
index 3fde9fbc4708..f56beb896414 100644
--- a/arch/mips/mach-octeon/cpu.c
+++ b/arch/mips/mach-octeon/cpu.c
@@ -15,6 +15,8 @@
#include <mach/clock.h>
#include <mach/cavm-reg.h>
#include <mach/cvmx-bootmem.h>
+#include <mach/cvmx-regs.h>
+#include <mach/cvmx-sata-defs.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -49,7 +51,6 @@ const bool octeon_should_swizzle_table[256] = {
[0x1e] = true, /* PCI mmio window */
[0x68] = true, /* OCTEON III USB */
[0x69] = true, /* OCTEON III USB */
- [0x6c] = true, /* OCTEON III SATA */
[0x6f] = true, /* OCTEON II USB */
};
@@ -412,3 +413,21 @@ int arch_misc_init(void)
return 0;
}
+
+int board_ahci_enable(void)
+{
+ cvmx_sata_uctl_shim_cfg_t shim_cfg;
+
+ /*
+ * Configure proper endian swapping for the AHCI port so that the
+ * common AHCI code can be used
+ */
+ shim_cfg.u64 = csr_rd(CVMX_SATA_UCTL_SHIM_CFG);
+ shim_cfg.s.dma_endian_mode = 1;
+ /* Use 1 for LE mode when running BE, or 3 for BE mode running BE */
+ shim_cfg.s.csr_endian_mode = 3; /* Don't byte swap */
+ shim_cfg.s.dma_read_cmd = 1; /* No allocate L2C */
+ csr_wr(CVMX_SATA_UCTL_SHIM_CFG, shim_cfg.u64);
+
+ return 0;
+}
--
2.31.1
next prev parent reply other threads:[~2021-04-07 7:12 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-07 7:12 [PATCH v1 00/15] mips: octeon: MIPS Octeon misc updates: NIC23, AHCI, serial-remote tools etc Stefan Roese
2021-04-07 7:12 ` [PATCH v1 01/15] mips: octeon: Move CVMX_SYNC from octeon_ddr.h to cvmx-regs.h Stefan Roese
2021-04-07 7:12 ` [PATCH v1 02/15] mips: octeon: cvmx-bootmem: Fix compare in "if" statement Stefan Roese
2021-04-07 7:12 ` [PATCH v1 03/15] mips: octeon: cvmx-coremask.h: Fix cvmx_coremask_dprint() with DEBUG defined Stefan Roese
2021-04-07 7:12 ` [PATCH v1 04/15] serial: serial_octeon_pcie_console.c: Add PCI remote console support Stefan Roese
2021-04-07 7:12 ` [PATCH v1 05/15] serial: serial_octeon_bootcmd.c: " Stefan Roese
2021-04-07 7:12 ` [PATCH v1 06/15] mips: octeon: cpu.c: Add arch_misc_init() for pci-console & pci-bootcmd Stefan Roese
2021-04-07 7:12 ` Stefan Roese [this message]
2021-04-07 7:12 ` [PATCH v1 08/15] sata: ahci_mvebu.c: Enable AHCI/SATA driver for MIPS Octeon Stefan Roese
2021-04-07 7:12 ` [PATCH v1 09/15] ata: ahci: Fix usage on big-endian platforms Stefan Roese
2021-04-07 7:12 ` [PATCH v1 10/15] scsi: Add ata_swap_buf_le16() to support " Stefan Roese
2021-04-07 7:12 ` [PATCH v1 11/15] mips: octeon: mrvl, cn73xx.dtsi: Add AHCI/SATA DT node Stefan Roese
2021-04-07 7:12 ` [PATCH v1 12/15] mips: octeon: Add Octeon III NIC23 board support Stefan Roese
2021-04-07 7:12 ` [PATCH v1 13/15] mips: octeon: dts/dtsi: Change UART DT node to use clocks property Stefan Roese
2021-04-07 7:12 ` [PATCH v1 14/15] mips: octeon: ebb7304: Add support for some I2C devices Stefan Roese
2021-04-07 7:12 ` [PATCH v1 15/15] mips: octeon: octeon_ebb7304_defconfig: Enable USB storage support Stefan Roese
2021-04-24 22:49 ` [PATCH v1 00/15] mips: octeon: MIPS Octeon misc updates: NIC23, AHCI, serial-remote tools etc Daniel Schwierzeck
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=20210407071241.536752-8-sr@denx.de \
--to=sr@denx.de \
--cc=u-boot@lists.denx.de \
/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