User Tools

Site Tools


sata_port_multipliers

This is an old revision of the document!


Overview

Discussion of kernel support for SATA port multipliers.

Kernel content

  • include/
    • linux/
      • ata.h
      • libata.h
  • drivers/
    • ata/
      • Kconfig
      • Makefile
      • libata-pmp.c

Build files

Kconfig

config SATA_PMP
        bool "SATA Port Multiplier support"
        default y
        help
          This option adds support for SATA Port Multipliers
          (the SATA version of an ethernet hub, or SAS expander).

Makefile

libata-$(CONFIG_SATA_PMP)       += libata-pmp.o

Header files [include/linux/]

ata.h

enum {
        /* various global constants */
        ...
        /* ATA device commands */
        ...
        ATA_CMD_PMP_READ        = 0xE4,
        ATA_CMD_PMP_READ_DMA    = 0xE9,
        ATA_CMD_PMP_WRITE       = 0xE8,
        ATA_CMD_PMP_WRITE_DMA   = 0xEB,
        ...
/* PMP stuff */
SATA_PMP_MAX_PORTS      = 15,
SATA_PMP_CTRL_PORT      = 15,

SATA_PMP_GSCR_DWORDS    = 128,
SATA_PMP_GSCR_PROD_ID   = 0,
SATA_PMP_GSCR_REV       = 1,
SATA_PMP_GSCR_PORT_INFO = 2,
SATA_PMP_GSCR_ERROR     = 32,
SATA_PMP_GSCR_ERROR_EN  = 33,
SATA_PMP_GSCR_FEAT      = 64,
SATA_PMP_GSCR_FEAT_EN   = 96,

SATA_PMP_PSCR_STATUS    = 0,
SATA_PMP_PSCR_ERROR     = 1,
SATA_PMP_PSCR_CONTROL   = 2,
SATA_PMP_FEAT_BIST      = (1 << 0),
SATA_PMP_FEAT_PMREQ     = (1 << 1),
SATA_PMP_FEAT_DYNSSC    = (1 << 2),
SATA_PMP_FEAT_NOTIFY    = (1 << 3),
#define sata_pmp_gscr_vendor(gscr)      ((gscr)[SATA_PMP_GSCR_PROD_ID] & 0xffff)
#define sata_pmp_gscr_devid(gscr)       ((gscr)[SATA_PMP_GSCR_PROD_ID] >> 16)
#define sata_pmp_gscr_rev(gscr)         (((gscr)[SATA_PMP_GSCR_REV] >> 8) & 0xff)
#define sata_pmp_gscr_ports(gscr)       ((gscr)[SATA_PMP_GSCR_PORT_INFO] & 0xf)

libata.h

enum {
        /* various global constants */
        ...
        ATA_DEV_UNKNOWN         = 0,    /* unknown device */
        ATA_DEV_ATA             = 1,    /* ATA device */
        ATA_DEV_ATA_UNSUP       = 2,    /* ATA device (unsupported) */
        ATA_DEV_ATAPI           = 3,    /* ATAPI device */
        ATA_DEV_ATAPI_UNSUP     = 4,    /* ATAPI device (unsupported) */
        
        ATA_DEV_PMP             = 5,    /* SATA port multiplier */
        ATA_DEV_PMP_UNSUP       = 6,    /* SATA port multiplier (unsupported) */
        
        ATA_DEV_SEMB            = 7,    /* SEMB */
        ATA_DEV_SEMB_UNSUP      = 8,    /* SEMB (unsupported) */
        ATA_DEV_ZAC             = 9,    /* ZAC device */
        ATA_DEV_ZAC_UNSUP       = 10,   /* ZAC device (unsupported) */
        ATA_DEV_NONE            = 11,   /* no device */
        ...
        /* struct ata_port flags */
        ...
        ATA_FLAG_PMP            = (1 << 19), /* controller supports PMP */
        ...

libata-pmp.c

sata_port_multipliers.1556102467.txt.gz · Last modified: 2019/04/24 10:41 by rpjday