Commit Graph

15549 Commits

Author SHA1 Message Date
Sam Protsenko
116cffeca6 mmc: Fix timeout values passed to mmc_wait_dat0()
mmc_wait_dat0() expects timeout argument to be in usec units. But some
overlying functions operate on timeout in msec units. Convert timeout
from msec to usec when passing it to mmc_wait_dat0().

This fixes 'avb' commands on BeagleBoard X15, because next chain was
failing:

    get_partition() -> mmc_switch_part() -> __mmc_switch() ->
    mmc_wait_dat0()

when passing incorrect timeout from __mmc_switch() to mmc_wait_dat0().

Fixes: bb98b8c5c0 ("mmc: During a switch, poll on dat0 if available and check the final status")
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Reviewed-by: Eugeniu Rosca <rosca.eugeniu@gmail.com>
Tested-by: Eugeniu Rosca <rosca.eugeniu@gmail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Tested-by: Igor Opaniuk <igor.opaniuk@gmail.com>
Reviewed-by: Igor Opaniuk <igor.opaniuk@gmail.com>
2019-09-05 15:27:31 +08:00
Andy Yan
701a51e1ef dm: mmc: remove unused U_BOOT_DRIVER(mmc)
When look through the code, I found this bare metal
drives is not used, so remove it.

Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2019-09-05 15:27:31 +08:00
Tom Rini
f65fb411ed Merge tag 'for-v2019.10-v2' of https://gitlab.denx.de/u-boot/custodians/u-boot-i2c
i2c bugfixes for 2019.10 take 2
- i2c: mxc: add CONFIG_CLK support
  If CONFIG_CLK is enabled use clk framework for clock settings.
2019-09-03 07:16:05 -04:00
Rick Chen
4fa4267d82 dm: cache: add v5l2 cache controller driver
Add a v5l2 cache controller driver that is usually found on
Andes RISC-V ae350 platform. It will parse the cache settings
from the dtb.

In this version tag and data ram control timing can be adjusted
by the requirement from the dtb.

Signed-off-by: Rick Chen <rick@andestech.com>
Cc: KC Lin <kclin@andestech.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2019-09-03 09:31:03 +08:00
Rick Chen
abd858e575 dm: cache: Add enable and disable ops for sandbox and test
Add cache enable and disable ops for test coverage.

Signed-off-by: Rick Chen <rick@andestech.com>
Cc: KC Lin <kclin@andestech.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2019-09-03 09:31:03 +08:00
Rick Chen
4d0140ee1a dm: cache: Add enable and disable ops for cache uclass
Add cache enable/disable ops to the DM cache uclass driver

Signed-off-by: Rick Chen <rick@andestech.com>
Cc: KC Lin <kclin@andestech.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2019-09-03 09:31:03 +08:00
Bin Meng
4dfea4b5cd riscv: cpu: Skip unavailable hart in the get_count() op
We should not count in hart that is marked as not available in the
device tree in riscv_cpu_get_count().

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Rick Chen <rick@andestech.com>
Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
2019-09-03 09:29:43 +08:00
Peng Fan
6dba0864ec i2c: mxc: add CONFIG_CLK support
When CONFIG_CLK enabled, use CLK UCLASS for clk related settings.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Tested-by: Frieder Schrempf <frieder.schrempf@kontron.de>

hs: removed hunk in mxc_i2c_probe() as not longer in code
2019-09-02 06:35:08 +02:00
Tom Rini
d22c8be964 Merge branch 'master' of git://git.denx.de/u-boot-sh
- r8a66597 usb changes
2019-09-01 13:33:12 -04:00
Weijie Gao
47b7fa30c4 mmc: invalidate block cache after hwpart switched successfully
eMMC device has multiple hw partitions both address from zero. However the
mmc driver lacks block cache invalidation for switch hwpart. This causes a
problem that data of current hw partition is cached before switching to
another hw partition. And the following read operation of the latter hw
partition will get wrong data when reading from the addresses that have
been cached previously.

To solve this problem, invalidate block cache after a successful
mmc_switch_part() operation.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Felix Brack <fb@ltec.ch>
2019-08-30 14:17:11 -04:00
Weijie Gao
1ce884797c Revert "blk: Invalidate block cache when switching hwpart"
This reverts commit 0ebe112d09.

