20 while (!(*reg &
mask)) {
54 for (i = 0; i <
count; i++) {
56 *eeprd = ((
address + i) << 2) & 0x1FFC;
61 buffer[i] = (*eeprd & 0xffff0000) >> 16;
83 for (i = 0; i < 0x3f; i++)
119 for (i = 0; i <
count; i++) {
122 *eepwr = ((((
address + i) << 2) & 0x1FFC) | (
buffer[i] << 16));
130 *eepwr = (0x3f << 2) |
checksum << 16;
150 if (!dev || !mac_adr)
168 if (!dev || !mac_adr)
198 if (
memcmp(cur_adr, adr_to_set, 6)) {
211 if (
CONFIG(PCI_ALLOW_BUS_MASTER_ANY_DEVICE))
225 static const struct pci_driver i210_driver
__pci_driver = {
void * memcpy(void *dest, const void *src, size_t n)
cb_err
coreboot error codes
@ CB_SUCCESS
Call completed successfully.
#define printk(level,...)
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 ...
static const struct pci_driver i210_driver __pci_driver
static uint32_t write_mac_adr(struct device *dev, uint8_t *mac_adr)
This function can write the MAC address to the MACPHY.
static void enable_bus_master(struct device *dev)
static uint32_t read_mac_adr(struct device *dev, uint8_t *mac_adr)
This function can read the MAC address out of the MACPHY.
static uint32_t compute_checksum(struct device *dev, uint16_t *checksum)
This function computes the checksum for the configuration space.
static int wait_done(uint32_t *reg, uint32_t mask)
static const unsigned short i210_device_ids[]
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 i...
static struct device_operations i210_ops
static void init(struct device *dev)
This function is the driver entry point for the init phase of the PCI bus allocator.
enum cb_err mainboard_get_mac_address(struct device *dev, uint8_t mac[MAC_ADDR_LEN])
This function will search for a MAC address which can be assigned to a MACPHY.
#define I210_FLASH_UPDATE_ERROR
#define I210_CHECKSUM_ERROR
#define I210_TARGET_CHECKSUM
#define I210_INVALID_PARAM
#define I210_POLL_TIMEOUT_US
static __always_inline void pci_or_config16(const struct device *dev, u16 reg, u16 ormask)
static __always_inline u32 pci_read_config32(const struct device *dev, u16 reg)
static uint8_t checksum(uint8_t *data, int offset)
#define BIOS_INFO
BIOS_INFO - Expected events.
#define BIOS_NOTICE
BIOS_NOTICE - Unexpected but relatively insignificant.
#define BIOS_ERR
BIOS_ERR - System in incomplete state.
#define PCI_COMMAND_MASTER
#define PCI_BASE_ADDRESS_0
void pci_dev_enable_resources(struct device *dev)
void pci_dev_read_resources(struct device *dev)
void pci_dev_set_resources(struct device *dev)
u8 buffer[C2P_BUFFER_MAXSIZE]
int memcmp(const void *s1, const void *s2, size_t n)
void(* read_resources)(struct device *dev)