<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/drivers/i2c, branch v2019.07</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<entry>
<title>i2c: stm32f7: improve loopback in timing algorithm</title>
<updated>2019-05-23T09:36:47+00:00</updated>
<author>
<name>Nicolas Le Bayon</name>
<email>nicolas.le.bayon@st.com</email>
</author>
<published>2019-04-18T15:32:43+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=5237f37e5c35052533588fe0a53febad2f047d70'/>
<id>5237f37e5c35052533588fe0a53febad2f047d70</id>
<content type='text'>
This avoids useless loops inside the I2C timing algorithm.
Actually, we support only one possible solution per prescaler value.
So after finding a solution with a prescaler, the algorithm can
switch directly to the next prescaler value.

Signed-off-by: Nicolas Le Bayon &lt;nicolas.le.bayon@st.com&gt;
Reviewed-by: Patrick DELAUNAY &lt;patrick.delaunay@st.com&gt;
Signed-off-by: Patrick Delaunay &lt;patrick.delaunay@st.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This avoids useless loops inside the I2C timing algorithm.
Actually, we support only one possible solution per prescaler value.
So after finding a solution with a prescaler, the algorithm can
switch directly to the next prescaler value.

Signed-off-by: Nicolas Le Bayon &lt;nicolas.le.bayon@st.com&gt;
Reviewed-by: Patrick DELAUNAY &lt;patrick.delaunay@st.com&gt;
Signed-off-by: Patrick Delaunay &lt;patrick.delaunay@st.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>i2c: stm32f7: Fix SDADEL minimum formula</title>
<updated>2019-05-23T09:36:47+00:00</updated>
<author>
<name>Nicolas Le Bayon</name>
<email>nicolas.le.bayon@st.com</email>
</author>
<published>2019-04-18T15:32:42+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=e87da7521f922e3d0f6aaa6b162e872f8f39c649'/>
<id>e87da7521f922e3d0f6aaa6b162e872f8f39c649</id>
<content type='text'>
It conforms with Reference Manual I2C timing section.

Signed-off-by: Nicolas Le Bayon &lt;nicolas.le.bayon@st.com&gt;
Reviewed-by: Patrick DELAUNAY &lt;patrick.delaunay@st.com&gt;
Signed-off-by: Patrick Delaunay &lt;patrick.delaunay@st.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It conforms with Reference Manual I2C timing section.

Signed-off-by: Nicolas Le Bayon &lt;nicolas.le.bayon@st.com&gt;
Reviewed-by: Patrick DELAUNAY &lt;patrick.delaunay@st.com&gt;
Signed-off-by: Patrick Delaunay &lt;patrick.delaunay@st.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge git://git.denx.de/u-boot-mpc83xx</title>
<updated>2019-05-21T11:13:35+00:00</updated>
<author>
<name>Tom Rini</name>
<email>trini@konsulko.com</email>
</author>
<published>2019-05-21T11:13:35+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=e1a2ed7180adeefb6164239a18249dca5701319d'/>
<id>e1a2ed7180adeefb6164239a18249dca5701319d</id>
<content type='text'>
- Update MPC83xx platform support to current best practices, etc.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Update MPC83xx platform support to current best practices, etc.
</pre>
</div>
</content>
</entry>
<entry>
<title>i2c: ihs: Improve error handling</title>
<updated>2019-05-21T05:52:34+00:00</updated>
<author>
<name>Mario Six</name>
<email>mario.six@gdsys.cc</email>
</author>
<published>2019-01-28T08:45:58+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=482c76e7c386da683e2fc5b6f939fc8d80a0f186'/>
<id>482c76e7c386da683e2fc5b6f939fc8d80a0f186</id>
<content type='text'>
Improve the error handling and reporting of the IHS I2C driver.

Signed-off-by: Mario Six &lt;mario.six@gdsys.cc&gt;
Reviewed-by: Heiko Schocher &lt;hs@denx.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Improve the error handling and reporting of the IHS I2C driver.

