On 10/19/2017 09:50 AM, gabriel291...@gmail.com wrote: > From: Gabriel Augusto Costa <gabriel291...@gmail.com> > > I add a new arm machine with some peripherals. The machine is mk64fn1m0, a > cortex-m4 microcontroller from NXP Kinetis family. The machine can run a > simple arm binary file using UART0 in polling mode. > I prepared two patchs to include this machine: > PATCH v1: Include the machine and peripherals devices; > PATCH v2: Change the make file to compile this machine. > Also, I made a folder tree to accomodate this machine more or less like > u-boot. > In my opinion put all files in the same folder "/hw/arm" is not a good idea, > or put all code in an unique file, because machines from the same family > sharing the same peripherals. > The folder tree struct is machine/family/peripheral, as an example: > kinetis/k64/peripheral. > So, in this way the code will be more maintainable. > > Signed-off-by: Gabriel Augusto Costa <gabriel291...@gmail.com> > --- [...] > +static void kinetis_k64_sim_init(Object *obj) > +{ > + kinetis_k64_sim_state *s = KINETIS_K64_SIM(obj); > + SysBusDevice *sbd = SYS_BUS_DEVICE(obj); > + > + memory_region_init_io(&s->iomem, obj, &kinetis_k64_sim_ops, s, > + TYPE_KINETIS_K64_SIM, 0x2000);
Why not... personally I'd rather use 2 regions for the sysctl, a 8B for SOPT1 and and 128B for the rest mapped at the next 4KB block. > + sysbus_init_mmio(sbd, &s->iomem); > +}