From patchwork Wed Dec 1 09:05:15 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Subhasish Ghosh X-Patchwork-Id: 370611 Received: from bear.ext.ti.com (bear.ext.ti.com [192.94.94.41]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oB18tuAS015568 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 1 Dec 2010 08:56:17 GMT Received: from dlep36.itg.ti.com ([157.170.170.91]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id oB18sMId011150 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 1 Dec 2010 02:54:23 -0600 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep36.itg.ti.com (8.13.8/8.13.8) with ESMTP id oB18sMYS017379; Wed, 1 Dec 2010 02:54:22 -0600 (CST) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 6C12780627; Wed, 1 Dec 2010 02:54:22 -0600 (CST) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp51.itg.ti.com (dflp51.itg.ti.com [128.247.22.94]) by linux.omap.com (Postfix) with ESMTP id 2769580626 for ; Wed, 1 Dec 2010 02:54:21 -0600 (CST) Received: from medina.ext.ti.com (localhost [127.0.0.1]) by dflp51.itg.ti.com (8.13.7/8.13.7) with ESMTP id oB18sKb3014778 for ; Wed, 1 Dec 2010 02:54:20 -0600 (CST) Received: from psmtp.com (na3sys009amx221.postini.com [74.125.149.61]) by medina.ext.ti.com (8.13.7/8.13.7) with SMTP id oB18sK1r000798 for ; Wed, 1 Dec 2010 02:54:20 -0600 Received: from source ([209.85.212.173]) by na3sys009amx221.postini.com ([74.125.148.10]) with SMTP; Wed, 01 Dec 2010 08:54:20 GMT Received: by pxi16 with SMTP id 16so1256774pxi.4 for ; Wed, 01 Dec 2010 00:54:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=md4RJgvnI5cz84sZLMBx+e1EGv8mTmZbpDfgyAAl6aw=; b=HUluAaA2339Ve0cdVXzQJsjVEv2+PhiWpUhdUR3YXsEjYneDfQ7VmiP/G6K09Dni1t SfJIlLvO1rzCsX+wWP3fz/FjUsB9634JqVMVsihSFKvBFsWxFKAPyfbDT7M6gEErDLTv Xsc2z75P3rXDxtmpRquBKCpx1ZWUrK/cUP2+w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=DQdqAqiZl6+7zJWSEuIvs69gRLiu6u9S+81dwLOxyXjDxPSMdGs9KsgdwVJbUS+Fbz yh3ShhGcmD+MxHL04KMWlpvmKxAoerM09F/N1vW6IKtXzcMtMb46CO7ZoWP7lVBTL12S FD4Y5xufs90EoyGy6UZCaDF0IWbIva3SNuAfc= Received: by 10.142.179.5 with SMTP id b5mr8418666wff.225.1291193659994; Wed, 01 Dec 2010 00:54:19 -0800 (PST) Received: from localhost ([122.167.113.84]) by mx.google.com with ESMTPS id w14sm10155601wfd.6.2010.12.01.00.54.17 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 01 Dec 2010 00:54:19 -0800 (PST) From: Subhasish Ghosh To: davinci-linux-open-source@linux.davincidsp.com Subject: [PATCH 2/2] da850-evm: Board file modifications TI's PRU CAN. Date: Wed, 1 Dec 2010 14:35:15 +0530 Message-Id: <1291194315-4629-2-git-send-email-subhasish@mistralsolutions.com> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1291194315-4629-1-git-send-email-subhasish@mistralsolutions.com> References: <1291194315-4629-1-git-send-email-subhasish@mistralsolutions.com> X-pstn-neptune: 0/0/0.00/0 X-pstn-levels: (S:70.68832/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: m-watkins@ti.com, Subhasish Ghosh 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@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com X-Greylist: Sender succeeded STARTTLS authentication, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 01 Dec 2010 08:56:17 +0000 (UTC) diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index f89b0b7..3563a46 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c @@ -43,6 +43,7 @@ #define DA850_MMCSD_CD_PIN GPIO_TO_PIN(4, 0) #define DA850_MMCSD_WP_PIN GPIO_TO_PIN(4, 1) +#define DA850_PRU_CAN_TRX_PIN GPIO_TO_PIN(2, 0) #define DA850_MII_MDIO_CLKEN_PIN GPIO_TO_PIN(2, 6) @@ -188,6 +189,41 @@ static struct platform_device *da850_evm_devices[] __initdata = { &da850_evm_norflash_device, }; +const short da850_pru_can_pins[] = { + DA850_PRU0_R31_0, DA850_PRU1_R30_15, DA850_PRU1_R31_18, + -1 +}; + +static int __init da850_evm_setup_pru_can(void) +{ + int ret; + + if (!machine_is_davinci_da850_evm()) + return 0; + + ret = davinci_cfg_reg_list(da850_pru_can_pins); + if (ret) + pr_warning("da850_evm_init: da850_pru_can_pins mux setup" + "failed:%d\n", ret); + + ret = davinci_cfg_reg(DA850_GPIO2_0); + if (ret) + pr_warning("da850_evm_init:GPIO(2,0) mux setup " + "failed\n"); + + /* value = 0 to enable the CAN transceiver */ + ret = gpio_request_one(DA850_PRU_CAN_TRX_PIN, GPIOF_OUT_INIT_LOW, "pru_can_en"); + if (ret) + pr_warning("Cannot setup GPIO %d\n", DA850_PRU_CAN_TRX_PIN); + + ret = da8xx_register_pru_can(); + if (ret) + pr_warning("da850_evm_init: pru can registration failed:" + "%d\n", ret); + return ret; +} +device_initcall(da850_evm_setup_pru_can); + #define DA8XX_AEMIF_CE2CFG_OFFSET 0x10 #define DA8XX_AEMIF_ASIZE_16BIT 0x1