Signed-off-by: Mario Six &lt;mario.six@gdsys.cc&gt;
Reviewed-by: Heiko Schocher &lt;hs@denx.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>i2c: ihs: Get rid of fpgamap</title>
<updated>2019-05-21T05:52:34+00:00</updated>
<author>
<name>Mario Six</name>
<email>mario.six@gdsys.cc</email>
</author>
<published>2019-01-28T08:45:57+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=98e4249f97ab5784c5f9e281519c7277c0b7588c'/>
<id>98e4249f97ab5784c5f9e281519c7277c0b7588c</id>
<content type='text'>
Since the IHS I2C driver want upstream, the surrounding infrastructure
has changed quite a bit (notably, the fpgamap driver was replaced with a
regmap driver).

Update the driver to work with these changes.

Signed-off-by: Mario Six &lt;mario.six@gdsys.cc&gt;
Reviewed-by: Heiko Schocher &lt;hs@denx.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since the IHS I2C driver want upstream, the surrounding infrastructure
has changed quite a bit (notably, the fpgamap driver was replaced with a
regmap driver).

Update the driver to work with these changes.

Signed-off-by: Mario Six &lt;mario.six@gdsys.cc&gt;
Reviewed-by: Heiko Schocher &lt;hs@denx.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>i2c: mxc: Hide kconfig based control in DM_I2C mode</title>
<updated>2019-05-17T03:35:24+00:00</updated>
<author>
<name>Trent Piepho</name>
<email>tpiepho@impinj.com</email>
</author>
<published>2019-05-08T23:30:06+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=ca0a8f3e8c5920485e9ab2ebba30a01b901f6bb7'/>
<id>ca0a8f3e8c5920485e9ab2ebba30a01b901f6bb7</id>
<content type='text'>
These options only apply when not using DM_I2C.  When using device
trees, the dt will enable and control the speeds of the I2C
controller(s) and these configuration options have no effect.

So disable them in DM_I2C mode.  Otherwise they show up as decoys, and
make it look like one is enabling I2C controllers and setting the speed
when really it's doing nothing.

However, a system using a SPL build will not use DM_I2C in the SPL, even
if DM_I2C is enabled for the main u-boot.  And so the SPL might use the
kconfig based I2C speed controls while the main u-boot does not.

Cc: Sriram Dash &lt;sriram.dash@nxp.com&gt;
Cc: Priyanka Jain &lt;priyanka.jain@nxp.com&gt;
Cc: Heiko Schocher &lt;hs@denx.de&gt;
Signed-off-by: Trent Piepho &lt;tpiepho@impinj.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These options only apply when not using DM_I2C.  When using device
trees, the dt will enable and control the speeds of the I2C
controller(s) and these configuration options have no effect.

So disable them in DM_I2C mode.  Otherwise they show up as decoys, and
make it look like one is enabling I2C controllers and setting the speed
when really it's doing nothing.

However, a system using a SPL build will not use DM_I2C in the SPL, even
if DM_I2C is enabled for the main u-boot.  And so the SPL might use the
kconfig based I2C speed controls while the main u-boot does not.

Cc: Sriram Dash &lt;sriram.dash@nxp.com&gt;
Cc: Priyanka Jain &lt;priyanka.jain@nxp.com&gt;
Cc: Heiko Schocher &lt;hs@denx.de&gt;
Signed-off-by: Trent Piepho &lt;tpiepho@impinj.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>i2c: mxc_i2c: Fix read and read-&gt;write xfers in DM mode</title>
<updated>2019-05-17T03:35:23+00:00</updated>
<author>
<name>Trent Piepho</name>
<email>tpiepho@impinj.com</email>
</author>
<published>2019-04-30T16:08:19+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=c854933f50307f7abcb0280f93f8b2bba70b1ddb'/>
<id>c854933f50307f7abcb0280f93f8b2bba70b1ddb</id>
<content type='text'>
This is an old driver that supports both device mapped and non-mapped
mode, and covers a wide range of hardware.  It's hard to change without
risking breaking something.  I have to tried to be exceedingly detailed
in this patch, so please excuse the length of the commit essay that
follows.

