Search

Technical Discussion Group Forum

This forum is provided for user discussion. While Beacon EmbeddedWorks support staff and engineers participate, Beacon EmbeddedWorks does not guarantee the accuracy of all information within in the Technical Discussion Group (TDG).

The "Articles" forums provide brief Articles written by Beacon EmbeddedWorks engineers that address the most frequently asked technical questions.

To receive email notifications when updates are posted for a Beacon EmbeddedWorks product download, please subscribe to the TDG Forum of interest.

TDG Forum

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 08 Nov 2006 01:07 PM by  kurtl@logicpd.com
Using EEPROM on 5485EVB
 15 Replies
Sort:
You are not authorized to post a reply.
Author Messages
tmloos
New Member
New Member
Posts:


--
27 Jan 2006 08:16 AM
    I am using Freescale's PCS and BSP and was wondering if anyone doing the same has been able to get reads and writes working to the EEPROM...

    I see some EEPROM lines under the drivers-->I2C section of the kernel config, but don't see anything obvious.

    Also curious about how to interface to the device from a C program.

    Thanks!
    Anonymous
    Posts:


    --
    27 Jan 2006 01:31 PM
    Hi tmloos,

    You need to have a programmed CPLD for this functionality.

    The CPLD device on the Fire Engines included in the M5475EVB, M5485EVB, M5474LITEKIT, and M5484LITEKIT Development Kits, does not contain any CPLD code.

    The CPLD is not required to run the microprocessor memory architecture or on-chip peripherals.

    Logic has developed additional features in the CPLD that provide the following interfaces and functionality:

    1. ISA-Like bus interface

    2. Serial EEPROM interface This interface can be used for scripting. Scripting is a method to execute losh commands automatically by listing them in a script file and using the command "source" to run the script in the file. This is useful for automating repetitive command line entries. For example: the command "source /cf_card/MYSCRIPT.TXT" will execute the script stored in the file "myscript.txt" on a mounted CompactFlash card.

    3. Compact Flash (CF) Type 1 memory mode only interface. The LogicLoader contains support for mounting and booting from the CompactFlash interface on the Fire Engine. If an ELF, BIN, RAW, or S-record image is stored on the CompactFlash card, that image may be loaded into memory.

    4. Board Power Management features

    You can find more information about getting the programming file for your CPLD here:

    http://www.logicpd.com/su...q/faq.php?faq_id=148

    Thanks,
    tmloos
    New Member
    New Member
    Posts:


    --
    27 Jan 2006 01:37 PM
    Aaron,
    Thanks for the reply...

    Once the CPLD is programmed, are you aware of the EEPROM support in the Freescale Linux PCS BSP and the operations to interface with a C program?

    Thanks,
    Tom
    Anonymous
    Posts:


    --
    27 Jan 2006 01:39 PM
    Hi Tom,

    I personally don't have any information about support within Freescale's BSP. Have you tried working with Logic's Linux BSP?

    Thanks,
    tmloos
    New Member
    New Member
    Posts:


    --
    27 Jan 2006 02:51 PM
    Aaron,
    I haven't but maybe I will... Can you describe the EEPROM Logic Linux support and C program interface?

    I was trying to get USB support running with the Freescale stuff using external controllers (PCI), but they are not very anxious to help... Maybe I'll start another thread on that with my experiment proposal using the Logic tools...

    Thanks,
    Tom
    peter.barada@logicpd.com
    New Member
    New Member
    Posts:72


    --
    02 Feb 2006 10:49 AM
    > I haven't but maybe I will... Can you describe the EEPROM Logic Linux support and C
    > program interface?

    At this point there's no software interface in the Logic Linux to interface to the EEPROM You use the flash filesystem to update/store a file that contains persistant state information.

    > I see some EEPROM lines under the drivers-->I2C section of the kernel config, but
    > don't see anything obvious.

    On the EVB we have the realtime clock that is interfaced via I2C. The I2C driver is enabled under Char Drivers->I2C Support->I2C Coldfire, and the code is in linux-2.4.26/drivers/i2c/, specifically i2c-algo-mcf.c. Also the RTC driver that uses this driver to communicate with the RTC chip(rv5c387a) is in linux-2.4.26/drivers/char/rv5c387a-rtc.c You can also read linux-2.4.26/Documentation/i2c/* for information on how to use the kernel I2C interface.

    Hope this helps...
    tmloos
    New Member
    New Member
    Posts:


    --
    09 Feb 2006 09:05 AM
    Freescale has responded that they do not support the eeprom either, but found a file in the arch/mips/lasat directory called at93c.c. This is apparantly a driver for the eeprom but I can't see how this fits into i2c. There is a missing layer and I'm wondering if anyone can help...

    What do you thing?
    peter.barada@logicpd.com
    New Member
    New Member
    Posts:72


    --
    09 Feb 2006 09:33 AM
    > Freescale has responded that they do not support the eeprom either, but found a file
    > in the arch/mips/lasat directory called at93c.c. This is apparantly a driver for the
    > eeprom but I can't see how this fits into i2c. There is a missing layer and I'm wondering
    > if anyone can help...

    The code that Freescale pointed you to is code that *directly* manipulates the SDA/SCLK signals on the lasat board to access teh EEPROM for that hardware.

    If you are planning to add a EEPROM that is hooked up to the i2c bus, then you can use the I2C layer as it is to access the EEPROM.

    The EEPROM that is currently on the FireEngine SOM is connected to the CPLD, and requires that you manipulate the SDA/SLCK signals via CPLD registers. To do this requires that the CPLD is programmed, and code to perform the bit-manipulation(which has noy yet been written, but at93c.c can be used as a guide to write the low-level access routines).

    As I said before, you *could* just write a file into the flash filesystem which is stored in the flash, and would be persistant across reboots.

    Why is it that you need to access the EEPROM? Can you describe more general what problem you are trying to solve, and how the EEPROM is part of the solution?
    tmloos
    New Member
    New Member
    Posts:


    --
    23 Feb 2006 07:55 PM
    Peter,
    Thanks for the response...

    We are using three eeproms in our design to set/get configuration from other devices, kind of like a shared memory approach. We are not necessarily interested in the non-volitle storage nature, which would easily be done with flash.

    I realize that the cpld needs to be programmed, we have an engineer on-site who can write that code.

    Could you please give some more details on how to use the i2c driver support in Linux to access the eeprom? I have not found any examples on-line and would appreciate some help.

    Thanks,
    Tom
    peter.barada@logicpd.com
    New Member
    New Member
    Posts:72


    --
    23 Feb 2006 08:44 PM
    > We are using three eeproms in our design to set/get configuration from other devices,
    > kind of like a shared memory approach. We are not necessarily interested in the
    > non-volitle storage nature, which would easily be done with flash.
    >
    > I realize that the cpld needs to be programmed, we have an engineer on-site who can
    > write that code.
    >
    > Could you please give some more details on how to use the i2c driver support in Linux
    > to access the eeprom? I have not found any examples on-line and would appreciate
    > some help.

    Let me try to explain. The SOM has an EEPROM that is wired to the CPLD. The ColdFire processor has an i2c controller that is wired through the SOM connectors to the mainboard where on the EVB is an i2c-RTC. The device driver I pointed you to accesses the RTC via the i2c layer. Currently I don't believe there are the i2c devices that you can access from users space, but if they were, then a google search for "linux eeprom i2c" should yield a wealth of information. As an example,
    http://codesink.org/eeprog.html
    Includes a program for read/writing to a 24xxx stype eeprom part on the i2c bus from an application. It should give you some more information on how to access the i2c bus, as well as the documentation in linux-2.4.26/Documentation/i2c.

    Hope this helps.
    alaemmer@htwg-konstanz.de
    New Member
    New Member
    Posts:


    --
    01 Nov 2006 02:14 AM
    Is it possible to store the MAC Ethernet address to this eeprom?

    André
    kurtl@logicpd.com
    New Member
    New Member
    Posts:


    --
    03 Nov 2006 11:28 AM
    Yes you could store the MAC address to the EEPROM.

    -Kurt
    Anonymous
    Posts:


    --
    03 Nov 2006 04:23 PM
    Another option that would be much simpler is to store the MAC address in a file and store it in a YAFFS partition in flash. LogicLoader uses the EEPROM so if you were to write a value I would suggest writing towards the end of the e2.

    Thanks,
    alaemmer@htwg-konstanz.de
    New Member
    New Member
    Posts:


    --
    04 Nov 2006 12:31 AM
    I have to read the MAC address from MQX and I think it would be easier to read a eeprom or a address in the flash memory than a file.

    I also have the problem, that I am using dBug ando lolo parallel with different memory locations. After creating a config in lolo and loading a program with CodeWarrier, dBug and lolo is not working anymore. So I do not know if the memory map is ok or if there a overlapping.

    Is there a description of the eeprom which bytes are reserved?

    André Lämmer
    Anonymous
    Posts:


    --
    07 Nov 2006 02:24 PM
    Hi Andre,

    Sorry for the delayed response, all the memory map information that you should need is in this doc.

    http://www.logicpd.com/do...60/1000202_Rev_B.pdf

    Thanks,
    kurtl@logicpd.com
    New Member
    New Member
    Posts:


    --
    08 Nov 2006 01:07 PM
    Lolo only uses the EEPROM if the first characters are "LOLO" or "VOLO" after reset.

    So if your not using Lolo power up scripts you can store anything in the EEPROM and use it in any software application.

    -Kurt
    You are not authorized to post a reply.