From patchwork Tue Feb 22 13:37:02 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Williamson X-Patchwork-Id: 580371 Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p1MDd0S2030408 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 22 Feb 2011 13:39:22 GMT Received: from dlep34.itg.ti.com ([157.170.170.115]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id p1MDd0vT003916 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 22 Feb 2011 07:39:00 -0600 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep34.itg.ti.com (8.13.7/8.13.7) with ESMTP id p1MDcx3K018363 for ; Tue, 22 Feb 2011 07:39:00 -0600 (CST) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 7579680639 for ; Tue, 22 Feb 2011 07:38:58 -0600 (CST) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp53.itg.ti.com (dflp53.itg.ti.com [128.247.5.6]) by linux.omap.com (Postfix) with ESMTP id 89CF180627 for ; Tue, 22 Feb 2011 07:37:55 -0600 (CST) Received: from red.ext.ti.com (localhost [127.0.0.1]) by dflp53.itg.ti.com (8.13.8/8.13.8) with ESMTP id p1MDbtRf020248 for ; Tue, 22 Feb 2011 07:37:55 -0600 (CST) Received: from psmtp.com (na3sys009amx167.postini.com [74.125.149.93]) by red.ext.ti.com (8.13.7/8.13.7) with SMTP id p1MDbsXA023368 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 22 Feb 2011 07:37:54 -0600 Received: from source ([209.85.220.173]) (using TLSv1) by na3sys009amx167.postini.com ([74.125.148.10]) with SMTP; Tue, 22 Feb 2011 13:37:55 GMT Received: by mail-vx0-f173.google.com with SMTP id 41so1711944vxb.4 for ; Tue, 22 Feb 2011 05:37:47 -0800 (PST) Received: by 10.52.164.99 with SMTP id yp3mr3939243vdb.79.1298381866464; Tue, 22 Feb 2011 05:37:46 -0800 (PST) Received: from localhost.localdomain (rrcs-24-39-249-130.nys.biz.rr.com [24.39.249.130]) by mx.google.com with ESMTPS id l6sm2326746vcp.38.2011.02.22.05.37.43 (version=SSLv3 cipher=OTHER); Tue, 22 Feb 2011 05:37:44 -0800 (PST) From: Michael Williamson To: davinci-linux-open-source@linux.davincidsp.com Subject: [PATCH v3 7/9] davinci: add spi devices support for MityDSP-L138/MityARM-1808 platform Date: Tue, 22 Feb 2011 08:37:02 -0500 Message-Id: <1298381824-7723-8-git-send-email-michael.williamson@criticallink.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1298381824-7723-1-git-send-email-michael.williamson@criticallink.com> References: <1298381824-7723-1-git-send-email-michael.williamson@criticallink.com> X-pstn-neptune: 0/0/0.00/0 X-pstn-levels: (S:99.90000/99.90000 CV:99.9000 FC:95.5390 LC:95.5390 R:95.9108 P:95.9108 M:97.0282 C:98.6951 ) X-pstn-settings: 2 (0.5000:0.0750) s cv GT3 gt2 gt1 r p m c X-pstn-addresses: from [db-null] Cc: khilman@deeprootsystems.com, linux-arm-kernel@lists.infradead.org X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: davinci-linux-open-source-bounces+patchwork-davinci=patchwork.kernel.org@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces+patchwork-davinci=patchwork.kernel.org@linux.davincidsp.com X-Greylist: Sender succeeded STARTTLS authentication, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 22 Feb 2011 13:39:24 +0000 (UTC) diff --git a/arch/arm/mach-davinci/board-mityomapl138.c b/arch/arm/mach-davinci/board-mityomapl138.c index 0ea5932..dc4c3f1 100644 --- a/arch/arm/mach-davinci/board-mityomapl138.c +++ b/arch/arm/mach-davinci/board-mityomapl138.c @@ -17,6 +17,8 @@ #include #include #include +#include +#include #include #include @@ -25,6 +27,7 @@ #include #include #include +#include #define MITYOMAPL138_PHY_ID "0:03" @@ -294,6 +297,100 @@ static int __init pmic_tps65023_init(void) } /* + * SPI Devices: + * SPI1_CS0: 8M Flash ST-M25P64-VME6G + */ +static struct mtd_partition spi_flash_partitions[] = { + [0] = { + .name = "ubl", + .offset = 0, + .size = SZ_64K, + .mask_flags = MTD_WRITEABLE, + }, + [1] = { + .name = "u-boot", + .offset = MTDPART_OFS_APPEND, + .size = SZ_512K, + .mask_flags = MTD_WRITEABLE, + }, + [2] = { + .name = "u-boot-env", + .offset = MTDPART_OFS_APPEND, + .size = SZ_64K, + .mask_flags = MTD_WRITEABLE, + }, + [3] = { + .name = "periph-config", + .offset = MTDPART_OFS_APPEND, + .size = SZ_64K, + .mask_flags = MTD_WRITEABLE, + }, + [4] = { + .name = "reserved", + .offset = MTDPART_OFS_APPEND, + .size = SZ_256K + SZ_64K, + }, + [5] = { + .name = "kernel", + .offset = MTDPART_OFS_APPEND, + .size = SZ_2M + SZ_1M, + }, + [6] = { + .name = "fpga", + .offset = MTDPART_OFS_APPEND, + .size = SZ_2M, + }, + [7] = { + .name = "spare", + .offset = MTDPART_OFS_APPEND, + .size = MTDPART_SIZ_FULL, + }, +}; + +static struct flash_platform_data mityomapl138_spi_flash_data = { + .name = "m25p80", + .parts = spi_flash_partitions, + .nr_parts = ARRAY_SIZE(spi_flash_partitions), + .type = "m24p64", +}; + +static struct davinci_spi_config spi_eprom_config = { + .io_type = SPI_IO_TYPE_DMA, + .c2tdelay = 8, + .t2cdelay = 8, +}; + +static struct spi_board_info mityomapl138_spi_flash_info[] = { + { + .modalias = "m25p80", + .platform_data = &mityomapl138_spi_flash_data, + .controller_data = &spi_eprom_config, + .mode = SPI_MODE_0, + .max_speed_hz = 30000000, + .bus_num = 1, + .chip_select = 0, + }, +}; + +static void __init mityomapl138_init_spi1(struct spi_board_info *info, + unsigned len) +{ + int ret; + + ret = spi_register_board_info(info, len); + if (ret) + pr_warning("%s: failed to register board info : %d\n", + __func__, ret); + + da8xx_spi_pdata[1].num_chipselect = len; + + ret = da8xx_register_spi(1); + if (ret) + pr_warning("%s: failed to register spi 1 device : %d\n", + __func__, ret); +} + +/* * MityDSP-L138 includes a 256 MByte large-page NAND flash * (128K blocks). */ @@ -448,6 +545,9 @@ static void __init mityomapl138_init(void) mityomapl138_setup_nand(); + mityomapl138_init_spi1(mityomapl138_spi_flash_info, + ARRAY_SIZE(mityomapl138_spi_flash_info)); + mityomapl138_config_emac(); ret = da8xx_register_rtc();