coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
sata.c File Reference
#include <device/mmio.h>
#include <device/pci_ops.h>
#include <console/console.h>
#include <device/device.h>
#include <device/pci.h>
#include <device/pci_ids.h>
#include <delay.h>
#include "chip.h"
#include "iobp.h"
#include "pch.h"
Include dependency graph for sata.c:

Go to the source code of this file.

Macros

#define SATA_PORT_MASK   0x3f
 

Functions

static u32 sir_read (struct device *dev, int idx)
 
static void sir_write (struct device *dev, int idx, u32 value)
 
static void sir_unset_and_set_mask (struct device *dev, int idx, u32 unset, u32 set)
 
static void sata_init (struct device *dev)
 
static void sata_enable (struct device *dev)
 

Variables

static struct device_operations sata_ops
 
static const unsigned short pci_device_ids []
 
static const struct pci_driver pch_sata __pci_driver
 

Macro Definition Documentation

◆ SATA_PORT_MASK

#define SATA_PORT_MASK   0x3f

Definition at line 17 of file sata.c.

Function Documentation

◆ sata_enable()

static void sata_enable ( struct device dev)
static

Definition at line 197 of file sata.c.

References device::chip_info, config, pci_write_config16(), and SATA_PORT_MASK.

Here is the call graph for this function:

◆ sata_init()

◆ sir_read()

static u32 sir_read ( struct device dev,
int  idx 
)
inlinestatic

Definition at line 20 of file sata.c.

References pci_read_config32(), pci_write_config32(), SATA_SIRD, and SATA_SIRI.

Here is the call graph for this function:

◆ sir_unset_and_set_mask()

static void sir_unset_and_set_mask ( struct device dev,
int  idx,
u32  unset,
u32  set 
)
inlinestatic

Definition at line 32 of file sata.c.

References pci_read_config32(), pci_write_config32(), SATA_SIRD, SATA_SIRI, and value.

Referenced by sata_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sir_write()

static void sir_write ( struct device dev,
int  idx,
u32  value 
)
inlinestatic

Definition at line 26 of file sata.c.

References pci_write_config32(), SATA_SIRD, SATA_SIRI, and value.

Referenced by sata_init().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ __pci_driver

const struct pci_driver pch_sata __pci_driver
static
Initial value:
= {
.ops = &sata_ops,
.vendor = PCI_VID_INTEL,
.devices = pci_device_ids,
}
#define PCI_VID_INTEL
Definition: pci_ids.h:2157
static struct device_operations sata_ops
Definition: sata.c:212
static const unsigned short pci_device_ids[]
Definition: sata.c:221

Definition at line 221 of file sata.c.

◆ pci_device_ids

const unsigned short pci_device_ids[]
static
Initial value:
= {
0
}
#define PCI_DID_INTEL_LPT_LP_SATA_RAID_2
Definition: pci_ids.h:3453
#define PCI_DID_INTEL_LPT_H_DESKTOP_SATA_RAID_PREM
Definition: pci_ids.h:3441
#define PCI_DID_INTEL_LPT_H_DESKTOP_SATA_RAID_1
Definition: pci_ids.h:3440
#define PCI_DID_INTEL_LPT_LP_SATA_AHCI
Definition: pci_ids.h:3450
#define PCI_DID_INTEL_LPT_H_MOBILE_SATA_AHCI
Definition: pci_ids.h:3445
#define PCI_DID_INTEL_LPT_H_MOBILE_SATA_RAID_1
Definition: pci_ids.h:3446
#define PCI_DID_INTEL_LPT_H_DESKTOP_SATA_AHCI
Definition: pci_ids.h:3439
#define PCI_DID_INTEL_LPT_LP_SATA_RAID_1
Definition: pci_ids.h:3451
#define PCI_DID_INTEL_LPT_H_MOBILE_SATA_RAID_PREM
Definition: pci_ids.h:3447
#define PCI_DID_INTEL_LPT_H_MOBILE_SATA_IDE
Definition: pci_ids.h:3444
#define PCI_DID_INTEL_LPT_H_MOBILE_SATA_IDE_P45
Definition: pci_ids.h:3448
#define PCI_DID_INTEL_LPT_H_DESKTOP_SATA_RAID_2
Definition: pci_ids.h:3443
#define PCI_DID_INTEL_LPT_H_MOBILE_SATA_RAID_2
Definition: pci_ids.h:3449
#define PCI_DID_INTEL_LPT_H_DESKTOP_SATA_IDE_P45
Definition: pci_ids.h:3442
#define PCI_DID_INTEL_LPT_H_DESKTOP_SATA_IDE
Definition: pci_ids.h:3438
#define PCI_DID_INTEL_LPT_LP_SATA_RAID_PREM
Definition: pci_ids.h:3452

Definition at line 221 of file sata.c.

◆ sata_ops

struct device_operations sata_ops
static
Initial value:
= {
.read_resources = pci_dev_read_resources,
.set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources,
.init = sata_init,
.enable = sata_enable,
.ops_pci = &pci_dev_ops_pci,
}
void pci_dev_enable_resources(struct device *dev)
Definition: pci_device.c:721
void pci_dev_read_resources(struct device *dev)
Definition: pci_device.c:534
struct pci_operations pci_dev_ops_pci
Default device operation for PCI devices.
Definition: pci_device.c:911
void pci_dev_set_resources(struct device *dev)
Definition: pci_device.c:691
void sata_enable(struct device *dev)
Definition: sata.c:33
static void sata_init(struct device *dev)
Definition: sata.c:40

Definition at line 197 of file sata.c.