Wake up sequence of crypto - atmel-i2c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jianhui,
(CC: crypto and i2c sub-systems)


I am trying to use ATECC608B chip
(it is compatible with ATECC508), but no luck so far.

Specifically, it fails in atmel_i2c_wakeup() in
drivers/crypto/atmel-i2c.c


I have a question about your commit.


commit 2638268fa9ebe4f13a8aee89044719f2084f80c8
Author: Jianhui Zhao <zhaojh329@xxxxxxxxx>
Date:   Tue Mar 10 20:25:51 2020 +0800

    crypto: atmel-i2c - Fix wakeup fail




Datasheet [1] page 40 says this:
 The Wake condition requires that either the system processor manually
 drives the SDA pin low for tWLO, or a data byte of 0x00 be transmitted
 at a clock rate sufficiently slow so that SDA is low for a minimum
 period of tWLO. When the device is awake, the normal processor I2C
 hardware and/or software can be used for device communications up to
 and including the I/O sequence required, thus putting the device
 back into low power (i.e. sleep) mode.




To pull down the SDA pin for the period of tWLO,
atmel_i2c_wakeup() sends long enough zero data.
(3 byte for 400KHz, 1 byte for 100kHz)

However, it relies on the i2c controller understanding
I2C_M_IGNORE_NAK, correct?

Not all i2c controllers can do I2C_M_IGNORE_NAK.

In my case, the SoC is IMX8MM, and the driver is
drivers/i2c/busses/i2c-imx.c, which does not handle
I2C_M_IGNORE_NAK flag.

If I2C_M_IGNORE_NAK is not recognized, the controller
sends the slave address and nobody responds
(as the ATECC chip is in the sleep state), then the
controller quits without sending zero data.

I guess that is the reason why atmel_i2c_wakeup()
does not work for me.

Am I correct?


[1] https://content.arduino.cc/assets/mkr-microchip_atecc508a_cryptoauthentication_device_summary_datasheet-20005927a.pdf





-- 
Best Regards
Masahiro Yamada



[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]
  Powered by Linux