[ECOS] 28Fxxx Flash query problem

Andrew Lunn andrew@lunn.ch
Tue Jun 24 14:18:00 GMT 2008


Probably the debugger is having trouble mapping registers to
variable. However r8 is used as w.

>     CYGHWR_FLASH_WRITE_ENABLE();
> 0041AFA0: 3D600280  lis      r11,640
> 0041AFA4: 3D40FFC0  lis      r10,-64
> 0041AFA8: 616B100C  ori      r11,r11,0x100c
> 0041AFAC: A10A0000  lhz      r8,0(r10)

Here is the load ROM[0]

> 0041AFB0: 800B0000  lwz      r0,0(r11)
> 0041AFB4: 7C0006AC  eieio
> 0041AFB8: 60000004  ori      r0,r0,0x0004
> 0041AFBC: 900B0000  stw      r0,0(r11)
> 0041AFC0: 7C0006AC  eieio
>     
>     ROM[0] = FLASH_Read_ID;
> 0041AFC4: 38000090  li       r0,144
> 0041AFC8: B00A0000  sth      r0,0(r10)
> 
>     // Manufacturers' code
>     id[0] = ROM[0];
> 0041AFCC: A12A0000  lhz      r9,0(r10)
> 0041AFD0: B1230000  sth      r9,0(r3)
>     // Part number
>     id[1] = ROM[1];
> 0041AFD4: A00A0002  lhz      r0,2(r10)
> 
>     ROM[0] = FLASH_Reset;
> 0041AFD8: 392000FF  li       r9,255
> 0041AFDC: B0030002  sth      r0,2(r3)
> 0041AFE0: B12A0000  sth      r9,0(r10)
> 
>     CYGHWR_FLASH_WRITE_DISABLE();
> 0041AFE4: 800B0000  lwz      r0,0(r11)
> 0041AFE8: 7C0006AC  eieio
> 0041AFEC: 540007B8  rlwinm   r0,r0,0,30,28
> 0041AFF0: 900B0000  stw      r0,0(r11)
> 0041AFF4: 7C0006AC  eieio
>     
>     // Stall, waiting for flash to return to read mode.
>     while (w != ROM[0]);
> 0041AFF8: A00A0000  lhz      r0,0(r10)
> 0041AFFC: 7C004000  cmpw     r0,r8
> 0041B000: 4D820020  beqlr
> 0041B004: 4BFFFFF4  b        flash_query+0x58 (0x41aff8)

And here is the loop waiting for it to return back to the old value.

The basic assembly language looks O.K, but im no expert with this CPU
architecture. I would still suspect there is not a caching problem....

              Andrew
 

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss



More information about the Ecos-discuss mailing list