summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/intel/i210/Makefile.inc19
-rw-r--r--src/drivers/intel/i210/i210.c8
-rw-r--r--src/drivers/intel/i210/i210.h8
3 files changed, 26 insertions, 9 deletions
diff --git a/src/drivers/intel/i210/Makefile.inc b/src/drivers/intel/i210/Makefile.inc
index a69602246b..c3dac658f5 100644
--- a/src/drivers/intel/i210/Makefile.inc
+++ b/src/drivers/intel/i210/Makefile.inc
@@ -1,5 +1,20 @@
-ifeq ($(CONFIG_DRIVER_INTEL_I210),y)
+##
+## This file is part of the coreboot project.
+##
+## Copyright 2016 Siemens AG
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; version 2 of the License.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
-ramstage-y += i210.c
+ramstage-$(CONFIG_DRIVER_INTEL_I210)+= i210.c
+ifeq ($(CONFIG_DRIVER_INTEL_I210),y)
+CFLAGS_x86_32 += -Isrc/drivers/intel/i210
endif
diff --git a/src/drivers/intel/i210/i210.c b/src/drivers/intel/i210/i210.c
index c5e0c4ef69..656e4f3c89 100644
--- a/src/drivers/intel/i210/i210.c
+++ b/src/drivers/intel/i210/i210.c
@@ -23,11 +23,6 @@
#include <types.h>
#include <delay.h>
-/* We need one function we can call to get a MAC address to use */
-/* This function can be coded somewhere else but must exist. */
-extern enum cb_err mainboard_get_mac_address(uint16_t bus, uint8_t devfn,
- uint8_t mac[6]);
-
/* This is a private function to wait for a bit mask in a given register */
/* To avoid endless loops, a time-out is implemented here. */
static int wait_done(uint32_t* reg, uint32_t mask)
@@ -202,8 +197,7 @@ static void init(struct device *dev)
enum cb_err status;
/*Check first whether there is a valid MAC address available */
- status = mainboard_get_mac_address(dev->bus->subordinate,
- dev->path.pci.devfn, adr_to_set);
+ status = mainboard_get_mac_address(dev, adr_to_set);
if (status != CB_SUCCESS) {
printk(BIOS_ERR, "I210: No valid MAC address found\n");
return;
diff --git a/src/drivers/intel/i210/i210.h b/src/drivers/intel/i210/i210.h
index b19b584f56..e3179b7e1a 100644
--- a/src/drivers/intel/i210/i210.h
+++ b/src/drivers/intel/i210/i210.h
@@ -16,6 +16,9 @@
#ifndef _INTEL_I210_H_
#define _INTEL_I210_H_
+#include <types.h>
+#include <device/device.h>
+
#define I210_PCI_MEM_BAR_OFFSET 0x10
#define I210_REG_EECTRL 0x12010 /* Offset for EEPROM control reg */
#define I210_FLUPD 0x800000 /* Start flash update bit */
@@ -38,4 +41,9 @@
#define I210_CHECKSUM_ERROR 0x00000010
#define I210_FLASH_UPDATE_ERROR 0x00000020
+/* We need one function we can call to get a MAC address to use */
+/* This function can be coded somewhere else but must exist. */
+extern enum cb_err mainboard_get_mac_address(struct device *dev,
+ uint8_t mac[6]);
+
#endif /* _INTEL_I210_H_ */