linux/drivers/ata/sata_dwc_460ex.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * drivers/ata/sata_dwc_460ex.c
 *
 * Synopsys DesignWare Cores (DWC) SATA host driver
 *
 * Author: Mark Miesfeld <[email protected]>
 *
 * Ported from 2.6.19.2 to 2.6.25/26 by Stefan Roese <[email protected]>
 * Copyright 2008 DENX Software Engineering
 *
 * Based on versions provided by AMCC and Synopsys which are:
 *          Copyright 2006 Applied Micro Circuits Corporation
 *          COPYRIGHT (C) 2005  SYNOPSYS, INC.  ALL RIGHTS RESERVED
 */

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/dmaengine.h>
#include <linux/of.h>
#include <linux/of_irq.h>
#include <linux/platform_device.h>
#include <linux/phy/phy.h>
#include <linux/libata.h>
#include <linux/slab.h>
#include <trace/events/libata.h>

#include "libata.h"

#include <scsi/scsi_host.h>
#include <scsi/scsi_cmnd.h>

/* These two are defined in "libata.h" */
#undef	DRV_NAME
#undef	DRV_VERSION

#define DRV_NAME
#define DRV_VERSION

#define sata_dwc_writel(a, v)
#define sata_dwc_readl(a)

#define AHB_DMA_BRST_DFLT

enum {};

/* DWC SATA Registers */
struct sata_dwc_regs {};

enum {};

#define SATA_DWC_SCR0_SPD_GET(v)
#define SATA_DWC_DMACR_TX_CLEAR(v)
#define SATA_DWC_DMACR_RX_CLEAR(v)
#define SATA_DWC_DBTSR_MWR(size)
#define SATA_DWC_DBTSR_MRD(size)
struct sata_dwc_device {};

/*
 * Allow one extra special slot for commands and DMA management
 * to account for libata internal commands.
 */
#define SATA_DWC_QCMD_MAX

struct sata_dwc_device_port {};

/*
 * Commonly used DWC SATA driver macros
 */
#define HSDEV_FROM_HOST(host)
#define HSDEV_FROM_AP(ap)
#define HSDEVP_FROM_AP(ap)
#define HSDEV_FROM_QC(qc)
#define HSDEV_FROM_HSDEVP(p)

enum {};

/*
 * Prototypes
 */
static void sata_dwc_bmdma_start_by_tag(struct ata_queued_cmd *qc, u8 tag);
static int sata_dwc_qc_complete(struct ata_port *ap, struct ata_queued_cmd *qc);
static void sata_dwc_dma_xfer_complete(struct ata_port *ap);
static void sata_dwc_clear_dmacr(struct sata_dwc_device_port *hsdevp, u8 tag);

#ifdef CONFIG_SATA_DWC_OLD_DMA

#include <linux/platform_data/dma-dw.h>
#include <linux/dma/dw.h>

static struct dw_dma_slave sata_dwc_dma_dws =;

static bool sata_dwc_dma_filter(struct dma_chan *chan, void *param)
{}

static int sata_dwc_dma_get_channel_old(struct sata_dwc_device_port *hsdevp)
{}

static int sata_dwc_dma_init_old(struct platform_device *pdev,
				 struct sata_dwc_device *hsdev)
{}

static void sata_dwc_dma_exit_old(struct sata_dwc_device *hsdev)
{}

#endif

static const char *get_prot_descript(u8 protocol)
{}

static void dma_dwc_xfer_done(void *hsdev_instance)
{}

static struct dma_async_tx_descriptor *dma_dwc_xfer_setup(struct ata_queued_cmd *qc)
{}

static int sata_dwc_scr_read(struct ata_link *link, unsigned int scr, u32 *val)
{}

static int sata_dwc_scr_write(struct ata_link *link, unsigned int scr, u32 val)
{}

static void clear_serror(struct ata_port *ap)
{}

static void clear_interrupt_bit(struct sata_dwc_device *hsdev, u32 bit)
{}

static u32 qcmd_tag_to_mask(u8 tag)
{}

/* See ahci.c */
static void sata_dwc_error_intr(struct ata_port *ap,
				struct sata_dwc_device *hsdev, uint intpr)
{}

/*
 * Function : sata_dwc_isr
 * arguments : irq, void *dev_instance, struct pt_regs *regs
 * Return value : irqreturn_t - status of IRQ
 * This Interrupt handler called via port ops registered function.
 * .irq_handler = sata_dwc_isr
 */
static irqreturn_t sata_dwc_isr(int irq, void *dev_instance)
{}

static void sata_dwc_clear_dmacr(struct sata_dwc_device_port *hsdevp, u8 tag)
{}

static void sata_dwc_dma_xfer_complete(struct ata_port *ap)
{}

static int sata_dwc_qc_complete(struct ata_port *ap, struct ata_queued_cmd *qc)
{}

static void sata_dwc_enable_interrupts(struct sata_dwc_device *hsdev)
{}

static void sata_dwc_setup_port(struct ata_ioports *port, void __iomem *base)
{}

static int sata_dwc_dma_get_channel(struct sata_dwc_device_port *hsdevp)
{}

/*
 * Function : sata_dwc_port_start
 * arguments : struct ata_ioports *port
 * Return value : returns 0 if success, error code otherwise
 * This function allocates the scatter gather LLI table for AHB DMA
 */
static int sata_dwc_port_start(struct ata_port *ap)
{}

static void sata_dwc_port_stop(struct ata_port *ap)
{}

/*
 * Function : sata_dwc_exec_command_by_tag
 * arguments : ata_port *ap, ata_taskfile *tf, u8 tag, u32 cmd_issued
 * Return value : None
 * This function keeps track of individual command tag ids and calls
 * ata_exec_command in libata
 */
static void sata_dwc_exec_command_by_tag(struct ata_port *ap,
					 struct ata_taskfile *tf,
					 u8 tag, u32 cmd_issued)
{}

static void sata_dwc_bmdma_setup_by_tag(struct ata_queued_cmd *qc, u8 tag)
{}

static void sata_dwc_bmdma_setup(struct ata_queued_cmd *qc)
{}

static void sata_dwc_bmdma_start_by_tag(struct ata_queued_cmd *qc, u8 tag)
{}

static void sata_dwc_bmdma_start(struct ata_queued_cmd *qc)
{}

static unsigned int sata_dwc_qc_issue(struct ata_queued_cmd *qc)
{}

static void sata_dwc_error_handler(struct ata_port *ap)
{}

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

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

/*
 * scsi mid-layer and libata interface structures
 */
static const struct scsi_host_template sata_dwc_sht =;

static struct ata_port_operations sata_dwc_ops =;

static const struct ata_port_info sata_dwc_port_info[] =;

static int sata_dwc_probe(struct platform_device *ofdev)
{}

static void sata_dwc_remove(struct platform_device *ofdev)
{}

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

static struct platform_driver sata_dwc_driver =;

module_platform_driver();

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