From owner-freebsd-mips@freebsd.org Sun May 19 16:04:07 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 CF25215B1A08 for ; Sun, 19 May 2019 16:04:06 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-yw1-xc32.google.com (mail-yw1-xc32.google.com [IPv6:2607:f8b0:4864:20::c32]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BE88C6AB7F; Sun, 19 May 2019 16:04:05 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-yw1-xc32.google.com with SMTP id a130so4825907ywe.13; Sun, 19 May 2019 09:04:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5vXHk/FqwIJ2fetouAL6mXtAwPEBhzBZ346e9BcEQVI=; b=Yj2FuJgabHF+5sypk5wW48+EKxZQB9DvzvUqLou7i77iwXoT2giaTjNqOmllXwMKPS pmVqM8PeVfwfB+emvZ5/0mHhMqWQO5lhTzFsCsPoAupfP0l1k6FvZDiUG4EYyPE4UXkK J96b7x4ohMun2xIY7V8F4B1+oIbP4B2ckaxzH4Fa34i3Qyv/CLmGYcwJ2xguiqg4Yupn 2GUUZ7A060Hf+Iwh2IVXMBbIluCmzd7GCrwO/hIEHYgEXK1FADfa/PfggPvArM58zdKm m0pt7N88C2J6z3UKkk6IoyufLMGfDe4v6Yrj7ngEXAL9gV6zn0Yh7DBdEhbizwQedSki 63Og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5vXHk/FqwIJ2fetouAL6mXtAwPEBhzBZ346e9BcEQVI=; b=lIIXzRTAbW3zMtZxacXzjrICWh3hHTXc8kf/kNID8zqojEBrYTWedlbeAG+ze9vhVq ZANL14OtFEB03PMnAY1MgpN1NIF4TtjuYBrhib7oYeEaYPSnXKmlJp6ST9AhQEjPC7BG KZg5ND2NHX859hp6Gu7lUn90ZaE4Znhlrcu5akIVoCQ7iLHsqMUuurK4mFqQE+0J3H4G Qwdz35eNizm0qiUfqEDyARC1kTMcWnK45DiekwUO3XNa3mnydLmlzcCUzilyobIqEP7M meQRSW+teKENVGRd57bpc+2St+PLlko2ieojpbctm4tRvwGWrAIzBBOVqD8ZAcR0oU9Y 61Dg== X-Gm-Message-State: APjAAAXoowd+lHpt1Cvk3QNyymzoGUsIhgsKgiWRnYIOtGEdBnKxmSrw EHz7ncpZwUUSSaeQyFAh3vrbSw0qEVsxW8Tm9qk= X-Google-Smtp-Source: APXvYqzqwuUMVcniJNpIrD+AxVTLGd/HQcQWkydqEwlGcUhuBOhpv140YyoGIPvatqZ3Kq+kVavlp0XrMc8ODtWx3gU= X-Received: by 2002:a81:3217:: with SMTP id y23mr31656204ywy.386.1558281845058; Sun, 19 May 2019 09:04:05 -0700 (PDT) MIME-Version: 1.0 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> <130153476.2287928.1556589558764.JavaMail.yahoo@jws700105.mail.ssk.yahoo.co.jp> In-Reply-To: <130153476.2287928.1556589558764.JavaMail.yahoo@jws700105.mail.ssk.yahoo.co.jp> From: Adrian Chadd Date: Sun, 19 May 2019 09:03:53 -0700 Message-ID: Subject: Re: spigen problem To: Mori Hiroki Cc: Emmanuel Vadot , Ian Lepore , "freebsd-mips@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: BE88C6AB7F X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=Yj2FuJga; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of adrianchadd@gmail.com designates 2607:f8b0:4864:20::c32 as permitted sender) smtp.mailfrom=adrianchadd@gmail.com X-Spamd-Result: default: False [-6.71 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-0.90)[-0.903,0]; FREEMAIL_TO(0.00)[yahoo.co.jp]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(-2.80)[ip: (-8.38), ipnet: 2607:f8b0::/32(-3.26), asn: 15169(-2.27), country: US(-0.06)]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2.3.c.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; 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: Sun, 19 May 2019 16:04:07 -0000 hi! this looks ok to me. I'll go commit this tonight. -a On Mon, 29 Apr 2019 at 19:03, Mori Hiroki wrote: > > 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 > > > > 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 > > _______________________________________________ > > freebsd-mips@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/freebsd-mips > > To unsubscribe, send any mail to > > "freebsd-mips-unsubscribe@freebsd.org" > > > > _______________________________________________ > freebsd-mips@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-mips > To unsubscribe, send any mail to "freebsd-mips-unsubscribe@freebsd.org"