blob: 1cc6a28a0bce1756ef480d60cc77c31316cb6248 [file] [log] [blame]
Angel Pons8a3453f2020-04-02 23:48:19 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Werner Zeh63693dc2015-02-13 12:18:58 +01002
3#ifndef _INTEL_I210_H_
4#define _INTEL_I210_H_
5
Werner Zehe22d96c2016-06-29 07:53:47 +02006#include <types.h>
7#include <device/device.h>
8
Werner Zeh63693dc2015-02-13 12:18:58 +01009#define I210_PCI_MEM_BAR_OFFSET 0x10
10#define I210_REG_EECTRL 0x12010 /* Offset for EEPROM control reg */
11#define I210_FLUPD 0x800000 /* Start flash update bit */
12#define I210_FLUDONE 0x4000000 /* Flash update done indicator */
13#define I210_REG_EEREAD 0x12014 /* Offset for EEPROM read reg */
14#define I210_REG_EEWRITE 0x12018 /* Offset for EEPROM write reg */
15#define I210_CMDV 0x01 /* command valid bit */
16#define I210_DONE 0x02 /* command done bit */
17#define I210_TARGET_CHECKSUM 0xBABA /* resulting checksum */
18
Werner Zeh63693dc2015-02-13 12:18:58 +010019/*define some other useful values here */
20#define I210_POLL_TIMEOUT_US 300000 /* 300 ms */
21/*Define some error states here*/
22#define I210_SUCCESS 0x00000000
23#define I210_INVALID_PARAM 0x00000001
24#define I210_NOT_READY 0x00000002
25#define I210_READ_ERROR 0x00000004
26#define I210_WRITE_ERROR 0x00000008
27#define I210_CHECKSUM_ERROR 0x00000010
28#define I210_FLASH_UPDATE_ERROR 0x00000020
29
Angel Ponsc19a9a52020-11-10 17:08:11 +010030#define MAC_ADDR_LEN 6
31
Werner Zehe22d96c2016-06-29 07:53:47 +020032/* We need one function we can call to get a MAC address to use */
33/* This function can be coded somewhere else but must exist. */
Angel Ponsc19a9a52020-11-10 17:08:11 +010034extern enum cb_err mainboard_get_mac_address(struct device *dev, uint8_t mac[MAC_ADDR_LEN]);
Werner Zehe22d96c2016-06-29 07:53:47 +020035
Werner Zeh63693dc2015-02-13 12:18:58 +010036#endif /* _INTEL_I210_H_ */