How does one program/blow/burn fuses on an mx53 programmatically in WEC7?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How does one program/blow/burn fuses on an mx53 programmatically in WEC7?

2,772 Views
petertaylor
Contributor II

We’re trying to finish up the last bits and pieces of our BSP.  And of course, we’ve run into another strange problem. 

Background:  We've got a custom board with an iMX53 on it.  We're started with a WEC7 BSP from Adeneo and have most everything
working. We are using the iim driver from the BSP from Freescale/Adeneo. We have written a program that takes the address and the value as command line parameters and then loads the driver and programs the fuses, and then displays all of the fuses in bank 0 and 1.  The Reference Manual (with addendum) talks about the fuse box, iim, and the in the addendum lists the fuse information. 

 

Problem: We are trying to program some fuses, but they don't stay programmed after a re-boot.  We've verified that they do get programmed, and are programmed by reading the fuses. 

 

What we've tried:

  1.   At first we tried programming the user space ones (0x0860 - 0x087C).  We would program them with something, and then power cycle the board, and display the fuses again, and the bits were all back to 0's. 
  2. We found the documentation on VDD_FUSE in the imx53iec.pdf that said that the VDD_FUSE needed to be connected, so we connected it through a 100K pull-up first, then a 1K pull-up to the 3.3V supply on the board.  Again we attempted to program both the user space and the mad address areas, and after a power cycle we were back to 0's, again. 
    1. We got the source code to uBoot since that seems to be what most people are using, and compared the programming functions in both eBoot and uBoot.  The only major difference that we found was that eBoot  programs the IIM_FCTL with 0x31, where uBoot just programs it with 0x01.  So eBoot tells it to use a program pulse of 3 rather than 0 that uBoot uses. 
      1. Connected the VDD_FUSE to 26 ohm power resistor then to a 3.2 V power supply. The power supply was reporting 120 mA current, and then something has stopped working.  (I was about to say blown up, but there was no magic smoke.  How disappointing. ;-) )  So this might have worked, if my board hand's stopped working. 

        Questions:

        1. Has anyone had success programming fuses through the iim WEC7 driver?  (I just need to know that, yes, it can be done.)
        2. Is there something else that has to happen after programming?  Are there other bits that need to be set?  Do I need to program the lock the bits?(I was trying to avoid this). 
        3. What else should I try?

        Thanks,

        Peter

        Labels (2)
        0 Kudos
        Reply
        2 Replies

        1,125 Views
        Yuri
        NXP Employee
        NXP Employee

        First, VDD_FUSE [3.0 – 3.3 V] must be applied for burning.

        As for i.MX53 fuse burning two solutions may be recommended.

        1. MFG tool.

        The following Community thread contains files for the MFG tool.

        https://community.freescale.com/message/254185#254185

        2. U-boot.

        Note, U-boot may be loaded by the MFG tool.

        You may use U-boot to work with the fuses, assuming VDD_FUSE is

        proper for writing. Below is IIM command  help of U-boot.

        MX53-LOCO U-Boot > help iim

        iim - IIM sub system

        Usage:

        iim Warning: all numbers in parameter are in hex format!

        iim read <bank> <row>   - Read some fuses

        iim read fecmac - Read FEC Mac address

        iim blow <bank> <row> <value>   - Blow some fuses

        iim blow fecmac <0x##:0x##:0x##:0x##:0x##:0x##>- Blow FEC Mac address MX53-LOCO

        U-Boot >

        0 Kudos
        Reply

        1,125 Views
        petertaylor
        Contributor II

        It sounds like a lot of work to either get UBoot or the MFG test working on my custom board.  I would rather not start another development effort to do the simple job of programming the fuses.  What I would like to use is the driver provided in the ARD BSP  and referred to in the WCE700_MX53_ER_1105_ARD_ReferenceManual.pdf chapter 18  to blow the fuses.  [1]

        I've looked at both at the ARD code and the UBoot code and they are similar.  I just don't know
        why the ARD IIM Driver is not working for me.  I know that I need to provide 3.3V to VDD_FUSE.  I also know that I need to make sure that the EFUSE_PROG_SUPPLY_GATE  bit of the CGPR register is set.

        There is a cryptic message in the MX53QSB schematic, p111 that says:

        "Note: If the internal chip regulators for PLL circuits are not used, R12 should be 1K Ohm to limit current to VDD_FUSE. If the internal chip regulators are supplied by VDD_REG_2V5, R12 should be 0 Ohm."

        Which leaves me wondering if I need a resistor or not.  Our board started with the QSB design and so has the two internal LDO's powered up, but I don't believe that we're using either one to power something else.

        There is also a reference in the IIM chapter of the iMX53RM that alludes to "supervisor mode" (p 1843) it says:

        "All IIM registers can be accessed in user mode except FCTL, which controls programming functions and can be accessed in supervisor mode only."

        If I search the rest of the reference manual for "supervisor mode", I find a few references throughout the manual but nothing that says how to get into supervisor mode.  The only hint is on page 956 section 20.3.1 Peripheral Access Policy.

        A. So how would I tell if I'm in supervisor mode?

        B. How would I get into supervisor mode?

        <edit>

        Looking in the DDI0406C_armv7-AR-_architecture_reference_manual, and the documentation about the CSPR register, the last 5 bits are the mode bits.  Using a KITL connection, I've verified that in the driver code, the mode is system mode (0x1F) and that in my application it is user mode (0x10).  So it's not in supervisor mode (0x13), but does have the same privilege level.   (Sorry, I sleep with the MX53RM under my pillow and sometimes forget that there is other documentation. <grin>)

        So the answer to the above questions:

        A. You know which mode you are in by looking at the CSPR register, bits 4:0.

        B. WEC7 is taking you into and out of system mode, so it's probably somewhere in the private code.

        </edit>

        I guess the real question is what are the steps that I need to take both on my board and with the iim driver to program/blow/set the fuses?

        I think it would include:

        1 - Make sure that VDD_FUSE is at 3-3.3V

        2 - Enable fuse programming by setting the EFUSE_PROG_SUPPLY_GATE bit.

        3 - Make sure that the clock to the IIM is enabled, CCM_CCGR0[31:30).

        4 - For reading follow the reading instructions in the IIM chapter.

        5 - For writing follow the writing instructions in the IIM chapter.

        What else am I missing?

           

        [1] :
        http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=i.MX535&nodeId=018rH3ZrDR988D&fpsp=1&...

        0 Kudos
        Reply