In device mapped mode the I2C xfer function does not handle plain read,
and some other, transfers correctly.

What it can't handle are transactions that:
    Start with a read, or,
    Have a write followed by a read, or,
    Have more than one read in a row.

The common I2C/SMBUS read register and write register transactions
always start with a write, followed by a write or a read, and then end.
These work, so the bug is not apparent for most I2C slaves that only use
these common xfer forms.

The existing xfer loop initializes by sending the chip address in write
mode after it deals with bus arbitration and master setup.  When
processing each message, if the next message will be a read, it sends a
repeated start followed by the chip address in read mode after the
current message.

Obviously, this does not work if the first message is a read, as the
chip is always addressed in write mode initially by i2c_init_transfer().

A write following a read does not work because the repeated start is
only sent when the next message is a read.  There is no logic to send it
when the current message is a read and next is write.  It should be sent
every time the bus changes direction.

The ability to use a plain read was added to this driver in
commit 2feec4eafd40 ("imx: mxc_i2c: tweak the i2c transfer method"),
but this applied only the non-DM code path.

This patch fixes the DM code path.  The xfer function will call
i2c_init_transfer() with an alen of -1 to avoid sending the chip
address.  The same way the non-DM code achieves this.  The xfer
function's message loop will send the address and mode before each
message if the bus changes direction, and on the first message.

When reading data, the master hardware is one byte ahead of what we
receive.  I.e., reading a byte from the data register returns a byte
*already received* by the master, and causes the master to start the RX
of the *next* byte.  Therefor, before we read the final byte of a
message, we must tell the master what to do next.  I add a "last" flag
to i2c_read_data() to tell it if the message is to be followed by a stop
or a repeated start.  When last == true it acts exactly as before.

The non-DM code can only create an xfer where the read, if any, is the
final message of the xfer.  And so the only callsite of i2c_read_data()
in the non-DM code has the "last" parameter as true.  Therefore, this
change has no effect on the non-DM code.  As all other changes are in
the DM xfer function, which is not even compiled in non-DM code, I am
confident that this patch has no effect on boards not using I2C_DM.
This greatly reduces the range of hardware that could be affected.

For DM boards, I have verified every transaction the "i2c" command can
create on a scope and they are all exactly as they are supposed to be.
I also tested write-&gt;read-&gt;write, which isn't possible with the i2c
command, and it works as well.  I didn't fix multiple reads in a row, as
it's a lot more invasive and obviously no one has every wanted them
since they've never worked.  It didn't seem like the extra complexity
was justified to support something no one uses.

Cc: Nandor Han &lt;nandor.han@ge.com&gt;
Cc: Heiko Schocher &lt;hs@denx.de&gt;
Cc: Stefano Babic &lt;sbabic@denx.de&gt;
Cc: Fabio Estevam &lt;festevam@gmail.com&gt;
Cc: Breno Matheus Lima &lt;brenomatheus@gmail.com&gt;
Signed-off-by: Trent Piepho &lt;tpiepho@impinj.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is an old driver that supports both device mapped and non-mapped
mode, and covers a wide range of hardware.  It's hard to change without
risking breaking something.  I have to tried to be exceedingly detailed
in this patch, so please excuse the length of the commit essay that
follows.

In device mapped mode the I2C xfer function does not handle plain read,
and some other, transfers correctly.

What it can't handle are transactions that:
    Start with a read, or,
    Have a write followed by a read, or,
    Have more than one read in a row.

The common I2C/SMBUS read register and write register transactions
always start with a write, followed by a write or a read, and then end.
These work, so the bug is not apparent for most I2C slaves that only use
these common xfer forms.

The existing xfer loop initializes by sending the chip address in write
mode after it deals with bus arbitration and master setup.  When
processing each message, if the next message will be a read, it sends a
repeated start followed by the chip address in read mode after the
current message.

