From patchwork Sat Dec 12 13:15:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Daniel_Gonz=C3=A1lez_Cabanelas?= X-Patchwork-Id: 556021 X-Patchwork-Delegate: jogo@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 71111140AD9 for ; Sun, 13 Dec 2015 00:16:14 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=LCJY+cPd; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 4BFF9283C03; Sat, 12 Dec 2015 14:15:51 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 3C6C9280845 for ; Sat, 12 Dec 2015 14:15:44 +0100 (CET) X-policyd-weight: using cached result; rate: -8.5 Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com [74.125.82.44]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Sat, 12 Dec 2015 14:15:43 +0100 (CET) Received: by wmnn186 with SMTP id n186so65955478wmn.0 for ; Sat, 12 Dec 2015 05:15:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:user-agent:mime-version :content-transfer-encoding:content-type; bh=KnAboWAEch6Cal5eho9erBwVjghpXg74hwRWZrhRICo=; b=LCJY+cPdlJ9Cs8Au4bmUSOqFX3f+0OYxzsLJA8CeqieMJqQSe7vIkSt4bC25laMe9v NUJyDk1j7Y12HcDGEhSfQRmSU4RVw1QPh1lyq3grAmJiw6RM+qAhNfjFxakyNm8YEMpA dRs/Rm7ar2y2en6Q8XsaQlkLj7X0dhldMVF3JFaNN2SVIU4JK8YhaSY/EWYBUaXVGfkB puzDpM3c67AojCOkjefLNc0iQ3dQhIK+vadQAzF0SUzC7BnBrWtS6Dx46s/yTQDIJL1m DCz5Idfl8/AKU+l21Pc+pV+3qa+Ve2BMaH8kT9XkuYO/w79gIYK2gk/FCr87ZNXpW/c/ J2Wg== X-Received: by 10.28.8.15 with SMTP id 15mr13101671wmi.50.1449926155512; Sat, 12 Dec 2015 05:15:55 -0800 (PST) Received: from tool.localnet ([77.231.193.140]) by smtp.googlemail.com with ESMTPSA id bv1sm12749966wjc.24.2015.12.12.05.15.54 for (version=TLSv1/SSLv3 cipher=OTHER); Sat, 12 Dec 2015 05:15:54 -0800 (PST) From: dani To: openwrt-devel@lists.openwrt.org Date: Sat, 12 Dec 2015 14:15:58 +0100 Message-ID: <1929857.yCeuYgd2Wv@tool> User-Agent: KMail/4.14.10 (Linux/4.2.5-1-ARCH; KDE/4.14.14; x86_64; ; ) MIME-Version: 1.0 Subject: [OpenWrt-Devel] [PATCH] CC: brcm63xx: backport fix gpio ephy-reset X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" ephy-reset, which uses a GPIO for enabling external ethernet phys, is broken. This patch fix the problem. This problem causes in boards with external phys with a reset pin connected to gpio, are initialized without lan interfaces. The line ephy_reset.table[0].chip_label = gpio_chip_labels[hw_gpio / 32]; always returns bcm63xx-gpio.1. As a result of this, reset pins connected to gpios <32 will return messages "gpio X out of range", and ethernet fails to initialize. The array *gpio_chip_labels[] should be initialized with different names for each element, otherwise sprintf will copy the label of the gpio chip for both elements at the same time. And the name of both elements of the array will be the same. Using a different name on the second array element solves the problem. Signed-off-by: Daniel Gonzalez diff --git a/target/linux/brcm63xx/patches-3.18/377-MIPS-BCM63XX-register-lookup-for-ephy-reset-gpio.patch b/target/linux/brcm63xx/patches-3.18/377-MIPS-BCM63XX-register-lookup-for-ephy-reset-gpio.patch index 30f6ba5..40d3f3f 100644 --- a/target/linux/brcm63xx/patches-3.18/377-MIPS-BCM63XX-register-lookup-for-ephy-reset-gpio.patch +++ b/target/linux/brcm63xx/patches-3.18/377-MIPS-BCM63XX-register-lookup-for-ephy-reset-gpio.patch @@ -61,7 +61,7 @@ Signed-off-by: Jonas Gorski +/* for registering lookups; make them large enough to hold OF names */ +static char *gpio_chip_labels[] = { + "xxxxxxxx.gpio-controller", -+ "xxxxxxxx.gpio-controller", ++ "yyyyyyyy.gpio-controller", +}; + static void __init bcm63xx_gpio_init_one(int id, int dir, int data, int ngpio)