element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Avnet Boards Forums
  • Products
  • Dev Tools
  • Avnet & Tria Boards Community
  • Avnet Boards Forums
  • More
  • Cancel
Avnet Boards Forums
ZedBoard Hardware Design PS I2C on Xillinux
  • Forum
  • Documents
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Avnet Boards Forums to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 11 replies
  • Subscribers 339 subscribers
  • Views 1272 views
  • Users 0 members are here
Related

PS I2C on Xillinux

Former Member
Former Member over 13 years ago

Hi,
I use Xillinux and I need I2C for my application.
I open system.xmp, enable I2C 0 in PS and configure to use MIO 10..11. I folow instuctions in Getting started with Xillinux for Zynq-7000 EPP 3.3, 3.5 and 3.6. New bitstreem is identical to origin. I thing that bitstreem must be little different.
What I do wrong?

Thanks

  • Sign in to reply
  • Cancel
Parents
  • Former Member
    0 Former Member over 13 years ago

    I have some progress. FSBL is possible to create from SDK. I tried to add UART0 and I2C0 both connected to the MIO. I adjusted DTS. UART works well, but I2C is still not accessible from linux. /dev/i2c-0 does not exists.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 13 years ago in reply to Former Member

    Vatu,

    Did you recompile Linux and create the dtb file form the ./scripts directory based on your updated dts file?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 13 years ago in reply to Former Member

    Thanks for answer.
    I decompile DTB on first partition of SD using DTC -I dtb -O dts -o devicetree.dts devicetree.dtb. I add UART0 and I2C0 in to DTS. Last step is compiling DTB using DTC -I dts -O dtb -o devicetree.dtb devicetree.dts. Uart works fine but I2C does not.

    Two possible reasons:
    1. Wrong entry for I2C0 in DTS
    2. Driver for I2C not found or does not exist in Xillinux.

    I am linux newbie and I am not sure how to verify this.
    I tried list modules by lsmod and modprobe -l. But nothing look like I2C driver. I thing that I2C driver is not instaled. I believe that it is not need recompile entire kernel. I read in  "Getting started with Xillybus on a Linux host" about compiling single module respective specified folder. This is what I tryed, but no success yet.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 13 years ago in reply to Former Member

    Hi Tim,
    I am recompile kernel. I am use git clone https://github.com/Digilent/linux-3.3-digilent.git to get sources. I am apply 6 patches from /usr/src/xillinux/kernel-patches successfly. I am recompile kernel using by make. Then I copy zImage from arch/arm/boot to first partition on SD.

    I am decompile DTB on first partition of SD using DTC -I dtb -O dts -o devicetree.dts devicetree.dtb. I add UART0 and I2C0 in to DTS.

    ttserial@e0000000 {
    tttclock = <0x2faf080>;
    tttcompatible = "xlnx,ps7-uart-1.00.a", "xlnx,xuartps";
    tttdevice_type = "serial";
    tttinterrupt-parent = <0x1>;
    tttinterrupts = <0x0 0x1b 0x0>;
    tttreg = <0xe0000000 0x1000>;
    tttxlnx,has-modem = <0x0>;
    tttxlnx,uart-clk-freq-hz = <0x2faf080>;
    tt};


    tti2c0: i2c@e0004000 {
    tttcompatible = "xlnx,ps7-i2c-1.00.a";
    tttreg = <0xE0004000 0x1000>;
    tttinterrupts = <0 25 0>;
    tttinterrupt-parent = <1>;
    tttbus-id = <0>;
    tttinput-clk = <50000000>;
    ttti2c-clk = <100000>;
    ttt
    ttt#address-cells = <1>;
    ttt#size-cells = <0>;
    tt};

    Last step is compiling DTB using DTC -I dts -O dtb -o devicetree.dtb devicetree.dts.

    After power off and power on zedboard boot successfly.





    U-Boot 2012.04.01 (Oct 16 2012 - 17:41:50)

    DRAM:  512 MiB
    WARNING: Caches not enabled
    MMC:   SDHCI: 0
    Using default environment

    In:    serial
    Out:   serial
    Err:   serial
    Net:   zynq_gem
    Hit any key to stop autoboot:  0
    Copying Linux from SD to RAM...
    Device: SDHCI
    Manufacturer ID: 1d
    OEM: 4144
    Name: SD
    Tran Speed: 25000000
    Rd Block Len: 512
    SD version 2.0
    High Capacity: Yes
    Capacity: 15 GiB
    Bus Width: 4-bit
    reading zImage

    2674504 bytes read
    reading devicetree.dtb

    6483 bytes read
    reading ramdisk8M.image.gz

    ** Unable to read "ramdisk8M.image.gz" from mmc 0:1 **
    ## Starting application at 0x00008000 ...
    Uncompressing Linux... done, booting the kernel.
    [    0.000000] Booting Linux on physical CPU 0
    [    0.000000] Linux version 3.3.0-xillinux-1.0+ (root@arbot2) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #1 SMP PREEMPT Sat Nov 10 20:54:10 UTC 2012
    [    0.000000] CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
    [    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
    [    0.000000] Machine: Xilinx Zynq Platform, model: Xillinux for Zedboard
    [    0.000000] bootconsole [earlycon0] enabled
    [    0.000000] Memory policy: ECC disabled, Data cache writealloc
    [    0.000000] BUG: mapping for 0xf8f00000 at 0xfe00c000 out of vmalloc space
    [    0.000000] BUG: mapping for 0xe0000000 at 0xfe000000 out of vmalloc space
    [    0.000000] BUG: mapping for 0xffff1000 at 0xfe200000 out of vmalloc space
    [    0.000000] PERCPU: Embedded 7 pages/cpu @c09c0000 s5440 r8192 d15040 u32768
    [    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 125824
    [    0.000000] Kernel command line: consoleblank=0 root=/dev/mmcblk0p2 rw rootwait earlyprintk
    [    0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
    [    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
    [    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
    [    0.000000] Memory: 240MB 256MB = 496MB total
    [    0.000000] Memory: 497428k/497428k available, 26860k reserved, 0K highmem
    [    0.000000] Virtual kernel memory layout:
    [    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    [    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    [    0.000000]     vmalloc : 0xe0800000 - 0xfd000000   ( 456 MB)
    [    0.000000]     lowmem  : 0xc0000000 - 0xe0000000   ( 512 MB)
    [    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
    [    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
    [    0.000000]       .text : 0xc0008000 - 0xc04bf650   (4830 kB)
    [    0.000000]       .init : 0xc04c0000 - 0xc04e9540   ( 166 kB)
    [    0.000000]       .data : 0xc04ea000 - 0xc051bfa0   ( 200 kB)
    [    0.000000]        .bss : 0xc051bfc4 - 0xc0538028   ( 113 kB)
    [    0.000000] Preemptible hierarchical RCU implementation.
    [    0.000000]  Verbose stalled-CPUs detection is disabled.
    [    0.000000] NR_IRQS:128
    [    0.000000] xlnx,ps7-ttc-1.00.a #0 at 0xe0800000, irq=43
    [    0.000000] Console: colour dummy device 80x30
    [    0.000000] console [tty0] enabled, bootconsole disabled

    Ubuntu 12.04 LTS arbot2 ttyPS0

    arbot2 login: root (automatic login)

    Last login: Sun Nov 11 08:00:07 UTC 2012 from 192.168.10.100 on pts/1
    Welcome to the Xillinux distribution for Zynq-7000 EPP.

    You may communicate data with standard FPGA FIFOs in the logic fabric by
    writing to or reading from the /dev/xillybus_* device files. Additional
    pipe files of that sort can be set up at request of a custom Xillybus IP core.

    For more information: http://www.xillybus.com.

    To start a graphical X-Windows session, type "startx" at shell prompt.



    But without i2c. :-(
    i2cdetect -l returns nothing.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 13 years ago in reply to Former Member

    I found log entry in /var/log/dmesg

    [    1.430000] xi2cps e0004000.i2c: 100 kHz mmio e0004000 irq 57

    But /dev/i2c-0 still does not exists.
    I have no idea.
    Any suggestions?

    Thanks

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 13 years ago in reply to Former Member

    Solved. It is easy. I2C-dev module must be installed (by default is disabled). It is controlled by option CONFIG_I2C_CHARDEV in .config.


    Vatu

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 13 years ago in reply to Former Member

    There is detailed procedure how to get working PS I2C.

    http://www.arbot.cz/post/2012/11/14/PS-I2C-in-Xillinux.aspx


    Vatu

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • Former Member
    0 Former Member over 13 years ago in reply to Former Member

    There is detailed procedure how to get working PS I2C.

    http://www.arbot.cz/post/2012/11/14/PS-I2C-in-Xillinux.aspx


    Vatu

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • Former Member
    0 Former Member over 11 years ago in reply to Former Member

    Could somebody tell me if there is any I2C device on Zedboard to play with?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube