linux/drivers/ata/sata_rcar.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * Renesas R-Car SATA driver
 *
 * Author: Vladimir Barinov <[email protected]>
 * Copyright (C) 2013-2015 Cogent Embedded, Inc.
 * Copyright (C) 2013-2015 Renesas Solutions Corp.
 */

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/ata.h>
#include <linux/libata.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/err.h>

#define DRV_NAME

/* SH-Navi2G/ATAPI module compatible control registers */
#define ATAPI_CONTROL1_REG
#define ATAPI_STATUS_REG
#define ATAPI_INT_ENABLE_REG
#define ATAPI_DTB_ADR_REG
#define ATAPI_DMA_START_ADR_REG
#define ATAPI_DMA_TRANS_CNT_REG
#define ATAPI_CONTROL2_REG
#define ATAPI_SIG_ST_REG
#define ATAPI_BYTE_SWAP_REG

/* ATAPI control 1 register (ATAPI_CONTROL1) bits */
#define ATAPI_CONTROL1_ISM
#define ATAPI_CONTROL1_DTA32M
#define ATAPI_CONTROL1_RESET
#define ATAPI_CONTROL1_DESE
#define ATAPI_CONTROL1_RW
#define ATAPI_CONTROL1_STOP
#define ATAPI_CONTROL1_START

/* ATAPI status register (ATAPI_STATUS) bits */
#define ATAPI_STATUS_SATAINT
#define ATAPI_STATUS_DNEND
#define ATAPI_STATUS_DEVTRM
#define ATAPI_STATUS_DEVINT
#define ATAPI_STATUS_ERR
#define ATAPI_STATUS_NEND
#define ATAPI_STATUS_ACT

/* Interrupt enable register (ATAPI_INT_ENABLE) bits */
#define ATAPI_INT_ENABLE_SATAINT
#define ATAPI_INT_ENABLE_DNEND
#define ATAPI_INT_ENABLE_DEVTRM
#define ATAPI_INT_ENABLE_DEVINT
#define ATAPI_INT_ENABLE_ERR
#define ATAPI_INT_ENABLE_NEND
#define ATAPI_INT_ENABLE_ACT

/* Access control registers for physical layer control register */
#define SATAPHYADDR_REG
#define SATAPHYWDATA_REG
#define SATAPHYACCEN_REG
#define SATAPHYRESET_REG
#define SATAPHYRDATA_REG
#define SATAPHYACK_REG

/* Physical layer control address command register (SATAPHYADDR) bits */
#define SATAPHYADDR_PHYRATEMODE
#define SATAPHYADDR_PHYCMD_READ
#define SATAPHYADDR_PHYCMD_WRITE

/* Physical layer control enable register (SATAPHYACCEN) bits */
#define SATAPHYACCEN_PHYLANE

/* Physical layer control reset register (SATAPHYRESET) bits */
#define SATAPHYRESET_PHYRST
#define SATAPHYRESET_PHYSRES

/* Physical layer control acknowledge register (SATAPHYACK) bits */
#define SATAPHYACK_PHYACK

/* Serial-ATA HOST control registers */
#define BISTCONF_REG
#define SDATA_REG
#define SSDEVCON_REG

#define SCRSSTS_REG
#define SCRSERR_REG
#define SCRSCON_REG
#define SCRSACT_REG

#define SATAINTSTAT_REG
#define SATAINTMASK_REG

/* SATA INT status register (SATAINTSTAT) bits */
#define SATAINTSTAT_SERR
#define SATAINTSTAT_ATA

/* SATA INT mask register (SATAINTSTAT) bits */
#define SATAINTMASK_SERRMSK
#define SATAINTMASK_ERRMSK
#define SATAINTMASK_ERRCRTMSK
#define SATAINTMASK_ATAMSK
#define SATAINTMASK_ALL_GEN1
#define SATAINTMASK_ALL_GEN2

#define SATA_RCAR_INT_MASK

/* Physical Layer Control Registers */
#define SATAPCTLR1_REG
#define SATAPCTLR2_REG
#define SATAPCTLR3_REG
#define SATAPCTLR4_REG

/* Descriptor table word 0 bit (when DTA32M = 1) */
#define SATA_RCAR_DTEND

#define SATA_RCAR_DMA_BOUNDARY

/* Gen2 Physical Layer Control Registers */
#define RCAR_GEN2_PHY_CTL1_REG
#define RCAR_GEN2_PHY_CTL1
#define RCAR_GEN2_PHY_CTL1_SS

#define RCAR_GEN2_PHY_CTL2_REG
#define RCAR_GEN2_PHY_CTL2

#define RCAR_GEN2_PHY_CTL3_REG
#define RCAR_GEN2_PHY_CTL3

#define RCAR_GEN2_PHY_CTL4_REG
#define RCAR_GEN2_PHY_CTL4

#define RCAR_GEN2_PHY_CTL5_REG
#define RCAR_GEN2_PHY_CTL5
#define RCAR_GEN2_PHY_CTL5_DC
#define RCAR_GEN2_PHY_CTL5_TR

enum sata_rcar_type {};

struct sata_rcar_priv {};

static void sata_rcar_gen1_phy_preinit(struct sata_rcar_priv *priv)
{}

static void sata_rcar_gen1_phy_write(struct sata_rcar_priv *priv, u16 reg,
				     u32 val, int group)
{}

static void sata_rcar_gen1_phy_init(struct sata_rcar_priv *priv)
{}

static void sata_rcar_gen2_phy_init(struct sata_rcar_priv *priv)
{}

static void sata_rcar_freeze(struct ata_port *ap)
{}

static void sata_rcar_thaw(struct ata_port *ap)
{}

static void sata_rcar_ioread16_rep(void __iomem *reg, void *buffer, int count)
{}

static void sata_rcar_iowrite16_rep(void __iomem *reg, void *buffer, int count)
{}

static u8 sata_rcar_check_status(struct ata_port *ap)
{}

static u8 sata_rcar_check_altstatus(struct ata_port *ap)
{}

static void sata_rcar_set_devctl(struct ata_port *ap, u8 ctl)
{}

static void sata_rcar_dev_select(struct ata_port *ap, unsigned int device)
{}

static bool sata_rcar_ata_devchk(struct ata_port *ap, unsigned int device)
{}

static int sata_rcar_wait_after_reset(struct ata_link *link,
				      unsigned long deadline)
{}

static int sata_rcar_bus_softreset(struct ata_port *ap, unsigned long deadline)
{}

static int sata_rcar_softreset(struct ata_link *link, unsigned int *classes,
			       unsigned long deadline)
{}

static void sata_rcar_tf_load(struct ata_port *ap,
			      const struct ata_taskfile *tf)
{}

static void sata_rcar_tf_read(struct ata_port *ap, struct ata_taskfile *tf)
{}

static void sata_rcar_exec_command(struct ata_port *ap,
				   const struct ata_taskfile *tf)
{}

static unsigned int sata_rcar_data_xfer(struct ata_queued_cmd *qc,
					      unsigned char *buf,
					      unsigned int buflen, int rw)
{}

static void sata_rcar_drain_fifo(struct ata_queued_cmd *qc)
{}

static int sata_rcar_scr_read(struct ata_link *link, unsigned int sc_reg,
			      u32 *val)
{}

static int sata_rcar_scr_write(struct ata_link *link, unsigned int sc_reg,
			       u32 val)
{}

static void sata_rcar_bmdma_fill_sg(struct ata_queued_cmd *qc)
{}

static enum ata_completion_errors sata_rcar_qc_prep(struct ata_queued_cmd *qc)
{}

static void sata_rcar_bmdma_setup(struct ata_queued_cmd *qc)
{}

static void sata_rcar_bmdma_start(struct ata_queued_cmd *qc)
{}

static void sata_rcar_bmdma_stop(struct ata_queued_cmd *qc)
{}

static u8 sata_rcar_bmdma_status(struct ata_port *ap)
{}

static const struct scsi_host_template sata_rcar_sht =;

static struct ata_port_operations sata_rcar_port_ops =;

static void sata_rcar_serr_interrupt(struct ata_port *ap)
{}

static void sata_rcar_ata_interrupt(struct ata_port *ap)
{}

static irqreturn_t sata_rcar_interrupt(int irq, void *dev_instance)
{}

static void sata_rcar_setup_port(struct ata_host *host)
{}

static void sata_rcar_init_module(struct sata_rcar_priv *priv)
{}

static void sata_rcar_init_controller(struct ata_host *host)
{}

static const struct of_device_id sata_rcar_match[] =;
MODULE_DEVICE_TABLE(of, sata_rcar_match);

static int sata_rcar_probe(struct platform_device *pdev)
{}

static void sata_rcar_remove(struct platform_device *pdev)
{}

#ifdef CONFIG_PM_SLEEP
static int sata_rcar_suspend(struct device *dev)
{}

static int sata_rcar_resume(struct device *dev)
{}

static int sata_rcar_restore(struct device *dev)
{}

static const struct dev_pm_ops sata_rcar_pm_ops =;
#endif

static struct platform_driver sata_rcar_driver =;

module_platform_driver();

MODULE_LICENSE();
MODULE_AUTHOR();
MODULE_DESCRIPTION();