Obviously, this does not work if the first message is a read, as the
chip is always addressed in write mode initially by i2c_init_transfer().

A write following a read does not work because the repeated start is
only sent when the next message is a read.  There is no logic to send it
when the current message is a read and next is write.  It should be sent
every time the bus changes direction.

The ability to use a plain read was added to this driver in
commit 2feec4eafd40 ("imx: mxc_i2c: tweak the i2c transfer method"),
but this applied only the non-DM code path.

This patch fixes the DM code path.  The xfer function will call
i2c_init_transfer() with an alen of -1 to avoid sending the chip
address.  The same way the non-DM code achieves this.  The xfer
function's message loop will send the address and mode before each
message if the bus changes direction, and on the first message.

When reading data, the master hardware is one byte ahead of what we
receive.  I.e., reading a byte from the data register returns a byte
*already received* by the master, and causes the master to start the RX
of the *next* byte.  Therefor, before we read the final byte of a
message, we must tell the master what to do next.  I add a "last" flag
to i2c_read_data() to tell it if the message is to be followed by a stop
or a repeated start.  When last == true it acts exactly as before.

The non-DM code can only create an xfer where the read, if any, is the
final message of the xfer.  And so the only callsite of i2c_read_data()
in the non-DM code has the "last" parameter as true.  Therefore, this
change has no effect on the non-DM code.  As all other changes are in
the DM xfer function, which is not even compiled in non-DM code, I am
confident that this patch has no effect on boards not using I2C_DM.
This greatly reduces the range of hardware that could be affected.

For DM boards, I have verified every transaction the "i2c" command can
create on a scope and they are all exactly as they are supposed to be.
I also tested write-&gt;read-&gt;write, which isn't possible with the i2c
command, and it works as well.  I didn't fix multiple reads in a row, as
it's a lot more invasive and obviously no one has every wanted them
since they've never worked.  It didn't seem like the extra complexity
was justified to support something no one uses.

Cc: Nandor Han &lt;nandor.han@ge.com&gt;
Cc: Heiko Schocher &lt;hs@denx.de&gt;
Cc: Stefano Babic &lt;sbabic@denx.de&gt;
Cc: Fabio Estevam &lt;festevam@gmail.com&gt;
Cc: Breno Matheus Lima &lt;brenomatheus@gmail.com&gt;
Signed-off-by: Trent Piepho &lt;tpiepho@impinj.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>i2c: mxc_i2c: Document how non-DM functions work</title>
<updated>2019-05-17T03:35:23+00:00</updated>
<author>
<name>Trent Piepho</name>
<email>tpiepho@impinj.com</email>
</author>
<published>2019-04-30T16:08:18+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=6314b3c7c3acbb81471e2f525c82660ebab5b2fb'/>
<id>6314b3c7c3acbb81471e2f525c82660ebab5b2fb</id>
<content type='text'>
It is not very clear how these work in relation to the exact I2C xfers
they produce.  In paticular, the address length is somewhat overloaded
in the read method.  Clearly document the existing behavior.  Maybe this
will help the next person who needs to work on this driver and not break
non-DM boards.

Cc: Nandor Han &lt;nandor.han@ge.com&gt;
Cc: Heiko Schocher &lt;hs@denx.de&gt;
Cc: Stefano Babic &lt;sbabic@denx.de&gt;
Cc: Fabio Estevam &lt;festevam@gmail.com&gt;
Cc: Breno Matheus Lima &lt;brenomatheus@gmail.com&gt;
Signed-off-by: Trent Piepho &lt;tpiepho@impinj.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It is not very clear how these work in relation to the exact I2C xfers
they produce.  In paticular, the address length is somewhat overloaded
in the read method.  Clearly document the existing behavior.  Maybe this
will help the next person who needs to work on this driver and not break
non-DM boards.

