Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Apr 2019 10:59:18 +0900 (JST)
From:      Mori Hiroki <yamori813@yahoo.co.jp>
To:        Emmanuel Vadot <manu@bidouilliste.com>, Ian Lepore <ian@freebsd.org>
Cc:        "freebsd-mips@freebsd.org" <freebsd-mips@freebsd.org>
Subject:   Re: spigen problem
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> <c05a6d77563c5d332a108272654ef75f74c88067.camel@freebsd.org> <20190429202357.79ac2d8dba8d0bed1caa8203@bidouilliste.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <manu@bidouilliste.com>
> To: Ian Lepore <ian@freebsd.org>
> Cc: "freebsd-mips@freebsd.org" <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 <ian@freebsd.org> 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 <ian@freebsd.org> 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 <manu@bidouilliste.com> <manu@freebsd.org>
> _______________________________________________
> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?130153476.2287928.1556589558764.JavaMail.yahoo>