From owner-freebsd-mips@freebsd.org Mon Apr 29 18:13:46 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 44AC5159819B for ; Mon, 29 Apr 2019 18:13:46 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound3d.ore.mailhop.org (outbound3d.ore.mailhop.org [54.186.57.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C2C88EF61 for ; Mon, 29 Apr 2019 18:13:45 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1556561624; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=oUcLk4tnxH9WnWlu9k03HdGFYARdH5fvSioAHJx/E8lsFiRRo0gktpjKHg46dBMNvmoewMo6jTF4n TuYlIqxUnPEpvZ6rfmS2lfpUYd7U1JrBZSblGSWuuaSj/UPHM4GW/CZvbTpOrmNgrHvRq71ahCsMZA +D42Xut3o91HRvZf2lu2FdvBB2Wh4YU0dpHMD7n9XteIe72RwHIE89sqXIzzBLTYbFZ8HComVG+wrz iRSrsEvnf5IC3CJyuZB+fozO5Q80Z1CfzdHAT4MoLAJyTFz9XeP9MZFdvMZRuFNJabkhImNrK7kb1h NqDVEeTnA0zWd5dcmu+GxQUqNRdUfXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=QKkwxb6cWjhn2UCrCGcgr2Jpq5WMPtxVdxjFHaLpW00=; b=KEFtPe1ytUNkpjYsG8+Setq8nhq4TYAnpVjS8BYLZ5x9CHn9x3URJl/sdnZeOr8vXDlVmBKa+ks3J FA5cmLmLhNhcATXbSA5BTQ6g6jkYT4EPTyITQ6Q6VQFPl8nSbKSBl3Ofor0o+IkJHBdL8A0Cp80LTX 2DwPnhMfVxqFNvnz2sqEC/8EWgC0wy8xeng4QXprbjjDAPtPjaDpIfgRrVCMx/RocmVpRWk4+nXiBG 1cv1ukz0UDEY/578VcCoo1XBKZMJvBRJYH9YgDiTL7Ac1BoUb58nK1mD3Sj83CLuCQzL30VpBfqILy ljC0Lk57q5clX0trHeO31AVhGUG3I6A== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=QKkwxb6cWjhn2UCrCGcgr2Jpq5WMPtxVdxjFHaLpW00=; b=pawPOoaEN15M4yi5KPZKqw2IXoxTRryGGh9gMNA2xNAiVKwOdvahfGABmUKkXBgS2OoKiomw9D7wd ZohrxFe4b8V4h/dZ7D/CYy4fslq7MjswTln0KXh6PFAJY/XZL+wVfq3XZXHwX2hPBy9Pynx2AkLTuq yPEcYh7YbcQavifU7niw7gl1D9bMa60Va6wqt0nY1mR6HmL8FEL7v/wI07mSmQ1qYvnXAxwZ0sHtWT Ni0C0KuWxWmb14YGlx/HMMewP6O3Wd3se6WKC/dMMMsjP3lRcnRMOttcI2mm7fxbQAndD/HNyJd3yD w1XOv17oOWvEyntp64iLDlCij/N+QfQ== X-MHO-RoutePath: aGlwcGll X-MHO-User: 84b525b2-6aaa-11e9-990e-673a89bc4518 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id 84b525b2-6aaa-11e9-990e-673a89bc4518; Mon, 29 Apr 2019 18:13:43 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x3TIDfHY003813; Mon, 29 Apr 2019 12:13:41 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: spigen problem From: Ian Lepore To: Emmanuel Vadot Cc: Mori Hiroki , "freebsd-mips@freebsd.org" Date: Mon, 29 Apr 2019 12:13:41 -0600 In-Reply-To: <20190429195750.409e9d13aea2ff1654a20d3c@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> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 7C2C88EF61 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; ASN(0.00)[asn:16509, ipnet:54.186.0.0/15, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,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: Mon, 29 Apr 2019 18:13:46 -0000 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