Cc: Nandor Han &lt;nandor.han@ge.com&gt;
Cc: Heiko Schocher &lt;hs@denx.de&gt;
Cc: Stefano Babic &lt;sbabic@denx.de&gt;
Cc: Fabio Estevam &lt;festevam@gmail.com&gt;
Cc: Breno Matheus Lima &lt;brenomatheus@gmail.com&gt;
Signed-off-by: Trent Piepho &lt;tpiepho@impinj.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge git://git.denx.de/u-boot-marvell</title>
<updated>2019-05-03T18:22:23+00:00</updated>
<author>
<name>Tom Rini</name>
<email>trini@konsulko.com</email>
</author>
<published>2019-05-03T18:22:23+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=90c2ebd2156982eee1af6faa00f6740e9f79b3c5'/>
<id>90c2ebd2156982eee1af6faa00f6740e9f79b3c5</id>
<content type='text'>
- Fix in kwbimage (return code checking) (Young Xiao)
- Misc updates to Turris Omnia (Marek)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Fix in kwbimage (return code checking) (Young Xiao)
- Misc updates to Turris Omnia (Marek)
</pre>
</div>
</content>
</entry>
<entry>
<title>i2c: mvtwsi: fix reading status register after interrupt</title>
<updated>2019-05-03T06:14:39+00:00</updated>
<author>
<name>Marek Behún</name>
<email>marek.behun@nic.cz</email>
</author>
<published>2019-05-02T14:53:38+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=d50e29662f78be5e0843ce1e0c5d818b6a74cc98'/>
<id>d50e29662f78be5e0843ce1e0c5d818b6a74cc98</id>
<content type='text'>
The twsi_wait function reads the control register for interrupt flag,
and if interrupt flag is present, it immediately reads status register.

On our device this sometimes causes bad value being read from status
register, as if the value was not yet updated.

My theory is that the controller does approximately this:
  1. sets interrupt flag in control register,
  2. sets the value of status register,
  3. causes an interrupt

In U-Boot we do not use interrupts, so I think that it is possible that
sometimes the status register in the twsi_wait function is read between
points 1 and 2.

The bug does not appear if I add a small delay before reading status
register.

Wait 100ns (which in U-Boot currently means 1 us, because ndelay(i)
function calls udelay(DIV_ROUND_UP(i, 1000))) before reading the status
register.

Signed-off-by: Marek Behún &lt;marek.behun@nic.cz&gt;
Reviewed-by: Heiko Schocher &lt;hs@denx.de&gt;
Reviewed-by: Stefan Roese &lt;sr@denx.de&gt;
Cc: Mario Six &lt;mario.six@gdsys.cc&gt;
Cc: Baruch Siach &lt;baruch@tkos.co.il&gt;
Signed-off-by: Stefan Roese &lt;sr@denx.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The twsi_wait function reads the control register for interrupt flag,
and if interrupt flag is present, it immediately reads status register.

On our device this sometimes causes bad value being read from status
register, as if the value was not yet updated.

My theory is that the controller does approximately this:
  1. sets interrupt flag in control register,
  2. sets the value of status register,
  3. causes an interrupt

In U-Boot we do not use interrupts, so I think that it is possible that
sometimes the status register in the twsi_wait function is read between
points 1 and 2.

The bug does not appear if I add a small delay before reading status
register.

Wait 100ns (which in U-Boot currently means 1 us, because ndelay(i)
function calls udelay(DIV_ROUND_UP(i, 1000))) before reading the status
register.

Signed-off-by: Marek Behún &lt;marek.behun@nic.cz&gt;
Reviewed-by: Heiko Schocher &lt;hs@denx.de&gt;
Reviewed-by: Stefan Roese &lt;sr@denx.de&gt;
Cc: Mario Six &lt;mario.six@gdsys.cc&gt;
Cc: Baruch Siach &lt;baruch@tkos.co.il&gt;
Signed-off-by: Stefan Roese &lt;sr@denx.de&gt;
</pre>
</div>
</content>
</entry>
</feed>