Most block devices have only one hwpart. Multiple hwparts only found used
by eMMC devices in u-boot. The mmc driver do blk_dselect_hwpart() at the
beginning of mmc_bread() which causes block cache being invalidated too
frequently and makes block cache useless.

So it's not a good idea to put blkcache_invalidate() in the common
functions. It should be called inside mmc_select_hwpart().

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Felix Brack <fb@ltec.ch>
2019-08-30 14:17:11 -04:00
Tom Rini
25f32e0dff Merge https://gitlab.denx.de/u-boot/custodians/u-boot-mpc85xx
Enable DM PCI for T2080RDB, T4240RDB, T1024RDB, T1042D4RDB, P1020RDB,
P2020RDB, P2041RDB, P3041DS, P4080DS, and MPC8548CDS
2019-08-29 07:26:13 -04:00
Tom Rini
80505e59df - add missing g12b clock driver compatible, fixing odroid-n2 usb support
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEPVPGJshWBf4d9CyLd9zb2sjISdEFAl1mOIYACgkQd9zb2sjI
 SdFsTBAAjtaTPRmZ/e1wPdseIbVrTf/a4nssqezTvjR3GR3oG4B3tgxUItkS0iHk
 E7IGT2PAcgIuiSVXWF/JQzqCZf9QcUmXB57I1ELHfk5NwuFtWjx9+NnCcCToLSl/
 LPjmEMicRe2dtRF039JvXqA4grVqwbyF27vk44mZMiojwgMgjFRQCTz1G7JhdW1z
 5/pIPBk1HrO7tCJjwIDhuEb5qlJD404rO3XiocAHHnIFRhenzfoctrKYG7PdxTgX
 cCTGvSlp22lIv40PZVGaG0GKGLjBihnA1X7RmO1mJ4M1qqq1FmB1HJGzt42qdEzL
 wWWoVJUz5kft92jzI43XtulqHJ2TzwhstaawAoMyupTfHgctUl4gDtqGtFwiMNNq
 EKOfpLn3qkfLSFG21M8i9pVGtv+i7F1tDAxaWQU6xrKUzmLg5Dkuf5v/6RRZNCOJ
 x33ItJJjZleZfdRweWATC4GiD1T/nMkKDToGjDg6NzjwH+5uyxCbNjJQG7n+gman
 ou1HjbVuQNcA3sYZs5DukVMy7HwVo6deVq3TlrtWHxZE2zJ2s6UTp3sWfAy/EoXu
 Ukl8yXXQluu/IprkUmeZjsEbIPn2o8zT56kTeoc0I87G1bad9WKiq/F+uW2VkPNx
 SwI2zW7Gn8T6EOW/6QICxc66z0MFwrlFBa0rgzenkUlzUaK+L30=
 =rJnq
 -----END PGP SIGNATURE-----

Merge tag 'u-boot-amlogic-20190828' of https://gitlab.denx.de/u-boot/custodians/u-boot-amlogic

- add missing g12b clock driver compatible, fixing odroid-n2 usb support
2019-08-29 07:25:48 -04:00
Hou Zhiqiang
92e025c6e1 dm: pcie_fsl: Add MPC8548 PCIe support
Add compatible string for MPC8548 PCIe.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
2019-08-28 13:47:47 +05:30
Hou Zhiqiang
5274459628 dm: pcie_fsl: Add P5040 PCIe support
Add compatible string for P5040 PCIe.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
2019-08-28 13:47:47 +05:30
Hou Zhiqiang
7b7e4e1b7e dm: pcie_fsl: Add P4080 PCIe support
Add compatible string for P4080 PCIe.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
2019-08-28 13:47:46 +05:30
Hou Zhiqiang
096d5f8015 dm: pcie_fsl: Add P3041 PCIe support
Add compatible string for P3041 PCIe.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
2019-08-28 13:47:46 +05:30
Hou Zhiqiang
1a92802e32 dm: pcie_fsl: Add P2041 PCIe support
Add compatible string for P2041 PCIe.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
2019-08-28 13:47:46 +05:30
Hou Zhiqiang
ba827365f7 dm: pcie_fsl: Add PCIe support for P1 and P2 series SoCs
Add compatible string for PCIe of P1020, P1021, P1024, P1025
and P2020 SoCs.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
2019-08-28 13:47:45 +05:30
Hou Zhiqiang
4392ddbbbb dm: pcie_fsl: Add T104x PCIe support
Add compatible string for T104x PCIe.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
2019-08-28 13:47:45 +05:30
Hou Zhiqiang
a8c79f6189 dm: pcie_fsl: Add T102x PCIe support
Add compatible string for T102x PCIe.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
2019-08-28 13:47:45 +05:30
Hou Zhiqiang
9acc038b39 dm: pcie_fsl: Add T4240 PCIe support
Add compatible string for T4240 PCIe.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
2019-08-28 13:47:45 +05:30
Hou Zhiqiang
fbcb2ff5c6 dm: pcie_fsl: Fix the calculation of controller index
The PCIe controller register address in CCSR is different
on various platforms, the current code erroneously use
the hardcoded address (0xffe240000) and stride (0x10000)
to calculate the controller's index.

Fix it by adding the related info to the driver data
structure.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
2019-08-28 13:47:44 +05:30
Hou Zhiqiang
d18d06ac35 dm: pcie_fsl: Fix the Class Code fixup function
The Class Code fixup method was changed from PCIe block
revision 3.0, the current fixup is only valid for the
revision 3.0 and the later ones.

So add the Class Code fixup for the block revision < 3.0.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
2019-08-28 13:47:44 +05:30
Hou Zhiqiang
adc983b4d6 dm: pcie_fsl: Convert IS_ENABLED() run-time checking to #ifdef
This can avoid build error:
The macro in brackets of the IS_ENABLED(CONFIG_FOO) is only
defined on the platforms that select the CONFIG_FOO, while
it's not defined on platforms that do not select the
CONFIG_FOO.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
2019-08-28 13:47:44 +05:30
Mark Kettenis
d0e8c4ad51 clk: meson-g12b: add compatible
The G12B clock controller is almost identical to the G12A and
so far the differences don't matter.  Adding the G12B compatible
makes USB work on the Odroid-N2.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2019-08-28 10:14:31 +02:00
Tom Rini
8c56ea5c1e Merge branch 'u-boot-stm32_20190827' of https://gitlab.denx.de/u-boot/custodians/u-boot-stm
- Fixes and update related to STM32MP1 platforms
2019-08-27 13:19:47 -04:00
Tom Rini
e4b8dd9b34 Merge https://gitlab.denx.de/u-boot/custodians/u-boot-mpc85xx
Support of device tree model for T2080RDB, T4240RDB, T1024RDB,
T1042D4RDB, P1020RDB, P2020RDB, P2041RDB, P3041DS, P4080DS, P5040DS and
MPC8548CDS. Also support of  i2c dm model.
2019-08-27 07:11:37 -04:00
Patrick Delaunay
5d2901a4b6 stm32mp1: Add remoteproc support for m4 coprocessor
Alignment with kernel patch proposal for binding:

[PATCH v4 0/8] stm32 m4 remoteproc on STM32MP157c
https://lkml.org/lkml/2019/5/14/159

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2019-08-27 11:19:23 +02:00
Patrick Delaunay
1323470b74 misc: change RCC form MISC to NOP uclass
The RCC driver have no operation so the new NOP uclass
is more appropriate. It only used as parent for clock and reset driver.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2019-08-27 11:19:23 +02:00
Patrick Delaunay
ef32dcf119 stpmic1: simplify stpmic1_sysreset_request
Retrieve parent device from dev->parent instead of
calling uclass_get_device_by_driver()

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2019-08-27 11:19:23 +02:00
Patrick Delaunay
234a60244c pmu: stpmic1: change specific NVM api to MISC
Use MISC u-class to export the NVM register (starting at 0xF8 offset)
and avoid specific API.
- SHADOW have offset < 0.
- NVM have register > 0

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2019-08-27 11:19:23 +02:00
Patrick Delaunay
0c8620d2ff bsec: update after MISC u-class update
Since the commit 8729b1ae2c ("misc: Update read() and
write() methods to return bytes xfered"); The misc bsec driver
need to be adapted to reflect the number of transferred bytes.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2019-08-27 11:19:23 +02:00
Patrick Delaunay
4de076ed09 stm32mp1: clk: use gd to store frequency information
Use existing gd structure to store frequency information
which can be used in drivers or arch without new request.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2019-08-27 11:19:23 +02:00
Patrick Delaunay
7879a7d09c stm32mp1: clk: remove debug traces
Remove many debug trace.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2019-08-27 11:19:23 +02:00
Patrick Delaunay
757bca8d19 stm32mp1: ram: add pattern parameter in infinite write test
Add pattern for infinite test_read and test_write, that
allow to change the pattern to test without recompilation;
default pattern is 0xA5A5AA55.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2019-08-27 11:19:23 +02:00
Patrick Delaunay
25331ae1c1 stm32mp1: ram: reload watchdog during ddr test
Avoid watchdog during infinite DDR test.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2019-08-27 11:19:23 +02:00
Patrick Delaunay
37f41ae900 stm32mp1: ram: update loop management in infinite test
Reduce verbosity of the infinite tests to avoid CubeMX issue.
test and display loop by 1024*1024 accesses: read or write.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2019-08-27 11:19:23 +02:00
Patrick Delaunay
4b0496fe79 stm32mp1: ram: fix address issue in 2 tests
If user choose to test memory size is 1GByte (0x40000000),
memory address would overflow in test "Random" and
test "FrequencySelectivePattern".
Thus the system would hangs up when running DDR test.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Bossen WU <bossen.wu@st.com>
2019-08-27 11:19:23 +02:00
Patrick Delaunay
375c28ac76 stm32mp1: ram: cosmetic: remove unused prototype
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2019-08-27 11:19:23 +02:00
Patrick Delaunay
132518f36b serial: stm32: add Framing error support
Add management of Bit 1 of USART_ISR = FE: Framing error
This bit is set by hardware when a de-synchronization, excessive noise
or a break character is detected. It is cleared by software, writing 1
to the FECF bit in the USART_ICR register (for stm32 after f4).

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2019-08-27 11:19:23 +02:00
Christophe Kerello
48ac723a6f mmc: stm32_sdmmc2: reload watchdog
This patch solves a watchdog reset issue during mmc erase command.

Signed-off-by: Christophe Kerello <christophe.kerello@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2019-08-27 11:19:23 +02:00
Patrick Delaunay
abee80d789 pinctrl: stmfx: update pinconf settings
Alignment with kernel driver.

According to the following tab (coming from STMFX datasheet), updates
have to done in stmfx_pinctrl_conf_set function:

-"type" has to be set when "bias" is configured as "pull-up or pull-down"
-PIN_CONFIG_DRIVE_PUSH_PULL should only be used when gpio is configured as
 output. There is so no need to check direction.

  DIR | TYPE | PUPD | MFX GPIO configuration
  ----|------|------|---------------------------------------------------
  1   | 1    | 1    | OUTPUT open drain with internal pull-up resistor
  ----|------|------|---------------------------------------------------
  1   | 1    | 0    | OUTPUT open drain with internal pull-down resistor
  ----|------|------|---------------------------------------------------
  1   | 0    | 0/1  | OUTPUT push pull no pull
  ----|------|------|---------------------------------------------------
  0   | 1    | 1    | INPUT with internal pull-up resistor
  ----|------|------|---------------------------------------------------
  0   | 1    | 0    | INPUT with internal pull-down resistor
  ----|------|------|---------------------------------------------------
  0   | 0    | 1    | INPUT floating
  ----|------|------|---------------------------------------------------
  0   | 0    | 0    | analog (GPIO not used, default setting)

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2019-08-27 09:36:56 +02:00
Patrice Chotard
7385826475 pinctrl: pinctrl_stm32: cosmetic: Reorder include files
Reorder include files

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2019-08-27 09:36:56 +02:00
Patrick Delaunay
fed51572c8 rtc: stm32: manage 2 digit limitation on year
STM32 RTC manages only 2 digits for YEAR
(Year tens and units in BCD format in RTC_DR register).

With this patch, RTC driver assumes that tm->tm_years is between
2000 and 2099; tm->tm_year - 2000 have only 2 digit
(0 > and <= 99).

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2019-08-27 09:36:56 +02:00
Patrice Chotard
2e01fcf17c mmc: sti_sdhci: Fix sdhci_setup_cfg() call.
host->mmc, host->mmc->dev and host->mmc->priv must be set
before calling sdhci_setup_cfg() to avoid hang during mmc
initialization.

Thanks to commit 3d296365e4
("mmc: sdhci: Add support for sdhci-caps-mask") which put
this issue into evidence.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2019-08-27 09:36:56 +02:00
Patrice Chotard
23441fbf2b mmc: stm32_sdmmc2: Increase SDMMC_BUSYD0END_TIMEOUT_US
Increase SDMMC_BUSYD0END_TIMEOUT_US from 1s to 2s to
avoid timeout error during blocks erase on some sdcard

Issue seen on Kingston 16GB :
  Device: STM32 SDMMC2
  Manufacturer ID: 27
  OEM: 5048
  Name: SD16G
  Bus Speed: 50000000
  Mode: SD High Speed (50MHz)
  card capabilities: widths [4, 1] modes [SD Legacy, SD High Speed (50MHz)]
  host capabilities: widths [4, 1] modes [MMC legacy, SD Legacy, MMC High Speed (26MHz), SD High Speed (50MHz), MMC High Speed (52MHz)]
  Rd Block Len: 512
  SD version 3.0
  High Capacity: Yes
  Capacity: 14.5 GiB
  Bus Width: 4-bit
  Erase Group Size: 512 Bytes

Issue reproduced with following command:

STM32MP> mmc erase 0 100000

MMC erase: dev # 0, block # 0, count 1048576 ... mmc erase failed
16384 blocks erased: ERROR

By setting SDMMC_BUSYD0END_TIMEOUT_US at 2 seconds and by adding
time measurement in stm32_sdmmc2_end_cmd() as shown below:

	+start = get_timer(0);
	/* Polling status register */
	ret = readl_poll_timeout(priv->base + SDMMC_STA,
				 status, status & mask,
 				 SDMMC_BUSYD0END_TIMEOUT_US);

	+printf("time = %ld ms\n", get_timer(start));

We get the following trace:

STM32MP> mmc erase 0  100000

MMC erase: dev # 0, block # 0, count 1048576 ...
time = 17 ms
time = 1 ms
time = 1025 ms
time = 54 ms
time = 56 ms
time = 1021 ms
time = 57 ms
time = 56 ms
time = 1020 ms
time = 53 ms
time = 57 ms
time = 1021 ms
time = 53 ms
time = 57 ms
time = 1313 ms
time = 54 ms
time = 56 ms
time = 1026 ms
time = 54 ms
time = 56 ms
time = 1036 ms
time = 54 ms
time = 56 ms
time = 1028 ms
time = 53 ms
time = 56 ms
time = 1027 ms
time = 54 ms
time = 56 ms
time = 1024 ms
time = 54 ms
time = 56 ms
time = 1020 ms
time = 54 ms
time = 57 ms
time = 1023 ms
time = 54 ms
time = 56 ms
time = 1033 ms
time = 53 ms
time = 57 ms
....
time = 53 ms
time = 57 ms
time = 1021 ms
time = 56 ms
time = 56 ms
time = 1026 ms
time = 54 ms
time = 56 ms
1048576 blocks erased: OK

We see that 1 second timeout is not enough, we also see one measurement
up to 1313 ms. Set the timeout to 2 second to keep a security margin.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2019-08-27 09:36:56 +02:00
Baruch Siach
5ae84860b0 misc: i2c_eeprom: verify that the chip is functional at probe()
Read a single byte from EEPROM to verify that it is actually there.

This is equivalent to Linux kernel commit 00f0ea70d2b8 ("eeprom: at24:
check if the chip is functional in probe()").

Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>

hs: fixed style check prefer kernel type 'u8' over 'uint8_t'
2019-08-27 06:26:49 +02:00
Ye Li
d7d864017d i2c: mxc_i2c: Remove i2c_idle_bus from probe
i2c_idle_bus is already used in i2c_init_transfer. So before each transfer
if the bus is not ready, the i2c_idle_bus will be used to force idle.
It is unnecessary to call it again in probe.

We found a issue when enabling i2c mux with the mxc_i2c. The mxc_i2c is probed
after mux probing. However, at this moment the mux is still in idle state not
select any port. So if we call i2c_idle_bus in probe, it will fail and cause
mxc_i2c probe failed.

Signed-off-by: Ye Li <ye.li@nxp.com>
2019-08-27 06:20:23 +02:00
Ye Li
42cc3125c4 i2c-mux-gpio: Fix GPIO request flag issue
When requesting GPIO, the GPIOD_IS_OUT is missed in flag, so the GPIO
is set the input mode not output and cause mux not work.

Signed-off-by: Ye Li <ye.li@nxp.com>
2019-08-27 06:19:50 +02:00