Skip to content
Closed
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
3 changes: 3 additions & 0 deletions package/boot/uboot-envtools/files/mvebu
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ armada-385-linksys-shelby)
armada-385-linksys-rango)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
;;
armada-385-turris-omnia)
ubootenv_add_uci_config "/dev/mtd0" "0xC0000" "0x10000" "0x40000"
;;
armada-xp-linksys-mamba)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x20000"
;;
Expand Down
24 changes: 19 additions & 5 deletions target/linux/generic/files/drivers/net/phy/mvsw61xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -670,16 +670,30 @@ static int _mvsw61xx_reset(struct switch_dev *dev, bool full)
BMCR_SPEED1000);
}

/* enable SerDes if necessary */
if (full && i >= 5 && state->model == MV_IDENT_VALUE_6176) {
if (state->model == MV_IDENT_VALUE_6176) {
u16 sts = sr16(dev, MV_PORTREG(STATUS, i));
u16 mode = sts & MV_PORT_STATUS_CMODE_MASK;

if (mode == MV_PORT_STATUS_CMODE_100BASE_X ||
mode == MV_PORT_STATUS_CMODE_1000BASE_X ||
mode == MV_PORT_STATUS_CMODE_SGMII) {
/* enable SerDes if necessary */
if (i >= 5 && full &&
(mode == MV_PORT_STATUS_CMODE_100BASE_X ||
mode == MV_PORT_STATUS_CMODE_1000BASE_X ||
mode == MV_PORT_STATUS_CMODE_SGMII)) {
mvsw61xx_enable_serdes(dev);
}

/* Enable RGMII internal delay for CPU ports */
if (i == state->cpu_port0 || i == state->cpu_port1) {
u16 reg = sr16(dev, MV_PORTREG(PHYCTL, i));
if ((reg & (MV_PHYCTL_RGMII_DELAY_RXCLK |
MV_PHYCTL_RGMII_DELAY_TXCLK)) !=
(MV_PHYCTL_RGMII_DELAY_RXCLK |
MV_PHYCTL_RGMII_DELAY_TXCLK)) {
reg |= MV_PHYCTL_RGMII_DELAY_RXCLK |
MV_PHYCTL_RGMII_DELAY_TXCLK;
sw16(dev, MV_PORTREG(PHYCTL, i), reg);
}
}
}
}

Expand Down
2 changes: 2 additions & 0 deletions target/linux/generic/files/drivers/net/phy/mvsw61xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ enum {
enum {
MV_PHYCTL_FC_ENABLE = (3 << 6),
MV_PHYCTL_FC_DISABLE = (1 << 6),
MV_PHYCTL_RGMII_DELAY_TXCLK = (1 << 14),
MV_PHYCTL_RGMII_DELAY_RXCLK = (1 << 15),
};

enum {
Expand Down
2 changes: 1 addition & 1 deletion target/linux/mvebu/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
ARCH:=arm
BOARD:=mvebu
BOARDNAME:=Marvell Armada 37x/38x/XP
FEATURES:=fpu usb pci pcie gpio nand squashfs
FEATURES:=fpu usb pci pcie gpio nand squashfs ramdisk
CPU_TYPE:=cortex-a9
CPU_SUBTYPE:=vfpv3
MAINTAINER:=Imre Kaloz <kaloz@openwrt.org>
Expand Down
5 changes: 5 additions & 0 deletions target/linux/mvebu/base-files/etc/board.d/02_network
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ armada-xp-linksys-mamba)
ucidef_add_switch "switch0" \
"0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth0" "4:wan" "6@eth1"
;;
armada-385-turris-omnia)
ucidef_set_interface_wan "eth2"
ucidef_add_switch "switch0" \
"0:lan:0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4" "5@eth1" "6@eth0"
;;
armada-388-clearfog-*)
# eth0 is standalone ethernet
# eth1 is switch (-pro) or standalone ethernet (-base)
Expand Down
3 changes: 3 additions & 0 deletions target/linux/mvebu/base-files/lib/mvebu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ mvebu_board_detect() {
*"SolidRun Clearfog Base A1")
name="armada-388-clearfog-base"
;;
*"Turris Omnia")
name="armada-385-turris-omnia"
;;
esac

[ -z "$name" ] && name="unknown"
Expand Down
13 changes: 13 additions & 0 deletions target/linux/mvebu/base-files/lib/upgrade/clearfog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,21 @@ platform_check_image_clearfog() {
}

platform_do_upgrade_clearfog() {
. /lib/functions.sh
local board=$(board_name)

sync
get_image "$1" | dd of=/dev/mmcblk0 bs=2M conv=fsync

case "$board" in
armada-385-turris-omnia)
fw_setenv lede_bootargs 'earlyprintk console=ttyS0,115200 root=/dev/mmcblk0p2 rootfstype=auto rootwait'
fw_setenv lede_mmcload 'setenv bootargs "$lede_bootargs cfg80211.freg=$regdomain"; fatload mmc 0 0x01000000 zImage; fatload mmc 0 0x02000000 armada-385-turris-omnia.dtb'
fw_setenv factory_mmcload 'setenv bootargs "$bootargs cfg80211.freg=$regdomain"; btrload mmc 0 0x01000000 boot/zImage @; btrload mmc 0 0x02000000 boot/dtb @'
fw_setenv mmcboot 'mw 0xf10184a0 0xfd4d4cfa; run lede_mmcload || run factory_mmcload; bootz 0x01000000 - 0x02000000'
;;
esac

