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
    About the element14 Community
  • 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
Ultrazed Hardware Design Changing MAC address for IOCC carrier card
  • 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 8 replies
  • Subscribers 356 subscribers
  • Views 1217 views
  • Users 0 members are here
Related

Changing MAC address for IOCC carrier card

ishahak
ishahak over 7 years ago

Hi,

I have got a second IOCC card and have learned that by default it has the same MAC address as the first one - 00:0A:35:00:22:01.

This board has an I2C controlled EEPROM for storing the MAC address, but I couldn't find any instructions for how to change it.

The docs say that the I2C address is 0xA2, but I don't think that this I2C is mapped to one of the I2C devices in Petalinux.

Here is the result for I2C-detect:

i2cdetect -l

i2c-1   i2c             Xilinx DP AUX                           I2C adapter

i2c-0   i2c             Cadence I2C at ff030000                 I2C adapter

I was told that 0xA2 should be represents as 0x51 because in I2C the leftmost bit is part of the protocol. When I try for each of the above interfaces, I'm getting errors:

i2cget -y -f 0 0x51
i2cget: read failed: No such device or address

i2cget -y -f 1 0x51
i2cget: read failed: Connection timed out

Can anyone please suggest a way for modifying the MAC address? 

  • Sign in to reply
  • Cancel

Top Replies

  • zedhed
    zedhed over 7 years ago +1
    Hi ishahak, Check out the PetaLinux BSP named "UltraZed-EG IO Carrier Card - PetaLinux 2017.4 Enhanced BSP" that was just posted to this page: http://www.ultrazed.org/support/design/17596/131 We found…
  • zedhed
    0 zedhed over 7 years ago

    Hi ishahak,

    Check out the PetaLinux BSP named "UltraZed-EG IO Carrier Card - PetaLinux 2017.4 Enhanced BSP" that was just posted to this page:

    http://www.ultrazed.org/support/design/17596/131

    We found a way to use a startup script to scrape the MAC address out of that EEPROM and call ifconfig to set the HWADDR to the MAC address read from the EEPROM.

    Also, check out this source code here to see exactly what calls were made:

    https://github.com/Avnet/petalinux/blob/master/configs/meta-user.uz3eg_iocc/recipes-apps/mac-eeprom-config/files/mac_eeprom_config.sh

    Best Regards,

    -Kevin

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • rgb-sti
    0 rgb-sti over 7 years ago
    Hi ishahak,
     
     
    Also, I believe the MAC eeprom is on one of the slave channels for i2c1 switch / mux.
    This probably isn't configured correctly in Linux, as you woud expect to see this represented as four i2c busses.
     
    Regards,
     
    Richard.
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • ishahak
    0 ishahak over 7 years ago

    Thanks for the responses but it is still not working:

    I installed Petalinux 2017.4 and created a new project with the 2017.4 BSP

    Now if I do "cat project-spec/meta-user/recipes-apps/mac-eeprom-config-init/files/mac-eeprom-config-init" I see this:

    DAEMON=/home/root/mac_eeprom_config.sh
    DAEMON_OPTS="--bus 2 --slave 0x51 --file /etc/network/interfaces --interface eth0"

    and it means that a command for seeing the current setting would be as below, but it is still failing...
     

    i2cget -y 2 0x51 0xFA

    i2cget: can't open '/dev/i2c/2': No such file or directory

     
    Any idea please?
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • zedhed
    0 zedhed over 7 years ago

    Hi ishahak,

    You will need to make sure that the device tree has an entry for PSU I2C1 device as well as an entry for the the nxp,pca9542 compatible I2C multiplexer.

    https://github.com/Avnet/petalinux/blob/master/configs/device-tree/system-user.dtsi.UZ3EG_IOCC

    From this device tree source file that we use to build the PetaLinux BSP:

    &i2c1 {
    tstatus = "okay";
    tclock-frequency = <400000>;

    ti2cswitch@70 { /* U7 on UZ3EG SOM */
    ttcompatible = "nxp,pca9542";
    tt#address-cells = <1>;
    tt#size-cells = <0>;
    ttreg = <0x70>;
    tti2c@0 { /* i2c mw 70 0 1 */
    ttt#address-cells = <1>;
    ttt#size-cells = <0>;
    tttreg = <0>;
    ttt/* IIC_EEPROM */
    ttteeprom@51 { /* U5 on UZ3EG IOCC and U7 on the UZ7EV EVCC*/
    ttttcompatible = "at,24c08";
    ttttreg = <0x51>;
    ttt};
    tt};
    t};
    };

    However, I have found that this entry for EEPROM at address 0x51 will prevent you from manually accessing the device with i2ctools because the at,24c08 driver is assigned exclusive control over that slave device:

    eeprom@51 { /* U5 on UZ3EG IOCC and U7 on the UZ7EV EVCC*/
    ttttcompatible = "at,24c08";
    ttttreg = <0x51>;
    ttt};

    If you want to access the EEPROM from i2ctools, simply remove that EEPROM node from the devicetree and rebuild.

    Best Regards,

    -Kevin

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • rgb-sti
    0 rgb-sti over 7 years ago in reply to zedhed
    Hi,
     
    I was also looking at this recently. I found the driver for the i2c switch/mux isn't fully implemented for the 9543 in PetaLinux 2017.4.
     
    I ended up patching a version from a more recent mainline kernel.
     
    You should see the following from dmesg if it loaded correctly:
     
    [    1.568746] cdns-i2c ff020000.i2c: 400 kHz mmio ff020000 irq 34
    [    1.575213] cdns-i2c ff030000.i2c: 400 kHz mmio ff030000 irq 35
    [    1.609474] i2c i2c-1: Added multiplexed i2c bus 3
    [    1.614902] i2c i2c-1: Added multiplexed i2c bus 4
    [    1.619642] pca954x 1-0070: registered 2 multiplexed busses for I2C switch pca9543
     
    The end result should be that you are provided with four i2c buses to work with.
     
    Alternatively, you could use i2ctools to manually switch the channels on the mux for now, just so you can see what is present.
     
    ~# i2cdetect -l
    i2c-3   i2c             i2c-1-mux (chan_id 0)                   I2C adapter
    i2c-1   i2c             Cadence I2C at ff030000                 I2C adapter
    i2c-4   i2c             i2c-1-mux (chan_id 1)                   I2C adapter
    i2c-2   i2c             Cadence I2C at ff020000                 I2C adapter
    ~# i2cset -f 1 0x70 0x00 0x01
     
    The switch is at address 0x70, set the required channel to address 0x00.
    x00 - reset, x01 - channel 1, x02 - channel 2, x03 both channels.
    then i2cdetect the i2c at ff030000.
     
    Thanks,
     
    Richard.
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • ishahak
    0 ishahak over 7 years ago in reply to rgb-sti

    Hi @rgb-sti, 

    Thank you so much for the response.

    When I do dmegs, I'm getting only

    sh$ dmesg | grep -i i2c

    [    2.656801] i2c /dev entries driver
    [    2.660463] cdns-i2c ff030000.i2c: 400 kHz mmio ff030000 irq 32
    [    2.666850] pca954x 0-0070: registered 0 multiplexed busses for I2C mux pca9542
    sh$ i2cdetect -l
    i2c-1 i2c Xilinx DP AUX I2C adapter
    i2c-0 i2c  Cadence I2C at ff030000 I2C adapter
    So I'm afraid it is different setup. It seems like the MUX at my side it not really wired correctly. Did you put a specific configuration in Vivado for getting your current setup?
     
    Thank you!
    -Itay
     
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • rgb-sti
    0 rgb-sti over 7 years ago in reply to ishahak

    Hi Itay,

    The differences should be minor and probably not an issue. I doubt it is a Vivado issue, as your i2c bus is enabled. The switch is handled at board level customisation. It appears it is detected, but not fully functional.

    I had exactly the same issue until I used a later driver.

    Make sure the device tree is updated.

    &i2c1 {
        status = "okay";
        clock-frequency = <400000>;
     
        i2cswitch@70 { /* U7 on UZ3EG SOM */
            compatible = "nxp,pca9543";
            #address-cells = <1>;
            #size-cells = <0>;
            reg = <0x70>;
     
    ....
     
    Ensure the kconfig is updated, as per the driver requirements.
     
     
       CONFIG_I2C_MUX=y
     
       CONFIG_I2C_MUX_PCA9541=y
     
       CONFIG_I2C_MUX_PCA954x=y
     
        
     
       Patch a newer driver from Linux.
     
        
     
       /drivers/i2c/muxes/i2c-mux-pca954x.c
     
        
     
       I got one from the latest Linux Kernel and it worked fine.
     
        

    Thanks,

     

    Richard.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • ishahak
    0 ishahak over 7 years ago in reply to rgb-sti

    Hi Richard,

    I was trying your suggestion. Took the latest i2c-mux-pca954x.c and replaced it into the kernel-source tree. This leading to compilation problems.

    At first I got

    drivers/i2c/muxes/i2c-mux-pca954x.c:49:41: fatal error: linux/platform_data/pca954x.h: No such file or directory
     #include <linux/platform_data/pca954x.h>
     
    So I changed "platform_data" into "i2c".
     
    Then I got
    drivers/i2c/muxes/i2c-mux-pca954x.c:81:29: error: field ‘id’ has incomplete type
      struct i2c_device_identity id;
    So I was starting to change many files, without success...
    • 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 © 2026 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