diff --git a/build_debian.sh b/build_debian.sh index 185825cf34b..7a4e2f33c77 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -129,6 +129,9 @@ sudo cp files/initramfs-tools/union-fsck $FILESYSTEM_ROOT/etc/initramfs-tools/ho sudo chmod +x $FILESYSTEM_ROOT/etc/initramfs-tools/hooks/union-fsck sudo chroot $FILESYSTEM_ROOT update-initramfs -u +## Install latest intel igb driver +sudo cp target/debs/igb.ko $FILESYSTEM_ROOT/lib/modules/3.16.0-4-amd64/kernel/drivers/net/ethernet/intel/igb/igb.ko + ## Install docker echo '[INFO] Install docker' ## Install apparmor utils since they're missing and apparmor is enabled in the kernel diff --git a/rules/igb.mk b/rules/igb.mk new file mode 100644 index 00000000000..654c4bd7703 --- /dev/null +++ b/rules/igb.mk @@ -0,0 +1,8 @@ +# initramfs-tools package + +IGB_DRIVER_VERSION = 5.3.5.4 +export IGB_DRIVER_VERSION + +IGB_DRIVER = igb.ko +$(IGB_DRIVER)_SRC_PATH = $(SRC_PATH)/igb +SONIC_MAKE_DEBS += $(IGB_DRIVER) diff --git a/rules/linux-kernel.mk b/rules/linux-kernel.mk index 6aae74dc2b9..fbda245b8d4 100644 --- a/rules/linux-kernel.mk +++ b/rules/linux-kernel.mk @@ -1,4 +1,4 @@ -# redis package +# linux kernel package KVERSION = 3.16.0-4-amd64 diff --git a/rules/sonic-aboot.mk b/rules/sonic-aboot.mk index 7db01c10d3b..c2762cfa012 100644 --- a/rules/sonic-aboot.mk +++ b/rules/sonic-aboot.mk @@ -2,5 +2,5 @@ SONIC_ABOOT = sonic-aboot.bin $(SONIC_ABOOT)_MACHINE = aboot -$(SONIC_ABOOT)_DEPENDS += $(LINUX_KERNEL) $(INITRAMFS_TOOLS) +$(SONIC_ABOOT)_DEPENDS += $(LINUX_KERNEL) $(INITRAMFS_TOOLS) $(IGB_DRIVER) SONIC_INSTALLERS += $(SONIC_ABOOT) diff --git a/rules/sonic-generic.mk b/rules/sonic-generic.mk index a87c39c6512..807e26dbfd0 100644 --- a/rules/sonic-generic.mk +++ b/rules/sonic-generic.mk @@ -2,5 +2,5 @@ SONIC_GENERIC = sonic-generic.bin $(SONIC_GENERIC)_MACHINE = generic -$(SONIC_GENERIC)_DEPENDS += $(LINUX_KERNEL) $(INITRAMFS_TOOLS) +$(SONIC_GENERIC)_DEPENDS += $(LINUX_KERNEL) $(INITRAMFS_TOOLS) $(IGB_DRIVER) SONIC_INSTALLERS += $(SONIC_GENERIC) diff --git a/src/igb/Makefile b/src/igb/Makefile new file mode 100644 index 00000000000..ab8c68cef32 --- /dev/null +++ b/src/igb/Makefile @@ -0,0 +1,23 @@ +.ONESHELL: +SHELL = /bin/bash +.SHELLFLAGS += -e + +MAIN_TARGET = igb.ko + +$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : + rm -rf ./igb-$(IGB_DRIVER_VERSION) + wget -O igb-$(IGB_DRIVER_VERSION).tar.gz "https://downloadmirror.intel.com/13663/eng/igb-$(IGB_DRIVER_VERSION).tar.gz" + tar xzf igb-$(IGB_DRIVER_VERSION).tar.gz + + # Patch + pushd ./igb-$(IGB_DRIVER_VERSION) + patch -p1 < ../patch/0001-add-support-for-BCM54616-phy-for-intel-igb-driver.patch + + # Build the package + pushd src + export BUILD_KERNEL=3.16.0-4-amd64 + make + popd + + popd + mv ./igb-$(IGB_DRIVER_VERSION)/src/$* $(DEST)/ diff --git a/src/igb/patch/0001-add-support-for-BCM54616-phy-for-intel-igb-driver.patch b/src/igb/patch/0001-add-support-for-BCM54616-phy-for-intel-igb-driver.patch new file mode 100644 index 00000000000..3059c5f6f95 --- /dev/null +++ b/src/igb/patch/0001-add-support-for-BCM54616-phy-for-intel-igb-driver.patch @@ -0,0 +1,37 @@ +From 548db654a498a017ce121292f12820176544e6ed Mon Sep 17 00:00:00 2001 +From: Guohan Lu +Date: Tue, 27 Dec 2016 23:21:22 +0000 +Subject: [PATCH] add support for BCM54616 phy for intel igb driver + +--- + src/e1000_82575.c | 1 + + src/e1000_defines.h | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/src/e1000_82575.c b/src/e1000_82575.c +index b4b973e..248c670 100644 +--- a/src/e1000_82575.c ++++ b/src/e1000_82575.c +@@ -223,6 +223,7 @@ static s32 e1000_init_phy_params_82575(struct e1000_hw *hw) + case M88E1112_E_PHY_ID: + case M88E1340M_E_PHY_ID: + case M88E1111_I_PHY_ID: ++ case BCM54616_E_PHY_ID: + phy->type = e1000_phy_m88; + phy->ops.check_polarity = e1000_check_polarity_m88; + phy->ops.get_info = e1000_get_phy_info_m88; +diff --git a/src/e1000_defines.h b/src/e1000_defines.h +index 6de3988..d5da148 100644 +--- a/src/e1000_defines.h ++++ b/src/e1000_defines.h +@@ -1185,6 +1185,7 @@ + #define I210_I_PHY_ID 0x01410C00 + #define IGP04E1000_E_PHY_ID 0x02A80391 + #define M88_VENDOR 0x0141 ++#define BCM54616_E_PHY_ID 0x03625D10 + + /* M88E1000 Specific Registers */ + #define M88E1000_PHY_SPEC_CTRL 0x10 /* PHY Specific Control Reg */ +-- +1.9.1 +