Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Marvell a7020-comexp - add support for common CPU module
Signed-off-by: Gil Tabibian <gilt@marvell.com> Signed-off-by: Alex Doyle <adoyle@cumulusnetworks.com>
- Loading branch information
1 parent
5e8299f
commit f6429f6
Showing
11 changed files
with
244 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
machine/marvell/a7020-comexp/kernel/0003-dts-a7020-rename-10G-phy-mode-to-SFI.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
From 7c0c6d40ee361a158eadb703a6fd26e56969fd58 Mon Sep 17 00:00:00 2001 | ||
From: Gil Tabibian <gilt@marvell.com> | ||
Date: Fri, 20 Sep 2019 20:06:45 +0530 | ||
Subject: [PATCH] dts a7020 rename 10G phy mode to SFI | ||
|
||
--- | ||
arch/arm64/boot/dts/marvell/armada-7020-comexpress.dts | 6 +----- | ||
1 file changed, 1 insertion(+), 5 deletions(-) | ||
|
||
diff --git a/arch/arm64/boot/dts/marvell/armada-7020-comexpress.dts b/arch/arm64/boot/dts/marvell/armada-7020-comexpress.dts | ||
index 7dbe357..dd12d3f 100644 | ||
--- a/arch/arm64/boot/dts/marvell/armada-7020-comexpress.dts | ||
+++ b/arch/arm64/boot/dts/marvell/armada-7020-comexpress.dts | ||
@@ -41,13 +41,9 @@ | ||
status = "okay"; | ||
}; | ||
|
||
-&cpm_ethernet { | ||
- status = "okay"; | ||
-}; | ||
- | ||
&cp0_emac0 { | ||
status = "okay"; | ||
- phy-mode = "10gbase-kr"; | ||
+ phy-mode = "sfi"; | ||
}; | ||
|
||
&cp0_emac2 { | ||
-- | ||
2.7.4 | ||
|
30 changes: 30 additions & 0 deletions
30
machine/marvell/a7020-comexp/kernel/0004-phy-add-SFI-and-XFI-mode-to-PHY-mode-enum.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
From fd353f58e776986f059752e17cadd3d5279c9f46 Mon Sep 17 00:00:00 2001 | ||
From: Stefan Chulski <stefanc@marvell.com> | ||
Date: Thu, 12 Sep 2019 13:57:11 +0300 | ||
Subject: [PATCH 3/3] phy: add SFI and XFI mode to PHY mode enum | ||
|
||
Change-Id: Ida997f9b4cda3bfc35fb3491ccd34659d868136f | ||
Signed-off-by: Stefan Chulski <stefanc@marvell.com> | ||
Reviewed-on: https://sj1git1.cavium.com/15719 | ||
--- | ||
include/linux/phy.h | 4 ++++ | ||
1 file changed, 4 insertions(+) | ||
|
||
diff --git a/include/linux/phy.h b/include/linux/phy.h | ||
index 974f009..25c3479 100644 | ||
--- a/include/linux/phy.h | ||
+++ b/include/linux/phy.h | ||
@@ -144,6 +144,10 @@ static inline const char *phy_modes(phy_interface_t interface) | ||
return "xaui"; | ||
case PHY_INTERFACE_MODE_10GKR: | ||
return "10gbase-kr"; | ||
+ case PHY_INTERFACE_MODE_SFI: | ||
+ return "sfi"; | ||
+ case PHY_INTERFACE_MODE_XFI: | ||
+ return "xfi"; | ||
default: | ||
return "unknown"; | ||
} | ||
-- | ||
2.6.3 | ||
|
59 changes: 59 additions & 0 deletions
59
...ne/marvell/a7020-comexp/kernel/0005-ARM64-PCI-Allow-userspace-to-mmap-PCI-resources.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
From 309fe90bfda3aa4b482c0013d157d0e5c79c7cd5 Mon Sep 17 00:00:00 2001 | ||
From: gilt <gilt@marvell.com> | ||
Date: Mon, 26 Aug 2019 13:43:39 +0300 | ||
Subject: [PATCH 4/5] ARM64/PCI: Allow userspace to mmap PCI resources | ||
|
||
Change-Id: I87ef6492e4956c77c75470ec010a4f11a9a8bdaf | ||
--- | ||
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. | ||
*/ | ||
-- | ||
2.6.3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
0001-Marvell-support-for-armada7020.patch | ||
0002-add-a7020-comexp-dts.patch | ||
0003-dts-a7020-rename-10G-phy-mode-to-SFI.patch | ||
0004-phy-add-SFI-and-XFI-mode-to-PHY-mode-enum.patch | ||
0005-ARM64-PCI-Allow-userspace-to-mmap-PCI-resources.patch |
Binary file not shown.
5 changes: 5 additions & 0 deletions
5
machine/marvell/a7020-comexp/rootconf/sysroot-init/update_exec_installer.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!bin/sh | ||
|
||
cp -f /bin/exec_installer /bin/exec_installer_edit | ||
/bin/sed "s/tftp_wrap -g/tftp -g/g" /bin/exec_installer_edit > /bin/exec_installer | ||
rm -f /bin/exec_installer_edit |
93 changes: 93 additions & 0 deletions
93
machine/marvell/a7020-comexp/rootconf/sysroot-lib-onie/gen-config-platform
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
# Marvell a7020-comexp - update live machine configuration | ||
# | ||
# set 'onie_machine' & 'onie_platform' at run time by reading deviceID from Marvel PCI | ||
|
||
# global variables | ||
onie_mvl_machine_dflt=a7020-comexp | ||
|
||
mvl_pci=$(lspci | grep 11ab:8400 | awk '{print $1}') | ||
echo "1" > /sys/bus/pci/devices/0000\:$mvl_pci/enable | ||
|
||
bar0_space_address=$(cat /sys/bus/pci/devices/0000\:$mvl_pci/resource | awk '{print $1}' | head -1) | ||
bar2_space_address=$(cat /sys/bus/pci/devices/0000\:$mvl_pci/resource | awk '{print $1}' | head -3 | tail -1) | ||
bar2_mask=$(($bar2_space_address & 0xFFFFFFFF)) | ||
|
||
|
||
# sysfs_pci_write function | ||
# Arguments: | ||
# $1 - base_address | ||
# $2 - offset | ||
# $3 - data | ||
sysfs_pci_write() | ||
{ | ||
devmem_width=32 | ||
devmem $(($1 + $2)) $devmem_width $3 | ||
} | ||
|
||
|
||
# Create mapping window | ||
# Arguments: | ||
# $1 - deviceId base address | ||
configure_pci_window() | ||
{ | ||
sysfs_pci_write $bar0_space_address 0x1308 $bar2_mask | ||
sleep 0.001s | ||
sysfs_pci_write $bar0_space_address 0x130c $(($bar2_mask>>32)) | ||
sleep 0.001s | ||
sysfs_pci_write $bar0_space_address 0x1310 $(($bar2_mask+0xFFFFF)) | ||
sleep 0.001s | ||
sysfs_pci_write $bar0_space_address 0x1300 0x0 | ||
sleep 0.001s | ||
sysfs_pci_write $bar0_space_address 0x1304 0x80000000 | ||
sleep 0.001s | ||
|
||
# Configure the window map | ||
sysfs_pci_write bar0_space_address 0x1314 $1 | ||
sleep 0.001s | ||
} | ||
|
||
set_onie_machine() | ||
{ | ||
deviceIdBaseAddr=0x1d000000 | ||
deviceIdReg=0x4c | ||
configure_pci_window $deviceIdBaseAddr | ||
|
||
deviceId=$(devmem $(($bar2_space_address + $deviceIdReg))) | ||
deviceIdMask=$((deviceId & 0xFFFF0)) | ||
|
||
case "$deviceIdMask" in | ||
# 0x84000 | ||
540672) | ||
live_machine=db98cx8540_16cd | ||
;; | ||
# 0x86000 | ||
548864) | ||
live_machine=db98cx8580_32cd | ||
;; | ||
#TBD - add support for RD board | ||
#live_machine=rd98cx8580_128c | ||
*) | ||
esac | ||
} | ||
|
||
gen_live_config() | ||
{ | ||
onie_build_machine=$(cat /etc/machine-build.conf | grep 'onie_build_machine=' | cut -d "=" -f 2) | ||
if [ "$onie_build_machine" = "$onie_mvl_machine_dflt" ]; then | ||
set_onie_machine | ||
fi | ||
|
||
# Source build-time machine configuration | ||
. /etc/machine-build.conf | ||
if [ -n "$live_machine" ] ; then | ||
cat<<EOF | ||
# Runtime ONIE Machine | ||
onie_machine=$live_machine | ||
onie_platform=${onie_arch}-marvell_${live_machine}-r${onie_machine_rev} | ||
EOF | ||
fi | ||
} | ||
|
||
|
||
|
||
|
1 change: 1 addition & 0 deletions
1
machine/marvell/a7020-comexp/rootconf/sysroot-rcS/S60update_exec_installer.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../init.d/update_exec_installer.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters