designware_i2c.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616
  1. /*
  2. * (C) Copyright 2009
  3. * Vipin Kumar, ST Micoelectronics, vipin.kumar@st.com.
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. #include <common.h>
  8. #include <dm.h>
  9. #include <i2c.h>
  10. #include <pci.h>
  11. #include <asm/io.h>
  12. #include "designware_i2c.h"
  13. struct dw_scl_sda_cfg {
  14. u32 ss_hcnt;
  15. u32 fs_hcnt;
  16. u32 ss_lcnt;
  17. u32 fs_lcnt;
  18. u32 sda_hold;
  19. };
  20. #ifdef CONFIG_X86
  21. /* BayTrail HCNT/LCNT/SDA hold time */
  22. static struct dw_scl_sda_cfg byt_config = {
  23. .ss_hcnt = 0x200,
  24. .fs_hcnt = 0x55,
  25. .ss_lcnt = 0x200,
  26. .fs_lcnt = 0x99,
  27. .sda_hold = 0x6,
  28. };
  29. #endif
  30. struct dw_i2c {
  31. struct i2c_regs *regs;
  32. struct dw_scl_sda_cfg *scl_sda_cfg;
  33. };
  34. #ifdef CONFIG_SYS_I2C_DW_ENABLE_STATUS_UNSUPPORTED
  35. static void dw_i2c_enable(struct i2c_regs *i2c_base, bool enable)
  36. {
  37. u32 ena = enable ? IC_ENABLE_0B : 0;
  38. writel(ena, &i2c_base->ic_enable);
  39. }
  40. #else
  41. static void dw_i2c_enable(struct i2c_regs *i2c_base, bool enable)
  42. {
  43. u32 ena = enable ? IC_ENABLE_0B : 0;
  44. int timeout = 100;
  45. do {
  46. writel(ena, &i2c_base->ic_enable);
  47. if ((readl(&i2c_base->ic_enable_status) & IC_ENABLE_0B) == ena)
  48. return;
  49. /*
  50. * Wait 10 times the signaling period of the highest I2C
  51. * transfer supported by the driver (for 400KHz this is
  52. * 25us) as described in the DesignWare I2C databook.
  53. */
  54. udelay(25);
  55. } while (timeout--);
  56. printf("timeout in %sabling I2C adapter\n", enable ? "en" : "dis");
  57. }
  58. #endif
  59. /*
  60. * i2c_set_bus_speed - Set the i2c speed
  61. * @speed: required i2c speed
  62. *
  63. * Set the i2c speed.
  64. */
  65. static unsigned int __dw_i2c_set_bus_speed(struct i2c_regs *i2c_base,
  66. struct dw_scl_sda_cfg *scl_sda_cfg,
  67. unsigned int speed)
  68. {
  69. unsigned int cntl;
  70. unsigned int hcnt, lcnt;
  71. int i2c_spd;
  72. if (speed >= I2C_MAX_SPEED)
  73. i2c_spd = IC_SPEED_MODE_MAX;
  74. else if (speed >= I2C_FAST_SPEED)
  75. i2c_spd = IC_SPEED_MODE_FAST;
  76. else
  77. i2c_spd = IC_SPEED_MODE_STANDARD;
  78. /* to set speed cltr must be disabled */
  79. dw_i2c_enable(i2c_base, false);
  80. cntl = (readl(&i2c_base->ic_con) & (~IC_CON_SPD_MSK));
  81. switch (i2c_spd) {
  82. #ifndef CONFIG_X86 /* No High-speed for BayTrail yet */
  83. case IC_SPEED_MODE_MAX:
  84. cntl |= IC_CON_SPD_SS;
  85. if (scl_sda_cfg) {
  86. hcnt = scl_sda_cfg->fs_hcnt;
  87. lcnt = scl_sda_cfg->fs_lcnt;
  88. } else {
  89. hcnt = (IC_CLK * MIN_HS_SCL_HIGHTIME) / NANO_TO_MICRO;
  90. lcnt = (IC_CLK * MIN_HS_SCL_LOWTIME) / NANO_TO_MICRO;
  91. }
  92. writel(hcnt, &i2c_base->ic_hs_scl_hcnt);
  93. writel(lcnt, &i2c_base->ic_hs_scl_lcnt);
  94. break;
  95. #endif
  96. case IC_SPEED_MODE_STANDARD:
  97. cntl |= IC_CON_SPD_SS;
  98. if (scl_sda_cfg) {
  99. hcnt = scl_sda_cfg->ss_hcnt;
  100. lcnt = scl_sda_cfg->ss_lcnt;
  101. } else {
  102. hcnt = (IC_CLK * MIN_SS_SCL_HIGHTIME) / NANO_TO_MICRO;
  103. lcnt = (IC_CLK * MIN_SS_SCL_LOWTIME) / NANO_TO_MICRO;
  104. }
  105. writel(hcnt, &i2c_base->ic_ss_scl_hcnt);
  106. writel(lcnt, &i2c_base->ic_ss_scl_lcnt);
  107. break;
  108. case IC_SPEED_MODE_FAST:
  109. default:
  110. cntl |= IC_CON_SPD_FS;
  111. if (scl_sda_cfg) {
  112. hcnt = scl_sda_cfg->fs_hcnt;
  113. lcnt = scl_sda_cfg->fs_lcnt;
  114. } else {
  115. hcnt = (IC_CLK * MIN_FS_SCL_HIGHTIME) / NANO_TO_MICRO;
  116. lcnt = (IC_CLK * MIN_FS_SCL_LOWTIME) / NANO_TO_MICRO;
  117. }
  118. writel(hcnt, &i2c_base->ic_fs_scl_hcnt);
  119. writel(lcnt, &i2c_base->ic_fs_scl_lcnt);
  120. break;
  121. }
  122. writel(cntl, &i2c_base->ic_con);
  123. /* Configure SDA Hold Time if required */
  124. if (scl_sda_cfg)
  125. writel(scl_sda_cfg->sda_hold, &i2c_base->ic_sda_hold);
  126. /* Enable back i2c now speed set */
  127. dw_i2c_enable(i2c_base, true);
  128. return 0;
  129. }
  130. /*
  131. * i2c_setaddress - Sets the target slave address
  132. * @i2c_addr: target i2c address
  133. *
  134. * Sets the target slave address.
  135. */
  136. static void i2c_setaddress(struct i2c_regs *i2c_base, unsigned int i2c_addr)
  137. {
  138. /* Disable i2c */
  139. dw_i2c_enable(i2c_base, false);
  140. writel(i2c_addr, &i2c_base->ic_tar);
  141. /* Enable i2c */
  142. dw_i2c_enable(i2c_base, true);
  143. }
  144. /*
  145. * i2c_flush_rxfifo - Flushes the i2c RX FIFO
  146. *
  147. * Flushes the i2c RX FIFO
  148. */
  149. static void i2c_flush_rxfifo(struct i2c_regs *i2c_base)
  150. {
  151. while (readl(&i2c_base->ic_status) & IC_STATUS_RFNE)
  152. readl(&i2c_base->ic_cmd_data);
  153. }
  154. /*
  155. * i2c_wait_for_bb - Waits for bus busy
  156. *
  157. * Waits for bus busy
  158. */
  159. static int i2c_wait_for_bb(struct i2c_regs *i2c_base)
  160. {
  161. unsigned long start_time_bb = get_timer(0);
  162. while ((readl(&i2c_base->ic_status) & IC_STATUS_MA) ||
  163. !(readl(&i2c_base->ic_status) & IC_STATUS_TFE)) {
  164. /* Evaluate timeout */
  165. if (get_timer(start_time_bb) > (unsigned long)(I2C_BYTE_TO_BB))
  166. return 1;
  167. }
  168. return 0;
  169. }
  170. static int i2c_xfer_init(struct i2c_regs *i2c_base, uchar chip, uint addr,
  171. int alen)
  172. {
  173. if (i2c_wait_for_bb(i2c_base))
  174. return 1;
  175. i2c_setaddress(i2c_base, chip);
  176. while (alen) {
  177. alen--;
  178. /* high byte address going out first */
  179. writel((addr >> (alen * 8)) & 0xff,
  180. &i2c_base->ic_cmd_data);
  181. }
  182. return 0;
  183. }
  184. static int i2c_xfer_finish(struct i2c_regs *i2c_base)
  185. {
  186. ulong start_stop_det = get_timer(0);
  187. while (1) {
  188. if ((readl(&i2c_base->ic_raw_intr_stat) & IC_STOP_DET)) {
  189. readl(&i2c_base->ic_clr_stop_det);
  190. break;
  191. } else if (get_timer(start_stop_det) > I2C_STOPDET_TO) {
  192. break;
  193. }
  194. }
  195. if (i2c_wait_for_bb(i2c_base)) {
  196. printf("Timed out waiting for bus\n");
  197. return 1;
  198. }
  199. i2c_flush_rxfifo(i2c_base);
  200. return 0;
  201. }
  202. /*
  203. * i2c_read - Read from i2c memory
  204. * @chip: target i2c address
  205. * @addr: address to read from
  206. * @alen:
  207. * @buffer: buffer for read data
  208. * @len: no of bytes to be read
  209. *
  210. * Read from i2c memory.
  211. */
  212. static int __dw_i2c_read(struct i2c_regs *i2c_base, u8 dev, uint addr,
  213. int alen, u8 *buffer, int len)
  214. {
  215. unsigned long start_time_rx;
  216. unsigned int active = 0;
  217. #ifdef CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW
  218. /*
  219. * EEPROM chips that implement "address overflow" are ones
  220. * like Catalyst 24WC04/08/16 which has 9/10/11 bits of
  221. * address and the extra bits end up in the "chip address"
  222. * bit slots. This makes a 24WC08 (1Kbyte) chip look like
  223. * four 256 byte chips.
  224. *
  225. * Note that we consider the length of the address field to
  226. * still be one byte because the extra address bits are
  227. * hidden in the chip address.
  228. */
  229. dev |= ((addr >> (alen * 8)) & CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW);
  230. addr &= ~(CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW << (alen * 8));
  231. debug("%s: fix addr_overflow: dev %02x addr %02x\n", __func__, dev,
  232. addr);
  233. #endif
  234. if (i2c_xfer_init(i2c_base, dev, addr, alen))
  235. return 1;
  236. start_time_rx = get_timer(0);
  237. while (len) {
  238. if (!active) {
  239. /*
  240. * Avoid writing to ic_cmd_data multiple times
  241. * in case this loop spins too quickly and the
  242. * ic_status RFNE bit isn't set after the first
  243. * write. Subsequent writes to ic_cmd_data can
  244. * trigger spurious i2c transfer.
  245. */
  246. if (len == 1)
  247. writel(IC_CMD | IC_STOP, &i2c_base->ic_cmd_data);
  248. else
  249. writel(IC_CMD, &i2c_base->ic_cmd_data);
  250. active = 1;
  251. }
  252. if (readl(&i2c_base->ic_status) & IC_STATUS_RFNE) {
  253. *buffer++ = (uchar)readl(&i2c_base->ic_cmd_data);
  254. len--;
  255. start_time_rx = get_timer(0);
  256. active = 0;
  257. } else if (get_timer(start_time_rx) > I2C_BYTE_TO) {
  258. return 1;
  259. }
  260. }
  261. return i2c_xfer_finish(i2c_base);
  262. }
  263. /*
  264. * i2c_write - Write to i2c memory
  265. * @chip: target i2c address
  266. * @addr: address to read from
  267. * @alen:
  268. * @buffer: buffer for read data
  269. * @len: no of bytes to be read
  270. *
  271. * Write to i2c memory.
  272. */
  273. static int __dw_i2c_write(struct i2c_regs *i2c_base, u8 dev, uint addr,
  274. int alen, u8 *buffer, int len)
  275. {
  276. int nb = len;
  277. unsigned long start_time_tx;
  278. #ifdef CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW
  279. /*
  280. * EEPROM chips that implement "address overflow" are ones
  281. * like Catalyst 24WC04/08/16 which has 9/10/11 bits of
  282. * address and the extra bits end up in the "chip address"
  283. * bit slots. This makes a 24WC08 (1Kbyte) chip look like
  284. * four 256 byte chips.
  285. *
  286. * Note that we consider the length of the address field to
  287. * still be one byte because the extra address bits are
  288. * hidden in the chip address.
  289. */
  290. dev |= ((addr >> (alen * 8)) & CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW);
  291. addr &= ~(CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW << (alen * 8));
  292. debug("%s: fix addr_overflow: dev %02x addr %02x\n", __func__, dev,
  293. addr);
  294. #endif
  295. if (i2c_xfer_init(i2c_base, dev, addr, alen))
  296. return 1;
  297. start_time_tx = get_timer(0);
  298. while (len) {
  299. if (readl(&i2c_base->ic_status) & IC_STATUS_TFNF) {
  300. if (--len == 0) {
  301. writel(*buffer | IC_STOP,
  302. &i2c_base->ic_cmd_data);
  303. } else {
  304. writel(*buffer, &i2c_base->ic_cmd_data);
  305. }
  306. buffer++;
  307. start_time_tx = get_timer(0);
  308. } else if (get_timer(start_time_tx) > (nb * I2C_BYTE_TO)) {
  309. printf("Timed out. i2c write Failed\n");
  310. return 1;
  311. }
  312. }
  313. return i2c_xfer_finish(i2c_base);
  314. }
  315. /*
  316. * __dw_i2c_init - Init function
  317. * @speed: required i2c speed
  318. * @slaveaddr: slave address for the device
  319. *
  320. * Initialization function.
  321. */
  322. static void __dw_i2c_init(struct i2c_regs *i2c_base, int speed, int slaveaddr)
  323. {
  324. /* Disable i2c */
  325. dw_i2c_enable(i2c_base, false);
  326. writel((IC_CON_SD | IC_CON_SPD_FS | IC_CON_MM), &i2c_base->ic_con);
  327. writel(IC_RX_TL, &i2c_base->ic_rx_tl);
  328. writel(IC_TX_TL, &i2c_base->ic_tx_tl);
  329. writel(IC_STOP_DET, &i2c_base->ic_intr_mask);
  330. #ifndef CONFIG_DM_I2C
  331. __dw_i2c_set_bus_speed(i2c_base, NULL, speed);
  332. writel(slaveaddr, &i2c_base->ic_sar);
  333. #endif
  334. /* Enable i2c */
  335. dw_i2c_enable(i2c_base, true);
  336. }
  337. #ifndef CONFIG_DM_I2C
  338. /*
  339. * The legacy I2C functions. These need to get removed once
  340. * all users of this driver are converted to DM.
  341. */
  342. static struct i2c_regs *i2c_get_base(struct i2c_adapter *adap)
  343. {
  344. switch (adap->hwadapnr) {
  345. #if CONFIG_SYS_I2C_BUS_MAX >= 4
  346. case 3:
  347. return (struct i2c_regs *)CONFIG_SYS_I2C_BASE3;
  348. #endif
  349. #if CONFIG_SYS_I2C_BUS_MAX >= 3
  350. case 2:
  351. return (struct i2c_regs *)CONFIG_SYS_I2C_BASE2;
  352. #endif
  353. #if CONFIG_SYS_I2C_BUS_MAX >= 2
  354. case 1:
  355. return (struct i2c_regs *)CONFIG_SYS_I2C_BASE1;
  356. #endif
  357. case 0:
  358. return (struct i2c_regs *)CONFIG_SYS_I2C_BASE;
  359. default:
  360. printf("Wrong I2C-adapter number %d\n", adap->hwadapnr);
  361. }
  362. return NULL;
  363. }
  364. static unsigned int dw_i2c_set_bus_speed(struct i2c_adapter *adap,
  365. unsigned int speed)
  366. {
  367. adap->speed = speed;
  368. return __dw_i2c_set_bus_speed(i2c_get_base(adap), NULL, speed);
  369. }
  370. static void dw_i2c_init(struct i2c_adapter *adap, int speed, int slaveaddr)
  371. {
  372. __dw_i2c_init(i2c_get_base(adap), speed, slaveaddr);
  373. }
  374. static int dw_i2c_read(struct i2c_adapter *adap, u8 dev, uint addr,
  375. int alen, u8 *buffer, int len)
  376. {
  377. return __dw_i2c_read(i2c_get_base(adap), dev, addr, alen, buffer, len);
  378. }
  379. static int dw_i2c_write(struct i2c_adapter *adap, u8 dev, uint addr,
  380. int alen, u8 *buffer, int len)
  381. {
  382. return __dw_i2c_write(i2c_get_base(adap), dev, addr, alen, buffer, len);
  383. }
  384. /* dw_i2c_probe - Probe the i2c chip */
  385. static int dw_i2c_probe(struct i2c_adapter *adap, u8 dev)
  386. {
  387. struct i2c_regs *i2c_base = i2c_get_base(adap);
  388. u32 tmp;
  389. int ret;
  390. /*
  391. * Try to read the first location of the chip.
  392. */
  393. ret = __dw_i2c_read(i2c_base, dev, 0, 1, (uchar *)&tmp, 1);
  394. if (ret)
  395. dw_i2c_init(adap, adap->speed, adap->slaveaddr);
  396. return ret;
  397. }
  398. U_BOOT_I2C_ADAP_COMPLETE(dw_0, dw_i2c_init, dw_i2c_probe, dw_i2c_read,
  399. dw_i2c_write, dw_i2c_set_bus_speed,
  400. CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE, 0)
  401. #if CONFIG_SYS_I2C_BUS_MAX >= 2
  402. U_BOOT_I2C_ADAP_COMPLETE(dw_1, dw_i2c_init, dw_i2c_probe, dw_i2c_read,
  403. dw_i2c_write, dw_i2c_set_bus_speed,
  404. CONFIG_SYS_I2C_SPEED1, CONFIG_SYS_I2C_SLAVE1, 1)
  405. #endif
  406. #if CONFIG_SYS_I2C_BUS_MAX >= 3
  407. U_BOOT_I2C_ADAP_COMPLETE(dw_2, dw_i2c_init, dw_i2c_probe, dw_i2c_read,
  408. dw_i2c_write, dw_i2c_set_bus_speed,
  409. CONFIG_SYS_I2C_SPEED2, CONFIG_SYS_I2C_SLAVE2, 2)
  410. #endif
  411. #if CONFIG_SYS_I2C_BUS_MAX >= 4
  412. U_BOOT_I2C_ADAP_COMPLETE(dw_3, dw_i2c_init, dw_i2c_probe, dw_i2c_read,
  413. dw_i2c_write, dw_i2c_set_bus_speed,
  414. CONFIG_SYS_I2C_SPEED3, CONFIG_SYS_I2C_SLAVE3, 3)
  415. #endif
  416. #else /* CONFIG_DM_I2C */
  417. /* The DM I2C functions */
  418. static int designware_i2c_xfer(struct udevice *bus, struct i2c_msg *msg,
  419. int nmsgs)
  420. {
  421. struct dw_i2c *i2c = dev_get_priv(bus);
  422. int ret;
  423. debug("i2c_xfer: %d messages\n", nmsgs);
  424. for (; nmsgs > 0; nmsgs--, msg++) {
  425. debug("i2c_xfer: chip=0x%x, len=0x%x\n", msg->addr, msg->len);
  426. if (msg->flags & I2C_M_RD) {
  427. ret = __dw_i2c_read(i2c->regs, msg->addr, 0, 0,
  428. msg->buf, msg->len);
  429. } else {
  430. ret = __dw_i2c_write(i2c->regs, msg->addr, 0, 0,
  431. msg->buf, msg->len);
  432. }
  433. if (ret) {
  434. debug("i2c_write: error sending\n");
  435. return -EREMOTEIO;
  436. }
  437. }
  438. return 0;
  439. }
  440. static int designware_i2c_set_bus_speed(struct udevice *bus, unsigned int speed)
  441. {
  442. struct dw_i2c *i2c = dev_get_priv(bus);
  443. return __dw_i2c_set_bus_speed(i2c->regs, i2c->scl_sda_cfg, speed);
  444. }
  445. static int designware_i2c_probe_chip(struct udevice *bus, uint chip_addr,
  446. uint chip_flags)
  447. {
  448. struct dw_i2c *i2c = dev_get_priv(bus);
  449. struct i2c_regs *i2c_base = i2c->regs;
  450. u32 tmp;
  451. int ret;
  452. /* Try to read the first location of the chip */
  453. ret = __dw_i2c_read(i2c_base, chip_addr, 0, 1, (uchar *)&tmp, 1);
  454. if (ret)
  455. __dw_i2c_init(i2c_base, 0, 0);
  456. return ret;
  457. }
  458. static int designware_i2c_probe(struct udevice *bus)
  459. {
  460. struct dw_i2c *priv = dev_get_priv(bus);
  461. if (device_is_on_pci_bus(bus)) {
  462. #ifdef CONFIG_DM_PCI
  463. /* Save base address from PCI BAR */
  464. priv->regs = (struct i2c_regs *)
  465. dm_pci_map_bar(bus, PCI_BASE_ADDRESS_0, PCI_REGION_MEM);
  466. #ifdef CONFIG_X86
  467. /* Use BayTrail specific timing values */
  468. priv->scl_sda_cfg = &byt_config;
  469. #endif
  470. #endif
  471. } else {
  472. priv->regs = (struct i2c_regs *)dev_get_addr_ptr(bus);
  473. }
  474. __dw_i2c_init(priv->regs, 0, 0);
  475. return 0;
  476. }
  477. static int designware_i2c_bind(struct udevice *dev)
  478. {
  479. static int num_cards;
  480. char name[20];
  481. /* Create a unique device name for PCI type devices */
  482. if (device_is_on_pci_bus(dev)) {
  483. /*
  484. * ToDo:
  485. * Setting req_seq in the driver is probably not recommended.
  486. * But without a DT alias the number is not configured. And
  487. * using this driver is impossible for PCIe I2C devices.
  488. * This can be removed, once a better (correct) way for this
  489. * is found and implemented.
  490. */
  491. dev->req_seq = num_cards;
  492. sprintf(name, "i2c_designware#%u", num_cards++);
  493. device_set_name(dev, name);
  494. }
  495. return 0;
  496. }
  497. static const struct dm_i2c_ops designware_i2c_ops = {
  498. .xfer = designware_i2c_xfer,
  499. .probe_chip = designware_i2c_probe_chip,
  500. .set_bus_speed = designware_i2c_set_bus_speed,
  501. };
  502. static const struct udevice_id designware_i2c_ids[] = {
  503. { .compatible = "snps,designware-i2c" },
  504. { }
  505. };
  506. U_BOOT_DRIVER(i2c_designware) = {
  507. .name = "i2c_designware",
  508. .id = UCLASS_I2C,
  509. .of_match = designware_i2c_ids,
  510. .bind = designware_i2c_bind,
  511. .probe = designware_i2c_probe,
  512. .priv_auto_alloc_size = sizeof(struct dw_i2c),
  513. .ops = &designware_i2c_ops,
  514. };
  515. #ifdef CONFIG_X86
  516. static struct pci_device_id designware_pci_supported[] = {
  517. /* Intel BayTrail has 7 I2C controller located on the PCI bus */
  518. { PCI_VDEVICE(INTEL, 0x0f41) },
  519. { PCI_VDEVICE(INTEL, 0x0f42) },
  520. { PCI_VDEVICE(INTEL, 0x0f43) },
  521. { PCI_VDEVICE(INTEL, 0x0f44) },
  522. { PCI_VDEVICE(INTEL, 0x0f45) },
  523. { PCI_VDEVICE(INTEL, 0x0f46) },
  524. { PCI_VDEVICE(INTEL, 0x0f47) },
  525. {},
  526. };
  527. U_BOOT_PCI_DEVICE(i2c_designware, designware_pci_supported);
  528. #endif
  529. #endif /* CONFIG_DM_I2C */