<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Other NXP ProductsのトピックRe: imx6 i2c controller setup</title>
    <link>https://community.nxp.com/t5/Other-NXP-Products/imx6-i2c-controller-setup/m-p/2055125#M27679</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/229488"&gt;@elliott1609&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry to reply late, But could you explain more details about your question?&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;How did you access the three I2C controllers now? And what is your result?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;B.R&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 04 Mar 2025 02:29:12 GMT</pubDate>
    <dc:creator>pengyong_zhang</dc:creator>
    <dc:date>2025-03-04T02:29:12Z</dc:date>
    <item>
      <title>imx6 i2c controller setup</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/imx6-i2c-controller-setup/m-p/2046764#M27501</link>
      <description>&lt;P&gt;What must be initialized to access the three I2C controllers built into an imx6?&lt;/P&gt;&lt;P&gt;They are accessed through memory addresses beginning at 0x21a0000.&lt;BR /&gt;Despite initializing the IOMUX, clocks, AIPSTZ. and virtual memory pages, (but possibly with errors) all reads from the these memory locations return 0x50085008.&lt;/P&gt;&lt;P&gt;What more than this (in pairs for clock and data)?&lt;BR /&gt;1: MUX: 2 assignments like this&lt;BR /&gt;*(unsigned long*)(0x20E03B8) = 0x4001b8b1; // (IOMUXC_SW_PAD_CTL_PAD_EIM_DATA21)&lt;/P&gt;&lt;P&gt;2: clock: this looks ok but is it? (runtime output) CCM_CSCMR1: 0x20C401C = 0x900000&lt;/P&gt;&lt;P&gt;3: imx6 "AHB to IP Bridge (AIPSTZ): (runtime output) AIPSTZ2_MPR: 0x217C000 = 0x77777777&lt;/P&gt;&lt;P&gt;4: page tables for virtual to physical addressing, virtual=physical&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2025 01:46:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/imx6-i2c-controller-setup/m-p/2046764#M27501</guid>
      <dc:creator>elliott1609</dc:creator>
      <dc:date>2025-02-19T01:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: imx6 i2c controller setup</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/imx6-i2c-controller-setup/m-p/2055125#M27679</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/229488"&gt;@elliott1609&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry to reply late, But could you explain more details about your question?&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;How did you access the three I2C controllers now? And what is your result?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;B.R&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2025 02:29:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/imx6-i2c-controller-setup/m-p/2055125#M27679</guid>
      <dc:creator>pengyong_zhang</dc:creator>
      <dc:date>2025-03-04T02:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: imx6 i2c controller setup</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/imx6-i2c-controller-setup/m-p/2055180#M27681</link>
      <description>&lt;P&gt;Linux on the Phytec Mira board correctly accesses a tri-color LED connected to I2C1 and NXP PCA9533 with these commands:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Linux on the Phytec Mira board correctly accesses a tri-color LED connected to I2C1 and NXP PCA9533 with these commands:
