Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marvell Armhf support and Arm64 support #125

Open
wants to merge 2 commits into
base: 201911
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ KVERSION ?= $(KVERSION_SHORT)-amd64
KERNEL_VERSION ?= 4.9.168
KERNEL_SUBVERSION ?= 1+deb9u5
kernel_procure_method ?= build
CONFIGURED_ARCH ?= amd64

LINUX_HEADER_COMMON = linux-headers-$(KVERSION_SHORT)-common_$(KERNEL_VERSION)-$(KERNEL_SUBVERSION)_all.deb
LINUX_HEADER_AMD64 = linux-headers-$(KVERSION)_$(KERNEL_VERSION)-$(KERNEL_SUBVERSION)_amd64.deb
LINUX_IMAGE = linux-image-$(KVERSION)_$(KERNEL_VERSION)-$(KERNEL_SUBVERSION)_amd64.deb
LINUX_HEADER_AMD64 = linux-headers-$(KVERSION)_$(KERNEL_VERSION)-$(KERNEL_SUBVERSION)_$(CONFIGURED_ARCH).deb
LINUX_IMAGE = linux-image-$(KVERSION)_$(KERNEL_VERSION)-$(KERNEL_SUBVERSION)_$(CONFIGURED_ARCH).deb

MAIN_TARGET = $(LINUX_HEADER_COMMON)
DERIVED_TARGETS = $(LINUX_HEADER_AMD64) $(LINUX_IMAGE)
Expand Down Expand Up @@ -73,9 +74,13 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
debian/bin/gencontrol.py

# generate linux build file for amd64_none_amd64
fakeroot make -f debian/rules.gen setup_armhf_none_armmp
fakeroot make -f debian/rules.gen setup_arm64_none
fakeroot make -f debian/rules.gen setup_amd64_none_amd64

# Applying patches and configuration changes
git add debian/build/build_armhf_none_armmp/.config -f
git add debian/build/build_arm64_none_arm64/.config -f
git add debian/build/build_amd64_none_amd64/.config -f
git add debian/config.defines.dump -f
git add debian/control -f
Expand All @@ -89,7 +94,11 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :

# Building a custom kernel from Debian kernel source
DO_DOCS=False fakeroot make -f debian/rules -j $(shell nproc) binary-indep
fakeroot make -f debian/rules.gen -j $(shell nproc) binary-arch_amd64_none
ifeq ($(CONFIGURED_ARCH), armhf)
fakeroot make -f debian/rules.gen -j $(shell nproc) binary-arch_$(CONFIGURED_ARCH)_none_armmp
else
fakeroot make -f debian/rules.gen -j $(shell nproc) binary-arch_$(CONFIGURED_ARCH)_none
endif
popd

ifneq ($(DEST),)
Expand Down
117,374 changes: 117,374 additions & 0 deletions patch/0001-Marvell-support-for-armada7020-on-LK4.9.168.patch

Large diffs are not rendered by default.

74 changes: 74 additions & 0 deletions patch/0001-arm64-default-config-for-sonic-patches.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
From adf767005a35a2afeb8006c1023633af4de9d78e Mon Sep 17 00:00:00 2001
From: Antony Rheneus <[email protected]>
Date: Thu, 17 Oct 2019 18:31:57 +0530
Subject: [PATCH] arm64 default config for sonic patches

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please elaborate. Currently it looks like, only make olddefconfig was run against a newer Linux kernel version. This could be split out into a separate merge/pull request, couldn’t it be?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the patch approach for kernel config is obsolete in current master branch,

This PR has to be revisited and the required changes should go into patch/kconfig_inclusion and patch/kconfig_exclusion.
Thanks for your time to review this PR.
Action Item would be to raise a as per new manage_kernel_config infra.

---
debian/build/build_arm64_none_arm64/.config | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/debian/build/build_arm64_none_arm64/.config b/debian/build/build_arm64_none_arm64/.config
index 0ce4748..be5b136 100644
--- a/debian/build/build_arm64_none_arm64/.config
+++ b/debian/build/build_arm64_none_arm64/.config
@@ -1247,6 +1247,7 @@ CONFIG_NET_ACT_POLICE=m
CONFIG_NET_ACT_GACT=m
CONFIG_GACT_PROB=y
CONFIG_NET_ACT_MIRRED=m
+# CONFIG_NET_ACT_SAMPLE is not set
CONFIG_NET_ACT_IPT=m
CONFIG_NET_ACT_NAT=m
CONFIG_NET_ACT_PEDIT=m
@@ -1289,6 +1290,7 @@ CONFIG_MPLS_IPTUNNEL=m
# CONFIG_HSR is not set
# CONFIG_NET_SWITCHDEV is not set
CONFIG_NET_L3_MASTER_DEV=y
+# CONFIG_CGROUP_L3MDEV is not set
# CONFIG_QRTR is not set
# CONFIG_NET_NCSI is not set
CONFIG_RPS=y
@@ -1472,6 +1474,7 @@ CONFIG_NFC_PN533=m
CONFIG_NFC_PN533_USB=m
# CONFIG_NFC_PN533_I2C is not set
# CONFIG_NFC_ST95HF is not set
+# CONFIG_PSAMPLE is not set
CONFIG_LWTUNNEL=y
CONFIG_DST_CACHE=y
CONFIG_NET_DEVLINK=m
@@ -1721,6 +1724,8 @@ CONFIG_EEPROM_LEGACY=m
CONFIG_EEPROM_MAX6875=m
CONFIG_EEPROM_93CX6=m
# CONFIG_EEPROM_93XX46 is not set
+# CONFIG_EEPROM_SFF_8436 is not set
+# CONFIG_EEPROM_OPTOE is not set
CONFIG_CB710_CORE=m
# CONFIG_CB710_DEBUG is not set
CONFIG_CB710_DEBUG_ASSUMPTIONS=y
@@ -2999,6 +3004,7 @@ CONFIG_I2C_MUX=m
# CONFIG_I2C_MUX_PINCTRL is not set
# CONFIG_I2C_MUX_REG is not set
# CONFIG_I2C_DEMUX_PINCTRL is not set
+# CONFIG_I2C_MUX_MLXCPLD is not set
CONFIG_I2C_HELPER_AUTO=y
CONFIG_I2C_SMBUS=m
CONFIG_I2C_ALGOBIT=m
@@ -3386,6 +3392,7 @@ CONFIG_SENSORS_MAX1668=m
CONFIG_SENSORS_MAX6639=m
CONFIG_SENSORS_MAX6642=m
CONFIG_SENSORS_MAX6650=m
+# CONFIG_SENSORS_MAX6620 is not set
# CONFIG_SENSORS_MAX6697 is not set
# CONFIG_SENSORS_MAX31790 is not set
# CONFIG_SENSORS_MCP3021 is not set
@@ -5397,6 +5404,8 @@ CONFIG_LEDS_LT3593=m
#
# CONFIG_LEDS_BLINKM is not set
# CONFIG_LEDS_SYSCON is not set
+# CONFIG_LEDS_MLXREG is not set
+# CONFIG_LEDS_USER is not set

#
# LED Triggers
--
2.7.4

82 changes: 82 additions & 0 deletions patch/0001-armhf-default-config-for-the-sonic-patches.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
From 3a09f684413faf1c4f7d21d7d79914b54e087cf6 Mon Sep 17 00:00:00 2001
From: Antony Rheneus <[email protected]>
Date: Thu, 17 Oct 2019 10:48:29 +0530
Subject: [PATCH] armhf default config for the sonic patches

