2017-06-23 17:21 GMT-03:00 Philippe Mathieu-Daudé <f4...@amsat.org>:
> Hi Vinicius, > > Looking at the RT5350 datasheet: > http://www.mouser.com/ds/2/813/RT5350-1022839.pdf > > pp.19> > 3.2 Memory Map Summary > 1000.0000 - 1000.00FF 256 Mbps SYSCTL > 1011.0000 - 1011.7FFF 32 Kbps Ethernet switch > > pp.22> > 3.4 System Control > 3.4.3 Register Description (base: 0x1000_0000) > GPIOMODE: GPIO Purpose Select (offset: 0x0060) > > pp.122> > 3.19 Ethernet Switch > 3.19.4 Register Description (base: 0x1011_0000) > LEDC: LED Control Register (offset: 0x0168) > LED Polarity Control for each port: 1’b1: High active > > having 23=0b10111 my guess is your reset() function try to toggle on 4 > leds. everything seems fine on QEMU side, now it depends how you > implemented the SYSCTL and EthernetSwitch devices. > > eventually you are missing some EthernetSwitch mapped registers and an > exception is generated, ending reading some SYSCTL register... > > running qemu-system with '-d in_asm,int,unimp' helps to understand if them > problem comes from your model, before from QEMU core code. > > regards, > > Phil. > Hi, In the machine code, I added Ethernet Switch at 0x10110000: ralink_router.c#L282 <https://gitlab.com/vinifr/qemu-routers/blob/ralink/hw/mips/ralink_router.c#L282>. And here is Ethernet code: ralink_net.c <https://gitlab.com/vinifr/qemu-routers/blob/ralink/hw/net/ralink_net.c>. I'm trying to run u-boot bootloader: u-boot_RT5350F-OLinuXino <https://github.com/OLIMEX/u-boot_RT5350F-OLinuXino>. The problem happens when executing this line: start.S#L1540 <https://github.com/OLIMEX/u-boot_RT5350F-OLinuXino/blob/master/cpu/ralink_soc/start.S#L1540> . I have found Qemu reaches the function memory_region_dispatch_write: memory_region_dispatch_write (mr=0x555556219880 <io_mem_unassigned>, addr=269549928, data=23, size=4, attrs=...) at /home/vini/projs/emuladores/qemu-routers/memory.c:1306 1306 if (!memory_region_access_valid(mr, addr, size, true)) { (gdb) n 1307 unassigned_mem_write(mr, addr, data, size); return MEMTX_DECODE_ERROR; } So, it happened a decode error even with Ethernet Switch registered at 0x10110000. Thanks for help! Vini