From patchwork Sat Dec 9 18:55:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 846585 X-Patchwork-Delegate: joe.hershberger@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="G/8qiQRK"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3yvJQW34gWz9sR8 for ; Sun, 10 Dec 2017 05:58:27 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 07333C21E7C; Sat, 9 Dec 2017 18:56:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 299CDC21E4A; Sat, 9 Dec 2017 18:55:55 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 9DF1EC21E48; Sat, 9 Dec 2017 18:55:44 +0000 (UTC) Received: from mail-oi0-f67.google.com (mail-oi0-f67.google.com [209.85.218.67]) by lists.denx.de (Postfix) with ESMTPS id 13272C21E32 for ; Sat, 9 Dec 2017 18:55:40 +0000 (UTC) Received: by mail-oi0-f67.google.com with SMTP id u193so9230952oie.1 for ; Sat, 09 Dec 2017 10:55:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=mO/Fy+/Ihb/X6DZ8ew4K7wMq5eAdMX/0mjT9a6+1sPs=; b=G/8qiQRK94j2Pqh7/qEQyiK3ZRLcm5k0b5Ccrz5x7kFaQu6BLMFI16eBl3lN2NeKAt 0L4in7/Lm5RM86R4UCbDaL9apxbOGhRelKP4TgxMA7z1dSsv4tTZdR8O3jKVFbJZrm9y GBXHVt4I5n77CutzGJp17mka7Kn3Cr57vfANfbc7W6bEwwTEFvVs4n/PTQ+t0jfJ7ZuC zzaIF+OA/v8lubjqMSFhbuOn0pA298OZOBp0fLlpSH3AnvQkLYJkaynxk++g1MGZughP w8KW0klTZj7NOO8RmhPFZT8BXiyGNXol4kwtQzISiKjNi5swac8g9QaafPxQrdIW1IF/ 2xeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=mO/Fy+/Ihb/X6DZ8ew4K7wMq5eAdMX/0mjT9a6+1sPs=; b=ANV4hsAbgiYICjJikHbBgpqV9Wb1r7ZighOdb+F85hJzwb6vHXXpE1ertjTqDYTB8W v51w4RkViVi4yQSYM+AMl3CtaHmhAqUBEK/8vq/OZ1KKuNCEAVFcy5+e1dgdpm9bimlB sm6L1tN93iIZ8Bl26GPEBcobRFl9DfoHAwaPnzwp3zrUv0mL5vvLBrUm1hLHdFS5M0Zj 9GXE0xFjQZ8uSD8qaWI5UtIaTJNL/vD/yKuNhbD6L6Th64zbqUmhq/Tfg6SuuhCqaOWw OZiAMJKiI879KzMWqFbh0vh4VTX/RWxo2PS0CBQNcCy18CjVeJOEDch92c3K5DshcC1t i8sQ== X-Gm-Message-State: AJaThX4dj5HVNH1OgkBQmx0i3CYYtjjVvmF2XUCTFUK0tEAq3JSoXwCX esTRyDMAObszyYuLcBp5rzD9npFM X-Google-Smtp-Source: AGs4zMa0bfCUZf0HAXKFGF6SKkCjep1rmjDPknZF7xnc7vN3lhUmjgkSvAl36PtJRPe+HKWzlu41nA== X-Received: by 10.202.199.20 with SMTP id x20mr28090100oif.199.1512845738265; Sat, 09 Dec 2017 10:55:38 -0800 (PST) Received: from cox.net ([2001:470:d:73f:4d7d:8488:119c:738d]) by smtp.gmail.com with ESMTPSA id f100sm4826577otf.3.2017.12.09.10.55.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 09 Dec 2017 10:55:37 -0800 (PST) From: Florian Fainelli To: u-boot@lists.denx.de Date: Sat, 9 Dec 2017 10:55:27 -0800 Message-Id: <20171209185530.27342-2-f.fainelli@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171209185530.27342-1-f.fainelli@gmail.com> References: <20171209185530.27342-1-f.fainelli@gmail.com> Cc: Alexandru Gagniuc , Joe Hershberger , Stefan Roese , Jelle de Jong Subject: [U-Boot] [PATCH v3 1/4] net: phy: Add Broadcom BCM53xx switch driver X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Add a minimalistic Broadcom BCM53xx (roboswitch) switch driver similar to the Marvell MV88E617x. This takes care of configuring the minimum amount out of the switch hardware such that each user visible port (configurable) and the CPU port can forward packets between each other while preserving isolation with other ports. This is useful for e.g: the Lamobo R1 board featuring a Broadcom BCM53125 switch. Reviewed-by: Stefan Roese Acked-by: Joe Hershberger Signed-off-by: Florian Fainelli --- drivers/net/phy/Kconfig | 14 ++ drivers/net/phy/Makefile | 1 + drivers/net/phy/b53.c | 627 +++++++++++++++++++++++++++++++++++++++++++++++ drivers/net/phy/phy.c | 3 + include/phy.h | 1 + 5 files changed, 646 insertions(+) create mode 100644 drivers/net/phy/b53.c diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig index e32f1eb1c047..609305b8ebf8 100644 --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig @@ -12,6 +12,20 @@ menuconfig PHYLIB if PHYLIB +config B53_SWITCH + bool "Broadcom BCM53xx (roboswitch) Ethernet switch PHY support." + +if B53_SWITCH + +config B53_CPU_PORT + int "CPU port" + default 8 + +config B53_PHY_PORTS + hex "Bitmask of PHY ports" + +endif # B53_SWITCH + config MV88E61XX_SWITCH bool "Marvel MV88E61xx Ethernet switch PHY support." diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile index 1e264b2f2b03..f1980371c366 100644 --- a/drivers/net/phy/Makefile +++ b/drivers/net/phy/Makefile @@ -6,6 +6,7 @@ # obj-$(CONFIG_BITBANGMII) += miiphybb.o +obj-$(CONFIG_B53_SWITCH) += b53.o obj-$(CONFIG_MV88E61XX_SWITCH) += mv88e61xx.o obj-$(CONFIG_MV88E6352_SWITCH) += mv88e6352.o diff --git a/drivers/net/phy/b53.c b/drivers/net/phy/b53.c new file mode 100644 index 000000000000..167ae0077eea --- /dev/null +++ b/drivers/net/phy/b53.c @@ -0,0 +1,627 @@ +/* + * Copyright (C) 2017 + * Broadcom + * Florian Fainelli + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +/* + * PHY driver for Broadcom BCM53xx (roboswitch) Ethernet switches. + * + * This driver configures the b53 for basic use as a PHY. The switch + * supports vendor tags and VLAN configuration that can affect the switching decisions. + * This driver uses a simple configuration in which all ports are only allowed to + * send frames to the CPU port and receive frames from the CPU port this providing + * port isolation (no cross talk). + * + * The configuration determines which PHY ports to activate using the + * CONFIG_B53_PHY_PORTS bitmask. Set bit N will active port N and so on. + * + * This driver was written primarily for the Lamobo R1 platform using a BCM53152 + * switch but the BCM53xx being largely register compatible, extending it to cover + * other switches would be trivial. + */ + +#include + +#include +#include +#include +#include + +/* Pseudo-PHY address (non configurable) to access internal registers */ +#define BRCM_PSEUDO_PHY_ADDR 30 + +/* Maximum number of ports possible */ +#define B53_N_PORTS 9 + +#define B53_CTRL_PAGE 0x00 /* Control */ +#define B53_MGMT_PAGE 0x02 /* Management Mode */ +/* Port VLAN Page */ +#define B53_PVLAN_PAGE 0x31 + +/* Control Page registers */ +#define B53_PORT_CTRL(i) (0x00 + (i)) +#define PORT_CTRL_RX_DISABLE BIT(0) +#define PORT_CTRL_TX_DISABLE BIT(1) +#define PORT_CTRL_RX_BCST_EN BIT(2) /* Broadcast RX (P8 only) */ +#define PORT_CTRL_RX_MCST_EN BIT(3) /* Multicast RX (P8 only) */ +#define PORT_CTRL_RX_UCST_EN BIT(4) /* Unicast RX (P8 only) */ + +/* Switch Mode Control Register (8 bit) */ +#define B53_SWITCH_MODE 0x0b +#define SM_SW_FWD_MODE BIT(0) /* 1 = Managed Mode */ +#define SM_SW_FWD_EN BIT(1) /* Forwarding Enable */ + +/* IMP Port state override register (8 bit) */ +#define B53_PORT_OVERRIDE_CTRL 0x0e +#define PORT_OVERRIDE_LINK BIT(0) +#define PORT_OVERRIDE_FULL_DUPLEX BIT(1) /* 0 = Half Duplex */ +#define PORT_OVERRIDE_SPEED_S 2 +#define PORT_OVERRIDE_SPEED_10M (0 << PORT_OVERRIDE_SPEED_S) +#define PORT_OVERRIDE_SPEED_100M (1 << PORT_OVERRIDE_SPEED_S) +#define PORT_OVERRIDE_SPEED_1000M (2 << PORT_OVERRIDE_SPEED_S) +#define PORT_OVERRIDE_RV_MII_25 BIT(4) /* BCM5325 only */ +#define PORT_OVERRIDE_RX_FLOW BIT(4) +#define PORT_OVERRIDE_TX_FLOW BIT(5) +#define PORT_OVERRIDE_SPEED_2000M BIT(6) /* BCM5301X only, requires setting 1000M */ +#define PORT_OVERRIDE_EN BIT(7) /* Use the register contents */ + +#define B53_RGMII_CTRL_IMP 0x60 +#define RGMII_CTRL_ENABLE_GMII BIT(7) +#define RGMII_CTRL_TIMING_SEL BIT(2) +#define RGMII_CTRL_DLL_RXC BIT(1) +#define RGMII_CTRL_DLL_TXC BIT(0) + +/* Switch control (8 bit) */ +#define B53_SWITCH_CTRL 0x22 +#define B53_MII_DUMB_FWDG_EN BIT(6) + +/* Software reset register (8 bit) */ +#define B53_SOFTRESET 0x79 +#define SW_RST BIT(7) +#define EN_CH_RST BIT(6) +#define EN_SW_RST BIT(4) + +/* Fast Aging Control register (8 bit) */ +#define B53_FAST_AGE_CTRL 0x88 +#define FAST_AGE_STATIC BIT(0) +#define FAST_AGE_DYNAMIC BIT(1) +#define FAST_AGE_PORT BIT(2) +#define FAST_AGE_VLAN BIT(3) +#define FAST_AGE_STP BIT(4) +#define FAST_AGE_MC BIT(5) +#define FAST_AGE_DONE BIT(7) + +/* Port VLAN mask (16 bit) IMP port is always 8, also on 5325 & co */ +#define B53_PVLAN_PORT_MASK(i) ((i) * 2) + +/* MII registers */ +#define REG_MII_PAGE 0x10 /* MII Page register */ +#define REG_MII_ADDR 0x11 /* MII Address register */ +#define REG_MII_DATA0 0x18 /* MII Data register 0 */ +#define REG_MII_DATA1 0x19 /* MII Data register 1 */ +#define REG_MII_DATA2 0x1a /* MII Data register 2 */ +#define REG_MII_DATA3 0x1b /* MII Data register 3 */ + +#define REG_MII_PAGE_ENABLE BIT(0) +#define REG_MII_ADDR_WRITE BIT(0) +#define REG_MII_ADDR_READ BIT(1) + + +struct b53_device { + struct mii_dev *bus; + unsigned int cpu_port; +}; + +static int b53_mdio_op(struct mii_dev *bus, u8 page, u8 reg, u16 op) +{ + int ret; + int i; + u16 v; + + /* set page number */ + v = (page << 8) | REG_MII_PAGE_ENABLE; + ret = bus->write(bus, BRCM_PSEUDO_PHY_ADDR, MDIO_DEVAD_NONE, + REG_MII_PAGE, v); + if (ret) + return ret; + + /* set register address */ + v = (reg << 8) | op; + ret = bus->write(bus, BRCM_PSEUDO_PHY_ADDR, MDIO_DEVAD_NONE, + REG_MII_ADDR, v); + if (ret) + return ret; + + /* check if operation completed */ + for (i = 0; i < 5; ++i) { + v = bus->read(bus, BRCM_PSEUDO_PHY_ADDR, MDIO_DEVAD_NONE, + REG_MII_ADDR); + if (!(v & (REG_MII_ADDR_WRITE | REG_MII_ADDR_READ))) + break; + + udelay(100); + } + + if (i == 5) + return -EIO; + + return 0; +} + +static int b53_mdio_read8(struct mii_dev *bus, u8 page, u8 reg, u8 *val) +{ + int ret; + + ret = b53_mdio_op(bus, page, reg, REG_MII_ADDR_READ); + if (ret) + return ret; + + *val = bus->read(bus, BRCM_PSEUDO_PHY_ADDR, MDIO_DEVAD_NONE, + REG_MII_DATA0) & 0xff; + + return 0; +} + +static int b53_mdio_read16(struct mii_dev *bus, u8 page, u8 reg, u16 *val) +{ + int ret; + + ret = b53_mdio_op(bus, page, reg, REG_MII_ADDR_READ); + if (ret) + return ret; + + *val = bus->read(bus, BRCM_PSEUDO_PHY_ADDR, MDIO_DEVAD_NONE, + REG_MII_DATA0); + + return 0; +} + +static int b53_mdio_read32(struct mii_dev *bus, u8 page, u8 reg, u32 *val) +{ + int ret; + + ret = b53_mdio_op(bus, page, reg, REG_MII_ADDR_READ); + if (ret) + return ret; + + *val = bus->read(bus, BRCM_PSEUDO_PHY_ADDR, MDIO_DEVAD_NONE, REG_MII_DATA0); + *val |= bus->read(bus, BRCM_PSEUDO_PHY_ADDR, MDIO_DEVAD_NONE, + REG_MII_DATA1) << 16; + + return 0; +} + +static int b53_mdio_read48(struct mii_dev *bus, u8 page, u8 reg, u64 *val) +{ + u64 temp = 0; + int i; + int ret; + + ret = b53_mdio_op(bus, page, reg, REG_MII_ADDR_READ); + if (ret) + return ret; + + for (i = 2; i >= 0; i--) { + temp <<= 16; + temp |= bus->read(bus, BRCM_PSEUDO_PHY_ADDR, MDIO_DEVAD_NONE, + REG_MII_DATA0 + i); + } + + *val = temp; + + return 0; +} + +static int b53_mdio_read64(struct mii_dev *bus, u8 page, u8 reg, u64 *val) +{ + u64 temp = 0; + int i; + int ret; + + ret = b53_mdio_op(bus, page, reg, REG_MII_ADDR_READ); + if (ret) + return ret; + + for (i = 3; i >= 0; i--) { + temp <<= 16; + temp |= bus->read(bus, BRCM_PSEUDO_PHY_ADDR, MDIO_DEVAD_NONE, + REG_MII_DATA0 + i); + } + + *val = temp; + + return 0; +} + +static int b53_mdio_write8(struct mii_dev *bus, u8 page, u8 reg, u8 value) +{ + int ret; + + ret = bus->write(bus, BRCM_PSEUDO_PHY_ADDR, MDIO_DEVAD_NONE, + REG_MII_DATA0, value); + if (ret) + return ret; + + return b53_mdio_op(bus, page, reg, REG_MII_ADDR_WRITE); +} + +static int b53_mdio_write16(struct mii_dev *bus, u8 page, u8 reg, + u16 value) +{ + int ret; + + ret = bus->write(bus, BRCM_PSEUDO_PHY_ADDR, MDIO_DEVAD_NONE, + REG_MII_DATA0, value); + if (ret) + return ret; + + return b53_mdio_op(bus, page, reg, REG_MII_ADDR_WRITE); +} + +static int b53_mdio_write32(struct mii_dev *bus, u8 page, u8 reg, + u32 value) +{ + unsigned int i; + u32 temp = value; + + for (i = 0; i < 2; i++) { + int ret = bus->write(bus, BRCM_PSEUDO_PHY_ADDR, + MDIO_DEVAD_NONE, + REG_MII_DATA0 + i, temp & 0xffff); + if (ret) + return ret; + temp >>= 16; + } + + return b53_mdio_op(bus, page, reg, REG_MII_ADDR_WRITE); +} + +static int b53_mdio_write48(struct mii_dev *bus, u8 page, u8 reg, + u64 value) +{ + unsigned int i; + u64 temp = value; + + for (i = 0; i < 3; i++) { + int ret = bus->write(bus, BRCM_PSEUDO_PHY_ADDR, + MDIO_DEVAD_NONE, + REG_MII_DATA0 + i, temp & 0xffff); + if (ret) + return ret; + temp >>= 16; + } + + return b53_mdio_op(bus, page, reg, REG_MII_ADDR_WRITE); +} + +static int b53_mdio_write64(struct mii_dev *bus, u8 page, u8 reg, + u64 value) +{ + unsigned int i; + u64 temp = value; + + for (i = 0; i < 4; i++) { + int ret = bus->write(bus, BRCM_PSEUDO_PHY_ADDR, + MDIO_DEVAD_NONE, + REG_MII_DATA0 + i, temp & 0xffff); + if (ret) + return ret; + temp >>= 16; + } + + return b53_mdio_op(bus, page, reg, REG_MII_ADDR_WRITE); +} + +static inline int b53_read8(struct b53_device *dev, u8 page, + u8 reg, u8 *value) +{ + return b53_mdio_read8(dev->bus, page, reg, value); +} + +static inline int b53_read16(struct b53_device *dev, u8 page, + u8 reg, u16 *value) +{ + return b53_mdio_read16(dev->bus, page, reg, value); +} + +static inline int b53_read32(struct b53_device *dev, u8 page, + u8 reg, u32 *value) +{ + return b53_mdio_read32(dev->bus, page, reg, value); +} + +static inline int b53_read48(struct b53_device *dev, u8 page, + u8 reg, u64 *value) +{ + return b53_mdio_read48(dev->bus, page, reg, value); +} + +static inline int b53_read64(struct b53_device *dev, u8 page, + u8 reg, u64 *value) +{ + return b53_mdio_read64(dev->bus, page, reg, value); +} + +static inline int b53_write8(struct b53_device *dev, u8 page, + u8 reg, u8 value) +{ + return b53_mdio_write8(dev->bus, page, reg, value); +} + +static inline int b53_write16(struct b53_device *dev, u8 page, + u8 reg, u16 value) +{ + return b53_mdio_write16(dev->bus, page, reg, value); +} + +static inline int b53_write32(struct b53_device *dev, u8 page, + u8 reg, u32 value) +{ + return b53_mdio_write32(dev->bus, page, reg, value); +} + +static inline int b53_write48(struct b53_device *dev, u8 page, + u8 reg, u64 value) +{ + return b53_mdio_write48(dev->bus, page, reg, value); +} + +static inline int b53_write64(struct b53_device *dev, u8 page, + u8 reg, u64 value) +{ + return b53_mdio_write64(dev->bus, page, reg, value); +} + +static int b53_flush_arl(struct b53_device *dev, u8 mask) +{ + unsigned int i; + + b53_write8(dev, B53_CTRL_PAGE, B53_FAST_AGE_CTRL, + FAST_AGE_DONE | FAST_AGE_DYNAMIC | mask); + + for (i = 0; i < 10; i++) { + u8 fast_age_ctrl; + + b53_read8(dev, B53_CTRL_PAGE, B53_FAST_AGE_CTRL, + &fast_age_ctrl); + + if (!(fast_age_ctrl & FAST_AGE_DONE)) + goto out; + + mdelay(1); + } + + return -ETIMEDOUT; +out: + /* Only age dynamic entries (default behavior) */ + b53_write8(dev, B53_CTRL_PAGE, B53_FAST_AGE_CTRL, FAST_AGE_DYNAMIC); + return 0; +} + +static int b53_switch_reset(struct phy_device *phydev) +{ + struct b53_device *dev = phydev->priv; + unsigned int timeout = 1000; + u8 mgmt; + u8 reg; + + b53_read8(dev, B53_CTRL_PAGE, B53_SOFTRESET, ®); + reg |= SW_RST | EN_SW_RST | EN_CH_RST; + b53_write8(dev, B53_CTRL_PAGE, B53_SOFTRESET, reg); + + do { + b53_read8(dev, B53_CTRL_PAGE, B53_SOFTRESET, ®); + if (!(reg & SW_RST)) + break; + + mdelay(1); + } while (timeout-- > 0); + + if (timeout == 0) + return -ETIMEDOUT; + + b53_read8(dev, B53_CTRL_PAGE, B53_SWITCH_MODE, &mgmt); + + if (!(mgmt & SM_SW_FWD_EN)) { + mgmt &= ~SM_SW_FWD_MODE; + mgmt |= SM_SW_FWD_EN; + + b53_write8(dev, B53_CTRL_PAGE, B53_SWITCH_MODE, mgmt); + b53_read8(dev, B53_CTRL_PAGE, B53_SWITCH_MODE, &mgmt); + + if (!(mgmt & SM_SW_FWD_EN)) { + printf("Failed to enable switch!\n"); + return -EINVAL; + } + } + + /* Include IMP port in dumb forwarding mode when no tagging protocol + * is configured + */ + b53_read8(dev, B53_CTRL_PAGE, B53_SWITCH_CTRL, &mgmt); + mgmt |= B53_MII_DUMB_FWDG_EN; + b53_write8(dev, B53_CTRL_PAGE, B53_SWITCH_CTRL, mgmt); + + return b53_flush_arl(dev, FAST_AGE_STATIC); +} + +static void b53_enable_cpu_port(struct phy_device *phydev) +{ + struct b53_device *dev = phydev->priv; + u8 port_ctrl; + + port_ctrl = PORT_CTRL_RX_BCST_EN | + PORT_CTRL_RX_MCST_EN | + PORT_CTRL_RX_UCST_EN; + b53_write8(dev, B53_CTRL_PAGE, B53_PORT_CTRL(dev->cpu_port), port_ctrl); + + port_ctrl = PORT_OVERRIDE_EN | PORT_OVERRIDE_LINK | + PORT_OVERRIDE_FULL_DUPLEX | PORT_OVERRIDE_SPEED_1000M; + b53_write8(dev, B53_CTRL_PAGE, B53_PORT_OVERRIDE_CTRL, port_ctrl); + + b53_read8(dev, B53_CTRL_PAGE, B53_RGMII_CTRL_IMP, &port_ctrl); +} + +static void b53_imp_vlan_setup(struct b53_device *dev, int cpu_port) +{ + unsigned int port; + u16 pvlan; + + /* Enable the IMP port to be in the same VLAN as the other ports + * on a per-port basis such that we only have Port i and IMP in + * the same VLAN. + */ + for (port = 0; port < B53_N_PORTS; port++) { + if (!((1 << port) & CONFIG_B53_PHY_PORTS)) + continue; + + b53_read16(dev, B53_PVLAN_PAGE, B53_PVLAN_PORT_MASK(port), + &pvlan); + pvlan |= BIT(cpu_port); + b53_write16(dev, B53_PVLAN_PAGE, B53_PVLAN_PORT_MASK(port), + pvlan); + } +} + +static int b53_port_enable(struct phy_device *phydev, unsigned int port) +{ + struct b53_device *dev = phydev->priv; + unsigned int cpu_port = dev->cpu_port; + u16 pvlan; + + /* Clear the Rx and Tx disable bits and set to no spanning tree */ + b53_write8(dev, B53_CTRL_PAGE, B53_PORT_CTRL(port), 0); + + /* Set this port, and only this one to be in the default VLAN */ + b53_read16(dev, B53_PVLAN_PAGE, B53_PVLAN_PORT_MASK(port), &pvlan); + pvlan &= ~0x1ff; + pvlan |= BIT(port); + b53_write16(dev, B53_PVLAN_PAGE, B53_PVLAN_PORT_MASK(port), pvlan); + + b53_imp_vlan_setup(dev, cpu_port); + + return 0; +} + +static int b53_switch_init(struct phy_device *phydev) +{ + static int init; + int ret; + + if (init) + return 0; + + ret = b53_switch_reset(phydev); + if (ret < 0) + return ret; + + b53_enable_cpu_port(phydev); + + init = 1; + + return 0; +} + +static int b53_probe(struct phy_device *phydev) +{ + struct b53_device *dev; + int ret; + + dev = malloc(sizeof(*dev)); + if (!dev) + return -ENOMEM; + + memset(dev, 0, sizeof(*dev)); + + phydev->priv = dev; + dev->bus = phydev->bus; + dev->cpu_port = CONFIG_B53_CPU_PORT; + + ret = b53_switch_reset(phydev); + if (ret < 0) + return ret; + + return 0; +} + +static int b53_phy_config(struct phy_device *phydev) +{ + unsigned int port; + int res; + + res = b53_switch_init(phydev); + if (res < 0) + return res; + + for (port = 0; port < B53_N_PORTS; port++) { + if (!((1 << port) & CONFIG_B53_PHY_PORTS)) + continue; + + res = b53_port_enable(phydev, port); + if (res < 0) { + printf("Error enabling port %i\n", port); + continue; + } + + res = genphy_config_aneg(phydev); + if (res < 0) { + printf("Error setting PHY %i autoneg\n", port); + continue; + } + + res = 0; + } + + return res; +} + +static int b53_phy_startup(struct phy_device *phydev) +{ + unsigned int port; + int res; + + for (port = 0; port < B53_N_PORTS; port++) { + if (!((1 << port) & CONFIG_B53_PHY_PORTS)) + continue; + + phydev->addr = port; + + res = genphy_startup(phydev); + if (res < 0) + continue; + else + break; + } + + /* Since we are connected directly to the switch, hardcode the link + * parameters to match those of the CPU port configured in + * b53_enable_cpu_port, we cannot be dependent on the user-facing port + * settings (e.g: 100Mbits/sec would not work here) + */ + phydev->speed = 1000; + phydev->duplex = 1; + phydev->link = 1; + + return 0; +} + +static struct phy_driver b53_driver = { + .name = "Broadcom BCM53125", + .uid = 0x03625c00, + .mask = 0xfffffc00, + .features = PHY_GBIT_FEATURES, + .probe = b53_probe, + .config = b53_phy_config, + .startup = b53_phy_startup, + .shutdown = &genphy_shutdown, +}; + +int phy_b53_init(void) +{ + phy_register(&b53_driver); + + return 0; +} diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index fd3dd556c879..e31f3aa3a989 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -461,6 +461,9 @@ static LIST_HEAD(phy_drivers); int phy_init(void) { +#ifdef CONFIG_B53_SWITCH + phy_b53_init(); +#endif #ifdef CONFIG_MV88E61XX_SWITCH phy_mv88e61xx_init(); #endif diff --git a/include/phy.h b/include/phy.h index 50f1e12f8c2c..0543ec10c28c 100644 --- a/include/phy.h +++ b/include/phy.h @@ -257,6 +257,7 @@ int gen10g_startup(struct phy_device *phydev); int gen10g_shutdown(struct phy_device *phydev); int gen10g_discover_mmds(struct phy_device *phydev); +int phy_b53_init(void); int phy_mv88e61xx_init(void); int phy_aquantia_init(void); int phy_atheros_init(void); From patchwork Sat Dec 9 18:55:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 846583 X-Patchwork-Delegate: joe.hershberger@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="hBda7kub"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3yvJPZ5chCz9sxR for ; Sun, 10 Dec 2017 05:57:38 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 64FDBC21E7C; Sat, 9 Dec 2017 18:56:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 4CB5AC21EA7; Sat, 9 Dec 2017 18:56:06 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 100C8C21E66; Sat, 9 Dec 2017 18:55:45 +0000 (UTC) Received: from mail-oi0-f68.google.com (mail-oi0-f68.google.com [209.85.218.68]) by lists.denx.de (Postfix) with ESMTPS id 10F78C21E54 for ; Sat, 9 Dec 2017 18:55:42 +0000 (UTC) Received: by mail-oi0-f68.google.com with SMTP id f69so9214605oig.10 for ; Sat, 09 Dec 2017 10:55:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=maYUuCPAsxtjNos/keRFJ6maMdoMWdjMrpfWblWhcM0=; b=hBda7kubxXf5jB9UhuPwNPRNNpGSrqqANhqQ28ptBp1dwY3ZfCe7aBFpdoNy066hPs SMlN2Ajl1S1vnp7LIPrAcIr5jrUWNZ1pbdOhD6NOi02/IqQBmcE5bFS2VH9xV9DbhV00 uOr8YrwtnxqpQQJSo2rrZoVDkL4eD5F/66jJovSmRVMaNEKRal+LDmtG3gVXygDyK3r3 dwREMkcn3bDG+YQsfPhHIWLx+7S2VxASZBo/yo1+6iu0Bj3uyzIariBs7st7i0NHvauJ nGPJEKNuVUCyCmNdwGlJQdFcBVSPpsCVz+6gM9b0+H0JsArZsNqjS3t2JGbzAJ6ambdo wCFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=maYUuCPAsxtjNos/keRFJ6maMdoMWdjMrpfWblWhcM0=; b=X8YVVZbCTiYot+l0F9lEiN3QIRkxfov3eTEIxTRMWadr2XNZ4q1GjlSmhyBrXDieuE qdo+YpKEQEcM5QKmKAnkOwdv5PYz53OP6nfjyDYgdae70RwtKuMbEYOPV53ujEozrPvD noDDIuUSyu8nGcoS82E4j02Bp1wHKFyTuOFSexx0aOQ0GwtL/n2NCVTKMqw5tNQ3m26w j9QROIr8vC6q8qu2iFOdG1ASYhVlvpov2pnRyaeQR0SWBXYjsr+/XaxN58A/hfbEw07U VaFVAHwygbMEdltPVUn/UHWK8RQ3oFs1AgCU87/T743qHzcrNwFU7JCwdPxrBLJq0o/i TLjQ== X-Gm-Message-State: AJaThX5/6YghD3cptYBlGkQNCYvbhATiEmYGIBwxBzdBQH8m8XViJ+y7 1WmEkd4VF1IF9z55H+29K2C8YHL7 X-Google-Smtp-Source: AGs4zMZ+kNurOl6BK8ADjyoA1L15vEVxhOh5atWCfYxCP5jHnEQ8WRdF21Jn9nnxXgGoImgRqEEsVw== X-Received: by 10.202.80.8 with SMTP id e8mr27719352oib.152.1512845740529; Sat, 09 Dec 2017 10:55:40 -0800 (PST) Received: from cox.net ([2001:470:d:73f:4d7d:8488:119c:738d]) by smtp.gmail.com with ESMTPSA id f100sm4826577otf.3.2017.12.09.10.55.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 09 Dec 2017 10:55:39 -0800 (PST) From: Florian Fainelli To: u-boot@lists.denx.de Date: Sat, 9 Dec 2017 10:55:28 -0800 Message-Id: <20171209185530.27342-3-f.fainelli@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171209185530.27342-1-f.fainelli@gmail.com> References: <20171209185530.27342-1-f.fainelli@gmail.com> Cc: Alexandru Gagniuc , Joe Hershberger , Stefan Roese , Jelle de Jong Subject: [U-Boot] [PATCH v3 2/4] net: designware: Pad small packets X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Make sure that we pad small packets to a minimum length of 60 bytes (without FCS). This is necessary to interface with Ethernet switches that will reject RUNT frames unless padded correctly. Signed-off-by: Florian Fainelli Acked-by: Joe Hershberger --- drivers/net/designware.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/designware.c b/drivers/net/designware.c index 036d231071ca..56fa0ebd8f31 100644 --- a/drivers/net/designware.c +++ b/drivers/net/designware.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include "designware.h" @@ -343,6 +344,8 @@ int designware_eth_enable(struct dw_eth_dev *priv) return 0; } +#define ETH_ZLEN 60 + static int _dw_eth_send(struct dw_eth_dev *priv, void *packet, int length) { struct eth_dma_regs *dma_p = priv->dma_regs_p; @@ -369,6 +372,8 @@ static int _dw_eth_send(struct dw_eth_dev *priv, void *packet, int length) return -EPERM; } + length = max(length, ETH_ZLEN); + memcpy((void *)data_start, packet, length); /* Flush data to be sent */ From patchwork Sat Dec 9 18:55:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 846582 X-Patchwork-Delegate: joe.hershberger@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="X+rWXEdB"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3yvJNT1vqrz9sR8 for ; Sun, 10 Dec 2017 05:56:40 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 91F72C21E0A; Sat, 9 Dec 2017 18:56:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id CBC6AC21DB0; Sat, 9 Dec 2017 18:55:50 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id EFB95C21E24; Sat, 9 Dec 2017 18:55:47 +0000 (UTC) Received: from mail-ot0-f194.google.com (mail-ot0-f194.google.com [74.125.82.194]) by lists.denx.de (Postfix) with ESMTPS id 339DEC21E4A for ; Sat, 9 Dec 2017 18:55:44 +0000 (UTC) Received: by mail-ot0-f194.google.com with SMTP id q3so11712043oth.2 for ; Sat, 09 Dec 2017 10:55:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=fzwaZjBNG6tuv3ItcBzhjM1qCbsOk6iDFknECOZHCc4=; b=X+rWXEdB2gTVb5ylO9gYO3YW8CfsGOnfaIEgHP1QlCiN7U8mE5SdjnsxGMDBWlNVqm nc2ygli3JgnvJyzRVgX1OyTLh/Z/Ztv5iwKlcmdzNcn/5w7BH21zf6b1jveP5inWAr2v fAxSBvu3PL0ppgvqzhdur7uHH1tNTKWxcBqYWEFVlmNwVp5xDRX/YghF7JlfekPUPD/p /rQz0h403xg9LghZdtoztuuOXmhDeQELlyFfpjafKG0RB0Qh2piCezoe4SfeeMR+2vVW ZDttCOqDH7AxEcm6Si/CrbhyuMlpE+4hyRMaQrGuuYV1yd1JBntp8X+VI1OEw5b5cHcR SU2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=fzwaZjBNG6tuv3ItcBzhjM1qCbsOk6iDFknECOZHCc4=; b=kxuZ+yEZKxCxeg74DShf2a23WBSafUi5ypmgIdsXKNLrSxyoJyy3vmBDT6Zi5Pf/tk 4u5Pu8p6HWkT7h2HXRCI2DBg7uf+aGHCy7wlKMtZYscTKW6OpTiDzqCpWGsgk2DqXbCO gNnTdQrbJ47VemkTQUwDZRouq5HG5d2CEXMAVyxhpHAWU1ewvAlNODXRYvyBaBfmLJ0N i+UCrG7BsA9cz/BF1t4AwxZLKrUbaJnOZavLtkFF0fMFZzU49iKWuAKE7sr3rN98OKiT BdTBvNnt+hdAW6JIDRYykY02OcJ5RV8aX78sAwwd1lsHNg7IgXNtAA0MdmREAR75yuiD fKgQ== X-Gm-Message-State: AJaThX5magxM8NHjhgXYr23t3YWvIKod3terfLjccMoM1aPxmy7cTHZV SfsA1kitM5K29dDcT+AinSE1YwGI X-Google-Smtp-Source: AGs4zMaLS10NIajrULUFpA5Tm/toppk6ms8ih2VCutBUpOqiWl+dNlbtXsGdjY+NQgtjMhrC5PnUvg== X-Received: by 10.157.43.167 with SMTP id u36mr31692284ota.287.1512845742621; Sat, 09 Dec 2017 10:55:42 -0800 (PST) Received: from cox.net ([2001:470:d:73f:4d7d:8488:119c:738d]) by smtp.gmail.com with ESMTPSA id f100sm4826577otf.3.2017.12.09.10.55.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 09 Dec 2017 10:55:41 -0800 (PST) From: Florian Fainelli To: u-boot@lists.denx.de Date: Sat, 9 Dec 2017 10:55:29 -0800 Message-Id: <20171209185530.27342-4-f.fainelli@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171209185530.27342-1-f.fainelli@gmail.com> References: <20171209185530.27342-1-f.fainelli@gmail.com> Cc: Alexandru Gagniuc , Joe Hershberger , Stefan Roese , Jelle de Jong Subject: [U-Boot] [PATCH v3 3/4] net: phy: b53: Add b53_reg read/write commands X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Add a b53_reg read/write command which allows inspecting the switch registers. Because the Broadcom BCM53xx registers have different sizes, we need to split the accesses in 8, 16, 32, 48 or 64 bits to obtain expected results. Reviewed-by: Stefan Roese Acked-by: Joe Hershberger Signed-off-by: Florian Fainelli --- drivers/net/phy/b53.c | 138 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) diff --git a/drivers/net/phy/b53.c b/drivers/net/phy/b53.c index 167ae0077eea..6fc8d5df1801 100644 --- a/drivers/net/phy/b53.c +++ b/drivers/net/phy/b53.c @@ -625,3 +625,141 @@ int phy_b53_init(void) return 0; } + +int do_b53_reg_read(const char *name, int argc, char * const argv[]) +{ + u8 page, offset, width; + struct mii_dev *bus; + int ret = -EINVAL; + u64 value64 = 0; + u32 value32 = 0; + u16 value16 = 0; + u8 value8 = 0; + + bus = miiphy_get_dev_by_name(name); + if (!bus) { + printf("unable to find MDIO bus: %s\n", name); + return ret; + } + + page = simple_strtoul(argv[1], NULL, 16); + offset = simple_strtoul(argv[2], NULL, 16); + width = simple_strtoul(argv[3], NULL, 10); + + switch (width) { + case 8: + ret = b53_mdio_read8(bus, page, offset, &value8); + printf("page=0x%02x, offset=0x%02x, value=0x%02x\n", + page, offset, value8); + break; + case 16: + ret = b53_mdio_read16(bus, page, offset, &value16); + printf("page=0x%02x, offset=0x%02x, value=0x%04x\n", + page, offset, value16); + break; + case 32: + ret = b53_mdio_read32(bus, page, offset, &value32); + printf("page=0x%02x, offset=0x%02x, value=0x%08x\n", + page, offset, value32); + break; + case 48: + ret = b53_mdio_read48(bus, page, offset, &value64); + printf("page=0x%02x, offset=0x%02x, value=0x%012llx\n", + page, offset, value64); + break; + case 64: + ret = b53_mdio_read48(bus, page, offset, &value64); + printf("page=0x%02x, offset=0x%02x, value=0x%016llx\n", + page, offset, value64); + break; + default: + printf("Unsupported width: %d\n", width); + break; + } + + return ret; +} + +int do_b53_reg_write(const char *name, int argc, char * const argv[]) +{ + u8 page, offset, width; + struct mii_dev *bus; + int ret = -EINVAL; + u64 value64 = 0; + u32 value = 0; + + bus = miiphy_get_dev_by_name(name); + if (!bus) { + printf("unable to find MDIO bus: %s\n", name); + return ret; + } + + page = simple_strtoul(argv[1], NULL, 16); + offset = simple_strtoul(argv[2], NULL, 16); + width = simple_strtoul(argv[3], NULL, 10); + if (width == 48 || width == 64) + value64 = simple_strtoull(argv[4], NULL, 16); + else + value = simple_strtoul(argv[4], NULL, 16); + + switch (width) { + case 8: + ret = b53_mdio_write8(bus, page, offset, value & 0xff); + break; + case 16: + ret = b53_mdio_write16(bus, page, offset, value); + break; + case 32: + ret = b53_mdio_write32(bus, page, offset, value); + break; + case 48: + ret = b53_mdio_write48(bus, page, offset, value64); + break; + case 64: + ret = b53_mdio_write64(bus, page, offset, value64); + break; + default: + printf("Unsupported width: %d\n", width); + break; + } + + return ret; +} + +int do_b53_reg(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +{ + const char *cmd, *mdioname; + int ret = 0; + + if (argc < 2) + return cmd_usage(cmdtp); + + cmd = argv[1]; + --argc; + ++argv; + + if (!strcmp(cmd, "write")) { + if (argc < 4) + return cmd_usage(cmdtp); + mdioname = argv[1]; + --argc; + ++argv; + ret = do_b53_reg_write(mdioname, argc, argv); + } else if (!strcmp(cmd, "read")) { + if (argc < 5) + return cmd_usage(cmdtp); + mdioname = argv[1]; + --argc; + ++argv; + ret = do_b53_reg_read(mdioname, argc, argv); + } else + return cmd_usage(cmdtp); + + return ret; +} + +U_BOOT_CMD(b53_reg, 7, 1, do_b53_reg, + "Broadcom B53 switch register access", + "write mdioname page (hex) offset (hex) width (dec) value (hex)\n" + "read mdioname page (hex) offset (hex) width (dec)\n" + ); From patchwork Sat Dec 9 18:55:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 846584 X-Patchwork-Delegate: joe.hershberger@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="BS8L9KoO"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3yvJPx3jlcz9sxR for ; Sun, 10 Dec 2017 05:57:57 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 16359C21E7F; Sat, 9 Dec 2017 18:57:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 2A53BC21E55; Sat, 9 Dec 2017 18:57:08 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 47EEEC21E43; Sat, 9 Dec 2017 18:55:50 +0000 (UTC) Received: from mail-ot0-f193.google.com (mail-ot0-f193.google.com [74.125.82.193]) by lists.denx.de (Postfix) with ESMTPS id 613AFC21E54 for ; Sat, 9 Dec 2017 18:55:46 +0000 (UTC) Received: by mail-ot0-f193.google.com with SMTP id 103so11706448otj.12 for ; Sat, 09 Dec 2017 10:55:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8kDKKBAWTTK8HVoqj6k3B7vb5PvK1y6MkOTI1ZWvIKU=; b=BS8L9KoOBLcj2XKmXO243sAmSUP6EKzKSaJqYS2Iiw3cXHAMuymOL6ijxrsSArEU/0 KDOq9c7IivW2hZpj1bBHhtciGiYCsfRCpheEpqHQTDpRnZ+YY0hVVwzPHCd1bs4j3uOH 1ij/apOYhr4w8R9wuiR/eKrckAoBQ63D4WFLxREVCkhtvQdMCWemNvkHhE3s/lUyEaiE q8OHjeJQK5Qfi4C54NE+deDlmUpMk9iTY9ZsDoq7NcZNOJOVaX5ZatTdYpOU1RDfhESh rs+22lTOzoC9f9QH2kOHmQrIvPJcmlMYAvOjiFGp2Abe70sTrt0DDGv+d7eTYpUilwlU v4qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=8kDKKBAWTTK8HVoqj6k3B7vb5PvK1y6MkOTI1ZWvIKU=; b=Wrk8lnCJz7OUoMCW/WWY0CwyMOnJAyACmb8mnPFbUtz6WZpBOAK37gG1uy7WjpjcnW n/91fZLKKV48+sBv1igaZDVU6gtiWz3mMp+z0hVsgrg4mdZgYS0xqhvaZZSdxmIUoap7 lBO7SZkQjpmDaXpsmx1HvCx8697kfdrz7DDpboIpRy8jOHDp1DVcZvYmpbNLRPU9f0ze bEPxXLDLFLk/+BcVEUSwtmzyelMgxHs3NuXQScfbbfhPEGMK0bl5sxDbJTsAvk5Wvc/0 DomHLDVnKwgGcRzSASSW+Zhhgpb60d44FhiDz616qgC3XX9Tz1O5KMTn0iiWgCVuUZ08 0EBg== X-Gm-Message-State: AJaThX7oAAEuyuWzjgfI9eBLApmvm7w0GWMypuEp/MBNalhANMo/Ae+e AvqvmQFYbkNWnnBEeJ87uloNNS2F X-Google-Smtp-Source: AGs4zMbp92gGHW9iUf+YmObXSxq2zTNLhX7hxn9tZ8D9Mk9bU+F9IbePmiVH1NOEUFfqL9zimISKMQ== X-Received: by 10.157.11.106 with SMTP id p39mr32112112otd.310.1512845744887; Sat, 09 Dec 2017 10:55:44 -0800 (PST) Received: from cox.net ([2001:470:d:73f:4d7d:8488:119c:738d]) by smtp.gmail.com with ESMTPSA id f100sm4826577otf.3.2017.12.09.10.55.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 09 Dec 2017 10:55:43 -0800 (PST) From: Florian Fainelli To: u-boot@lists.denx.de Date: Sat, 9 Dec 2017 10:55:30 -0800 Message-Id: <20171209185530.27342-5-f.fainelli@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171209185530.27342-1-f.fainelli@gmail.com> References: <20171209185530.27342-1-f.fainelli@gmail.com> Cc: Alexandru Gagniuc , Joe Hershberger , Stefan Roese , Jelle de Jong Subject: [U-Boot] [PATCH v3 4/4] configs: Update Lamobo_R1 with B53 switch options X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Enable CONFIG_B53_SWITCH, define the CPU/management port number (8) and enable all 5 ports of the switch to be usable. Reviewed-by: Stefan Roese Acked-by: Joe Hershberger Signed-off-by: Florian Fainelli --- configs/Lamobo_R1_defconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configs/Lamobo_R1_defconfig b/configs/Lamobo_R1_defconfig index 84007ad374b8..19c977ef42ee 100644 --- a/configs/Lamobo_R1_defconfig +++ b/configs/Lamobo_R1_defconfig @@ -22,3 +22,6 @@ CONFIG_SUN7I_GMAC=y CONFIG_SCSI=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y +CONFIG_B53_SWITCH=y +CONFIG_B53_CPU_PORT=8 +CONFIG_B53_PHY_PORTS=0x1f