From owner-freebsd-mips@freebsd.org Tue Apr 30 02:02:49 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 5CC3A15A450D for ; Tue, 30 Apr 2019 02:02:49 +0000 (UTC) (envelope-from yamori813@yahoo.co.jp) Received: from nh502-vm10.bullet.mail.kks.yahoo.co.jp (nh502-vm10.bullet.mail.kks.yahoo.co.jp [183.79.56.155]) by mx1.freebsd.org (Postfix) with SMTP id A1C2B875C9 for ; Tue, 30 Apr 2019 02:02:46 +0000 (UTC) (envelope-from yamori813@yahoo.co.jp) Received: from [183.79.100.138] by nh502.bullet.mail.kks.yahoo.co.jp with NNFMP; 30 Apr 2019 01:59:20 -0000 Received: from [183.79.100.136] by t501.bullet.mail.kks.yahoo.co.jp with NNFMP; 30 Apr 2019 01:59:20 -0000 Received: from [127.0.0.1] by omp505.mail.kks.yahoo.co.jp with NNFMP; 30 Apr 2019 01:59:20 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 7045.32235.bm@omp505.mail.kks.yahoo.co.jp X-YMail-OSG: o2lBzDIVM1k9N0Bd_csdnblxDGy8Pxsj9MjPE4BHlsqvqsGVyAVbYhJ8BIsIUa8 QJsaxF7yuEfDu5FGhyu7k7T56juT5n.tME1H6T9Lkyhamdtoi3OCAVJQkHu4nKd87WYtoyaeXixl qci1VinN4lXiw.Clm.3Xucxk3DhXhtxlCk8Uy9xQDse_4M3VHJE57Fi2DbazI6yG3HcHX4j5FPTv ebghu7mdsnoTmxLZByLNPaxAIBPQVaofCgVBOK0j9X4UUr6ljdFsLlZOcHviPhOzrNHhCN0sy87r k.GUlsDtDbiVICFXtrUCt2HABHNrpryRPm0ssz5iIUrS7PbqeX06tWGLYv_z6hLJAJDV2Puq8eKn BVsbMpg7KrDactgPPRurwSW2xmFfiYDV3EvIbnjYQA_mnThqErfYk2jyKtR1jWf5cg_bIhQwgIfg EHlHb04zDKiJuIxyU7xR93Cv8Z4C2W3D1x_gzvvJeyxkDXyDy099INouJTuFdq.cy1dUURcu19F4 BHf7BpO0yUycY6xO54gk.lCYk6VRs0i3_IS48k5zK03lQQV8D1KTMTf5PsVtT4yk_Nl7hO_bSZPU 4zt21Axl27vfENxmVma5OmXuHsDPdoYnEKhvTe4jVIg-- Received: from jws700105.mail.ssk.yahoo.co.jp by sendmailws612.mail.ssk.yahoo.co.jp; Tue, 30 Apr 2019 10:59:19 +0000; 1556589559.375 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1556589559; s=yj20110701; d=yahoo.co.jp; h=Date:From:Reply-To:To:Cc:Message-ID:In-Reply-To:References:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=Ac+pQ0N2JtOw24la+1wbYyiE+I5KiVMSiDNbBgk4cj4=; b=pn1flooNdsKfuJ3gPejH8xFN5aIDuq6HCB7f0QV/7Oa5Oy2KYmMOVbTMZvsj9ECe +cz4SpjqrbE7KbqRg5sYR2l300uQhTb8x83hkotw9HYkQpA6N+5JgQ/o3HjuSoZSwsf xinY5f/qPZASl3PeXBhy7hYKiynkzKVyEvymx1uY= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=yj20110701; d=yahoo.co.jp; h=Date:From:Reply-To:Cc:Message-ID:In-Reply-To:References:MIME-Version:Content-Type:Content-Transfer-Encoding; b=VQD3FFp6oKasU8RU56Melq4hZv9C8TNNIE1SxDzNvS2Aidc7C/YvMSBkGdhRth4e 4bbhIGtUcdzESNEXZOogeSAQ8qP0XIPqJ/asZ+2JRqOIrT35wxDNiPYiF2kAE/GkgDe wv5Pp/Oo0k07TKd8jD4Y1c8sz4UBhMbZSRej6hbg=; Date: Tue, 30 Apr 2019 10:59:18 +0900 (JST) From: Mori Hiroki Reply-To: Mori Hiroki To: Emmanuel Vadot , Ian Lepore Cc: "freebsd-mips@freebsd.org" Message-ID: <130153476.2287928.1556589558764.JavaMail.yahoo@jws700105.mail.ssk.yahoo.co.jp> In-Reply-To: <20190429202357.79ac2d8dba8d0bed1caa8203@bidouilliste.com> 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> <20190429202357.79ac2d8dba8d0bed1caa8203@bidouilliste.com> Subject: Re: spigen problem MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: A1C2B875C9 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.co.jp header.s=yj20110701 header.b=pn1flooN; dmarc=pass (policy=none) header.from=yahoo.co.jp; spf=pass (mx1.freebsd.org: domain of yamori813@yahoo.co.jp designates 183.79.56.155 as permitted sender) smtp.mailfrom=yamori813@yahoo.co.jp X-Spamd-Result: default: False [-0.63 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; HAS_REPLYTO(0.00)[yamori813@yahoo.co.jp]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:183.79.56.0/23]; FREEMAIL_FROM(0.00)[yahoo.co.jp]; MX_GOOD(-0.01)[cached: mx3.mail.yahoo.co.jp]; DKIM_TRACE(0.00)[yahoo.co.jp:+]; DMARC_POLICY_ALLOW(-0.50)[yahoo.co.jp,none]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.co.jp]; ASN(0.00)[asn:24572, ipnet:183.79.0.0/16, country:JP]; IP_SCORE(0.87)[ipnet: 183.79.0.0/16(2.46), asn: 24572(1.97), country: JP(-0.06)]; DWL_DNSWL_NONE(0.00)[yahoo.co.jp.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.37)[-0.368,0]; R_DKIM_ALLOW(-0.20)[yahoo.co.jp:s=yj20110701]; RCVD_COUNT_FIVE(0.00)[5]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; REPLYTO_EQ_FROM(0.00)[]; NEURAL_HAM_LONG(-0.68)[-0.679,0]; MIME_GOOD(-0.10)[text/plain]; FREEMAIL_REPLYTO(0.00)[yahoo.co.jp]; NEURAL_SPAM_SHORT(0.46)[0.458,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[155.56.79.183.list.dnswl.org : 127.0.5.0] 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: Tue, 30 Apr 2019 02:02:49 -0000 Hi. I'm sorry. This is mtk_spi_v1.c issue. Current code hard depend flash access. I add workadound for this code and put review. https://reviews.freebsd.org/D20101 Thanks Hiroki Mori ----- Original Message ----- > From: Emmanuel Vadot > To: Ian Lepore > Cc: "freebsd-mips@freebsd.org" > Date: 2019/4/30, Tue 03:23 > Subject: Re: spigen problem >=20 > On Mon, 29 Apr 2019 12:13:41 -0600 > Ian Lepore wrote: >=20 >>=C2=A0=C2=A0On Mon, 2019-04-29 at 19:57 +0200, Emmanuel Vadot wrote: >>=C2=A0=C2=A0> On Mon, 29 Apr 2019 11:34:34 -0600 >>=C2=A0=C2=A0> Ian Lepore wrote: >>=C2=A0=C2=A0>=20 >>=C2=A0=C2=A0> > On Tue, 2019-04-30 at 02:18 +0900, Mori Hiroki wrote: >>=C2=A0=C2=A0> > > Hi >>=C2=A0=C2=A0> > >=20 >>=C2=A0=C2=A0> > > I add small spi lcd on RT3050. This lcd controller is= =20 > S6D0151. >>=C2=A0=C2=A0> > >=20 >>=C2=A0=C2=A0> > > S6D0151 transfer is tree byte command then tree byte da= ta. >>=C2=A0=C2=A0> > >=20 >>=C2=A0=C2=A0> > > I use spigen mruby rapper. This rapper use=20 > SPIGENIOC_TRANSFER. >>=C2=A0=C2=A0> > >=20 >>=C2=A0=C2=A0> > > I try to send tree byte command. But spi transfer is si= x=20 > byte. >>=C2=A0=C2=A0> > >=20 >>=C2=A0=C2=A0> > > This is reason. >>=C2=A0=C2=A0> > >=20 >>=C2=A0=C2=A0> > > sys/dev/spibus/spigen.c >>=C2=A0=C2=A0> > >=20 >>=C2=A0=C2=A0> > >=C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0=C2=A0error =3D copyin(= st->st_command.iov_base,=20 > transfer.tx_cmd, >>=C2=A0=C2=A0> > >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 transfer.tx_cm= d_sz =3D transfer.rx_cmd_sz =3D st- >>=C2=A0=C2=A0> > > > st_command.iov_len);=C2=A0=20 >>=C2=A0=C2=A0> > >=20 >>=C2=A0=C2=A0> > >=20 >>=C2=A0=C2=A0> > > This lcd not work six byte transfer. >>=C2=A0=C2=A0> > >=20 >>=C2=A0=C2=A0> > > How do I fix this ? >>=C2=A0=C2=A0> > >=20 >>=C2=A0=C2=A0> > > Regards >>=C2=A0=C2=A0> > >=20 >>=C2=A0=C2=A0> > > Hiroki Mori >>=C2=A0=C2=A0> > >=20 >>=C2=A0=C2=A0> >=20 >>=C2=A0=C2=A0> > I'm not sure what you mean by "This is the reason",=20 > that code sets >>=C2=A0=C2=A0> > up >>=C2=A0=C2=A0> > the transfer for exactly as many bytes as you requested i= n >>=C2=A0=C2=A0> > st_command.iov_len.=C2=A0 If you set that to three bytes,= only three >>=C2=A0=C2=A0> > bytes >>=C2=A0=C2=A0> > will be transfered. >>=C2=A0=C2=A0> >=20 >>=C2=A0=C2=A0> > -- Ian >>=C2=A0=C2=A0>=20 >>=C2=A0=C2=A0>=C2=A0 I guess that Mori-San wants to transfer 3 bytes but r= eceive 6, if >>=C2=A0=C2=A0> it's >>=C2=A0=C2=A0> that you need to set tx_cmd_sz with dummy bytes count too. = The tx >>=C2=A0=C2=A0> buffer will also need to contain the dummy bytes values. >>=C2=A0=C2=A0>=20 >>=20 >>=C2=A0=C2=A0If you mean send 3 command bytes and read back 3 response byt= es, then >>=C2=A0=C2=A0set st_command.iov_len to 3 and st_data.iov_len to 3. >>=20 >>=C2=A0=C2=A0-- Ian >=20 > Ah right, forgot about command/data being splitted. >=20 > --=20 > Emmanuel Vadot > _______________________________________________ > freebsd-mips@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-mips > To unsubscribe, send any mail to=20 > "freebsd-mips-unsubscribe@freebsd.org" >=20