From patchwork Wed Jun 12 02:11:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 2707751 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4A35DC1459 for ; Wed, 12 Jun 2013 02:11:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 657EE201CF for ; Wed, 12 Jun 2013 02:11:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BDAF8201CC for ; Wed, 12 Jun 2013 02:11:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754638Ab3FLCLn (ORCPT ); Tue, 11 Jun 2013 22:11:43 -0400 Received: from mail-pd0-f170.google.com ([209.85.192.170]:60766 "EHLO mail-pd0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754129Ab3FLCLn (ORCPT ); Tue, 11 Jun 2013 22:11:43 -0400 Received: by mail-pd0-f170.google.com with SMTP id x11so3564993pdj.15 for ; Tue, 11 Jun 2013 19:11:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:sender:message-id:to:cc:in-reply-to:references:from:subject :mime-version:content-type; bh=C+FHOJ3tfUO2z4I2cNMDUMYcrxJm8H0/MVDsHKdyTDk=; b=vjS3OwAgLiSngA7MbvriZOPiV7Z386r6NnPtE1PDnyl+eZSoOAs93RVPMTRZeWjAV2 wvRRcjIn5sQTqJlnMsJov+9vbYpphA2JgWNhXvanZ/CV6dc6Y66N7TNO8/GNIbjNUjV8 3k6mz4UtJJeaasrmK0wt9Muc6K9WX5MBjNCIk5pD9gp6lKqcs1+Ac1V0yPXO2+BPgXXk GDZ6RqFCgTrifC74YoILoAnzdw9WE877iE8+1N707/37L4616ROqufwgBfQihfDQ6L1Y PkTh8HY09uMNWxf+W5Dh2WSWhNgJGkZrH2Pmc76FqxTPiwzKB6AnBwHhdGLUqOeWMTLD bLDw== X-Received: by 10.66.135.139 with SMTP id ps11mr7735983pab.51.1371003102574; Tue, 11 Jun 2013 19:11:42 -0700 (PDT) Received: from morimoto-Dell-XPS420.gmail.com (49.14.32.202.bf.2iij.net. [202.32.14.49]) by mx.google.com with ESMTPSA id at1sm17004988pbc.10.2013.06.11.19.11.40 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 11 Jun 2013 19:11:41 -0700 (PDT) Date: Tue, 11 Jun 2013 19:11:41 -0700 (PDT) Message-ID: <87a9mw6pt1.wl%kuninori.morimoto.gx@renesas.com> To: Simon Cc: Magnus , Linux-SH , Kuninori Morimoto , (RSO) goda In-Reply-To: <87d2rs6pvv.wl%kuninori.morimoto.gx@renesas.com> References: <87li7fwgk8.wl%kuninori.morimoto.gx@renesas.com> <87d2rs6pvv.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 2/3 v4] ARM: shmobile: bockw: add SPI FLASH support MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 This patch enables Spansion S25FL008K chip on HSPI0 Signed-off-by: Yusuke Goda Signed-off-by: Kuninori Morimoto --- v3 -> v4 - based on renesas-next-20130611v2 arch/arm/mach-shmobile/board-bockw.c | 36 ++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/arch/arm/mach-shmobile/board-bockw.c b/arch/arm/mach-shmobile/board-bockw.c index 29cf3ed..f0f9eaa 100644 --- a/arch/arm/mach-shmobile/board-bockw.c +++ b/arch/arm/mach-shmobile/board-bockw.c @@ -20,11 +20,14 @@ #include #include +#include #include #include #include #include #include +#include +#include #include #include #include @@ -73,7 +76,37 @@ static struct i2c_board_info i2c0_devices[] = { }, }; +/* HSPI*/ +static struct mtd_partition m25p80_spi_flash_partitions[] = { + { + .name = "data(spi)", + .size = 0x0100000, + .offset = 0, + }, +}; + +static struct flash_platform_data spi_flash_data = { + .name = "m25p80", + .type = "s25fl008k", + .parts = m25p80_spi_flash_partitions, + .nr_parts = ARRAY_SIZE(m25p80_spi_flash_partitions), +}; + +static struct spi_board_info spi_board_info[] __initdata = { + { + .modalias = "m25p80", + .max_speed_hz = 104000000, + .chip_select = 0, + .bus_num = 0, + .mode = SPI_MODE_0, + .platform_data = &spi_flash_data, + }, +}; + static const struct pinctrl_map bockw_pinctrl_map[] = { + /* HSPI0 */ + PIN_MAP_MUX_GROUP_DEFAULT("sh-hspi.0", "pfc-r8a7778", + "hspi0_a", "hspi0"), /* SCIF0 */ PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.0", "pfc-r8a7778", "scif0_data_a", "scif0"), @@ -101,9 +134,12 @@ static void __init bockw_init(void) r8a7778_add_standard_devices(); r8a7778_add_usb_phy_device(&usb_phy_platform_data); r8a7778_add_i2c_device(0); + r8a7778_add_hspi_device(0); i2c_register_board_info(0, i2c0_devices, ARRAY_SIZE(i2c0_devices)); + spi_register_board_info(spi_board_info, + ARRAY_SIZE(spi_board_info)); pinctrl_register_mappings(bockw_pinctrl_map, ARRAY_SIZE(bockw_pinctrl_map)); r8a7778_pinmux_init();