Reading Fuse

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
1,342件の閲覧回数
SteM
Contributor III

Hi all,

how can i read the iMX51 fuses inside a WEC700 driver?

I need to read the unique ID of the chip and my guess is that is contained in the fuses area.

My try is:

UINT8* pRegs;
    int val;
    PHYSICAL_ADDRESS phyAddr;
    ULONG ulSize = 0x840*sizeof(UINT8);
    phyAddr.QuadPart = CSP_BASE_REG_PA_IIM;
    pRegs = (UINT8*)MmMapIoSpace(phyAddr, ulSize, FALSE);
    RETAILMSG(1, (L":  %x\r\n", pRegs));

    val  = INREG32(&pRegs[0x820]);
    RETAILMSG(1, (L":  %x\r\n", val));

    val <<= 8;
    val |= INREG32(&pRegs[0x824]);
    RETAILMSG(1, (L":  %x\r\n", val));

but the driver hangs and the system stop to work.

How can i do it?

Thanks!

ラベル(2)
0 件の賞賛
1 解決策
1,040件の閲覧回数
JerryZeng
NXP Employee
NXP Employee

I don't see any code to enable IIM clock in your driver, so you violate the basic rule in the driver. I believe that's the root cause for your hang (and this is a typical case for a driver hang).

Please add following code before / after IIM access:

    DDKClockSetGatingMode(DDK_CLOCK_GATE_INDEX_IIM, DDK_CLOCK_GATE_MODE_ENABLED_ALL);

    ......

    DDKClockSetGatingMode(DDK_CLOCK_GATE_INDEX_IIM, DDK_CLOCK_GATE_MODE_DISABLED);

元の投稿で解決策を見る

0 件の賞賛
4 返答(返信)
1,040件の閲覧回数
JasonLiu
NXP Employee
NXP Employee

Please keep in mind, before any access to the register of one IP component, we need turn that IP component clock ON, otherwise, system bus will hang up and then system hang eventually.

1,041件の閲覧回数
JerryZeng
NXP Employee
NXP Employee

I don't see any code to enable IIM clock in your driver, so you violate the basic rule in the driver. I believe that's the root cause for your hang (and this is a typical case for a driver hang).

Please add following code before / after IIM access:

    DDKClockSetGatingMode(DDK_CLOCK_GATE_INDEX_IIM, DDK_CLOCK_GATE_MODE_ENABLED_ALL);

    ......

    DDKClockSetGatingMode(DDK_CLOCK_GATE_INDEX_IIM, DDK_CLOCK_GATE_MODE_DISABLED);

0 件の賞賛
1,040件の閲覧回数
SteM
Contributor III

Yes!

I added your code and it solved the problem.

Btw, I don't understand why there was no problem reading pRegs[0x20] and there was problem to read pRegs[0x820]...

Thanks a lot!

0 件の賞賛
1,040件の閲覧回数
JerryZeng
NXP Employee
NXP Employee

pRegs[0x20] is for IIM register and pRegs[0x820] is for eFuse, maybe IIM register access only need IPG clock and this clock is enabled by other driver. Just guess.

0 件の賞賛