2 * PXA270-based Intel Mainstone platforms.
4 * Copyright (c) 2007 by Armin Kuster <akuster@kama-aina.net> or
7 * Code based on spitz platform by Andrzej Zaborowski <balrog@zabor.org>
9 * This code is licensed under the GNU GPL v2.
17 #include "mainstone.h"
21 enum mainstone_model_e
{ mainstone
};
23 static void mainstone_common_init(int ram_size
, int vga_ram_size
,
24 DisplayState
*ds
, const char *kernel_filename
,
25 const char *kernel_cmdline
, const char *initrd_filename
,
26 const char *cpu_model
, enum mainstone_model_e model
, int arm_id
)
28 uint32_t mainstone_ram
= 0x04000000;
29 uint32_t mainstone_rom
= 0x00800000;
30 struct pxa2xx_state_s
*cpu
;
35 cpu_model
= "pxa270-c5";
37 /* Setup CPU & memory */
38 if (ram_size
< mainstone_ram
+ mainstone_rom
+ PXA2XX_INTERNAL_SIZE
) {
39 fprintf(stderr
, "This platform requires %i bytes of memory\n",
40 mainstone_ram
+ mainstone_rom
+ PXA2XX_INTERNAL_SIZE
);
44 cpu
= pxa270_init(mainstone_ram
, ds
, cpu_model
);
45 cpu_register_physical_memory(0, mainstone_rom
,
46 qemu_ram_alloc(mainstone_rom
) | IO_MEM_ROM
);
48 /* Setup initial (reset) machine state */
49 cpu
->env
->regs
[15] = PXA2XX_SDRAM_BASE
;
51 /* There are two 32MiB flash devices on the board */
52 index
= drive_get_index(IF_PFLASH
, 0, 0);
54 fprintf(stderr
, "Two flash images must be given with the "
55 "'pflash' parameter\n");
58 if (!pflash_register(MST_FLASH_0
, mainstone_ram
+ PXA2XX_INTERNAL_SIZE
,
59 drives_table
[index
].bdrv
,
60 256 * 1024, 128, 4, 0, 0, 0, 0)) {
61 fprintf(stderr
, "qemu: Error registering flash memory.\n");
65 index
= drive_get_index(IF_PFLASH
, 0, 1);
67 fprintf(stderr
, "Two flash images must be given with the "
68 "'pflash' parameter\n");
71 if (!pflash_register(MST_FLASH_1
, mainstone_ram
+ PXA2XX_INTERNAL_SIZE
,
72 drives_table
[index
].bdrv
,
73 256 * 1024, 128, 4, 0, 0, 0, 0)) {
74 fprintf(stderr
, "qemu: Error registering flash memory.\n");
78 mst_irq
= mst_irq_init(cpu
, MST_FPGA_PHYS
, PXA2XX_PIC_GPIO_0
);
81 pxa2xx_mmci_handlers(cpu
->mmc
, NULL
, mst_irq
[MMC_IRQ
]);
83 smc91c111_init(&nd_table
[0], MST_ETH_PHYS
, mst_irq
[ETHERNET_IRQ
]);
85 arm_load_kernel(cpu
->env
, mainstone_ram
, kernel_filename
, kernel_cmdline
,
86 initrd_filename
, arm_id
, PXA2XX_SDRAM_BASE
);
89 static void mainstone_init(int ram_size
, int vga_ram_size
,
90 const char *boot_device
, DisplayState
*ds
,
91 const char *kernel_filename
, const char *kernel_cmdline
,
92 const char *initrd_filename
, const char *cpu_model
)
94 mainstone_common_init(ram_size
, vga_ram_size
, ds
, kernel_filename
,
95 kernel_cmdline
, initrd_filename
, cpu_model
, mainstone
, 0x196);
98 QEMUMachine mainstone2_machine
= {
100 "Mainstone II (PXA27x)",