From owner-freebsd-mips@freebsd.org Mon Apr 29 18:24:00 2019 Return-Path: Delivered-To: freebsd-mips@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AF5015986F1 for ; Mon, 29 Apr 2019 18:24:00 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 961E88FD59; Mon, 29 Apr 2019 18:23:59 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id 2d6397f1; Mon, 29 Apr 2019 20:23:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=Uss3K4EOxhK0Z7C8ch8CE/msmNU=; b=APhAuJW1x3GSgIc/NMBr4xs8VFg1 4QXqYuff9jplXHFyZ83cmovEE0C1oXGO/o8l2aIVvj1iPcdW2xq/RqrosbrX+fgt o3z+4ILW8qiPoC3r6V9TyhpgzL0+7HT0sjF2FKqwu40n6oMT4SFMlGnUpsOaK/oq GE8WFJh2lLlD/4A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=hMT57OGY9NIuVt3sdg16agUuVhK+ZzjVcnflpBRj1jmjtHJdP+sUL7Vv 3KXPz0QvNgCFhp56Q8NbduMk6aN2w34qOWcAb/+lGcllXUx5MbLrnZlFdTPCoBa5 M7GErgXOKDw3clKWaVeTi+WX8NYAl/JPFq3ieQKKJRT6zuaQbeY= Received: from skull.home.blih.net (ip-9.net-89-3-105.rev.numericable.fr [89.3.105.9]) by mail.blih.net (OpenSMTPD) with ESMTPSA id c5a87848 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Mon, 29 Apr 2019 20:23:57 +0200 (CEST) Date: Mon, 29 Apr 2019 20:23:57 +0200 From: Emmanuel Vadot To: Ian Lepore Cc: "freebsd-mips@freebsd.org" Subject: Re: spigen problem Message-Id: <20190429202357.79ac2d8dba8d0bed1caa8203@bidouilliste.com> In-Reply-To: References: <1991993923.530828.1556558314174.JavaMail.yahoo.ref@jws704008.mail.kks.yahoo.co.jp> <1991993923.530828.1556558314174.JavaMail.yahoo@jws704008.mail.kks.yahoo.co.jp> <22b68b094cbe7ab1b07673e43f6473906bd2d648.camel@freebsd.org> <20190429195750.409e9d13aea2ff1654a20d3c@bidouilliste.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 961E88FD59 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bidouilliste.com header.s=mail header.b=APhAuJW1; spf=pass (mx1.freebsd.org: domain of manu@bidouilliste.com designates 212.83.177.182 as permitted sender) smtp.mailfrom=manu@bidouilliste.com X-Spamd-Result: default: False [0.66 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; R_DKIM_ALLOW(-0.20)[bidouilliste.com:s=mail]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:212.83.177.182/32]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DMARC_NA(0.00)[bidouilliste.com]; NEURAL_SPAM_SHORT(0.71)[0.706,0]; NEURAL_HAM_LONG(-0.36)[-0.360,0]; NEURAL_HAM_MEDIUM(-0.16)[-0.163,0]; DKIM_TRACE(0.00)[bidouilliste.com:+]; RCPT_COUNT_TWO(0.00)[2]; MX_GOOD(-0.01)[cached: mx-backup.blih.net]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; IP_SCORE(0.39)[ip: (-0.82), ipnet: 212.83.160.0/19(2.95), asn: 12876(-0.17), country: FR(-0.01)]; ASN(0.00)[asn:12876, ipnet:212.83.160.0/19, country:FR]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 18:24:00 -0000 On Mon, 29 Apr 2019 12:13:41 -0600 Ian Lepore wrote: > On Mon, 2019-04-29 at 19:57 +0200, Emmanuel Vadot wrote: > > On Mon, 29 Apr 2019 11:34:34 -0600 > > Ian Lepore wrote: > > > > > On Tue, 2019-04-30 at 02:18 +0900, Mori Hiroki wrote: > > > > Hi > > > > > > > > I add small spi lcd on RT3050. This lcd controller is S6D0151. > > > > > > > > S6D0151 transfer is tree byte command then tree byte data. > > > > > > > > I use spigen mruby rapper. This rapper use SPIGENIOC_TRANSFER. > > > > > > > > I try to send tree byte command. But spi transfer is six byte. > > > > > > > > This is reason. > > > > > > > > sys/dev/spibus/spigen.c > > > > > > > > error = copyin(st->st_command.iov_base, transfer.tx_cmd, > > > > transfer.tx_cmd_sz = transfer.rx_cmd_sz = st- > > > > > st_command.iov_len); > > > > > > > > > > > > This lcd not work six byte transfer. > > > > > > > > How do I fix this ? > > > > > > > > Regards > > > > > > > > Hiroki Mori > > > > > > > > > > I'm not sure what you mean by "This is the reason", that code sets > > > up > > > the transfer for exactly as many bytes as you requested in > > > st_command.iov_len. If you set that to three bytes, only three > > > bytes > > > will be transfered. > > > > > > -- Ian > > > > I guess that Mori-San wants to transfer 3 bytes but receive 6, if > > it's > > that you need to set tx_cmd_sz with dummy bytes count too. The tx > > buffer will also need to contain the dummy bytes values. > > > > If you mean send 3 command bytes and read back 3 response bytes, then > set st_command.iov_len to 3 and st_data.iov_len to 3. > > -- Ian Ah right, forgot about command/data being splitted. -- Emmanuel Vadot