designware_i2c.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617
  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_RE | IC_CON_SPD_FS | IC_CON_MM,
  327. &i2c_base->ic_con);
  328. writel(IC_RX_TL, &i2c_base->ic_rx_tl);
  329. writel(IC_TX_TL, &i2c_base->ic_tx_tl);
  330. writel(IC_STOP_DET, &i2c_base->ic_intr_mask);
  331. #ifndef CONFIG_DM_I2C
  332. __dw_i2c_set_bus_speed(i2c_base, NULL, speed);
  333. writel(slaveaddr, &i2c_base->ic_sar);
  334. #endif
  335. /* Enable i2c */
  336. dw_i2c_enable(i2c_base, true);
  337. }
  338. #ifndef CONFIG_DM_I2C
  339. /*
  340. * The legacy I2C functions. These need to get removed once
  341. * all users of this driver are converted to DM.
  342. */
  343. static struct i2c_regs *i2c_get_base(struct i2c_adapter *adap)
  344. {
  345. switch (adap->hwadapnr) {
  346. #if CONFIG_SYS_I2C_BUS_MAX >= 4
  347. case 3:
  348. return (struct i2c_regs *)CONFIG_SYS_I2C_BASE3;
  349. #endif
  350. #if CONFIG_SYS_I2C_BUS_MAX >= 3
  351. case 2:
  352. return (struct i2c_regs *)CONFIG_SYS_I2C_BASE2;
  353. #endif
  354. #if CONFIG_SYS_I2C_BUS_MAX >= 2
  355. case 1:
  356. return (struct i2c_regs *)CONFIG_SYS_I2C_BASE1;
  357. #endif
  358. case 0:
  359. return (struct i2c_regs *)CONFIG_SYS_I2C_BASE;
  360. default:
  361. printf("Wrong I2C-adapter number %d\n", adap->hwadapnr);
  362. }
  363. return NULL;
  364. }
  365. static unsigned int dw_i2c_set_bus_speed(struct i2c_adapter *adap,
  366. unsigned int speed)
  367. {
  368. adap->speed = speed;
  369. return __dw_i2c_set_bus_speed(i2c_get_base(adap), NULL, speed);
  370. }
  371. static void dw_i2c_init(struct i2c_adapter *adap, int speed, int slaveaddr)
  372. {
  373. __dw_i2c_init(i2c_get_base(adap), speed, slaveaddr);
  374. }
  375. static int dw_i2c_read(struct i2c_adapter *adap, u8 dev, uint addr,
  376. int alen, u8 *buffer, int len)
  377. {
  378. return __dw_i2c_read(i2c_get_base(adap), dev, addr, alen, buffer, len);
  379. }
  380. static int dw_i2c_write(struct i2c_adapter *adap, u8 dev, uint addr,
  381. int alen, u8 *buffer, int len)
  382. {
  383. return __dw_i2c_write(i2c_get_base(adap), dev, addr, alen, buffer, len);
  384. }
  385. /* dw_i2c_probe - Probe the i2c chip */
  386. static int dw_i2c_probe(struct i2c_adapter *adap, u8 dev)
  387. {
  388. struct i2c_regs *i2c_base = i2c_get_base(adap);
  389. u32 tmp;
  390. int ret;
  391. /*
  392. * Try to read the first location of the chip.
  393. */
  394. ret = __dw_i2c_read(i2c_base, dev, 0, 1, (uchar *)&tmp, 1);
  395. if (ret)
  396. dw_i2c_init(adap, adap->speed, adap->slaveaddr);
  397. return ret;
  398. }
  399. U_BOOT_I2C_ADAP_COMPLETE(dw_0, dw_i2c_init, dw_i2c_probe, dw_i2c_read,
  400. dw_i2c_write, dw_i2c_set_bus_speed,
  401. CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE, 0)
  402. #if CONFIG_SYS_I2C_BUS_MAX >= 2
  403. U_BOOT_I2C_ADAP_COMPLETE(dw_1, dw_i2c_init, dw_i2c_probe, dw_i2c_read,
  404. dw_i2c_write, dw_i2c_set_bus_speed,
  405. CONFIG_SYS_I2C_SPEED1, CONFIG_SYS_I2C_SLAVE1, 1)
  406. #endif
  407. #if CONFIG_SYS_I2C_BUS_MAX >= 3
  408. U_BOOT_I2C_ADAP_COMPLETE(dw_2, dw_i2c_init, dw_i2c_probe, dw_i2c_read,
  409. dw_i2c_write, dw_i2c_set_bus_speed,
  410. CONFIG_SYS_I2C_SPEED2, CONFIG_SYS_I2C_SLAVE2, 2)
  411. #endif
  412. #if CONFIG_SYS_I2C_BUS_MAX >= 4
  413. U_BOOT_I2C_ADAP_COMPLETE(dw_3, dw_i2c_init, dw_i2c_probe, dw_i2c_read,
  414. dw_i2c_write, dw_i2c_set_bus_speed,
  415. CONFIG_SYS_I2C_SPEED3, CONFIG_SYS_I2C_SLAVE3, 3)
  416. #endif
  417. #else /* CONFIG_DM_I2C */
  418. /* The DM I2C functions */
  419. static int designware_i2c_xfer(struct udevice *bus, struct i2c_msg *msg,
  420. int nmsgs)
  421. {
  422. struct dw_i2c *i2c = dev_get_priv(bus);
  423. int ret;
  424. debug("i2c_xfer: %d messages\n", nmsgs);
  425. for (; nmsgs > 0; nmsgs--, msg++) {
  426. debug("i2c_xfer: chip=0x%x, len=0x%x\n", msg->addr, msg->len);
  427. if (msg->flags & I2C_M_RD) {
  428. ret = __dw_i2c_read(i2c->regs, msg->addr, 0, 0,
  429. msg->buf, msg->len);
  430. } else {
  431. ret = __dw_i2c_write(i2c->regs, msg->addr, 0, 0,
  432. msg->buf, msg->len);
  433. }
  434. if (ret) {
  435. debug("i2c_write: error sending\n");
  436. return -EREMOTEIO;
  437. }
  438. }
  439. return 0;
  440. }
  441. static int designware_i2c_set_bus_speed(struct udevice *bus, unsigned int speed)
  442. {
  443. struct dw_i2c *i2c = dev_get_priv(bus);
  444. return __dw_i2c_set_bus_speed(i2c->regs, i2c->scl_sda_cfg, speed);
  445. }
  446. static int designware_i2c_probe_chip(struct udevice *bus, uint chip_addr,
  447. uint chip_flags)
  448. {
  449. struct dw_i2c *i2c = dev_get_priv(bus);
  450. struct i2c_regs *i2c_base = i2c->regs;
  451. u32 tmp;
  452. int ret;
  453. /* Try to read the first location of the chip */
  454. ret = __dw_i2c_read(i2c_base, chip_addr, 0, 1, (uchar *)&tmp, 1);
  455. if (ret)
  456. __dw_i2c_init(i2c_base, 0, 0);
  457. return ret;
  458. }
  459. static int designware_i2c_probe(struct udevice *bus)
  460. {
  461. struct dw_i2c *priv = dev_get_priv(bus);
  462. if (device_is_on_pci_bus(bus)) {
  463. #ifdef CONFIG_DM_PCI
  464. /* Save base address from PCI BAR */
  465. priv->regs = (struct i2c_regs *)
  466. dm_pci_map_bar(bus, PCI_BASE_ADDRESS_0, PCI_REGION_MEM);
  467. #ifdef CONFIG_X86
  468. /* Use BayTrail specific timing values */
  469. priv->scl_sda_cfg = &byt_config;
  470. #endif
  471. #endif
  472. } else {
  473. priv->regs = (struct i2c_regs *)devfdt_get_addr_ptr(bus);
  474. }
  475. __dw_i2c_init(priv->regs, 0, 0);
  476. return 0;
  477. }
  478. static int designware_i2c_bind(struct udevice *dev)
  479. {
  480. static int num_cards;
  481. char name[20];
  482. /* Create a unique device name for PCI type devices */
  483. if (device_is_on_pci_bus(dev)) {
  484. /*
  485. * ToDo:
  486. * Setting req_seq in the driver is probably not recommended.
  487. * But without a DT alias the number is not configured. And
  488. * using this driver is impossible for PCIe I2C devices.
  489. * This can be removed, once a better (correct) way for this
  490. * is found and implemented.
  491. */
  492. dev->req_seq = num_cards;
  493. sprintf(name, "i2c_designware#%u", num_cards++);
  494. device_set_name(dev, name);
  495. }
  496. return 0;
  497. }
  498. static const struct dm_i2c_ops designware_i2c_ops = {
  499. .xfer = designware_i2c_xfer,
  500. .probe_chip = designware_i2c_probe_chip,
  501. .set_bus_speed = designware_i2c_set_bus_speed,
  502. };
  503. static const struct udevice_id designware_i2c_ids[] = {
  504. { .compatible = "snps,designware-i2c" },
  505. { }
  506. };
  507. U_BOOT_DRIVER(i2c_designware) = {
  508. .name = "i2c_designware",
  509. .id = UCLASS_I2C,
  510. .of_match = designware_i2c_ids,
  511. .bind = designware_i2c_bind,
  512. .probe = designware_i2c_probe,
  513. .priv_auto_alloc_size = sizeof(struct dw_i2c),
  514. .ops = &designware_i2c_ops,
  515. };
  516. #ifdef CONFIG_X86
  517. static struct pci_device_id designware_pci_supported[] = {
  518. /* Intel BayTrail has 7 I2C controller located on the PCI bus */
  519. { PCI_VDEVICE(INTEL, 0x0f41) },
  520. { PCI_VDEVICE(INTEL, 0x0f42) },
  521. { PCI_VDEVICE(INTEL, 0x0f43) },
  522. { PCI_VDEVICE(INTEL, 0x0f44) },
  523. { PCI_VDEVICE(INTEL, 0x0f45) },
  524. { PCI_VDEVICE(INTEL, 0x0f46) },
  525. { PCI_VDEVICE(INTEL, 0x0f47) },
  526. {},
  527. };
  528. U_BOOT_PCI_DEVICE(i2c_designware, designware_pci_supported);
  529. #endif
  530. #endif /* CONFIG_DM_I2C */