I am using C100 (Mindspeed ARM11 dual core).  I can correctly access
DDR2 and 16 bit flash on it via 8-bit and 32-bit commands (mdb,mdw) but
not 16-bit access. 

I discovered this by trying to do 'flash probe 0' and it returned 0. I
then looked through code and noticed that flash control/info is accessed
using 16-bit (since it is 16-bit part). I then verified that it also
fails on mdh command.

I traced it to arm11.c code:
int arm11_read_memory(struct target_s *target, uint32_t address,
uint32_t size, uint32_t count, uint8_t *buffer)
        case 2:
                {
                        arm11->reg_list[ARM11_RC_R1].dirty = 1;

                        for (size_t i = 0; i < count; i++)
                        {
                                /* ldrh    r1, [r0], #2 */
                                arm11_run_instr_no_data1(arm11,
                                        !
arm11_config_memrw_no_increment ? 0xe0d010b2 : 0xe1d010b0);

                                uint32_t res;

                                /* MCR p14,0,R1,c0,c5,0 */
                                arm11_run_instr_data_from_core(arm11,
0xEE001E15, &res, 1);

                                uint16_t svalue = res;
                                memcpy(buffer + count *
sizeof(uint16_t), &svalue, sizeof(uint16_t));
                        }

                        break;
                }

but I don't understand enough arm assembly to fix this.


> scan_chain
     TapName            | Enabled |   IdCode      Expected    IrLen
IrCap  IrMask Instr     
---|--------------------|---------|------------|------------|------|------|------|---------
 0 | c100.dsp           |    Y    | 0x27b3645b | 0x27b3645b | 0x05 |
0x01 | 0x1f | 0x1f
 1 | c100.cpu           |    Y    | 0x27b3645b | 0x27b3645b | 0x05 |
0x01 | 0x1f | 0x0c
> 
Below is output from running NOR and DDR accesses (nor bus is 16 bit,
ddr2 is 32 bit)

> mdb 0x20000000 0x10
0x20000000: 12 00 00 ea 14 f0 9f e5 14 f0 9f e5 14 f0 9f e5 
> mdh 0x20000000 0x10
0x20000000:   00   00   00   00   00   00   00   00   00   00   00   00
00   00   00   00 
> mdw 0x20000000 0x10
0x20000000: ea000012 e59ff014 e59ff014 e59ff014 e59ff014 e59ff014
e59ff014 e59ff014 
0x20000020: 80100120 80100180 801001e0 80100240 801002a0 80100300
80100360 12345678 
> mdb 0x80000000 0x10
0x80000000: 50 60 e6 12 f4 fa ee b3 b0 77 69 df 76 b6 73 7b 
> mdh 0x80000000 0x10
0x80000000:   00   00   00   00   00   00   00   00   00   00   00   00
00   00   00   00 
> mdw 0x80000000 0x10
0x80000000: 12e66050 b3eefaf4 df6977b0 7b73b676 8aefc6ef b9ec89fa
ecdef7b2 fd460aeb 
0x80000020: 9bf23b73 7bfbd81d 93b353ba d7b8da73 dccffae0 afdefc6e
28d99a7f ebce2fe2 
> 


Any help appreciated?
Michal


_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to