coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
#include "i210.h"
#include <device/device.h>
#include <console/console.h>
#include <device/pci.h>
#include <device/pci_ids.h>
#include <device/pci_ops.h>
#include <device/pci_def.h>
#include <string.h>
#include <types.h>
#include <delay.h>
Go to the source code of this file.
Functions | |
static int | wait_done (uint32_t *reg, uint32_t mask) |
static uint32_t | read_flash (struct device *dev, uint32_t address, uint32_t count, uint16_t *buffer) |
This function can read the configuration space of the MACPHY For this purpose, the EEPROM interface is used. More... | |
static uint32_t | compute_checksum (struct device *dev, uint16_t *checksum) |
This function computes the checksum for the configuration space. More... | |
static uint32_t | write_flash (struct device *dev, uint32_t address, uint32_t count, uint16_t *buffer) |
This function can write the configuration space of the MACPHY For this purpose, the EEPROM interface is used. More... | |
static uint32_t | read_mac_adr (struct device *dev, uint8_t *mac_adr) |
This function can read the MAC address out of the MACPHY. More... | |
static uint32_t | write_mac_adr (struct device *dev, uint8_t *mac_adr) |
This function can write the MAC address to the MACPHY. More... | |
static void | init (struct device *dev) |
This function is the driver entry point for the init phase of the PCI bus allocator. More... | |
static void | enable_bus_master (struct device *dev) |
Variables | |
static struct device_operations | i210_ops |
static const unsigned short | i210_device_ids [] = { 0x1537, 0x1538, 0x1533, 0 } |
static const struct pci_driver i210_driver | __pci_driver |
This function computes the checksum for the configuration space.
The address range for the checksum is 0x00..0x3e.
*dev | Pointer to the PCI device of this MACPHY |
*checksum | Pointer to the buffer where to store the checksum |
Definition at line 72 of file i210.c.
References checksum(), I210_READ_ERROR, I210_SUCCESS, I210_TARGET_CHECKSUM, and read_flash().
Referenced by write_flash().
Definition at line 209 of file i210.c.
References CONFIG, PCI_COMMAND, PCI_COMMAND_MASTER, and pci_or_config16().
This function is the driver entry point for the init phase of the PCI bus allocator.
It will program a MAC address into the MACPHY.
*dev | Pointer to the used PCI device |
Definition at line 181 of file i210.c.
References BIOS_ERR, BIOS_INFO, BIOS_NOTICE, CB_SUCCESS, mainboard_get_mac_address(), memcmp(), printk, read_mac_adr(), and write_mac_adr().
Referenced by dapc_init(), and mipi_panel_parse_init_commands().
|
static |
This function can read the configuration space of the MACPHY For this purpose, the EEPROM interface is used.
No direct access to the flash memory will be done.
*dev | Pointer to the PCI device of this MACPHY |
address | Address inside the flash where reading will start |
count | Number of words (16 bit values) to read |
*buffer | Pointer to the buffer where to store read data |
Definition at line 37 of file i210.c.
References address, buffer, count, I210_DONE, I210_INVALID_PARAM, I210_NOT_READY, I210_READ_ERROR, I210_REG_EEREAD, I210_SUCCESS, PCI_BASE_ADDRESS_0, pci_read_config32(), and wait_done().
Referenced by compute_checksum(), and read_mac_adr().
This function can read the MAC address out of the MACPHY.
*dev | Pointer to the PCI device of this MACPHY |
*MACAdr | Pointer to the buffer where to store read MAC address |
Definition at line 147 of file i210.c.
References I210_INVALID_PARAM, I210_READ_ERROR, I210_SUCCESS, memcpy(), and read_flash().
Referenced by init().
Definition at line 16 of file i210.c.
References I210_NOT_READY, I210_POLL_TIMEOUT_US, I210_SUCCESS, mask, and udelay().
Referenced by read_flash(), and write_flash().
|
static |
This function can write the configuration space of the MACPHY For this purpose, the EEPROM interface is used.
No direct access to the flash memory will be done. This function will update the checksum after a value was changed.
*dev | Pointer to the PCI device of this MACPHY |
address | Address inside the flash where writing will start |
count | Number of words (16 bit values) to write |
*buffer | Pointer to the buffer where data to write is stored in |
Definition at line 99 of file i210.c.
References address, buffer, checksum(), compute_checksum(), count, I210_CHECKSUM_ERROR, I210_DONE, I210_FLASH_UPDATE_ERROR, I210_FLUDONE, I210_FLUPD, I210_INVALID_PARAM, I210_NOT_READY, I210_REG_EECTRL, I210_REG_EEWRITE, I210_SUCCESS, I210_WRITE_ERROR, pci_read_config32(), and wait_done().
Referenced by write_mac_adr().
This function can write the MAC address to the MACPHY.
*dev | Pointer to the PCI device of this MACPHY |
*MACAdr | Pointer to the buffer where the desired MAC address is |
Definition at line 165 of file i210.c.
References I210_INVALID_PARAM, memcpy(), and write_flash().
Referenced by init().
|
static |
|
static |
|
static |