From patchwork Wed Apr 15 21:37:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Yeryomin X-Patchwork-Id: 461656 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 0E023140142 for ; Thu, 16 Apr 2015 07:38:22 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="verification failed; unprotected key" header.d=gmail.com header.i=@gmail.com header.b=Qe4YB8GT; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id B6EB0280942; Wed, 15 Apr 2015 23:36:53 +0200 (CEST) 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 C6BE1280871 for ; Wed, 15 Apr 2015 23:36:44 +0200 (CEST) X-policyd-weight: using cached result; rate: -8.5 Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com [209.85.217.175]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Wed, 15 Apr 2015 23:36:44 +0200 (CEST) Received: by lbbuc2 with SMTP id uc2so44410181lbb.2 for ; Wed, 15 Apr 2015 14:37:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=++Qys6ASiKP+d36Ss0wOqS+/wafboCLFPW0NR95b48o=; b=Qe4YB8GTJvmDd8Uvv3VQpf4xCZDk/dpq4SvyYQjgzm8pzEWcezOhtzYoEh0gnsDu7S i4944TClMoaMHDs1jx57PY+GAIN8U7MdI2qVlGNPLhvZpaxbQVQMKIrxIE2vJA+dmMTs LRbGClBF6UBQIoZ/Bv1LqGpEKipUsLSWKnwy7RqZ37UcGzlfZJM/QyeHrGShjqUBbl2V +tA0lP2bmKNcezh3bENa8ZYTsq0rh0x0rQ4wYTyi+87xIBps8Wvoe7uX6x88IsUNNhc8 HQ6B4kcjL3XuR3ygwVGmugOjhP6VibGoe07k5879DraQqyjC5jMKEh+u15WMEEJWsE4L RFsQ== X-Received: by 10.112.65.37 with SMTP id u5mr25627299lbs.44.1429133855864; Wed, 15 Apr 2015 14:37:35 -0700 (PDT) Received: from localhost.localdomain ([213.175.90.142]) by mx.google.com with ESMTPSA id rp10sm1202366lbb.8.2015.04.15.14.37.34 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 15 Apr 2015 14:37:34 -0700 (PDT) From: Roman Yeryomin X-Google-Original-From: Roman Yeryomin To: OpenWrt Development List Date: Thu, 16 Apr 2015 00:37:26 +0300 Message-Id: <1429133846-31343-1-git-send-email-roman@advem.lv> X-Mailer: git-send-email 2.1.0 Subject: [OpenWrt-Devel] [PATCH 2/2] ar71xx: spi cleanup for ap121, db120, ubnt-xm and ap136 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: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Signed-off-by: Roman Yeryomin --- ...ath79-make-chipselect-logic-more-flexible.patch | 89 ---------------------- .../patches-3.18/603-MIPS-ath79-ap121-fixes.patch | 40 +++++----- .../patches-3.18/605-MIPS-ath79-db120-fixes.patch | 10 +-- .../607-MIPS-ath79-ubnt-xm-fixes.patch | 10 +-- .../patches-3.18/609-MIPS-ath79-ap136-fixes.patch | 10 +-- 5 files changed, 28 insertions(+), 131 deletions(-) diff --git a/target/linux/ar71xx/patches-3.18/206-spi-ath79-make-chipselect-logic-more-flexible.patch b/target/linux/ar71xx/patches-3.18/206-spi-ath79-make-chipselect-logic-more-flexible.patch index 1cf4c23..76c067a 100644 --- a/target/linux/ar71xx/patches-3.18/206-spi-ath79-make-chipselect-logic-more-flexible.patch +++ b/target/linux/ar71xx/patches-3.18/206-spi-ath79-make-chipselect-logic-more-flexible.patch @@ -5,79 +5,11 @@ Subject: [PATCH 34/34] spi/ath79: make chipselect logic more flexible Signed-off-by: Gabor Juhos --- - arch/mips/ath79/mach-ap121.c | 6 ++ - arch/mips/ath79/mach-ap136.c | 6 ++ - arch/mips/ath79/mach-ap81.c | 6 ++ - arch/mips/ath79/mach-db120.c | 6 ++ arch/mips/ath79/mach-pb44.c | 6 ++ - arch/mips/ath79/mach-ubnt-xm.c | 6 ++ .../include/asm/mach-ath79/ath79_spi_platform.h | 8 ++- drivers/spi/spi-ath79.c | 67 +++++++++++++------- 8 files changed, 88 insertions(+), 23 deletions(-) ---- a/arch/mips/ath79/mach-ap121.c -+++ b/arch/mips/ath79/mach-ap121.c -@@ -58,12 +58,18 @@ static struct gpio_keys_button ap121_gpi - } - }; - -+static struct ath79_spi_controller_data ap121_spi0_data = { -+ .cs_type = ATH79_SPI_CS_TYPE_INTERNAL, -+ .cs_line = 0, -+}; -+ - static struct spi_board_info ap121_spi_info[] = { - { - .bus_num = 0, - .chip_select = 0, - .max_speed_hz = 25000000, - .modalias = "mx25l1606e", -+ .controller_data = &ap121_spi0_data, - } - }; - ---- a/arch/mips/ath79/mach-ap136.c -+++ b/arch/mips/ath79/mach-ap136.c -@@ -98,12 +98,18 @@ static struct gpio_keys_button ap136_gpi - }, - }; - -+static struct ath79_spi_controller_data ap136_spi0_data = { -+ .cs_type = ATH79_SPI_CS_TYPE_INTERNAL, -+ .cs_line = 0, -+}; -+ - static struct spi_board_info ap136_spi_info[] = { - { - .bus_num = 0, - .chip_select = 0, - .max_speed_hz = 25000000, - .modalias = "mx25l6405d", -+ .controller_data = &ap136_spi0_data, - } - }; - ---- a/arch/mips/ath79/mach-db120.c -+++ b/arch/mips/ath79/mach-db120.c -@@ -76,12 +76,18 @@ static struct gpio_keys_button db120_gpi - }, - }; - -+static struct ath79_spi_controller_data db120_spi0_data = { -+ .cs_type = ATH79_SPI_CS_TYPE_INTERNAL, -+ .cs_line = 0, -+}; -+ - static struct spi_board_info db120_spi_info[] = { - { - .bus_num = 0, - .chip_select = 0, - .max_speed_hz = 25000000, - .modalias = "s25sl064a", -+ .controller_data = &db120_spi0_data, - } - }; - --- a/arch/mips/ath79/mach-pb44.c +++ b/arch/mips/ath79/mach-pb44.c @@ -87,12 +87,18 @@ static struct gpio_keys_button pb44_gpio @@ -99,27 +31,6 @@ Signed-off-by: Gabor Juhos }, }; ---- a/arch/mips/ath79/mach-ubnt-xm.c -+++ b/arch/mips/ath79/mach-ubnt-xm.c -@@ -65,12 +65,18 @@ static struct gpio_keys_button ubnt_xm_g - } - }; - -+static struct ath79_spi_controller_data ubnt_xm_spi0_data = { -+ .cs_type = ATH79_SPI_CS_TYPE_INTERNAL, -+ .cs_line = 0, -+}; -+ - static struct spi_board_info ubnt_xm_spi_info[] = { - { - .bus_num = 0, - .chip_select = 0, - .max_speed_hz = 25000000, - .modalias = "mx25l6405d", -+ .controller_data = &ubnt_xm_spi0_data, - } - }; - --- a/arch/mips/include/asm/mach-ath79/ath79_spi_platform.h +++ b/arch/mips/include/asm/mach-ath79/ath79_spi_platform.h @@ -16,8 +16,14 @@ struct ath79_spi_platform_data { diff --git a/target/linux/ar71xx/patches-3.18/603-MIPS-ath79-ap121-fixes.patch b/target/linux/ar71xx/patches-3.18/603-MIPS-ath79-ap121-fixes.patch index b385b9e..36139b0 100644 --- a/target/linux/ar71xx/patches-3.18/603-MIPS-ath79-ap121-fixes.patch +++ b/target/linux/ar71xx/patches-3.18/603-MIPS-ath79-ap121-fixes.patch @@ -40,29 +40,33 @@ static struct gpio_led ap121_leds_gpio[] __initdata = { { -@@ -58,41 +67,78 @@ static struct gpio_keys_button ap121_gpi +@@ -58,35 +67,78 @@ static struct gpio_keys_button ap121_gpi } }; --static struct ath79_spi_controller_data ap121_spi0_data = { -- .cs_type = ATH79_SPI_CS_TYPE_INTERNAL, -- .cs_line = 0, +-static struct spi_board_info ap121_spi_info[] = { +- { +- .bus_num = 0, +- .chip_select = 0, +- .max_speed_hz = 25000000, +- .modalias = "mx25l1606e", +- } +-}; +- +-static struct ath79_spi_platform_data ap121_spi_data = { +- .bus_num = 0, +- .num_chipselect = 1, +-}; +static struct gpio_led ap121_mini_leds_gpio[] __initdata = { + { + .name = "ap121:green:wlan", + .gpio = AP121_MINI_GPIO_LED_WLAN, + .active_low = 0, + }, - }; - --static struct spi_board_info ap121_spi_info[] = { ++}; ++ +static struct gpio_keys_button ap121_mini_gpio_keys[] __initdata = { - { -- .bus_num = 0, -- .chip_select = 0, -- .max_speed_hz = 25000000, -- .modalias = "mx25l1606e", -- .controller_data = &ap121_spi0_data, ++ { + .desc = "jumpstart button", + .type = EV_KEY, + .code = KEY_WPS_BUTTON, @@ -77,13 +81,9 @@ + .debounce_interval = AP121_KEYS_DEBOUNCE_INTERVAL, + .gpio = AP121_MINI_GPIO_BTN_RESET, + .active_low = 1, - } - }; - --static struct ath79_spi_platform_data ap121_spi_data = { -- .bus_num = 0, -- .num_chipselect = 1, --}; ++ } ++}; ++ +static void __init ap121_common_setup(void) +{ + u8 *art = (u8 *) KSEG1ADDR(0x1fff0000); diff --git a/target/linux/ar71xx/patches-3.18/605-MIPS-ath79-db120-fixes.patch b/target/linux/ar71xx/patches-3.18/605-MIPS-ath79-db120-fixes.patch index b494f93..d62263f 100644 --- a/target/linux/ar71xx/patches-3.18/605-MIPS-ath79-db120-fixes.patch +++ b/target/linux/ar71xx/patches-3.18/605-MIPS-ath79-db120-fixes.patch @@ -63,28 +63,24 @@ }; static struct gpio_keys_button db120_gpio_keys[] __initdata = { -@@ -76,66 +93,85 @@ static struct gpio_keys_button db120_gpi +@@ -76,60 +93,85 @@ static struct gpio_keys_button db120_gpi }, }; --static struct ath79_spi_controller_data db120_spi0_data = { -- .cs_type = ATH79_SPI_CS_TYPE_INTERNAL, -- .cs_line = 0, +static struct ar8327_pad_cfg db120_ar8327_pad0_cfg = { + .mode = AR8327_PAD_MAC_RGMII, + .txclk_delay_en = true, + .rxclk_delay_en = true, + .txclk_delay_sel = AR8327_CLK_DELAY_SEL1, + .rxclk_delay_sel = AR8327_CLK_DELAY_SEL2, - }; - ++}; ++ -static struct spi_board_info db120_spi_info[] = { - { - .bus_num = 0, - .chip_select = 0, - .max_speed_hz = 25000000, - .modalias = "s25sl064a", -- .controller_data = &db120_spi0_data, - } +static struct ar8327_led_cfg db120_ar8327_led_cfg = { + .led_ctrl0 = 0x00000000, diff --git a/target/linux/ar71xx/patches-3.18/607-MIPS-ath79-ubnt-xm-fixes.patch b/target/linux/ar71xx/patches-3.18/607-MIPS-ath79-ubnt-xm-fixes.patch index cbbe20b..6170a0a 100644 --- a/target/linux/ar71xx/patches-3.18/607-MIPS-ath79-ubnt-xm-fixes.patch +++ b/target/linux/ar71xx/patches-3.18/607-MIPS-ath79-ubnt-xm-fixes.patch @@ -37,22 +37,16 @@ static struct gpio_led ubnt_xm_leds_gpio[] __initdata = { { -@@ -65,54 +66,10 @@ static struct gpio_keys_button ubnt_xm_g +@@ -65,48 +66,10 @@ static struct gpio_keys_button ubnt_xm_g } }; --static struct ath79_spi_controller_data ubnt_xm_spi0_data = { -- .cs_type = ATH79_SPI_CS_TYPE_INTERNAL, -- .cs_line = 0, --}; -- -static struct spi_board_info ubnt_xm_spi_info[] = { - { - .bus_num = 0, - .chip_select = 0, - .max_speed_hz = 25000000, - .modalias = "mx25l6405d", -- .controller_data = &ubnt_xm_spi0_data, - } -}; - @@ -94,7 +88,7 @@ ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_xm_leds_gpio), ubnt_xm_leds_gpio); -@@ -120,10 +77,8 @@ static void __init ubnt_xm_init(void) +@@ -114,10 +71,8 @@ static void __init ubnt_xm_init(void) ARRAY_SIZE(ubnt_xm_gpio_keys), ubnt_xm_gpio_keys); diff --git a/target/linux/ar71xx/patches-3.18/609-MIPS-ath79-ap136-fixes.patch b/target/linux/ar71xx/patches-3.18/609-MIPS-ath79-ap136-fixes.patch index ef0ae9a..af7368a 100644 --- a/target/linux/ar71xx/patches-3.18/609-MIPS-ath79-ap136-fixes.patch +++ b/target/linux/ar71xx/patches-3.18/609-MIPS-ath79-ap136-fixes.patch @@ -86,13 +86,10 @@ .gpio = AP136_GPIO_LED_USB, .active_low = 1, } -@@ -98,65 +106,151 @@ static struct gpio_keys_button ap136_gpi +@@ -98,59 +106,151 @@ static struct gpio_keys_button ap136_gpi }, }; --static struct ath79_spi_controller_data ap136_spi0_data = { -- .cs_type = ATH79_SPI_CS_TYPE_INTERNAL, -- .cs_line = 0, +static struct ar8327_pad_cfg ap136_ar8327_pad0_cfg; +static struct ar8327_pad_cfg ap136_ar8327_pad6_cfg; + @@ -113,8 +110,8 @@ + .txpause = 1, + .rxpause = 1, + }, - }; - ++}; ++ -static struct spi_board_info ap136_spi_info[] = { +static struct mdio_board_info ap136_mdio0_info[] = { { @@ -122,7 +119,6 @@ - .chip_select = 0, - .max_speed_hz = 25000000, - .modalias = "mx25l6405d", -- .controller_data = &ap136_spi0_data, - } + .bus_id = "ag71xx-mdio.0", + .phy_addr = 0,