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

Go to the source code of this file.

Macros

#define NAMBAR   0x10
 
#define MASTER_VOL   0x02
 
#define PAGING   0x24
 
#define EXT_AUDIO   0x28
 
#define FUNC_SEL   0x66
 
#define INFO_IO   0x68
 
#define CONNECTOR   0x6a
 
#define VENDOR_ID1   0x7c
 
#define VENDOR_ID2   0x7e
 
#define SEC_VENDOR_ID1   0xfc
 
#define SEC_VENDOR_ID2   0xfe
 
#define NABMBAR   0x14
 
#define GLOB_CNT   0x2c
 
#define GLOB_STA   0x30
 
#define CAS   0x34
 
#define MMBAR   0x10
 
#define EXT_MODEM_ID1   0x3c
 
#define EXT_MODEM_ID2   0xbc
 
#define MBAR   0x14
 
#define SEC_CODEC   0x40
 

Functions

static int ac97_semaphore (void)
 
static void init_cnr (void)
 
static void program_sigid (struct device *dev, u32 id)
 
static void ac97_audio_init (struct device *dev)
 
static void ac97_modem_init (struct device *dev)
 

Variables

static u16 ac97_function [16 *2][4]
 
static u16 nabmbar
 
static u16 nambar
 
static struct device_operations ac97_audio_ops
 
static struct device_operations ac97_modem_ops
 
static const struct pci_driver i82801db_ac97_audio __pci_driver
 

Macro Definition Documentation

◆ CAS

#define CAS   0x34

Definition at line 27 of file ac97.c.

◆ CONNECTOR

#define CONNECTOR   0x6a

Definition at line 18 of file ac97.c.

◆ EXT_AUDIO

#define EXT_AUDIO   0x28

Definition at line 15 of file ac97.c.

◆ EXT_MODEM_ID1

#define EXT_MODEM_ID1   0x3c

Definition at line 30 of file ac97.c.

◆ EXT_MODEM_ID2

#define EXT_MODEM_ID2   0xbc

Definition at line 31 of file ac97.c.

◆ FUNC_SEL

#define FUNC_SEL   0x66

Definition at line 16 of file ac97.c.

◆ GLOB_CNT

#define GLOB_CNT   0x2c

Definition at line 25 of file ac97.c.

◆ GLOB_STA

#define GLOB_STA   0x30

Definition at line 26 of file ac97.c.

◆ INFO_IO

#define INFO_IO   0x68

Definition at line 17 of file ac97.c.

◆ MASTER_VOL

#define MASTER_VOL   0x02

Definition at line 13 of file ac97.c.

◆ MBAR

#define MBAR   0x14

Definition at line 33 of file ac97.c.

◆ MMBAR

#define MMBAR   0x10

Definition at line 29 of file ac97.c.

◆ NABMBAR

#define NABMBAR   0x14

Definition at line 24 of file ac97.c.

◆ NAMBAR

#define NAMBAR   0x10

Definition at line 12 of file ac97.c.

◆ PAGING

#define PAGING   0x24

Definition at line 14 of file ac97.c.

◆ SEC_CODEC

#define SEC_CODEC   0x40

Definition at line 34 of file ac97.c.

◆ SEC_VENDOR_ID1

#define SEC_VENDOR_ID1   0xfc

Definition at line 21 of file ac97.c.

◆ SEC_VENDOR_ID2

#define SEC_VENDOR_ID2   0xfe

Definition at line 22 of file ac97.c.

◆ VENDOR_ID1

#define VENDOR_ID1   0x7c

Definition at line 19 of file ac97.c.

◆ VENDOR_ID2

#define VENDOR_ID2   0x7e

Definition at line 20 of file ac97.c.

Function Documentation

◆ ac97_audio_init()

static void ac97_audio_init ( struct device dev)
static

◆ ac97_modem_init()

static void ac97_modem_init ( struct device dev)
static

Definition at line 199 of file ac97.c.

◆ ac97_semaphore()

static int ac97_semaphore ( void  )
static

Definition at line 75 of file ac97.c.

References BIOS_DEBUG, CAS, inb(), nabmbar, and printk.

Referenced by ac97_audio_init().

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

◆ init_cnr()

static void init_cnr ( void  )
static

Definition at line 92 of file ac97.c.

Referenced by ac97_audio_init().

Here is the caller graph for this function:

◆ program_sigid()

static void program_sigid ( struct device dev,
u32  id 
)
static

Definition at line 97 of file ac97.c.

References pci_write_config32().

Referenced by ac97_audio_init().

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

Variable Documentation

◆ __pci_driver

static const struct pci_driver i82801db_ac97_modem __pci_driver
static
Initial value:
= {
.ops = &ac97_audio_ops,
.vendor = PCI_VID_INTEL,
}
static struct device_operations ac97_audio_ops
Definition: ac97.c:236
#define PCI_VID_INTEL
Definition: pci_ids.h:2157
#define PCI_DID_INTEL_82801DB_AC97_AUDIO
Definition: pci_ids.h:2279

Definition at line 199 of file ac97.c.

◆ ac97_audio_ops

struct device_operations ac97_audio_ops
static
Initial value:
= {
.read_resources = pci_dev_read_resources,
.set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources,
.enable = i82801dx_enable,
.init = ac97_audio_init,
}
static void ac97_audio_init(struct device *dev)
Definition: ac97.c:102
void i82801dx_enable(struct device *dev)
Definition: i82801dx.c:8
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
void pci_dev_set_resources(struct device *dev)
Definition: pci_device.c:691

Definition at line 199 of file ac97.c.

◆ ac97_function

u16 ac97_function[16 *2][4]
static

Definition at line 37 of file ac97.c.

Referenced by ac97_audio_init().

◆ ac97_modem_ops

struct device_operations ac97_modem_ops
static
Initial value:
= {
.read_resources = pci_dev_read_resources,
.set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources,
.enable = i82801dx_enable,
.init = ac97_modem_init,
}
static void ac97_modem_init(struct device *dev)
Definition: ac97.c:199

Definition at line 199 of file ac97.c.

◆ nabmbar

u16 nabmbar
static

Definition at line 72 of file ac97.c.

Referenced by ac97_audio_init(), and ac97_semaphore().

◆ nambar

u16 nambar
static

Definition at line 73 of file ac97.c.

Referenced by ac97_audio_init().