From patchwork Fri Nov 15 14:50:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Christophe PLAGNIOL-VILLARD X-Patchwork-Id: 3188581 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6F05F9F39E for ; Fri, 15 Nov 2013 14:51:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6D43920925 for ; Fri, 15 Nov 2013 14:51:54 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9E753208F8 for ; Fri, 15 Nov 2013 14:51:52 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VhKic-0001ys-Il; Fri, 15 Nov 2013 14:49:59 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VhKi1-0001ys-Lz; Fri, 15 Nov 2013 14:49:21 +0000 Received: from 8.mo2.mail-out.ovh.net ([188.165.52.147] helo=mo2.mail-out.ovh.net) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VhKh6-0001qD-Rq for linux-arm-kernel@lists.infradead.org; Fri, 15 Nov 2013 14:48:42 +0000 Received: from mail627.ha.ovh.net (b6.ovh.net [213.186.33.56]) by mo2.mail-out.ovh.net (Postfix) with SMTP id BE386FFA5D0 for ; Fri, 15 Nov 2013 15:48:03 +0100 (CET) Received: from b0.ovh.net (HELO queueout) (213.186.33.50) by b0.ovh.net with SMTP; 15 Nov 2013 16:48:06 +0200 Received: from ns203013.ovh.net (HELO localhost) (plagnioj%jcrosoft.com@91.121.171.124) by ns0.ovh.net with SMTP; 15 Nov 2013 16:48:04 +0200 From: Jean-Christophe PLAGNIOL-VILLARD To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 05/11] ARM: at91: switch flexibity to DT Date: Fri, 15 Nov 2013 15:50:00 +0100 Message-Id: <1384527006-9040-5-git-send-email-plagnioj@jcrosoft.com> X-Mailer: git-send-email 1.8.4.rc3 In-Reply-To: <1384527006-9040-1-git-send-email-plagnioj@jcrosoft.com> References: <20131115143855.GR28304@ns203013.ovh.net> <1384527006-9040-1-git-send-email-plagnioj@jcrosoft.com> X-Ovh-Tracer-Id: 3757127990593825789 X-Ovh-Remote: 91.121.171.124 (ns203013.ovh.net) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-OVH-SPAMSTATE: OK X-OVH-SPAMSCORE: -100 X-OVH-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeeiledrieehucetufdoteggodetrfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-Spam-Check: DONE|U 0.5/N X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeeiledrieehucetufdoteggodetrfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131115_094825_461958_CFF936BF X-CRM114-Status: GOOD ( 23.62 ) X-Spam-Score: -1.9 (-) Cc: Nicolas Ferre , Jean-Christophe PLAGNIOL-VILLARD X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD Cc: Nicolas Ferre --- arch/arm/boot/dts/Makefile | 1 + arch/arm/boot/dts/at91-flexibity.dts | 144 ++++++++++++++++++++++++ arch/arm/configs/at91sam9260_9g20_defconfig | 1 - arch/arm/mach-at91/Kconfig.non_dt | 6 - arch/arm/mach-at91/Makefile | 1 - arch/arm/mach-at91/board-flexibity.c | 168 ---------------------------- 6 files changed, 145 insertions(+), 176 deletions(-) create mode 100644 arch/arm/boot/dts/at91-flexibity.dts delete mode 100644 arch/arm/mach-at91/board-flexibity.c diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index de02fc7..a66de6d 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -5,6 +5,7 @@ ifeq ($(CONFIG_OF),y) dtb-$(CONFIG_ARCH_AT91) += at91rm9200ek.dtb dtb-$(CONFIG_ARCH_AT91) += at91-1arm.dtb dtb-$(CONFIG_ARCH_AT91) += at91-carmeva.dtb +dtb-$(CONFIG_ARCH_AT91) += at91-flexibity.dtb dtb-$(CONFIG_ARCH_AT91) += at91-kafa.dtb dtb-$(CONFIG_ARCH_AT91) += mpa1600.dtb # sam9260 diff --git a/arch/arm/boot/dts/at91-flexibity.dts b/arch/arm/boot/dts/at91-flexibity.dts new file mode 100644 index 0000000..2eb9b51 --- /dev/null +++ b/arch/arm/boot/dts/at91-flexibity.dts @@ -0,0 +1,144 @@ +/* + * at91-flexibity.dts - Device Tree file for Flexibity Connect board + * + * Copyright (C) 2013 Jean-Christophe PLAGNIOL-VILLARD + * + * Licensed under GPLv2 only + */ +/dts-v1/; +#include "at91sam9260.dtsi" + +/ { + model = "Flexibity Connect board"; + compatible = "flexibity,connect", "atmel,at91sam9260", "atmel,at91sam9"; + + memory { + reg = <0x20000000 0x4000000>; + }; + + clocks { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + main_clock: clock@0 { + compatible = "atmel,osc", "fixed-clock"; + clock-frequency = <18432000>; + }; + }; + + ahb { + apb { + dbgu: serial@fffff200 { + status = "okay"; + }; + + usb1: gadget@fffa4000 { + atmel,vbus-gpio = <&pioC 5 GPIO_ACTIVE_HIGH>; + status = "okay"; + }; + + mmc0: mmc@fffa8000 { + pinctrl-0 = < + &pinctrl_board_mmc0 + &pinctrl_mmc0_clk + &pinctrl_mmc0_slot0_cmd_dat0 + &pinctrl_mmc0_slot0_dat1_3>; + status = "okay"; + slot@0 { + reg = <0>; + bus-width = <4>; + cd-gpios = <&pioB 9 GPIO_ACTIVE_HIGH>; + wp-gpios = <&pioC 4 GPIO_ACTIVE_HIGH>; + }; + }; + + pinctrl@fffff400 { + mmc0 { + pinctrl_board_mmc0: mmc0-board { + atmel,pins = + ; + }; + }; + }; + + spi0: spi@fffc8000 { + status = "okay"; + cs-gpios = <0>, + <&pioC 11 GPIO_ACTIVE_HIGH>; + mtd_dataflash@1 { + compatible = "atmel,at45", "atmel,dataflash"; + spi-max-frequency = <15000000>; + reg = <1>; + }; + }; + }; + + usb0: ohci@00500000 { + num-ports = <2>; + status = "okay"; + }; + }; + + leds { + compatible = "gpio-leds"; + + usb1_green { + label = "usb1:green"; + gpios = <&pioA 12 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + usb1_red { + label = "usb1:red"; + gpios = <&pioA 13 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + usb2_green { + label = "usb2:green"; + gpios = <&pioB 16 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + usb2_red { + label = "usb2:red"; + gpios = <&pioB 27 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + usb3_green { + label = "usb3:green"; + gpios = <&pioC 8 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + usb3_red { + label = "usb3:red"; + gpios = <&pioC 6 13 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + usb4_green { + label = "usb4:green"; + gpios = <&pioB 4 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + usb4_red { + label = "usb4:red"; + gpios = <&pioB 5 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + }; + + i2c@0 { + status = "okay"; + + rtc@68 { + compatible = "dallas,ds1307"; + reg = <0x68>; + }; + }; +}; diff --git a/arch/arm/configs/at91sam9260_9g20_defconfig b/arch/arm/configs/at91sam9260_9g20_defconfig index 69b6928..ab66867 100644 --- a/arch/arm/configs/at91sam9260_9g20_defconfig +++ b/arch/arm/configs/at91sam9260_9g20_defconfig @@ -17,7 +17,6 @@ CONFIG_MACH_SAM9_L9260=y CONFIG_MACH_AFEB9260=y CONFIG_MACH_QIL_A9260=y CONFIG_MACH_CPU9260=y -CONFIG_MACH_FLEXIBITY=y CONFIG_MACH_AT91SAM9G20EK=y CONFIG_MACH_AT91SAM9G20EK_2MMC=y CONFIG_MACH_CPU9G20=y diff --git a/arch/arm/mach-at91/Kconfig.non_dt b/arch/arm/mach-at91/Kconfig.non_dt index cfef1de..694e959 100644 --- a/arch/arm/mach-at91/Kconfig.non_dt +++ b/arch/arm/mach-at91/Kconfig.non_dt @@ -171,12 +171,6 @@ config MACH_CPU9260 Select this if you are using a Eukrea Electromatique's CPU9260 Board -config MACH_FLEXIBITY - bool "Flexibity Connect board" - help - Select this if you are using Flexibity Connect board - - comment "AT91SAM9G20 Board Type" config MACH_AT91SAM9G20EK diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile index 61c19d7..70e2b22 100644 --- a/arch/arm/mach-at91/Makefile +++ b/arch/arm/mach-at91/Makefile @@ -52,7 +52,6 @@ obj-$(CONFIG_MACH_SAM9_L9260) += board-sam9-l9260.o obj-$(CONFIG_MACH_QIL_A9260) += board-qil-a9260.o obj-$(CONFIG_MACH_AFEB9260) += board-afeb-9260v1.o obj-$(CONFIG_MACH_CPU9260) += board-cpu9krea.o -obj-$(CONFIG_MACH_FLEXIBITY) += board-flexibity.o # AT91SAM9261 board-specific support obj-$(CONFIG_MACH_AT91SAM9261EK) += board-sam9261ek.o diff --git a/arch/arm/mach-at91/board-flexibity.c b/arch/arm/mach-at91/board-flexibity.c deleted file mode 100644 index 737c085..0000000 --- a/arch/arm/mach-at91/board-flexibity.c +++ /dev/null @@ -1,168 +0,0 @@ -/* - * linux/arch/arm/mach-at91/board-flexibity.c - * - * Copyright (C) 2010-2011 Flexibity - * Copyright (C) 2005 SAN People - * Copyright (C) 2006 Atmel - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include -#include -#include -#include -#include - -#include - -#include -#include -#include - -#include - -#include "at91_aic.h" -#include "board.h" -#include "generic.h" - -static void __init flexibity_init_early(void) -{ - /* Initialize processor: 18.432 MHz crystal */ - at91_initialize(18432000); -} - -/* USB Host port */ -static struct at91_usbh_data __initdata flexibity_usbh_data = { - .ports = 2, - .vbus_pin = {-EINVAL, -EINVAL}, - .overcurrent_pin= {-EINVAL, -EINVAL}, -}; - -/* USB Device port */ -static struct at91_udc_data __initdata flexibity_udc_data = { - .vbus_pin = AT91_PIN_PC5, - .pullup_pin = -EINVAL, /* pull-up driven by UDC */ -}; - -/* I2C devices */ -static struct i2c_board_info __initdata flexibity_i2c_devices[] = { - { - I2C_BOARD_INFO("ds1307", 0x68), - }, -}; - -/* SPI devices */ -static struct spi_board_info flexibity_spi_devices[] = { - { /* DataFlash chip */ - .modalias = "mtd_dataflash", - .chip_select = 1, - .max_speed_hz = 15 * 1000 * 1000, - .bus_num = 0, - }, -}; - -/* MCI (SD/MMC) */ -static struct mci_platform_data __initdata flexibity_mci0_data = { - .slot[0] = { - .bus_width = 4, - .detect_pin = AT91_PIN_PC9, - .wp_pin = AT91_PIN_PC4, - }, -}; - -/* LEDs */ -static struct gpio_led flexibity_leds[] = { - { - .name = "usb1:green", - .gpio = AT91_PIN_PA12, - .active_low = 1, - .default_trigger = "default-on", - }, - { - .name = "usb1:red", - .gpio = AT91_PIN_PA13, - .active_low = 1, - .default_trigger = "default-on", - }, - { - .name = "usb2:green", - .gpio = AT91_PIN_PB26, - .active_low = 1, - .default_trigger = "default-on", - }, - { - .name = "usb2:red", - .gpio = AT91_PIN_PB27, - .active_low = 1, - .default_trigger = "default-on", - }, - { - .name = "usb3:green", - .gpio = AT91_PIN_PC8, - .active_low = 1, - .default_trigger = "default-on", - }, - { - .name = "usb3:red", - .gpio = AT91_PIN_PC6, - .active_low = 1, - .default_trigger = "default-on", - }, - { - .name = "usb4:green", - .gpio = AT91_PIN_PB4, - .active_low = 1, - .default_trigger = "default-on", - }, - { - .name = "usb4:red", - .gpio = AT91_PIN_PB5, - .active_low = 1, - .default_trigger = "default-on", - } -}; - -static void __init flexibity_board_init(void) -{ - /* Serial */ - /* DBGU on ttyS0. (Rx & Tx only) */ - at91_register_uart(0, 0, 0); - at91_add_device_serial(); - /* USB Host */ - at91_add_device_usbh(&flexibity_usbh_data); - /* USB Device */ - at91_add_device_udc(&flexibity_udc_data); - /* I2C */ - at91_add_device_i2c(flexibity_i2c_devices, - ARRAY_SIZE(flexibity_i2c_devices)); - /* SPI */ - at91_add_device_spi(flexibity_spi_devices, - ARRAY_SIZE(flexibity_spi_devices)); - /* MMC */ - at91_add_device_mci(0, &flexibity_mci0_data); - /* LEDs */ - at91_gpio_leds(flexibity_leds, ARRAY_SIZE(flexibity_leds)); -} - -MACHINE_START(FLEXIBITY, "Flexibity Connect") - /* Maintainer: Maxim Osipov */ - .init_time = at91sam926x_pit_init, - .map_io = at91_map_io, - .handle_irq = at91_aic_handle_irq, - .init_early = flexibity_init_early, - .init_irq = at91_init_irq_default, - .init_machine = flexibity_board_init, -MACHINE_END