mxc_i2c.c 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554
  1. /*
  2. * i2c driver for Freescale i.MX series
  3. *
  4. * (c) 2007 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de>
  5. * (c) 2011 Marek Vasut <marek.vasut@gmail.com>
  6. *
  7. * Based on i2c-imx.c from linux kernel:
  8. * Copyright (C) 2005 Torsten Koschorrek <koschorrek at synertronixx.de>
  9. * Copyright (C) 2005 Matthias Blaschke <blaschke at synertronixx.de>
  10. * Copyright (C) 2007 RightHand Technologies, Inc.
  11. * Copyright (C) 2008 Darius Augulis <darius.augulis at teltonika.lt>
  12. *
  13. *
  14. * SPDX-License-Identifier: GPL-2.0+
  15. */
  16. #include <common.h>
  17. #include <asm/arch/clock.h>
  18. #include <asm/arch/imx-regs.h>
  19. #include <asm/errno.h>
  20. #include <asm/io.h>
  21. #include <i2c.h>
  22. #include <watchdog.h>
  23. DECLARE_GLOBAL_DATA_PTR;
  24. #ifdef I2C_QUIRK_REG
  25. struct mxc_i2c_regs {
  26. uint8_t iadr;
  27. uint8_t ifdr;
  28. uint8_t i2cr;
  29. uint8_t i2sr;
  30. uint8_t i2dr;
  31. };
  32. #else
  33. struct mxc_i2c_regs {
  34. uint32_t iadr;
  35. uint32_t ifdr;
  36. uint32_t i2cr;
  37. uint32_t i2sr;
  38. uint32_t i2dr;
  39. };
  40. #endif
  41. #define I2CR_IIEN (1 << 6)
  42. #define I2CR_MSTA (1 << 5)
  43. #define I2CR_MTX (1 << 4)
  44. #define I2CR_TX_NO_AK (1 << 3)
  45. #define I2CR_RSTA (1 << 2)
  46. #define I2SR_ICF (1 << 7)
  47. #define I2SR_IBB (1 << 5)
  48. #define I2SR_IAL (1 << 4)
  49. #define I2SR_IIF (1 << 1)
  50. #define I2SR_RX_NO_AK (1 << 0)
  51. #ifdef I2C_QUIRK_REG
  52. #define I2CR_IEN (0 << 7)
  53. #define I2CR_IDIS (1 << 7)
  54. #define I2SR_IIF_CLEAR (1 << 1)
  55. #else
  56. #define I2CR_IEN (1 << 7)
  57. #define I2CR_IDIS (0 << 7)
  58. #define I2SR_IIF_CLEAR (0 << 1)
  59. #endif
  60. #if defined(CONFIG_HARD_I2C) && !defined(CONFIG_SYS_I2C_BASE)
  61. #error "define CONFIG_SYS_I2C_BASE to use the mxc_i2c driver"
  62. #endif
  63. #ifdef I2C_QUIRK_REG
  64. static u16 i2c_clk_div[60][2] = {
  65. { 20, 0x00 }, { 22, 0x01 }, { 24, 0x02 }, { 26, 0x03 },
  66. { 28, 0x04 }, { 30, 0x05 }, { 32, 0x09 }, { 34, 0x06 },
  67. { 36, 0x0A }, { 40, 0x07 }, { 44, 0x0C }, { 48, 0x0D },
  68. { 52, 0x43 }, { 56, 0x0E }, { 60, 0x45 }, { 64, 0x12 },
  69. { 68, 0x0F }, { 72, 0x13 }, { 80, 0x14 }, { 88, 0x15 },
  70. { 96, 0x19 }, { 104, 0x16 }, { 112, 0x1A }, { 128, 0x17 },
  71. { 136, 0x4F }, { 144, 0x1C }, { 160, 0x1D }, { 176, 0x55 },
  72. { 192, 0x1E }, { 208, 0x56 }, { 224, 0x22 }, { 228, 0x24 },
  73. { 240, 0x1F }, { 256, 0x23 }, { 288, 0x5C }, { 320, 0x25 },
  74. { 384, 0x26 }, { 448, 0x2A }, { 480, 0x27 }, { 512, 0x2B },
  75. { 576, 0x2C }, { 640, 0x2D }, { 768, 0x31 }, { 896, 0x32 },
  76. { 960, 0x2F }, { 1024, 0x33 }, { 1152, 0x34 }, { 1280, 0x35 },
  77. { 1536, 0x36 }, { 1792, 0x3A }, { 1920, 0x37 }, { 2048, 0x3B },
  78. { 2304, 0x3C }, { 2560, 0x3D }, { 3072, 0x3E }, { 3584, 0x7A },
  79. { 3840, 0x3F }, { 4096, 0x7B }, { 5120, 0x7D }, { 6144, 0x7E },
  80. };
  81. #else
  82. static u16 i2c_clk_div[50][2] = {
  83. { 22, 0x20 }, { 24, 0x21 }, { 26, 0x22 }, { 28, 0x23 },
  84. { 30, 0x00 }, { 32, 0x24 }, { 36, 0x25 }, { 40, 0x26 },
  85. { 42, 0x03 }, { 44, 0x27 }, { 48, 0x28 }, { 52, 0x05 },
  86. { 56, 0x29 }, { 60, 0x06 }, { 64, 0x2A }, { 72, 0x2B },
  87. { 80, 0x2C }, { 88, 0x09 }, { 96, 0x2D }, { 104, 0x0A },
  88. { 112, 0x2E }, { 128, 0x2F }, { 144, 0x0C }, { 160, 0x30 },
  89. { 192, 0x31 }, { 224, 0x32 }, { 240, 0x0F }, { 256, 0x33 },
  90. { 288, 0x10 }, { 320, 0x34 }, { 384, 0x35 }, { 448, 0x36 },
  91. { 480, 0x13 }, { 512, 0x37 }, { 576, 0x14 }, { 640, 0x38 },
  92. { 768, 0x39 }, { 896, 0x3A }, { 960, 0x17 }, { 1024, 0x3B },
  93. { 1152, 0x18 }, { 1280, 0x3C }, { 1536, 0x3D }, { 1792, 0x3E },
  94. { 1920, 0x1B }, { 2048, 0x3F }, { 2304, 0x1C }, { 2560, 0x1D },
  95. { 3072, 0x1E }, { 3840, 0x1F }
  96. };
  97. #endif
  98. #ifndef CONFIG_SYS_MXC_I2C1_SPEED
  99. #define CONFIG_SYS_MXC_I2C1_SPEED 100000
  100. #endif
  101. #ifndef CONFIG_SYS_MXC_I2C2_SPEED
  102. #define CONFIG_SYS_MXC_I2C2_SPEED 100000
  103. #endif
  104. #ifndef CONFIG_SYS_MXC_I2C3_SPEED
  105. #define CONFIG_SYS_MXC_I2C3_SPEED 100000
  106. #endif
  107. #ifndef CONFIG_SYS_MXC_I2C1_SLAVE
  108. #define CONFIG_SYS_MXC_I2C1_SLAVE 0
  109. #endif
  110. #ifndef CONFIG_SYS_MXC_I2C2_SLAVE
  111. #define CONFIG_SYS_MXC_I2C2_SLAVE 0
  112. #endif
  113. #ifndef CONFIG_SYS_MXC_I2C3_SLAVE
  114. #define CONFIG_SYS_MXC_I2C3_SLAVE 0
  115. #endif
  116. /*
  117. * Calculate and set proper clock divider
  118. */
  119. static uint8_t i2c_imx_get_clk(unsigned int rate)
  120. {
  121. unsigned int i2c_clk_rate;
  122. unsigned int div;
  123. u8 clk_div;
  124. #if defined(CONFIG_MX31)
  125. struct clock_control_regs *sc_regs =
  126. (struct clock_control_regs *)CCM_BASE;
  127. /* start the required I2C clock */
  128. writel(readl(&sc_regs->cgr0) | (3 << CONFIG_SYS_I2C_CLK_OFFSET),
  129. &sc_regs->cgr0);
  130. #endif
  131. /* Divider value calculation */
  132. i2c_clk_rate = mxc_get_clock(MXC_I2C_CLK);
  133. div = (i2c_clk_rate + rate - 1) / rate;
  134. if (div < i2c_clk_div[0][0])
  135. clk_div = 0;
  136. else if (div > i2c_clk_div[ARRAY_SIZE(i2c_clk_div) - 1][0])
  137. clk_div = ARRAY_SIZE(i2c_clk_div) - 1;
  138. else
  139. for (clk_div = 0; i2c_clk_div[clk_div][0] < div; clk_div++)
  140. ;
  141. /* Store divider value */
  142. return clk_div;
  143. }
  144. /*
  145. * Set I2C Bus speed
  146. */
  147. static int bus_i2c_set_bus_speed(void *base, int speed)
  148. {
  149. struct mxc_i2c_regs *i2c_regs = (struct mxc_i2c_regs *)base;
  150. u8 clk_idx = i2c_imx_get_clk(speed);
  151. u8 idx = i2c_clk_div[clk_idx][1];
  152. /* Store divider value */
  153. writeb(idx, &i2c_regs->ifdr);
  154. /* Reset module */
  155. writeb(I2CR_IDIS, &i2c_regs->i2cr);
  156. writeb(0, &i2c_regs->i2sr);
  157. return 0;
  158. }
  159. #define ST_BUS_IDLE (0 | (I2SR_IBB << 8))
  160. #define ST_BUS_BUSY (I2SR_IBB | (I2SR_IBB << 8))
  161. #define ST_IIF (I2SR_IIF | (I2SR_IIF << 8))
  162. static int wait_for_sr_state(struct mxc_i2c_regs *i2c_regs, unsigned state)
  163. {
  164. unsigned sr;
  165. ulong elapsed;
  166. ulong start_time = get_timer(0);
  167. for (;;) {
  168. sr = readb(&i2c_regs->i2sr);
  169. if (sr & I2SR_IAL) {
  170. #ifdef I2C_QUIRK_REG
  171. writeb(sr | I2SR_IAL, &i2c_regs->i2sr);
  172. #else
  173. writeb(sr & ~I2SR_IAL, &i2c_regs->i2sr);
  174. #endif
  175. printf("%s: Arbitration lost sr=%x cr=%x state=%x\n",
  176. __func__, sr, readb(&i2c_regs->i2cr), state);
  177. return -ERESTART;
  178. }
  179. if ((sr & (state >> 8)) == (unsigned char)state)
  180. return sr;
  181. WATCHDOG_RESET();
  182. elapsed = get_timer(start_time);
  183. if (elapsed > (CONFIG_SYS_HZ / 10)) /* .1 seconds */
  184. break;
  185. }
  186. printf("%s: failed sr=%x cr=%x state=%x\n", __func__,
  187. sr, readb(&i2c_regs->i2cr), state);
  188. return -ETIMEDOUT;
  189. }
  190. static int tx_byte(struct mxc_i2c_regs *i2c_regs, u8 byte)
  191. {
  192. int ret;
  193. writeb(I2SR_IIF_CLEAR, &i2c_regs->i2sr);
  194. writeb(byte, &i2c_regs->i2dr);
  195. ret = wait_for_sr_state(i2c_regs, ST_IIF);
  196. if (ret < 0)
  197. return ret;
  198. if (ret & I2SR_RX_NO_AK)
  199. return -ENODEV;
  200. return 0;
  201. }
  202. /*
  203. * Stop I2C transaction
  204. */
  205. static void i2c_imx_stop(struct mxc_i2c_regs *i2c_regs)
  206. {
  207. int ret;
  208. unsigned int temp = readb(&i2c_regs->i2cr);
  209. temp &= ~(I2CR_MSTA | I2CR_MTX);
  210. writeb(temp, &i2c_regs->i2cr);
  211. ret = wait_for_sr_state(i2c_regs, ST_BUS_IDLE);
  212. if (ret < 0)
  213. printf("%s:trigger stop failed\n", __func__);
  214. }
  215. /*
  216. * Send start signal, chip address and
  217. * write register address
  218. */
  219. static int i2c_init_transfer_(struct mxc_i2c_regs *i2c_regs,
  220. uchar chip, uint addr, int alen)
  221. {
  222. unsigned int temp;
  223. int ret;
  224. /* Enable I2C controller */
  225. #ifdef I2C_QUIRK_REG
  226. if (readb(&i2c_regs->i2cr) & I2CR_IDIS) {
  227. #else
  228. if (!(readb(&i2c_regs->i2cr) & I2CR_IEN)) {
  229. #endif
  230. writeb(I2CR_IEN, &i2c_regs->i2cr);
  231. /* Wait for controller to be stable */
  232. udelay(50);
  233. }
  234. if (readb(&i2c_regs->iadr) == (chip << 1))
  235. writeb((chip << 1) ^ 2, &i2c_regs->iadr);
  236. writeb(I2SR_IIF_CLEAR, &i2c_regs->i2sr);
  237. ret = wait_for_sr_state(i2c_regs, ST_BUS_IDLE);
  238. if (ret < 0)
  239. return ret;
  240. /* Start I2C transaction */
  241. temp = readb(&i2c_regs->i2cr);
  242. temp |= I2CR_MSTA;
  243. writeb(temp, &i2c_regs->i2cr);
  244. ret = wait_for_sr_state(i2c_regs, ST_BUS_BUSY);
  245. if (ret < 0)
  246. return ret;
  247. temp |= I2CR_MTX | I2CR_TX_NO_AK;
  248. writeb(temp, &i2c_regs->i2cr);
  249. /* write slave address */
  250. ret = tx_byte(i2c_regs, chip << 1);
  251. if (ret < 0)
  252. return ret;
  253. while (alen--) {
  254. ret = tx_byte(i2c_regs, (addr >> (alen * 8)) & 0xff);
  255. if (ret < 0)
  256. return ret;
  257. }
  258. return 0;
  259. }
  260. static int i2c_idle_bus(void *base);
  261. static int i2c_init_transfer(struct mxc_i2c_regs *i2c_regs,
  262. uchar chip, uint addr, int alen)
  263. {
  264. int retry;
  265. int ret;
  266. for (retry = 0; retry < 3; retry++) {
  267. ret = i2c_init_transfer_(i2c_regs, chip, addr, alen);
  268. if (ret >= 0)
  269. return 0;
  270. i2c_imx_stop(i2c_regs);
  271. if (ret == -ENODEV)
  272. return ret;
  273. printf("%s: failed for chip 0x%x retry=%d\n", __func__, chip,
  274. retry);
  275. if (ret != -ERESTART)
  276. /* Disable controller */
  277. writeb(I2CR_IDIS, &i2c_regs->i2cr);
  278. udelay(100);
  279. if (i2c_idle_bus(i2c_regs) < 0)
  280. break;
  281. }
  282. printf("%s: give up i2c_regs=%p\n", __func__, i2c_regs);
  283. return ret;
  284. }
  285. /*
  286. * Read data from I2C device
  287. */
  288. int bus_i2c_read(void *base, uchar chip, uint addr, int alen, uchar *buf,
  289. int len)
  290. {
  291. int ret;
  292. unsigned int temp;
  293. int i;
  294. struct mxc_i2c_regs *i2c_regs = (struct mxc_i2c_regs *)base;
  295. ret = i2c_init_transfer(i2c_regs, chip, addr, alen);
  296. if (ret < 0)
  297. return ret;
  298. temp = readb(&i2c_regs->i2cr);
  299. temp |= I2CR_RSTA;
  300. writeb(temp, &i2c_regs->i2cr);
  301. ret = tx_byte(i2c_regs, (chip << 1) | 1);
  302. if (ret < 0) {
  303. i2c_imx_stop(i2c_regs);
  304. return ret;
  305. }
  306. /* setup bus to read data */
  307. temp = readb(&i2c_regs->i2cr);
  308. temp &= ~(I2CR_MTX | I2CR_TX_NO_AK);
  309. if (len == 1)
  310. temp |= I2CR_TX_NO_AK;
  311. writeb(temp, &i2c_regs->i2cr);
  312. writeb(I2SR_IIF_CLEAR, &i2c_regs->i2sr);
  313. readb(&i2c_regs->i2dr); /* dummy read to clear ICF */
  314. /* read data */
  315. for (i = 0; i < len; i++) {
  316. ret = wait_for_sr_state(i2c_regs, ST_IIF);
  317. if (ret < 0) {
  318. i2c_imx_stop(i2c_regs);
  319. return ret;
  320. }
  321. /*
  322. * It must generate STOP before read I2DR to prevent
  323. * controller from generating another clock cycle
  324. */
  325. if (i == (len - 1)) {
  326. i2c_imx_stop(i2c_regs);
  327. } else if (i == (len - 2)) {
  328. temp = readb(&i2c_regs->i2cr);
  329. temp |= I2CR_TX_NO_AK;
  330. writeb(temp, &i2c_regs->i2cr);
  331. }
  332. writeb(I2SR_IIF_CLEAR, &i2c_regs->i2sr);
  333. buf[i] = readb(&i2c_regs->i2dr);
  334. }
  335. i2c_imx_stop(i2c_regs);
  336. return 0;
  337. }
  338. /*
  339. * Write data to I2C device
  340. */
  341. int bus_i2c_write(void *base, uchar chip, uint addr, int alen,
  342. const uchar *buf, int len)
  343. {
  344. int ret;
  345. int i;
  346. struct mxc_i2c_regs *i2c_regs = (struct mxc_i2c_regs *)base;
  347. ret = i2c_init_transfer(i2c_regs, chip, addr, alen);
  348. if (ret < 0)
  349. return ret;
  350. for (i = 0; i < len; i++) {
  351. ret = tx_byte(i2c_regs, buf[i]);
  352. if (ret < 0)
  353. break;
  354. }
  355. i2c_imx_stop(i2c_regs);
  356. return ret;
  357. }
  358. struct i2c_parms {
  359. void *base;
  360. void *idle_bus_data;
  361. int (*idle_bus_fn)(void *p);
  362. };
  363. struct sram_data {
  364. unsigned curr_i2c_bus;
  365. struct i2c_parms i2c_data[3];
  366. };
  367. static void * const i2c_bases[] = {
  368. #if defined(CONFIG_MX25)
  369. (void *)IMX_I2C_BASE,
  370. (void *)IMX_I2C2_BASE,
  371. (void *)IMX_I2C3_BASE
  372. #elif defined(CONFIG_MX27)
  373. (void *)IMX_I2C1_BASE,
  374. (void *)IMX_I2C2_BASE
  375. #elif defined(CONFIG_MX31) || defined(CONFIG_MX35) || \
  376. defined(CONFIG_MX51) || defined(CONFIG_MX53) || \
  377. defined(CONFIG_MX6)
  378. (void *)I2C1_BASE_ADDR,
  379. (void *)I2C2_BASE_ADDR,
  380. (void *)I2C3_BASE_ADDR
  381. #elif defined(CONFIG_VF610)
  382. (void *)I2C0_BASE_ADDR
  383. #elif defined(CONFIG_FSL_LSCH3)
  384. (void *)I2C1_BASE_ADDR,
  385. (void *)I2C2_BASE_ADDR,
  386. (void *)I2C3_BASE_ADDR,
  387. (void *)I2C4_BASE_ADDR
  388. #else
  389. #error "architecture not supported"
  390. #endif
  391. };
  392. void *i2c_get_base(struct i2c_adapter *adap)
  393. {
  394. return i2c_bases[adap->hwadapnr];
  395. }
  396. static struct i2c_parms *i2c_get_parms(void *base)
  397. {
  398. struct sram_data *srdata = (void *)gd->srdata;
  399. int i = 0;
  400. struct i2c_parms *p = srdata->i2c_data;
  401. while (i < ARRAY_SIZE(srdata->i2c_data)) {
  402. if (p->base == base)
  403. return p;
  404. p++;
  405. i++;
  406. }
  407. printf("Invalid I2C base: %p\n", base);
  408. return NULL;
  409. }
  410. static int i2c_idle_bus(void *base)
  411. {
  412. struct i2c_parms *p = i2c_get_parms(base);
  413. if (p && p->idle_bus_fn)
  414. return p->idle_bus_fn(p->idle_bus_data);
  415. return 0;
  416. }
  417. static int mxc_i2c_read(struct i2c_adapter *adap, uint8_t chip,
  418. uint addr, int alen, uint8_t *buffer,
  419. int len)
  420. {
  421. return bus_i2c_read(i2c_get_base(adap), chip, addr, alen, buffer, len);
  422. }
  423. static int mxc_i2c_write(struct i2c_adapter *adap, uint8_t chip,
  424. uint addr, int alen, uint8_t *buffer,
  425. int len)
  426. {
  427. return bus_i2c_write(i2c_get_base(adap), chip, addr, alen, buffer, len);
  428. }
  429. /*
  430. * Test if a chip at a given address responds (probe the chip)
  431. */
  432. static int mxc_i2c_probe(struct i2c_adapter *adap, uint8_t chip)
  433. {
  434. return bus_i2c_write(i2c_get_base(adap), chip, 0, 0, NULL, 0);
  435. }
  436. void bus_i2c_init(void *base, int speed, int unused,
  437. int (*idle_bus_fn)(void *p), void *idle_bus_data)
  438. {
  439. struct sram_data *srdata = (void *)gd->srdata;
  440. int i = 0;
  441. struct i2c_parms *p = srdata->i2c_data;
  442. if (!base)
  443. return;
  444. for (;;) {
  445. if (!p->base || (p->base == base)) {
  446. p->base = base;
  447. if (idle_bus_fn) {
  448. p->idle_bus_fn = idle_bus_fn;
  449. p->idle_bus_data = idle_bus_data;
  450. }
  451. break;
  452. }
  453. p++;
  454. i++;
  455. if (i >= ARRAY_SIZE(srdata->i2c_data))
  456. return;
  457. }
  458. bus_i2c_set_bus_speed(base, speed);
  459. }
  460. /*
  461. * Init I2C Bus
  462. */
  463. static void mxc_i2c_init(struct i2c_adapter *adap, int speed, int slaveaddr)
  464. {
  465. bus_i2c_init(i2c_get_base(adap), speed, slaveaddr, NULL, NULL);
  466. }
  467. /*
  468. * Set I2C Speed
  469. */
  470. static uint mxc_i2c_set_bus_speed(struct i2c_adapter *adap, uint speed)
  471. {
  472. return bus_i2c_set_bus_speed(i2c_get_base(adap), speed);
  473. }
  474. /*
  475. * Register mxc i2c adapters
  476. */
  477. U_BOOT_I2C_ADAP_COMPLETE(mxc0, mxc_i2c_init, mxc_i2c_probe,
  478. mxc_i2c_read, mxc_i2c_write,
  479. mxc_i2c_set_bus_speed,
  480. CONFIG_SYS_MXC_I2C1_SPEED,
  481. CONFIG_SYS_MXC_I2C1_SLAVE, 0)
  482. U_BOOT_I2C_ADAP_COMPLETE(mxc1, mxc_i2c_init, mxc_i2c_probe,
  483. mxc_i2c_read, mxc_i2c_write,
  484. mxc_i2c_set_bus_speed,
  485. CONFIG_SYS_MXC_I2C2_SPEED,
  486. CONFIG_SYS_MXC_I2C2_SLAVE, 1)
  487. #if defined(CONFIG_MX31) || defined(CONFIG_MX35) ||\
  488. defined(CONFIG_MX51) || defined(CONFIG_MX53) ||\
  489. defined(CONFIG_MX6)
  490. U_BOOT_I2C_ADAP_COMPLETE(mxc2, mxc_i2c_init, mxc_i2c_probe,
  491. mxc_i2c_read, mxc_i2c_write,
  492. mxc_i2c_set_bus_speed,
  493. CONFIG_SYS_MXC_I2C3_SPEED,
  494. CONFIG_SYS_MXC_I2C3_SLAVE, 2)
  495. #endif