2 * Copyright (c) 2011, Max Filippov, Open Source and Linux Lab.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the Open Source and Linux Lab nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 #include "qemu/osdep.h"
29 #include "qemu/units.h"
30 #include "qapi/error.h"
32 #include "sysemu/sysemu.h"
33 #include "hw/boards.h"
34 #include "hw/loader.h"
35 #include "hw/qdev-properties.h"
37 #include "exec/memory.h"
38 #include "exec/address-spaces.h"
39 #include "hw/char/serial.h"
41 #include "hw/sysbus.h"
42 #include "hw/block/flash.h"
43 #include "chardev/char.h"
44 #include "sysemu/device_tree.h"
45 #include "sysemu/reset.h"
46 #include "sysemu/runstate.h"
47 #include "qemu/error-report.h"
48 #include "qemu/option.h"
49 #include "bootparam.h"
50 #include "xtensa_memory.h"
51 #include "hw/xtensa/mx_pic.h"
52 #include "migration/vmstate.h"
54 typedef struct XtfpgaFlashDesc
{
61 typedef struct XtfpgaBoardDesc
{
62 const XtfpgaFlashDesc
*flash
;
67 typedef struct XtfpgaFpgaState
{
74 static void xtfpga_fpga_reset(void *opaque
)
76 XtfpgaFpgaState
*s
= opaque
;
82 static uint64_t xtfpga_fpga_read(void *opaque
, hwaddr addr
,
85 XtfpgaFpgaState
*s
= opaque
;
88 case 0x0: /*build date code*/
91 case 0x4: /*processor clock frequency, Hz*/
94 case 0x8: /*LEDs (off = 0, on = 1)*/
97 case 0xc: /*DIP switches (off = 0, on = 1)*/
103 static void xtfpga_fpga_write(void *opaque
, hwaddr addr
,
104 uint64_t val
, unsigned size
)
106 XtfpgaFpgaState
*s
= opaque
;
109 case 0x8: /*LEDs (off = 0, on = 1)*/
113 case 0x10: /*board reset*/
115 qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET
);
121 static const MemoryRegionOps xtfpga_fpga_ops
= {
122 .read
= xtfpga_fpga_read
,
123 .write
= xtfpga_fpga_write
,
124 .endianness
= DEVICE_NATIVE_ENDIAN
,
127 static XtfpgaFpgaState
*xtfpga_fpga_init(MemoryRegion
*address_space
,
128 hwaddr base
, uint32_t freq
)
130 XtfpgaFpgaState
*s
= g_malloc(sizeof(XtfpgaFpgaState
));
132 memory_region_init_io(&s
->iomem
, NULL
, &xtfpga_fpga_ops
, s
,
133 "xtfpga.fpga", 0x10000);
134 memory_region_add_subregion(address_space
, base
, &s
->iomem
);
136 xtfpga_fpga_reset(s
);
137 qemu_register_reset(xtfpga_fpga_reset
, s
);
141 static void xtfpga_net_init(MemoryRegion
*address_space
,
145 qemu_irq irq
, NICInfo
*nd
)
151 dev
= qdev_new("open_eth");
152 qdev_set_nic_properties(dev
, nd
);
154 s
= SYS_BUS_DEVICE(dev
);
155 sysbus_realize_and_unref(s
, &error_fatal
);
156 sysbus_connect_irq(s
, 0, irq
);
157 memory_region_add_subregion(address_space
, base
,
158 sysbus_mmio_get_region(s
, 0));
159 memory_region_add_subregion(address_space
, descriptors
,
160 sysbus_mmio_get_region(s
, 1));
162 ram
= g_malloc(sizeof(*ram
));
163 memory_region_init_ram_nomigrate(ram
, OBJECT(s
), "open_eth.ram", 16 * KiB
,
165 vmstate_register_ram_global(ram
);
166 memory_region_add_subregion(address_space
, buffers
, ram
);
169 static PFlashCFI01
*xtfpga_flash_init(MemoryRegion
*address_space
,
170 const XtfpgaBoardDesc
*board
,
171 DriveInfo
*dinfo
, int be
)
174 DeviceState
*dev
= qdev_new(TYPE_PFLASH_CFI01
);
176 qdev_prop_set_drive(dev
, "drive", blk_by_legacy_dinfo(dinfo
));
177 qdev_prop_set_uint32(dev
, "num-blocks",
178 board
->flash
->size
/ board
->flash
->sector_size
);
179 qdev_prop_set_uint64(dev
, "sector-length", board
->flash
->sector_size
);
180 qdev_prop_set_uint8(dev
, "width", 2);
181 qdev_prop_set_bit(dev
, "big-endian", be
);
182 qdev_prop_set_string(dev
, "name", "xtfpga.io.flash");
183 s
= SYS_BUS_DEVICE(dev
);
184 sysbus_realize_and_unref(s
, &error_fatal
);
185 memory_region_add_subregion(address_space
, board
->flash
->base
,
186 sysbus_mmio_get_region(s
, 0));
187 return PFLASH_CFI01(dev
);
190 static uint64_t translate_phys_addr(void *opaque
, uint64_t addr
)
192 XtensaCPU
*cpu
= opaque
;
194 return cpu_get_phys_page_debug(CPU(cpu
), addr
);
197 static void xtfpga_reset(void *opaque
)
199 XtensaCPU
*cpu
= opaque
;
204 static uint64_t xtfpga_io_read(void *opaque
, hwaddr addr
,
210 static void xtfpga_io_write(void *opaque
, hwaddr addr
,
211 uint64_t val
, unsigned size
)
215 static const MemoryRegionOps xtfpga_io_ops
= {
216 .read
= xtfpga_io_read
,
217 .write
= xtfpga_io_write
,
218 .endianness
= DEVICE_NATIVE_ENDIAN
,
221 static void xtfpga_init(const XtfpgaBoardDesc
*board
, MachineState
*machine
)
223 #ifdef TARGET_WORDS_BIGENDIAN
228 MemoryRegion
*system_memory
= get_system_memory();
229 XtensaCPU
*cpu
= NULL
;
230 CPUXtensaState
*env
= NULL
;
231 MemoryRegion
*system_io
;
232 XtensaMxPic
*mx_pic
= NULL
;
235 PFlashCFI01
*flash
= NULL
;
236 QemuOpts
*machine_opts
= qemu_get_machine_opts();
237 const char *kernel_filename
= qemu_opt_get(machine_opts
, "kernel");
238 const char *kernel_cmdline
= qemu_opt_get(machine_opts
, "append");
239 const char *dtb_filename
= qemu_opt_get(machine_opts
, "dtb");
240 const char *initrd_filename
= qemu_opt_get(machine_opts
, "initrd");
241 const unsigned system_io_size
= 224 * MiB
;
242 uint32_t freq
= 10000000;
244 unsigned int smp_cpus
= machine
->smp
.cpus
;
247 mx_pic
= xtensa_mx_pic_init(31);
248 qemu_register_reset(xtensa_mx_pic_reset
, mx_pic
);
250 for (n
= 0; n
< smp_cpus
; n
++) {
251 CPUXtensaState
*cenv
= NULL
;
253 cpu
= XTENSA_CPU(cpu_create(machine
->cpu_type
));
257 freq
= env
->config
->clock_freq_khz
* 1000;
261 MemoryRegion
*mx_eri
;
263 mx_eri
= xtensa_mx_pic_register_cpu(mx_pic
,
264 xtensa_get_extints(cenv
),
265 xtensa_get_runstall(cenv
));
266 memory_region_add_subregion(xtensa_get_er_region(cenv
),
269 cenv
->sregs
[PRID
] = n
;
270 xtensa_select_static_vectors(cenv
, n
!= 0);
271 qemu_register_reset(xtfpga_reset
, cpu
);
272 /* Need MMU initialized prior to ELF loading,
273 * so that ELF gets loaded into virtual addresses
278 extints
= xtensa_mx_pic_get_extints(mx_pic
);
280 extints
= xtensa_get_extints(env
);
284 XtensaMemory sysram
= env
->config
->sysram
;
286 sysram
.location
[0].size
= machine
->ram_size
;
287 xtensa_create_memory_regions(&env
->config
->instrom
, "xtensa.instrom",
289 xtensa_create_memory_regions(&env
->config
->instram
, "xtensa.instram",
291 xtensa_create_memory_regions(&env
->config
->datarom
, "xtensa.datarom",
293 xtensa_create_memory_regions(&env
->config
->dataram
, "xtensa.dataram",
295 xtensa_create_memory_regions(&sysram
, "xtensa.sysram",
299 system_io
= g_malloc(sizeof(*system_io
));
300 memory_region_init_io(system_io
, NULL
, &xtfpga_io_ops
, NULL
, "xtfpga.io",
302 memory_region_add_subregion(system_memory
, board
->io
[0], system_io
);
304 MemoryRegion
*io
= g_malloc(sizeof(*io
));
306 memory_region_init_alias(io
, NULL
, "xtfpga.io.cached",
307 system_io
, 0, system_io_size
);
308 memory_region_add_subregion(system_memory
, board
->io
[1], io
);
310 xtfpga_fpga_init(system_io
, 0x0d020000, freq
);
311 if (nd_table
[0].used
) {
312 xtfpga_net_init(system_io
, 0x0d030000, 0x0d030400, 0x0d800000,
313 extints
[1], nd_table
);
316 serial_mm_init(system_io
, 0x0d050020, 2, extints
[0],
317 115200, serial_hd(0), DEVICE_NATIVE_ENDIAN
);
319 dinfo
= drive_get(IF_PFLASH
, 0, 0);
321 flash
= xtfpga_flash_init(system_io
, board
, dinfo
, be
);
324 /* Use presence of kernel file name as 'boot from SRAM' switch. */
325 if (kernel_filename
) {
326 uint32_t entry_point
= env
->pc
;
327 size_t bp_size
= 3 * get_tag_size(0); /* first/last and memory tags */
328 uint32_t tagptr
= env
->config
->sysrom
.location
[0].addr
+
331 BpMemInfo memory_location
= {
332 .type
= tswap32(MEMORY_TYPE_CONVENTIONAL
),
333 .start
= tswap32(env
->config
->sysram
.location
[0].addr
),
334 .end
= tswap32(env
->config
->sysram
.location
[0].addr
+
337 uint32_t lowmem_end
= machine
->ram_size
< 0x08000000 ?
338 machine
->ram_size
: 0x08000000;
339 uint32_t cur_lowmem
= QEMU_ALIGN_UP(lowmem_end
/ 2, 4096);
341 lowmem_end
+= env
->config
->sysram
.location
[0].addr
;
342 cur_lowmem
+= env
->config
->sysram
.location
[0].addr
;
344 xtensa_create_memory_regions(&env
->config
->sysrom
, "xtensa.sysrom",
347 if (kernel_cmdline
) {
348 bp_size
+= get_tag_size(strlen(kernel_cmdline
) + 1);
351 bp_size
+= get_tag_size(sizeof(uint32_t));
353 if (initrd_filename
) {
354 bp_size
+= get_tag_size(sizeof(BpMemInfo
));
357 /* Put kernel bootparameters to the end of that SRAM */
358 tagptr
= (tagptr
- bp_size
) & ~0xff;
359 cur_tagptr
= put_tag(tagptr
, BP_TAG_FIRST
, 0, NULL
);
360 cur_tagptr
= put_tag(cur_tagptr
, BP_TAG_MEMORY
,
361 sizeof(memory_location
), &memory_location
);
363 if (kernel_cmdline
) {
364 cur_tagptr
= put_tag(cur_tagptr
, BP_TAG_COMMAND_LINE
,
365 strlen(kernel_cmdline
) + 1, kernel_cmdline
);
370 void *fdt
= load_device_tree(dtb_filename
, &fdt_size
);
371 uint32_t dtb_addr
= tswap32(cur_lowmem
);
374 error_report("could not load DTB '%s'", dtb_filename
);
378 cpu_physical_memory_write(cur_lowmem
, fdt
, fdt_size
);
379 cur_tagptr
= put_tag(cur_tagptr
, BP_TAG_FDT
,
380 sizeof(dtb_addr
), &dtb_addr
);
381 cur_lowmem
= QEMU_ALIGN_UP(cur_lowmem
+ fdt_size
, 4 * KiB
);
386 error_report("could not load DTB '%s': "
387 "FDT support is not configured in QEMU",
392 if (initrd_filename
) {
393 BpMemInfo initrd_location
= { 0 };
394 int initrd_size
= load_ramdisk(initrd_filename
, cur_lowmem
,
395 lowmem_end
- cur_lowmem
);
397 if (initrd_size
< 0) {
398 initrd_size
= load_image_targphys(initrd_filename
,
400 lowmem_end
- cur_lowmem
);
402 if (initrd_size
< 0) {
403 error_report("could not load initrd '%s'", initrd_filename
);
406 initrd_location
.start
= tswap32(cur_lowmem
);
407 initrd_location
.end
= tswap32(cur_lowmem
+ initrd_size
);
408 cur_tagptr
= put_tag(cur_tagptr
, BP_TAG_INITRD
,
409 sizeof(initrd_location
), &initrd_location
);
410 cur_lowmem
= QEMU_ALIGN_UP(cur_lowmem
+ initrd_size
, 4 * KiB
);
412 cur_tagptr
= put_tag(cur_tagptr
, BP_TAG_LAST
, 0, NULL
);
413 env
->regs
[2] = tagptr
;
416 uint64_t elf_lowaddr
;
417 int success
= load_elf(kernel_filename
, NULL
, translate_phys_addr
, cpu
,
418 &elf_entry
, &elf_lowaddr
, NULL
, NULL
, be
, EM_XTENSA
, 0, 0);
420 entry_point
= elf_entry
;
424 success
= load_uimage(kernel_filename
, &ep
, NULL
, &is_linux
,
425 translate_phys_addr
, cpu
);
426 if (success
> 0 && is_linux
) {
429 error_report("could not load kernel '%s'",
434 if (entry_point
!= env
->pc
) {
436 #ifdef TARGET_WORDS_BIGENDIAN
437 0x60, 0x00, 0x08, /* j 1f */
438 0x00, /* .literal_position */
439 0x00, 0x00, 0x00, 0x00, /* .literal entry_pc */
440 0x00, 0x00, 0x00, 0x00, /* .literal entry_a2 */
442 0x10, 0xff, 0xfe, /* l32r a0, entry_pc */
443 0x12, 0xff, 0xfe, /* l32r a2, entry_a2 */
444 0x0a, 0x00, 0x00, /* jx a0 */
446 0x06, 0x02, 0x00, /* j 1f */
447 0x00, /* .literal_position */
448 0x00, 0x00, 0x00, 0x00, /* .literal entry_pc */
449 0x00, 0x00, 0x00, 0x00, /* .literal entry_a2 */
451 0x01, 0xfe, 0xff, /* l32r a0, entry_pc */
452 0x21, 0xfe, 0xff, /* l32r a2, entry_a2 */
453 0xa0, 0x00, 0x00, /* jx a0 */
456 uint32_t entry_pc
= tswap32(entry_point
);
457 uint32_t entry_a2
= tswap32(tagptr
);
459 memcpy(boot
+ 4, &entry_pc
, sizeof(entry_pc
));
460 memcpy(boot
+ 8, &entry_a2
, sizeof(entry_a2
));
461 cpu_physical_memory_write(env
->pc
, boot
, sizeof(boot
));
465 MemoryRegion
*flash_mr
= pflash_cfi01_get_memory(flash
);
466 MemoryRegion
*flash_io
= g_malloc(sizeof(*flash_io
));
467 uint32_t size
= env
->config
->sysrom
.location
[0].size
;
469 if (board
->flash
->size
- board
->flash
->boot_base
< size
) {
470 size
= board
->flash
->size
- board
->flash
->boot_base
;
473 memory_region_init_alias(flash_io
, NULL
, "xtfpga.flash",
474 flash_mr
, board
->flash
->boot_base
, size
);
475 memory_region_add_subregion(system_memory
,
476 env
->config
->sysrom
.location
[0].addr
,
479 xtensa_create_memory_regions(&env
->config
->sysrom
, "xtensa.sysrom",
485 #define XTFPGA_MMU_RESERVED_MEMORY_SIZE (128 * MiB)
487 static const hwaddr xtfpga_mmu_io
[2] = {
491 static const hwaddr xtfpga_nommu_io
[2] = {
496 static const XtfpgaFlashDesc lx60_flash
= {
499 .sector_size
= 0x10000,
502 static void xtfpga_lx60_init(MachineState
*machine
)
504 static const XtfpgaBoardDesc lx60_board
= {
505 .flash
= &lx60_flash
,
506 .sram_size
= 0x20000,
509 xtfpga_init(&lx60_board
, machine
);
512 static void xtfpga_lx60_nommu_init(MachineState
*machine
)
514 static const XtfpgaBoardDesc lx60_board
= {
515 .flash
= &lx60_flash
,
516 .sram_size
= 0x20000,
517 .io
= xtfpga_nommu_io
,
519 xtfpga_init(&lx60_board
, machine
);
522 static const XtfpgaFlashDesc lx200_flash
= {
525 .sector_size
= 0x20000,
528 static void xtfpga_lx200_init(MachineState
*machine
)
530 static const XtfpgaBoardDesc lx200_board
= {
531 .flash
= &lx200_flash
,
532 .sram_size
= 0x2000000,
535 xtfpga_init(&lx200_board
, machine
);
538 static void xtfpga_lx200_nommu_init(MachineState
*machine
)
540 static const XtfpgaBoardDesc lx200_board
= {
541 .flash
= &lx200_flash
,
542 .sram_size
= 0x2000000,
543 .io
= xtfpga_nommu_io
,
545 xtfpga_init(&lx200_board
, machine
);
548 static const XtfpgaFlashDesc ml605_flash
= {
551 .sector_size
= 0x20000,
554 static void xtfpga_ml605_init(MachineState
*machine
)
556 static const XtfpgaBoardDesc ml605_board
= {
557 .flash
= &ml605_flash
,
558 .sram_size
= 0x2000000,
561 xtfpga_init(&ml605_board
, machine
);
564 static void xtfpga_ml605_nommu_init(MachineState
*machine
)
566 static const XtfpgaBoardDesc ml605_board
= {
567 .flash
= &ml605_flash
,
568 .sram_size
= 0x2000000,
569 .io
= xtfpga_nommu_io
,
571 xtfpga_init(&ml605_board
, machine
);
574 static const XtfpgaFlashDesc kc705_flash
= {
577 .boot_base
= 0x06000000,
578 .sector_size
= 0x20000,
581 static void xtfpga_kc705_init(MachineState
*machine
)
583 static const XtfpgaBoardDesc kc705_board
= {
584 .flash
= &kc705_flash
,
585 .sram_size
= 0x2000000,
588 xtfpga_init(&kc705_board
, machine
);
591 static void xtfpga_kc705_nommu_init(MachineState
*machine
)
593 static const XtfpgaBoardDesc kc705_board
= {
594 .flash
= &kc705_flash
,
595 .sram_size
= 0x2000000,
596 .io
= xtfpga_nommu_io
,
598 xtfpga_init(&kc705_board
, machine
);
601 static void xtfpga_lx60_class_init(ObjectClass
*oc
, void *data
)
603 MachineClass
*mc
= MACHINE_CLASS(oc
);
605 mc
->desc
= "lx60 EVB (" XTENSA_DEFAULT_CPU_MODEL
")";
606 mc
->init
= xtfpga_lx60_init
;
608 mc
->default_cpu_type
= XTENSA_DEFAULT_CPU_TYPE
;
609 mc
->default_ram_size
= 64 * MiB
;
612 static const TypeInfo xtfpga_lx60_type
= {
613 .name
= MACHINE_TYPE_NAME("lx60"),
614 .parent
= TYPE_MACHINE
,
615 .class_init
= xtfpga_lx60_class_init
,
618 static void xtfpga_lx60_nommu_class_init(ObjectClass
*oc
, void *data
)
620 MachineClass
*mc
= MACHINE_CLASS(oc
);
622 mc
->desc
= "lx60 noMMU EVB (" XTENSA_DEFAULT_CPU_NOMMU_MODEL
")";
623 mc
->init
= xtfpga_lx60_nommu_init
;
625 mc
->default_cpu_type
= XTENSA_DEFAULT_CPU_NOMMU_TYPE
;
626 mc
->default_ram_size
= 64 * MiB
;
629 static const TypeInfo xtfpga_lx60_nommu_type
= {
630 .name
= MACHINE_TYPE_NAME("lx60-nommu"),
631 .parent
= TYPE_MACHINE
,
632 .class_init
= xtfpga_lx60_nommu_class_init
,
635 static void xtfpga_lx200_class_init(ObjectClass
*oc
, void *data
)
637 MachineClass
*mc
= MACHINE_CLASS(oc
);
639 mc
->desc
= "lx200 EVB (" XTENSA_DEFAULT_CPU_MODEL
")";
640 mc
->init
= xtfpga_lx200_init
;
642 mc
->default_cpu_type
= XTENSA_DEFAULT_CPU_TYPE
;
643 mc
->default_ram_size
= 96 * MiB
;
646 static const TypeInfo xtfpga_lx200_type
= {
647 .name
= MACHINE_TYPE_NAME("lx200"),
648 .parent
= TYPE_MACHINE
,
649 .class_init
= xtfpga_lx200_class_init
,
652 static void xtfpga_lx200_nommu_class_init(ObjectClass
*oc
, void *data
)
654 MachineClass
*mc
= MACHINE_CLASS(oc
);
656 mc
->desc
= "lx200 noMMU EVB (" XTENSA_DEFAULT_CPU_NOMMU_MODEL
")";
657 mc
->init
= xtfpga_lx200_nommu_init
;
659 mc
->default_cpu_type
= XTENSA_DEFAULT_CPU_NOMMU_TYPE
;
660 mc
->default_ram_size
= 96 * MiB
;
663 static const TypeInfo xtfpga_lx200_nommu_type
= {
664 .name
= MACHINE_TYPE_NAME("lx200-nommu"),
665 .parent
= TYPE_MACHINE
,
666 .class_init
= xtfpga_lx200_nommu_class_init
,
669 static void xtfpga_ml605_class_init(ObjectClass
*oc
, void *data
)
671 MachineClass
*mc
= MACHINE_CLASS(oc
);
673 mc
->desc
= "ml605 EVB (" XTENSA_DEFAULT_CPU_MODEL
")";
674 mc
->init
= xtfpga_ml605_init
;
676 mc
->default_cpu_type
= XTENSA_DEFAULT_CPU_TYPE
;
677 mc
->default_ram_size
= 512 * MiB
- XTFPGA_MMU_RESERVED_MEMORY_SIZE
;
680 static const TypeInfo xtfpga_ml605_type
= {
681 .name
= MACHINE_TYPE_NAME("ml605"),
682 .parent
= TYPE_MACHINE
,
683 .class_init
= xtfpga_ml605_class_init
,
686 static void xtfpga_ml605_nommu_class_init(ObjectClass
*oc
, void *data
)
688 MachineClass
*mc
= MACHINE_CLASS(oc
);
690 mc
->desc
= "ml605 noMMU EVB (" XTENSA_DEFAULT_CPU_NOMMU_MODEL
")";
691 mc
->init
= xtfpga_ml605_nommu_init
;
693 mc
->default_cpu_type
= XTENSA_DEFAULT_CPU_NOMMU_TYPE
;
694 mc
->default_ram_size
= 256 * MiB
;
697 static const TypeInfo xtfpga_ml605_nommu_type
= {
698 .name
= MACHINE_TYPE_NAME("ml605-nommu"),
699 .parent
= TYPE_MACHINE
,
700 .class_init
= xtfpga_ml605_nommu_class_init
,
703 static void xtfpga_kc705_class_init(ObjectClass
*oc
, void *data
)
705 MachineClass
*mc
= MACHINE_CLASS(oc
);
707 mc
->desc
= "kc705 EVB (" XTENSA_DEFAULT_CPU_MODEL
")";
708 mc
->init
= xtfpga_kc705_init
;
710 mc
->default_cpu_type
= XTENSA_DEFAULT_CPU_TYPE
;
711 mc
->default_ram_size
= 1 * GiB
- XTFPGA_MMU_RESERVED_MEMORY_SIZE
;
714 static const TypeInfo xtfpga_kc705_type
= {
715 .name
= MACHINE_TYPE_NAME("kc705"),
716 .parent
= TYPE_MACHINE
,
717 .class_init
= xtfpga_kc705_class_init
,
720 static void xtfpga_kc705_nommu_class_init(ObjectClass
*oc
, void *data
)
722 MachineClass
*mc
= MACHINE_CLASS(oc
);
724 mc
->desc
= "kc705 noMMU EVB (" XTENSA_DEFAULT_CPU_NOMMU_MODEL
")";
725 mc
->init
= xtfpga_kc705_nommu_init
;
727 mc
->default_cpu_type
= XTENSA_DEFAULT_CPU_NOMMU_TYPE
;
728 mc
->default_ram_size
= 256 * MiB
;
731 static const TypeInfo xtfpga_kc705_nommu_type
= {
732 .name
= MACHINE_TYPE_NAME("kc705-nommu"),
733 .parent
= TYPE_MACHINE
,
734 .class_init
= xtfpga_kc705_nommu_class_init
,
737 static void xtfpga_machines_init(void)
739 type_register_static(&xtfpga_lx60_type
);
740 type_register_static(&xtfpga_lx200_type
);
741 type_register_static(&xtfpga_ml605_type
);
742 type_register_static(&xtfpga_kc705_type
);
743 type_register_static(&xtfpga_lx60_nommu_type
);
744 type_register_static(&xtfpga_lx200_nommu_type
);
745 type_register_static(&xtfpga_ml605_nommu_type
);
746 type_register_static(&xtfpga_kc705_nommu_type
);
749 type_init(xtfpga_machines_init
)