---
debian/build/build_armhf_none_armmp/.config | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/debian/build/build_armhf_none_armmp/.config b/debian/build/build_armhf_none_armmp/.config
index 8f02d03..32a2698 100644
--- a/debian/build/build_armhf_none_armmp/.config
+++ b/debian/build/build_armhf_none_armmp/.config
@@ -1501,6 +1501,7 @@ CONFIG_NET_ACT_POLICE=m
CONFIG_NET_ACT_GACT=m
CONFIG_GACT_PROB=y
CONFIG_NET_ACT_MIRRED=m
+# CONFIG_NET_ACT_SAMPLE is not set
CONFIG_NET_ACT_IPT=m
CONFIG_NET_ACT_NAT=m
CONFIG_NET_ACT_PEDIT=m
@@ -1543,6 +1544,7 @@ CONFIG_MPLS_IPTUNNEL=m
# CONFIG_HSR is not set
CONFIG_NET_SWITCHDEV=y
CONFIG_NET_L3_MASTER_DEV=y
+# CONFIG_CGROUP_L3MDEV is not set
# CONFIG_NET_NCSI is not set
CONFIG_RPS=y
CONFIG_RFS_ACCEL=y
@@ -1716,6 +1718,7 @@ CONFIG_NFC_PN533=m
CONFIG_NFC_PN533_USB=m
# CONFIG_NFC_PN533_I2C is not set
# CONFIG_NFC_ST95HF is not set
+# CONFIG_PSAMPLE is not set
CONFIG_LWTUNNEL=y
CONFIG_DST_CACHE=y
CONFIG_NET_DEVLINK=m
@@ -2010,6 +2013,8 @@ CONFIG_EEPROM_LEGACY=m
CONFIG_EEPROM_MAX6875=m
CONFIG_EEPROM_93CX6=m
# CONFIG_EEPROM_93XX46 is not set
+# CONFIG_EEPROM_SFF_8436 is not set
+# CONFIG_EEPROM_OPTOE is not set
CONFIG_CB710_CORE=m
# CONFIG_CB710_DEBUG is not set
CONFIG_CB710_DEBUG_ASSUMPTIONS=y
@@ -3385,6 +3390,7 @@ CONFIG_I2C_MUX_PCA954x=m
# CONFIG_I2C_MUX_PINCTRL is not set
# CONFIG_I2C_MUX_REG is not set
# CONFIG_I2C_DEMUX_PINCTRL is not set
+# CONFIG_I2C_MUX_MLXCPLD is not set
CONFIG_I2C_HELPER_AUTO=y
CONFIG_I2C_ALGOBIT=y
CONFIG_I2C_ALGOPCA=m
@@ -3818,6 +3824,7 @@ CONFIG_SENSORS_MAX1668=m
CONFIG_SENSORS_MAX6639=m
CONFIG_SENSORS_MAX6642=m
CONFIG_SENSORS_MAX6650=m
+# CONFIG_SENSORS_MAX6620 is not set
# CONFIG_SENSORS_MAX6697 is not set
# CONFIG_SENSORS_MAX31790 is not set
# CONFIG_SENSORS_MCP3021 is not set
@@ -6031,6 +6038,8 @@ CONFIG_LEDS_TCA6507=m
#
# CONFIG_LEDS_BLINKM is not set
# CONFIG_LEDS_SYSCON is not set
+# CONFIG_LEDS_MLXREG is not set
+# CONFIG_LEDS_USER is not set

#
# LED Triggers
@@ -6434,6 +6443,7 @@ CONFIG_SPEAKUP_SYNTH_DUMMY=m
CONFIG_CHROME_PLATFORMS=y
# CONFIG_CROS_EC_CHARDEV is not set
CONFIG_CROS_EC_PROTO=y
+# CONFIG_MELLANOX_PLATFORM is not set
CONFIG_CLKDEV_LOOKUP=y
CONFIG_HAVE_CLK_PREPARE=y
CONFIG_COMMON_CLK=y
--
2.7.4

