From 30663b1679c5948cd3382357aee89a6f6819c92f Mon Sep 17 00:00:00 2001 From: Guohan Lu Date: Wed, 28 Dec 2016 12:16:35 +0000 Subject: [PATCH 1/2] install latest intel igb driver --- build_debian.sh | 3 ++ rules/igb.mk | 8 ++++ rules/linux-kernel.mk | 2 +- rules/sonic-aboot.mk | 2 +- rules/sonic-generic.mk | 2 +- ...or-BCM54616-phy-for-intel-igb-driver.patch | 37 +++++++++++++++++++ src/igb/Makefile | 23 ++++++++++++ 7 files changed, 74 insertions(+), 3 deletions(-) create mode 100644 rules/igb.mk create mode 100644 src/igb/0001-add-support-for-BCM54616-phy-for-intel-igb-driver.patch create mode 100644 src/igb/Makefile 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/0001-add-support-for-BCM54616-phy-for-intel-igb-driver.patch b/src/igb/0001-add-support-for-BCM54616-phy-for-intel-igb-driver.patch new file mode 100644 index 00000000000..9c6488c2bd9 --- /dev/null +++ b/src/igb/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 + diff --git a/src/igb/Makefile b/src/igb/Makefile new file mode 100644 index 00000000000..a917879235d --- /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 "http://downloads.sourceforge.net/project/e1000/igb%20stable/5.3.5.4/igb-5.3.5.4.tar.gz?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fe1000%2Ffiles%2Figb%2520stable%2F5.3.5.4%2F&ts=1482880840&use_mirror=pilotfiber" + tar xzf igb-$(IGB_DRIVER_VERSION).tar.gz + + # Patch + pushd ./igb-$(IGB_DRIVER_VERSION) + patch -p1 < ../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)/ From 370d8f311aeb75adb37726762e38427de58723a0 Mon Sep 17 00:00:00 2001 From: Guohan Lu Date: Wed, 28 Dec 2016 22:32:29 +0000 Subject: [PATCH 2/2] use official url and change spaces to tab --- src/igb/Makefile | 4 ++-- ...01-add-support-for-BCM54616-phy-for-intel-igb-driver.patch | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) rename src/igb/{ => patch}/0001-add-support-for-BCM54616-phy-for-intel-igb-driver.patch (94%) diff --git a/src/igb/Makefile b/src/igb/Makefile index a917879235d..ab8c68cef32 100644 --- a/src/igb/Makefile +++ b/src/igb/Makefile @@ -6,12 +6,12 @@ MAIN_TARGET = igb.ko $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : rm -rf ./igb-$(IGB_DRIVER_VERSION) - wget -O igb-$(IGB_DRIVER_VERSION).tar.gz "http://downloads.sourceforge.net/project/e1000/igb%20stable/5.3.5.4/igb-5.3.5.4.tar.gz?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fe1000%2Ffiles%2Figb%2520stable%2F5.3.5.4%2F&ts=1482880840&use_mirror=pilotfiber" + 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 < ../0001-add-support-for-BCM54616-phy-for-intel-igb-driver.patch + patch -p1 < ../patch/0001-add-support-for-BCM54616-phy-for-intel-igb-driver.patch # Build the package pushd src diff --git a/src/igb/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 similarity index 94% rename from src/igb/0001-add-support-for-BCM54616-phy-for-intel-igb-driver.patch rename to src/igb/patch/0001-add-support-for-BCM54616-phy-for-intel-igb-driver.patch index 9c6488c2bd9..3059c5f6f95 100644 --- a/src/igb/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 @@ -16,7 +16,7 @@ index b4b973e..248c670 100644 case M88E1112_E_PHY_ID: case M88E1340M_E_PHY_ID: case M88E1111_I_PHY_ID: -+ case BCM54616_E_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; @@ -28,7 +28,7 @@ index 6de3988..d5da148 100644 #define I210_I_PHY_ID 0x01410C00 #define IGP04E1000_E_PHY_ID 0x02A80391 #define M88_VENDOR 0x0141 -+#define BCM54616_E_PHY_ID 0x03625D10 ++#define BCM54616_E_PHY_ID 0x03625D10 /* M88E1000 Specific Registers */ #define M88E1000_PHY_SPEC_CTRL 0x10 /* PHY Specific Control Reg */