sleep 1
}

Expand Down
4 changes: 2 additions & 2 deletions target/linux/mvebu/base-files/lib/upgrade/platform.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ platform_do_upgrade() {
armada-385-linksys-caiman|armada-385-linksys-cobra|armada-385-linksys-rango|armada-385-linksys-shelby|armada-xp-linksys-mamba)
platform_do_upgrade_linksys "$ARGV"
;;
armada-388-clearfog-base|armada-388-clearfog-pro)
armada-385-turris-omnia|armada-388-clearfog-base|armada-388-clearfog-pro)
platform_do_upgrade_clearfog "$ARGV"
;;
*)
Expand All @@ -29,7 +29,7 @@ platform_copy_config() {
armada-385-linksys-caiman|armada-385-linksys-cobra|armada-385-linksys-rango|armada-385-linksys-shelby|armada-xp-linksys-mamba)
platform_copy_config_linksys
;;
armada-388-clearfog-base|armada-388-clearfog-pro)
armada-385-turris-omnia|armada-388-clearfog-base|armada-388-clearfog-pro)
platform_copy_config_clearfog "$ARGV"
;;
esac
Expand Down
10 changes: 9 additions & 1 deletion target/linux/mvebu/config-4.9
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,13 @@ CONFIG_GENERIC_STRNCPY_FROM_USER=y
CONFIG_GENERIC_STRNLEN_USER=y
CONFIG_GLOB=y
CONFIG_GPIOLIB=y
CONFIG_GPIOLIB_IRQCHIP=y
CONFIG_GPIO_GENERIC=y
CONFIG_GPIO_GENERIC_PLATFORM=y
CONFIG_GPIO_MVEBU=y
CONFIG_GPIO_MVEBU_PWM=y
CONFIG_GPIO_PCA953X=y
# CONFIG_GPIO_PCA953X_IRQ is not set
CONFIG_GPIO_PCA953X_IRQ=y
CONFIG_GPIO_SYSFS=y
CONFIG_HANDLE_DOMAIN_IRQ=y
CONFIG_HARDIRQS_SW_RESEND=y
Expand Down Expand Up @@ -246,8 +249,11 @@ CONFIG_HWMON=y
CONFIG_HZ_FIXED=0
CONFIG_HZ_PERIODIC=y
CONFIG_I2C=y
CONFIG_I2C_ARB_GPIO_CHALLENGE=y
CONFIG_I2C_BOARDINFO=y
CONFIG_I2C_CHARDEV=y
CONFIG_I2C_MUX=y
CONFIG_I2C_MUX_GPIO=y
Copy link
Member

Choose a reason for hiding this comment

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

why do we need this? I don't see this used anywhere

Copy link
Member

Choose a reason for hiding this comment

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

Could someone please reply to this comment.

Copy link
Contributor

Choose a reason for hiding this comment

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

The SFP autodetect script shipped with the omnia uses i2c to probe the EEPROM of inserted SPF modules, as well as some GPIO pins to detect changes. Not sure if this option is related to that.

If it is, I don't think there's any reason to keep it enabled for now: the image I built from this pull request seems to be lacking driver support for some of the features that script is using anyway, so updates will have to be made to add the SFP switch support...

CONFIG_I2C_MV64XXX=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_IOMMU_HELPER=y
Expand Down Expand Up @@ -279,6 +285,8 @@ CONFIG_MAGIC_SYSRQ=y
CONFIG_MANGLE_BOOTARGS=y
CONFIG_MARVELL_PHY=y
CONFIG_MDIO_BOARDINFO=y
CONFIG_MDIO_BUS_MUX=y
CONFIG_MDIO_BUS_MUX_GPIO=y
Copy link
Member

Choose a reason for hiding this comment

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

why do we need this? I don't see this used anywhere

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are left over from the patch set I used as my base, I probably should have tidied up earlier.

I assumed that MDIO bus mux had been added for good reason and was somehow necessary to control both the 88E6176 switch and 88E1514 PHY on the same MDIO bus, but both seem to work fine on an image compiled without.

I am away from my Omnia now, but I will do some testing later to test all of these options and remove as many as possible. I suspect some will return in a future patch to add support for the Omnia's I2C-attached microcontroller for RGB LED control, but of course it is better to logically group options with the code that requires them rather than letting cruft build for 'just in case' selections.

Copy link
Member

Choose a reason for hiding this comment

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

Will you push an updated version?

CONFIG_MDIO_I2C=y
CONFIG_MEMORY=y
# CONFIG_MFD_MAX77620 is not set
Expand Down
Loading