blob: e3179b7e1a7472bb2758e2602e265b52fb427753 [file] [log] [blame]
Werner Zeh63693dc2015-02-13 12:18:58 +01001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2014 Siemens AG
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
Werner Zeh63693dc2015-02-13 12:18:58 +010014 */
15
16#ifndef _INTEL_I210_H_
17#define _INTEL_I210_H_
18
Werner Zehe22d96c2016-06-29 07:53:47 +020019#include <types.h>
20#include <device/device.h>
21
Werner Zeh63693dc2015-02-13 12:18:58 +010022#define I210_PCI_MEM_BAR_OFFSET 0x10
23#define I210_REG_EECTRL 0x12010 /* Offset for EEPROM control reg */
24#define I210_FLUPD 0x800000 /* Start flash update bit */
25#define I210_FLUDONE 0x4000000 /* Flash update done indicator */
26#define I210_REG_EEREAD 0x12014 /* Offset for EEPROM read reg */
27#define I210_REG_EEWRITE 0x12018 /* Offset for EEPROM write reg */
28#define I210_CMDV 0x01 /* command valid bit */
29#define I210_DONE 0x02 /* command done bit */
30#define I210_TARGET_CHECKSUM 0xBABA /* resulting checksum */
31
32
33/*define some other useful values here */
34#define I210_POLL_TIMEOUT_US 300000 /* 300 ms */
35/*Define some error states here*/
36#define I210_SUCCESS 0x00000000
37#define I210_INVALID_PARAM 0x00000001
38#define I210_NOT_READY 0x00000002
39#define I210_READ_ERROR 0x00000004
40#define I210_WRITE_ERROR 0x00000008
41#define I210_CHECKSUM_ERROR 0x00000010
42#define I210_FLASH_UPDATE_ERROR 0x00000020
43
Werner Zehe22d96c2016-06-29 07:53:47 +020044/* We need one function we can call to get a MAC address to use */
45/* This function can be coded somewhere else but must exist. */
46extern enum cb_err mainboard_get_mac_address(struct device *dev,
47 uint8_t mac[6]);
48
Werner Zeh63693dc2015-02-13 12:18:58 +010049#endif /* _INTEL_I210_H_ */