From patchwork Wed Dec 10 23:52:41 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: 419905 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 98FC41400E9 for ; Thu, 11 Dec 2014 10:53:16 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id C8E2D28C214; Thu, 11 Dec 2014 00:51:20 +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 07BFB28C212 for ; Thu, 11 Dec 2014 00:51:01 +0100 (CET) X-policyd-weight: using cached result; rate: -8.5 Received: from mail-wi0-f180.google.com (mail-wi0-f180.google.com [209.85.212.180]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Thu, 11 Dec 2014 00:51:00 +0100 (CET) Received: by mail-wi0-f180.google.com with SMTP id n3so6931328wiv.1 for ; Wed, 10 Dec 2014 15:52:44 -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=WkrcEPFgbXk3OLvAJ3J+uBS7YSqHWgo0ucXKLVmBB+Y=; b=nkUMt/nFDREQ0xuV1rcmG7l+HvU3bbt3RuW+Qo0a9oo5GywlaN3NFU4RXXLDTZZHzU NQTYfu7nBp/anyyytJtecxdrhPCh6PphM0XIUd/wf6TiYKkqEJMScJMeQlHiB6yhxGYM nv0VDBwqXl++5gn33Tg52LzD//TVui7TO4+yiS1MXy53WJQQtvRfou4Emo8OJ+lxwl61 DJ4kcbJIcM0Za7ntZ4jGP3lr6Lxk6b/3qze7nvJAOoOzGRcAF0GzEuGuG5mnGDM7GcC3 r4vx8FX8cBjnMfxTF16UK2FwcOTwvFjJ3lhjcXwz1/UGS66Ao19M0GKKJBri8XxSEvTL sNdA== X-Received: by 10.180.88.33 with SMTP id bd1mr10501922wib.10.1418255564577; Wed, 10 Dec 2014 15:52:44 -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 m6sm641645wix.10.2014.12.10.15.52.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 10 Dec 2014 15:52:43 -0800 (PST) Message-ID: <5488DCC9.6040205@gmail.com> Date: Thu, 11 Dec 2014 00:52:41 +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> In-Reply-To: <5488DC9C.3000504@gmail.com> Subject: [OpenWrt-Devel] [PATCH 2/3] 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 diff --git a/target/linux/brcm63xx/patches-3.14/375-GPIO-DT-over-legacy.patch b/target/linux/brcm63xx/patches-3.14/375-GPIO-DT-over-legacy.patch new file mode 100644 index 0000000..9c4f6ec --- /dev/null +++ b/target/linux/brcm63xx/patches-3.14/375-GPIO-DT-over-legacy.patch @@ -0,0 +1,93 @@ +--- a/arch/mips/bcm63xx/boards/board_common.c ++++ b/arch/mips/bcm63xx/boards/board_common.c +@@ -191,8 +191,6 @@ static struct of_device_id of_ids[] = { + */ + int __init board_register_devices(void) + { +- int button_count = 0; +- int led_count = 0; + int usbh_ports = 0; + + #if CONFIG_OF +@@ -204,6 +202,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); + +@@ -265,30 +267,35 @@ int __init board_register_devices(void) + + bcm63xx_flash_register(); + +- /* count number of LEDs defined by this device */ +- while (led_count < ARRAY_SIZE(board.leds) && board.leds[led_count].name) +- led_count++; +- +- if (led_count) { +- bcm63xx_led_data.num_leds = led_count; +- bcm63xx_led_data.leds = board.leds; +- +- platform_device_register(&bcm63xx_gpio_leds); +- } +- +- if (board.ephy_reset_gpio && board.ephy_reset_gpio_flags) +- gpio_request_one(board.ephy_reset_gpio, +- board.ephy_reset_gpio_flags, "ephy-reset"); +- +- /* count number of BUTTONs defined by this device */ +- while (button_count < ARRAY_SIZE(board.buttons) && board.buttons[button_count].desc) +- button_count++; +- +- if (button_count) { +- bcm63xx_gpio_keys_data.nbuttons = button_count; +- bcm63xx_gpio_keys_data.buttons = board.buttons; ++ if (!board_of_device_present("gpio0")) { ++ int led_count = 0; ++ int button_count = 0; ++ ++ /* count number of LEDs defined by this device */ ++ while (led_count < ARRAY_SIZE(board.leds) && board.leds[led_count].name) ++ led_count++; ++ ++ if (led_count) { ++ bcm63xx_led_data.num_leds = led_count; ++ bcm63xx_led_data.leds = board.leds; ++ ++ platform_device_register(&bcm63xx_gpio_leds); ++ } ++ ++ if (board.ephy_reset_gpio && board.ephy_reset_gpio_flags) ++ gpio_request_one(board.ephy_reset_gpio, ++ board.ephy_reset_gpio_flags, "ephy-reset"); ++ ++ /* count number of BUTTONs defined by this device */ ++ while (button_count < ARRAY_SIZE(board.buttons) && board.buttons[button_count].desc) ++ button_count++; ++ ++ if (button_count) { ++ bcm63xx_gpio_keys_data.nbuttons = button_count; ++ bcm63xx_gpio_keys_data.buttons = board.buttons; + +- platform_device_register(&bcm63xx_gpio_keys_device); ++ platform_device_register(&bcm63xx_gpio_keys_device); ++ } + } + + return 0; +--- a/arch/mips/bcm63xx/prom.c ++++ b/arch/mips/bcm63xx/prom.c +@@ -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-GPIO-DT-over-legacy.patch b/target/linux/brcm63xx/patches-3.18/375-GPIO-DT-over-legacy.patch new file mode 100755 index 0000000..9c4f6ec --- /dev/null +++ b/target/linux/brcm63xx/patches-3.18/375-GPIO-DT-over-legacy.patch @@ -0,0 +1,93 @@ +--- a/arch/mips/bcm63xx/boards/board_common.c ++++ b/arch/mips/bcm63xx/boards/board_common.c +@@ -191,8 +191,6 @@ static struct of_device_id of_ids[] = { + */ + int __init board_register_devices(void) + { +- int button_count = 0; +- int led_count = 0; + int usbh_ports = 0; + + #if CONFIG_OF +@@ -204,6 +202,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); + +@@ -265,30 +267,35 @@ int __init board_register_devices(void) + + bcm63xx_flash_register(); + +- /* count number of LEDs defined by this device */ +- while (led_count < ARRAY_SIZE(board.leds) && board.leds[led_count].name) +- led_count++; +- +- if (led_count) { +- bcm63xx_led_data.num_leds = led_count; +- bcm63xx_led_data.leds = board.leds; +- +- platform_device_register(&bcm63xx_gpio_leds); +- } +- +- if (board.ephy_reset_gpio && board.ephy_reset_gpio_flags) +- gpio_request_one(board.ephy_reset_gpio, +- board.ephy_reset_gpio_flags, "ephy-reset"); +- +- /* count number of BUTTONs defined by this device */ +- while (button_count < ARRAY_SIZE(board.buttons) && board.buttons[button_count].desc) +- button_count++; +- +- if (button_count) { +- bcm63xx_gpio_keys_data.nbuttons = button_count; +- bcm63xx_gpio_keys_data.buttons = board.buttons; ++ if (!board_of_device_present("gpio0")) { ++ int led_count = 0; ++ int button_count = 0; ++ ++ /* count number of LEDs defined by this device */ ++ while (led_count < ARRAY_SIZE(board.leds) && board.leds[led_count].name) ++ led_count++; ++ ++ if (led_count) { ++ bcm63xx_led_data.num_leds = led_count; ++ bcm63xx_led_data.leds = board.leds; ++ ++ platform_device_register(&bcm63xx_gpio_leds); ++ } ++ ++ if (board.ephy_reset_gpio && board.ephy_reset_gpio_flags) ++ gpio_request_one(board.ephy_reset_gpio, ++ board.ephy_reset_gpio_flags, "ephy-reset"); ++ ++ /* count number of BUTTONs defined by this device */ ++ while (button_count < ARRAY_SIZE(board.buttons) && board.buttons[button_count].desc) ++ button_count++; ++ ++ if (button_count) { ++ bcm63xx_gpio_keys_data.nbuttons = button_count; ++ bcm63xx_gpio_keys_data.buttons = board.buttons; + +- platform_device_register(&bcm63xx_gpio_keys_device); ++ platform_device_register(&bcm63xx_gpio_keys_device); ++ } + } + + return 0; +--- a/arch/mips/bcm63xx/prom.c ++++ b/arch/mips/bcm63xx/prom.c +@@ -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(); +