From patchwork Mon Dec 15 14:48:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= X-Patchwork-Id: 421420 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.1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 100FD14003E for ; Tue, 16 Dec 2014 01:50:16 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 4809A287BA5; Mon, 15 Dec 2014 15:47:06 +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 8075B289D15 for ; Mon, 15 Dec 2014 15:46:46 +0100 (CET) X-policyd-weight: using cached result; rate: -8.5 Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Mon, 15 Dec 2014 15:46:44 +0100 (CET) Received: by mail-wi0-f170.google.com with SMTP id bs8so10713366wib.1 for ; Mon, 15 Dec 2014 06:48:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=OIzN4Qm+DBshRaqVIbI7pqYqLWWlk9wl2wZrh04vofs=; b=YiYYb/1y9Mbxh4zh1jX6W5cLMsLb4cszXheSO9nsvzQKSNiwjiWeuLmLIwbTNr6qiP lXg+KGlTBWdRVk5c8yfhM0pf+pMtbpyss3ZFTDVJilLu+HdkwB/LPj/LSDB3aWLGWXQw LJ2m6F96jDB8bsW7gAqk4wDQVnP9KX06EFsvuIWVKxSoybMi6dc/BXY9dDWgDOSiUIHt vN2AhdQclgyh5sZvnJuhq+W9HI+1xLbBhh4MEEPSVzOi0ewq9GyLOoZWQ3xRgMCWFmvt hgKABj/x9PNbiYGA/l2Y5EZPyjwGrAOLU3ITIL9AQBze1yr6xVkYTSmbihhYvSthxrso fPZg== X-Received: by 10.194.60.45 with SMTP id e13mr53643450wjr.109.1418654898760; Mon, 15 Dec 2014 06:48:18 -0800 (PST) Received: from [192.168.1.10] (148.Red-83-46-232.dynamicIP.rima-tde.net. [83.46.232.148]) by mx.google.com with ESMTPSA id h14sm13523777wic.8.2014.12.15.06.48.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 15 Dec 2014 06:48:17 -0800 (PST) Message-ID: <548EF4A9.6000208@gmail.com> Date: Mon, 15 Dec 2014 15:48:09 +0100 From: =?ISO-8859-1?Q?=C1lvaro_Fern=E1ndez_Rojas?= User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: OpenWrt Development List , Jonas Gorski References: <5488DC9C.3000504@gmail.com> <548EF463.5000409@gmail.com> In-Reply-To: <548EF463.5000409@gmail.com> Subject: [OpenWrt-Devel] [PATCH v2 2/4] brcm63xx: use bcm6345-gpio over legacy 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" Signed-off-by: Álvaro Fernández Rojas --- v2: keep changes minimal as suggested by Jonas diff --git a/target/linux/brcm63xx/patches-3.14/375-DT-GPIO-over-legacy.patch b/target/linux/brcm63xx/patches-3.14/375-DT-GPIO-over-legacy.patch new file mode 100644 index 0000000..8c9bfc8 --- /dev/null +++ b/target/linux/brcm63xx/patches-3.14/375-DT-GPIO-over-legacy.patch @@ -0,0 +1,45 @@ +diff -uprN a/arch/mips/bcm63xx/boards/board_common.c b/arch/mips/bcm63xx/boards/board_common.c +--- a/arch/mips/bcm63xx/boards/board_common.c 2014-12-10 13:14:58.299519952 +0100 ++++ b/arch/mips/bcm63xx/boards/board_common.c 2014-12-13 02:24:59.308489309 +0100 +@@ -222,6 +222,10 @@ int __init board_register_devices(void) + } + #endif + ++ if (!board_of_device_present("gpio0")) { ++ bcm63xx_gpio_init(); ++ } ++ + if (board.has_uart0) + bcm63xx_uart_register(0); + +@@ -287,7 +291,7 @@ int __init board_register_devices(void) + while (led_count < ARRAY_SIZE(board.leds) && board.leds[led_count].name) + led_count++; + +- if (led_count) { ++ if (led_count && !board_of_device_present("gpio0")) { + bcm63xx_led_data.num_leds = led_count; + bcm63xx_led_data.leds = board.leds; + +@@ -302,7 +306,7 @@ int __init board_register_devices(void) + while (button_count < ARRAY_SIZE(board.buttons) && board.buttons[button_count].desc) + button_count++; + +- if (button_count) { ++ if (button_count && !board_of_device_present("gpio0")) { + bcm63xx_gpio_keys_data.nbuttons = button_count; + bcm63xx_gpio_keys_data.buttons = board.buttons; + +diff -uprN a/arch/mips/bcm63xx/prom.c b/arch/mips/bcm63xx/prom.c +--- a/arch/mips/bcm63xx/prom.c 2014-12-10 13:14:58.299519952 +0100 ++++ b/arch/mips/bcm63xx/prom.c 2014-12-10 13:16:13.879516528 +0100 +@@ -54,9 +54,6 @@ void __init prom_init(void) + reg &= ~mask; + bcm_perf_writel(reg, PERF_CKCTL_REG); + +- /* register gpiochip */ +- bcm63xx_gpio_init(); +- + /* detect and setup flash access */ + bcm63xx_flash_detect(); + diff --git a/target/linux/brcm63xx/patches-3.18/375-DT-GPIO-over-legacy.patch b/target/linux/brcm63xx/patches-3.18/375-DT-GPIO-over-legacy.patch new file mode 100644 index 0000000..8c9bfc8 --- /dev/null +++ b/target/linux/brcm63xx/patches-3.18/375-DT-GPIO-over-legacy.patch @@ -0,0 +1,45 @@ +diff -uprN a/arch/mips/bcm63xx/boards/board_common.c b/arch/mips/bcm63xx/boards/board_common.c +--- a/arch/mips/bcm63xx/boards/board_common.c 2014-12-10 13:14:58.299519952 +0100 ++++ b/arch/mips/bcm63xx/boards/board_common.c 2014-12-13 02:24:59.308489309 +0100 +@@ -222,6 +222,10 @@ int __init board_register_devices(void) + } + #endif + ++ if (!board_of_device_present("gpio0")) { ++ bcm63xx_gpio_init(); ++ } ++ + if (board.has_uart0) + bcm63xx_uart_register(0); + +@@ -287,7 +291,7 @@ int __init board_register_devices(void) + while (led_count < ARRAY_SIZE(board.leds) && board.leds[led_count].name) + led_count++; + +- if (led_count) { ++ if (led_count && !board_of_device_present("gpio0")) { + bcm63xx_led_data.num_leds = led_count; + bcm63xx_led_data.leds = board.leds; + +@@ -302,7 +306,7 @@ int __init board_register_devices(void) + while (button_count < ARRAY_SIZE(board.buttons) && board.buttons[button_count].desc) + button_count++; + +- if (button_count) { ++ if (button_count && !board_of_device_present("gpio0")) { + bcm63xx_gpio_keys_data.nbuttons = button_count; + bcm63xx_gpio_keys_data.buttons = board.buttons; + +diff -uprN a/arch/mips/bcm63xx/prom.c b/arch/mips/bcm63xx/prom.c +--- a/arch/mips/bcm63xx/prom.c 2014-12-10 13:14:58.299519952 +0100 ++++ b/arch/mips/bcm63xx/prom.c 2014-12-10 13:16:13.879516528 +0100 +@@ -54,9 +54,6 @@ void __init prom_init(void) + reg &= ~mask; + bcm_perf_writel(reg, PERF_CKCTL_REG); + +- /* register gpiochip */ +- bcm63xx_gpio_init(); +- + /* detect and setup flash access */ + bcm63xx_flash_detect(); +