Skip to content

Commit

Permalink
Adding support to compile ARM architecture (#102)
Browse files Browse the repository at this point in the history
* Adding support to compile ARM 32 and ARM 64 architecture
ARM32 arch config uses armmp including lpae

Signed-off-by: Antony Rheneus <arheneus@marvell.com>

* Adding support to compile ARM 32 and ARM 64 architecture
ARM32 arch config uses armmp including lpae

Signed-off-by: Antony Rheneus <arheneus@marvell.com>

* [Patch] armhf marvell defconfig

* [Patch] Removed patch for marvell defconfig as it is NOT used

* [Makerfile] Added comment for armhf

Signed-off-by: Antony Rheneus <arheneus@marvell.com>

* [Patch] Removed maintaing spearate file for arm

Signed-off-by: Antony Rheneus <arheneus@marvell.com>

* [Arm] Added configuraiton needed for ARMHF platform

Signed-off-by: Antony Rheneus <arheneus@marvell.com>

Co-authored-by: lguohan <lguohan@gmail.com>
  • Loading branch information
antony-rheneus and lguohan committed Feb 3, 2020
1 parent 6e090da commit e2d1a17
Show file tree
Hide file tree
Showing 10 changed files with 375 additions and 3 deletions.
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.189
KERNEL_SUBVERSION ?= 3+deb9u2
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
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 <arheneus@marvell.com>
Date: Thu, 17 Oct 2019 18:31:57 +0530
Subject: [PATCH] arm64 default config for sonic patches

---
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 <arheneus@marvell.com>
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

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 <gilt@marvell.com>
Date: Mon, 22 Jul 2019 13:44:06 +0300
Subject: [PATCH 1/4] Micron 4G flash support

Change-Id: Ib4dd7094920c124c213f6b3c81140845e5baa084
---
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

89 changes: 89 additions & 0 deletions patch/0042-armhf-additional-configs.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
From a961464da6c88aee4d94af4038c748a1e8a1f412 Mon Sep 17 00:00:00 2001
From: Antony Rheneus <arheneus@marvell.com>
Date: Thu, 17 Oct 2019 18:57:48 +0530
Subject: [PATCH] armhf mandatory configs for boot

---
debian/build/build_armhf_none_armmp/.config | 53 ++++++++++++++++-------------
1 file changed, 30 insertions(+), 23 deletions(-)

diff --git a/debian/build/build_armhf_none_armmp/.config b/debian/build/build_armhf_none_armmp/.config
index e997934..69288eb 100644
--- a/debian/build/build_armhf_none_armmp/.config
+++ b/debian/build/build_armhf_none_armmp/.config
@@ -1793,16 +1793,16 @@ CONFIG_PROC_EVENTS=y
CONFIG_MTD=y
# CONFIG_MTD_TESTS is not set
# CONFIG_MTD_REDBOOT_PARTS is not set
-# CONFIG_MTD_CMDLINE_PARTS is not set
+CONFIG_MTD_CMDLINE_PARTS=y
# CONFIG_MTD_AFS_PARTS is not set
-CONFIG_MTD_OF_PARTS=m
-CONFIG_MTD_AR7_PARTS=m
+CONFIG_MTD_OF_PARTS=y
+CONFIG_MTD_AR7_PARTS=y

#
# User Modules And Translation Layers
#
-CONFIG_MTD_BLKDEVS=m
-CONFIG_MTD_BLOCK=m
+CONFIG_MTD_BLKDEVS=y
+CONFIG_MTD_BLOCK=y
CONFIG_MTD_BLOCK_RO=m
# CONFIG_FTL is not set
# CONFIG_NFTL is not set
@@ -1817,8 +1817,10 @@ CONFIG_MTD_SWAP=m
#
# RAM/ROM/Flash chip drivers
#
-# CONFIG_MTD_CFI is not set
+CONFIG_MTD_CFI=y
# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_GEN_PROBE=y
+# CONFIG_MTD_CFI_ADV_OPTIONS is not set
CONFIG_MTD_MAP_BANK_WIDTH_1=y
CONFIG_MTD_MAP_BANK_WIDTH_2=y
CONFIG_MTD_MAP_BANK_WIDTH_4=y
@@ -1829,6 +1831,10 @@ CONFIG_MTD_CFI_I1=y
CONFIG_MTD_CFI_I2=y
# CONFIG_MTD_CFI_I4 is not set
# CONFIG_MTD_CFI_I8 is not set
+CONFIG_MTD_CFI_INTELEXT=y
+CONFIG_MTD_CFI_AMDSTD=y
+CONFIG_MTD_CFI_STAA=y
+CONFIG_MTD_CFI_UTIL=y
CONFIG_MTD_RAM=m
# CONFIG_MTD_ROM is not set
# CONFIG_MTD_ABSENT is not set
@@ -1850,8 +1856,8 @@ CONFIG_MTD_PLATRAM=m
CONFIG_MTD_DATAFLASH=m
# CONFIG_MTD_DATAFLASH_WRITE_VERIFY is not set
# CONFIG_MTD_DATAFLASH_OTP is not set
-CONFIG_MTD_M25P80=m
-CONFIG_MTD_SST25L=m
+CONFIG_MTD_M25P80=y
+CONFIG_MTD_SST25L=y
# CONFIG_MTD_SLRAM is not set
# CONFIG_MTD_PHRAM is not set
# CONFIG_MTD_MTDRAM is not set
@@ -1878,7 +1884,7 @@ CONFIG_MTD_NAND_RICOH=m
# CONFIG_MTD_NAND_DISKONCHIP is not set
# CONFIG_MTD_NAND_DOCG4 is not set
CONFIG_MTD_NAND_CAFE=m
-CONFIG_MTD_NAND_PXA3xx=m
+CONFIG_MTD_NAND_PXA3xx=y
CONFIG_MTD_NAND_NANDSIM=m
CONFIG_MTD_NAND_GPMI_NAND=m
# CONFIG_MTD_NAND_BRCMNAND is not set
@@ -3824,7 +3830,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_MAX6620=m
# CONFIG_SENSORS_MAX6697 is not set
# CONFIG_SENSORS_MAX31790 is not set
# CONFIG_SENSORS_MCP3021 is not set
2.7.4

22 changes: 22 additions & 0 deletions patch/0042-armhf-proc-dma-kconfig.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
From b8d69b46ddc0f78d2965e426da48082202d030a3 Mon Nov 19 00:00:00 2001
From: Antony Rheneus <arheneus@marvell.com>
Date: Tue, 19 Nov 2019 15:45:07 +0530
Subject: [PATCH] armhf proc dma Kconfig

---
arch/arm/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 32a2698..d50fff8 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -219,7 +219,7 @@
bool

config GENERIC_ISA_DMA
- bool
+ def_bool y

config FIQ
bool
13 changes: 13 additions & 0 deletions patch/config-l3mdev-cgroup.patch
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,16 @@ index b7bcf15..a8d64a7 100644
# CONFIG_NET_NCSI is not set
CONFIG_RPS=y
CONFIG_RFS_ACCEL=y
diff --git a/debian/build/build_armhf_none_armmp/.config b/debian/build/build_armhf_none_armmp/.config
index 32a2698..d50fff8 100644
--- a/debian/build/build_armhf_none_armmp/.config
+++ b/debian/build/build_armhf_none_armmp/.config
@@ -1544,7 +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_CGROUP_L3MDEV=y
# CONFIG_NET_NCSI is not set
CONFIG_RPS=y
CONFIG_RFS_ACCEL=y
15 changes: 15 additions & 0 deletions patch/config-optoe.patch
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,18 @@ index 5bc6c67..0a94577 100644
CONFIG_CB710_CORE=m
# CONFIG_CB710_DEBUG is not set
CONFIG_CB710_DEBUG_ASSUMPTIONS=y
diff --git a/debian/build/build_armhf_none_armmp/.config b/debian/build/build_armhf_none_armmp/.config
index 69288eb..6224070 100644
--- a/debian/build/build_armhf_none_armmp/.config
+++ b/debian/build/build_armhf_none_armmp/.config
@@ -2019,8 +2019,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_EEPROM_SFF_8436=m
+CONFIG_EEPROM_OPTOE=m
CONFIG_CB710_CORE=m
# CONFIG_CB710_DEBUG is not set
CONFIG_CB710_DEBUG_ASSUMPTIONS=y
Loading

0 comments on commit e2d1a17

Please sign in to comment.