59 changes: 59 additions & 0 deletions patch/0042-ARM64-PCI-Allow-userspace-to-mmap-PCI-resources.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
From b5a750c95de583df71ab719ac9ae455bd6cfe7cc Mon Sep 17 00:00:00 2001
From: gilt <[email protected]>
Date: Mon, 26 Aug 2019 13:43:39 +0300
Subject: [PATCH 4/6] ARM64/PCI: Allow userspace to mmap PCI resources

Change-Id: I87ef6492e4956c77c75470ec010a4f11a9a8bdaf
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this back port? if yes, what is original commit id in linux kernel tree?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this is not a backport, For arm64 this change is been circulated in the kernel forum and still not taken.
https://lore.kernel.org/patchwork/patch/770393/

---
arch/arm64/include/asm/pci.h | 4 ++++
arch/arm64/kernel/pci.c | 19 +++++++++++++++++++
2 files changed, 23 insertions(+)

diff --git a/arch/arm64/include/asm/pci.h b/arch/arm64/include/asm/pci.h
index b9a7ba9..8a18915 100644
--- a/arch/arm64/include/asm/pci.h
+++ b/arch/arm64/include/asm/pci.h
@@ -31,6 +31,10 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
return -ENODEV;
}

+#define HAVE_PCI_MMAP
+extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
+ enum pci_mmap_state mmap_state,
+ int write_combine);
static inline int pci_proc_domain(struct pci_bus *bus)
{
return 1;
diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c
index 1b3eb67..db6dd98 100644
--- a/arch/arm64/kernel/pci.c
+++ b/arch/arm64/kernel/pci.c
@@ -54,6 +54,25 @@ int pcibios_alloc_irq(struct pci_dev *dev)
return 0;
}

+int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
+ enum pci_mmap_state mmap_state, int write_combine)
+{
+ if (mmap_state == pci_mmap_io)
+ return -EINVAL;
+
+ /*
+ * Mark this as IO
+ */
+ vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
+
+ if (remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff,
+ vma->vm_end - vma->vm_start,
+ vma->vm_page_prot))
+ return -EAGAIN;
+
+ return 0;
+}
+
/*
* raw_pci_read/write - Platform-specific PCI config space access.
*/
--
1.8.3.1

41 changes: 41 additions & 0 deletions patch/0042-Marvell-a385-Micron-4G-flash-support.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
From 5e248248ac5be0541cacb45b2b4d05df3741c2c6 Mon Sep 17 00:00:00 2001
From: gilt <[email protected]>
Date: Mon, 22 Jul 2019 13:44:06 +0300
Subject: [PATCH 1/4] Micron 4G flash support

Change-Id: Ib4dd7094920c124c213f6b3c81140845e5baa084
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this has been sent upstream, please add the URL or git hash in the Linux repository.

---
drivers/mtd/nand/pxa3xx_nand.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
index 3b8911c..98e9a34 100644
--- a/drivers/mtd/nand/pxa3xx_nand.c
+++ b/drivers/mtd/nand/pxa3xx_nand.c
@@ -1638,7 +1638,22 @@ static int pxa_ecc_init(struct pxa3xx_nand_info *info,
ecc->size = info->chunk_size;
mtd_set_ooblayout(mtd, &pxa3xx_ooblayout_ops);
ecc->strength = 16;
- } else {
+ }
+ else if (strength == 8 && ecc_stepsize == 512 && page_size == 8192) {
+ info->ecc_bch = 1;
+ info->nfullchunks = 8;
+ info->ntotalchunks = 9;
+ info->chunk_size = 1024;
+ info->spare_size = 0;
+ info->last_chunk_size = 0;
+ info->last_spare_size = 160;
+ info->ecc_size = 32;
+ ecc->mode = NAND_ECC_HW;
+ ecc->size = info->chunk_size;
+ mtd_set_ooblayout(mtd, &pxa3xx_ooblayout_ops);
+ ecc->strength = 16;
+ }
+ else {
dev_err(&info->pdev->dev,
"ECC strength %d at page size %d is not supported\n",
strength, page_size);
--
2.6.3

Loading