root@phyboard-mira-imx6-3:mira-red# pwd
/sys/devices/platform/dimleds/leds/mira-red
root@phyboard-mira-imx6-3:mira-red# ls -l
total 0
lrwxrwxrwx 1 root root    0 Jun 15 17:58 device -&amp;gt; ../../../dimleds/
drwxr-xr-x 2 root root    0 Jun 15 17:58 power/
lrwxrwxrwx 1 root root    0 Apr 28  2022 subsystem -&amp;gt; ../../../../../class/leds/
-rw-r--r-- 1 root root 4096 Jun 15 17:58 brightness
-r--r--r-- 1 root root 4096 Jun 15 17:58 max_brightness
-rw-r--r-- 1 root root    0 Jun 15 17:58 trigger
-rw-r--r-- 1 root root 4096 Apr 28  2022 uevent
root@phyboard-mira-imx6-3:mira-red# echo 1 &amp;gt; brightness &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works too...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;i2cdetect -l
i2c-0	i2c       	21a0000.i2c                     	I2C adapter
i2c-1	i2c       	21a4000.i2c                     	I2C adapter
i2c-2	i2c       	21a8000.i2c                     	I2C adapter&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works too...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;root@phyboard-mira-imx6-3:~# i2cdetect -y 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- UU -- -- -- -- -- UU -- -- -- -- -- -- -- &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;But if I try to display I/O memory for the first I2C controller - segmentation fault!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;root@phyboard-mira-imx6-3:~# devmem2 0x21a0000
/dev/mem opened.
[  133.730598] 8&amp;lt;--- cut here ---
Memory mapped at address 0xb6f750[  133.734931] Unhandled fault: page domain fault (0x01b) at 0x0046087e
00.
[  133.744145] pgd = 372d4450
[  133.747281] [0046087e] *pgd=4c289831
[  133.750871] Internal error: : 1b [#1] SMP ARM
[  133.755233] Modules linked in: cfg80211 coda_vpu v4l2_jpeg imx_vdoa etnaviv dw_hdmi_ahb_audio
[  133.763795] CPU: 2 PID: 375 Comm: devmem2 Not tainted 5.15.102-bsp-yocto-ampliphy-i.mx6-pd22.1.1 #1
[  133.772850] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
[  133.779380] PC is at imx6q_pcie_abort_handler+0x4/0x6c
[  133.784545] LR is at do_DataAbort+0x38/0xbc
[  133.788739] pc : [&amp;lt;c059f2b8&amp;gt;]    lr : [&amp;lt;c0113fd0&amp;gt;]    psr: 600f0193
[  133.795011] sp : c2c4ff88  ip : c130a66c  fp : 00000002
[  133.800240] r10: 00000077  r9 : 00000000  r8 : c059f2b4
[  133.805468] r7 : c2c4ffb0  r6 : b6f75000  r5 : c130a6ec  r4 : 00001018
[  133.812000] r3 : 0046087e  r2 : c2c4ffb0  r1 : 00001018  r0 : b6f75000
[  133.818532] Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment none
[  133.825763] Control: 10c5387d  Table: 1297804a  DAC: 00000051
[  133.831512] Register r0 information: non-paged memory
[  133.836573] Register r1 information: non-paged memory
[  133.841630] Register r2 information: non-slab/vmalloc memory
[  133.847301] Register r3 information: non-paged memory
[  133.852358] Register r4 information: non-paged memory
[  133.857415] Register r5 information: non-slab/vmalloc memory
[  133.863079] Register r6 information: non-paged memory
[  133.868136] Register r7 information: non-slab/vmalloc memory
[  133.873801] Register r8 information: non-slab/vmalloc memory
[  133.879465] Register r9 information: NULL pointer
[  133.884174] Register r10 information: non-paged memory
[  133.889318] Register r11 information: non-paged memory
[  133.894461] Register r12 information: non-slab/vmalloc memory
[  133.900212] Process devmem2 (pid: 375, stack limit = 0x45ccccb7)
[  133.906225] Stack: (0xc2c4ff88 to 0xc2c50000)
[  133.910592] ff80:                   01366000 00000025 01366190 b6f77200 0046087e 200f0030
[  133.918778] ffa0: ffffffff 10c5387d 10c5387d c0100e64 00000000 00000000 00000001 00000008
[  133.926963] ffc0: b6f75000 00001000 021a0000 00000003 b6f75000 00000000 00000077 00000002
[  133.935147] ffe0: 00471f98 be96fba8 b6e6f96b 0046087e 200f0030 ffffffff 00000000 00000000
[  133.943332] [&amp;lt;c059f2b8&amp;gt;] (imx6q_pcie_abort_handler) from [&amp;lt;c0113fd0&amp;gt;] (do_DataAbort+0x38/0xbc)
[  133.951965] [&amp;lt;c0113fd0&amp;gt;] (do_DataAbort) from [&amp;lt;c0100e64&amp;gt;] (__dabt_usr+0x44/0x60)
[  133.959376] Exception stack(0xc2c4ffb0 to 0xc2c4fff8)
[  133.964434] ffa0:                                     00000000 00000000 00000001 00000008
[  133.972619] ffc0: b6f75000 00001000 021a0000 00000003 b6f75000 00000000 00000077 00000002
[  133.980804] ffe0: 00471f98 be96fba8 b6e6f96b 0046087e 200f0030 ffffffff
[  133.987426] Code: c10428d0 c10428b4 c1042898 e592303c (e5933000) 
[  133.993527] ---[ end trace 79bea8ac688e94bd ]---
Segmentation fault&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are two other attempts to access the I2C controller I/O address space, this time with barebox...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Hit m for menu or any to stop autoboot: 2
barebox@PHYTEC phyCORE-i.MX6 Quad with NAND:/ mmuinfo 0x21a0000
PAR result for 0x021a0000:
privileged read: 0x021a0090
Physical Address [31:12]: 0x021a0000
Reserved [11]: 0x0
Not Outer Shareable [10]: 0x0
Non-Secure [9]: 0x0
Impl. def. [8]: 0x0
Shareable [7]: 0x1
Inner mem. attr. [6:4]: 0x1 (0b001 Strongly-ordered)
Outer mem. attr. [3:2]: 0x0 (0b00 Non-cacheable)
SuperSection [1]: 0x0
Failure [0]: 0x0
privileged write: 0x021a0090
Physical Address [31:12]: 0x021a0000
Reserved [11]: 0x0
Not Outer Shareable [10]: 0x0
Non-Secure [9]: 0x0
Impl. def. [8]: 0x0
Shareable [7]: 0x1
Inner mem. attr. [6:4]: 0x1 (0b001 Strongly-ordered)
Outer mem. attr. [3:2]: 0x0 (0b00 Non-cacheable)
SuperSection [1]: 0x0
Failure [0]: 0x0&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Barebox again showing (I believe) that something is blocking access to the I/O address space for all three I2C controllers ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;barebox@PHYTEC phyCORE-i.MX6 Quad with NAND:/ md -l 0x219FFF0+0x20
0219fff0: 00000000 00000000 00000000 00000000 ................
021a0000: xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx ................
barebox@PHYTEC phyCORE-i.MX6 Quad with NAND:/ md -l 0x21abff0+0x20
021abff0: xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx ................
021ac000: 00000000 00000000 00000000 00000000 ................&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My (short) BARE METAL program correctly accesses UART2, the green SOM LED, and the three LEDS on the Mira "expansion board"&lt;/P&gt;&lt;P&gt;I believe my program fails to control the tri-color LED attached to the PCA9533 because something is blocking memory access to I2C controller registers beginning at 21a_0000. Why do I conclude that? Because ALL reads from ANY I2C register (frequency, status. etc) return 0x50085008&lt;/P&gt;&lt;P&gt;My program's output (via UART2)...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; IOMUXC_SW_MUX_CTL_PAD_GPIO04 0x20E0238 = 0x5
 IOMUXC_SW_PAD_CTL_PAD_GPIO04 0x20E0608 = 0x1B0B0
 GPIO05 direction extension green: 0x20AC004 = 0x20000000
R0: 0xC5187F (SCTRL)
R1: 0x0
R2: 0x918048 (translation table base 0)
 CCM_CCGR2: 0x20C4070 = 0xFFFFFFFF
 CCM_CBCMR:   0x20C4018 = 0x11204
 CCM_CBCDR:   0x20C4014 = 0x18D00
 CCM_CSCMR1:  0x20C401C = 0x900000
 AIPSTZ1_MPR:  0x207C000 = 0x77777777
 AIPSTZ2_MPR:  0x217C000 = 0x77777777
 AIPSTZ2_OPACR1:  0x217C044 = 0x0
 IOMUXC_SW_PAD_CTL_PAD_EIM_DATA21:  0x20E03B8 = 0x1B8B1
 I2C1 frequency:  0x21A0004 = 0x50085008
 I2C1_I2SR at start:  0x21A000C = 0x50085008I2C RXAK timeout!  0x21A000C = 0x50085008I2C RXAK timeout!  0x21A000C = 0x50085008I2C RXAK timeout!  0x21A000C = 0x50085008
RV-4162-C7 real-time clock...I2C RXAK timeout!  0x21A000C = 0x50085008I2C RXAK timeout!  0x21A000C = 0x50085008&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2025 03:55:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/imx6-i2c-controller-setup/m-p/2055180#M27681</guid>
      <dc:creator>elliott1609</dc:creator>
      <dc:date>2025-03-04T03:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: imx6 i2c controller setup</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/imx6-i2c-controller-setup/m-p/2059131#M27901</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/229488"&gt;@elliott1609&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is your BSP version? You can use the ./memtool tool read and write the I2C controller.&lt;/P&gt;
&lt;P&gt;B.R&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2025 03:04:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/imx6-i2c-controller-setup/m-p/2059131#M27901</guid>
      <dc:creator>pengyong_zhang</dc:creator>
      <dc:date>2025-03-11T03:04:10Z</dc:date>
    </item>
  </channel>
</rss>

