From patchwork Mon Jan 3 14:04:24 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Subhasish Ghosh X-Patchwork-Id: 447681 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 p03DpAKY026550 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 3 Jan 2011 13:51:31 GMT Received: from dlep35.itg.ti.com ([157.170.170.118]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id p03Dp9F5024562 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 3 Jan 2011 07:51:09 -0600 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep35.itg.ti.com (8.13.7/8.13.7) with ESMTP id p03Dp6Bq020722 for ; Mon, 3 Jan 2011 07:51:07 -0600 (CST) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id BCA218064F for ; Mon, 3 Jan 2011 07:51:05 -0600 (CST) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp52.itg.ti.com (dflp52.itg.ti.com [128.247.22.96]) by linux.omap.com (Postfix) with ESMTP id 2760680626 for ; Mon, 3 Jan 2011 07:50:59 -0600 (CST) Received: from medina.ext.ti.com (localhost [127.0.0.1]) by dflp52.itg.ti.com (8.13.7/8.13.7) with ESMTP id p03Dow6x015946 for ; Mon, 3 Jan 2011 07:50:58 -0600 (CST) Received: from psmtp.com (na3sys009amx164.postini.com [74.125.149.90]) by medina.ext.ti.com (8.13.7/8.13.7) with SMTP id p03DowhQ013459 for ; Mon, 3 Jan 2011 07:50:58 -0600 Received: from source ([74.125.83.193]) by na3sys009amx164.postini.com ([74.125.148.10]) with SMTP; Mon, 03 Jan 2011 08:50:58 EST Received: by pvg11 with SMTP id 11so1978355pvg.4 for ; Mon, 03 Jan 2011 05:50:58 -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=pfviQg41sakpKsDofRy4yst53U/lcoBd/e7U7Y/rmHs=; b=gA6/j9b9Vg17w1YdQioYb7TShalMdDpNYDhECwaXXjEBzIA+q/D2ww18jH5B64x0h2 SQu8EO4R1xwZw7nqce71XljzvT1pKo/b6Bju8gbgPVLI1vT3RaRXK7oC1ltcqEsfrJ3n 1WXdq8cBRgsgOwn125vWzi2RHNxBsvpEycds8= 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=C4riY74rSsC+ZTqUhvlQOp03ckKY92GakkCvYRfZSaRMosQDvb7Sp1RRf7X6wz8kKa rTUe/xMxd+x9dnqC0BplQQktBCEz79PXSgxt2RDQP/Wimcu/mUsgw2SKBaCZA57qmBuh kUhmPDn/YXeEfADZespSGjcn6RbCxsMwOH9C0= Received: by 10.142.12.14 with SMTP id 14mr16634218wfl.146.1294062657769; Mon, 03 Jan 2011 05:50:57 -0800 (PST) Received: from localhost ([59.97.0.30]) by mx.google.com with ESMTPS id y42sm29365677wfd.22.2011.01.03.05.50.54 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 03 Jan 2011 05:50:57 -0800 (PST) From: Subhasish Ghosh To: davinci-linux-open-source@linux.davincidsp.com Subject: [RFC: PATCH 2/5] da850: Board file modifications TI's PRU CAN. Date: Mon, 3 Jan 2011 19:34:24 +0530 Message-Id: <1294063467-22465-2-git-send-email-subhasish@mistralsolutions.com> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1294063467-22465-1-git-send-email-subhasish@mistralsolutions.com> References: <1294063467-22465-1-git-send-email-subhasish@mistralsolutions.com> X-pstn-neptune: 0/0/0.00/0 X-pstn-levels: (S:66.44846/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, sshtylyov@mvista.com, Subhasish 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.3 (demeter1.kernel.org [140.211.167.41]); Mon, 03 Jan 2011 13:51:32 +0000 (UTC) diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index b01fb2a..f44d184 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c @@ -45,6 +45,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) @@ -190,6 +191,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