From patchwork Fri May 2 21:05:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junfeng Feng X-Patchwork-Id: 4105291 Return-Path: X-Original-To: patchwork-davinci@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 BA1C89F1E1 for ; Fri, 2 May 2014 21:06:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A025820253 for ; Fri, 2 May 2014 21:06:37 +0000 (UTC) Received: from devils.ext.ti.com (devils.ext.ti.com [198.47.26.153]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BC9FD20173 for ; Fri, 2 May 2014 21:06:35 +0000 (UTC) Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id s42L5LOH032298; Fri, 2 May 2014 16:05:21 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s42L5KJu018806; Fri, 2 May 2014 16:05:20 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.174.1; Fri, 2 May 2014 16:05:20 -0500 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s42L5JQa003374; Fri, 2 May 2014 16:05:19 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 2EAC080627; Fri, 2 May 2014 16:05:19 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflxv17.itg.ti.com (dflxv17.itg.ti.com [128.247.5.93]) by linux.omap.com (Postfix) with ESMTP id 4B2E780626 for ; Fri, 2 May 2014 16:05:17 -0500 (CDT) Received: from white.ext.ti.com (white.ext.ti.com [192.94.93.38]) by dflxv17.itg.ti.com (8.14.3/8.13.8) with ESMTP id s42L5HHf008410 for ; Fri, 2 May 2014 16:05:17 -0500 Received: from mail6.bemta8.messagelabs.com (mail6.bemta8.messagelabs.com [216.82.243.55]) by white.ext.ti.com (8.13.7/8.13.7) with ESMTP id s42L5GMd006558 for ; Fri, 2 May 2014 16:05:16 -0500 Received: from [216.82.242.147:49489] by server-17.bemta-8.messagelabs.com id DF/AB-09669-C8804635; Fri, 02 May 2014 21:05:16 +0000 X-Env-Sender: jfeng@evertz.com X-Msg-Ref: server-14.tower-95.messagelabs.com!1399064714!29881687!1 X-Originating-IP: [204.187.63.106] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 26730 invoked from network); 2 May 2014 21:05:14 -0000 Received: from mail.evertz.com (HELO mail.evertz.com) (204.187.63.106) by server-14.tower-95.messagelabs.com with SMTP; 2 May 2014 21:05:14 -0000 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-Class: urn:content-classes:message MIME-Version: 1.0 Subject: IGMP issue with Davinci kernel 2.6.31 Date: Fri, 2 May 2014 17:05:13 -0400 Message-ID: In-Reply-To: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: IGMP issue with Davinci kernel 2.6.31 Thread-Index: Ac9mKBLqh7EcWNFAQ02Dl9bQH/FvawAIXmgA References: From: Junfeng Feng To: 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: , Sender: Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 Hello there, Right now, I try to support the IGMP functionality on Davinci. I have configured the option CONFIG_IP_MULTICAST. But when I try to join or leave one multicast group, I did not see the multicast traffic. For comparison, I have tried the same test program on Netra chip with kernel 2.6.37 and there is multicast message there. Have anyone encountered the same issue before? Thanks. Regards, Junfeng -----Original Message----- From: davinci-linux-open-source-bounces+jfeng=evertz.com@linux.davincidsp.com [mailto:davinci-linux-open-source-bounces+jfeng=evertz.com@linux.davinci dsp.com] On Behalf Of davinci-linux-open-source-request@linux.davincidsp.com Sent: Friday, May 02, 2014 1:00 PM To: davinci-linux-open-source@linux.davincidsp.com Subject: Davinci-linux-open-source Digest, Vol 101, Issue 1 Send Davinci-linux-open-source mailing list submissions to davinci-linux-open-source@linux.davincidsp.com To subscribe or unsubscribe via the World Wide Web, visit http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source or, via email, send a message with subject or body 'help' to davinci-linux-open-source-request@linux.davincidsp.com You can reach the person managing the list at davinci-linux-open-source-owner@linux.davincidsp.com When replying, please edit your Subject line so it is more specific than "Re: Contents of Davinci-linux-open-source digest..." Today's Topics: 1. [PATCH] i2c: davinci: Add block read functionality for IPMI (Murali Karicheri) ---------------------------------------------------------------------- Message: 1 Date: Thu, 1 May 2014 14:49:46 -0400 From: Murali Karicheri To: , , Cc: Wolfram Sang , Kevin Hilman , Santosh Shilimkar , Garrett Ding Subject: [PATCH] i2c: davinci: Add block read functionality for IPMI Message-ID: <1398970186-12204-1-git-send-email-m-karicheri2@ti.com> Content-Type: text/plain Intelligent Plaform Management Interface (IPMI) requires I2C driver to support block read, where the first byte received from slave is the length of following data:- Added length check if the read type is block read (I2C_M_RECV_LEN) Send NACK/STOP bits before last byte is received Signed-off-by: Garrett Ding Signed-off-by: Murali Karicheri Tested-by: Garrett Ding CC: Sekhar Nori CC: Kevin Hilman CC: Wolfram Sang CC: Santosh Shilimkar --- Tested on a customer board based on K2HK SoC drivers/i2c/busses/i2c-davinci.c | 42 +++++++++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 5 deletions(-) davinci_i2c_write_reg(dev, DAVINCI_I2C_CNT_REG, dev->buf_len); @@ -456,7 +466,7 @@ i2c_davinci_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num) static u32 i2c_davinci_func(struct i2c_adapter *adap) { - return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL; + return I2C_CAPABILITIES; } static void terminate_read(struct davinci_i2c_dev *dev) @@ -528,10 +538,32 @@ static irqreturn_t i2c_davinci_isr(int this_irq, void *dev_id) case DAVINCI_I2C_IVR_RDR: if (dev->buf_len) { - *dev->buf++ = - davinci_i2c_read_reg(dev, - DAVINCI_I2C_DRR_REG); + *dev->buf++ = davinci_i2c_read_reg(dev, + DAVINCI_I2C_DRR_REG); + /* + * check if the first received byte is message + * length, i.e, I2C_M_RECV_LEN + */ + if (dev->buf_len == 0xffff) + dev->buf_len = *(dev->buf - 1) + 1; + dev->buf_len--; + /* + * send NACK/STOP bits BEFORE last byte is + * received + */ + if (dev->buf_len == 1) { + w = davinci_i2c_read_reg(dev, + DAVINCI_I2C_MDR_REG); + w |= DAVINCI_I2C_MDR_NACK; + davinci_i2c_write_reg(dev, + DAVINCI_I2C_MDR_REG, w); + + w |= DAVINCI_I2C_MDR_STP; + davinci_i2c_write_reg(dev, + DAVINCI_I2C_MDR_REG, w); + } + if (dev->buf_len) continue; -- 1.7.9.5 ------------------------------ diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c index 389bc68..cd97920 100644 --- a/drivers/i2c/busses/i2c-davinci.c +++ b/drivers/i2c/busses/i2c-davinci.c @@ -97,6 +97,10 @@ #define DAVINCI_I2C_IMR_NACK BIT(1) #define DAVINCI_I2C_IMR_AL BIT(0) +/* capabilities */ +#define I2C_CAPABILITIES (I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL | \ + I2C_FUNC_SMBUS_READ_BLOCK_DATA) + struct davinci_i2c_dev { struct device *dev; void __iomem *base; @@ -318,7 +322,13 @@ i2c_davinci_xfer_msg(struct i2c_adapter *adap, struct i2c_msg *msg, int stop) davinci_i2c_write_reg(dev, DAVINCI_I2C_SAR_REG, msg->addr); dev->buf = msg->buf; - dev->buf_len = msg->len; + + /* if first received byte is length, set buf_len = 0xffff as flag */ + if (msg->flags & I2C_M_RECV_LEN) + dev->buf_len = 0xffff; + else + dev->buf_len = msg->len; + dev->stop = stop;