blob: 9146269153128626d5453b10cec57359df9e29d8 [file] [log] [blame]
balrog05ee37e2007-11-17 11:50:55 +00001/*
2 * Gumstix Platforms
3 *
4 * Copyright (c) 2007 by Thorsten Zitterell <info@bitmux.org>
5 *
6 * Code based on spitz platform by Andrzej Zaborowski <balrog@zabor.org>
7 *
8 * This code is licensed under the GNU GPL v2.
Paolo Bonzini6b620ca2012-01-13 17:44:23 +01009 *
10 * Contributions after 2012-01-13 are licensed under the terms of the
11 * GNU GPL, version 2 or (at your option) any later version.
balrog05ee37e2007-11-17 11:50:55 +000012 */
Philippe Mathieu-Daudé1c2adde2023-01-09 12:53:08 +010013
balrog3e3f6752007-11-24 23:47:38 +000014/*
15 * Example usage:
16 *
17 * connex:
18 * =======
19 * create image:
20 * # dd of=flash bs=1k count=16k if=/dev/zero
21 * # dd of=flash bs=1k conv=notrunc if=u-boot.bin
22 * # dd of=flash bs=1k conv=notrunc seek=256 if=rootfs.arm_nofpu.jffs2
23 * start it:
24 * # qemu-system-arm -M connex -pflash flash -monitor null -nographic
25 *
26 * verdex:
27 * =======
28 * create image:
29 * # dd of=flash bs=1k count=32k if=/dev/zero
30 * # dd of=flash bs=1k conv=notrunc if=u-boot.bin
31 * # dd of=flash bs=1k conv=notrunc seek=256 if=rootfs.arm_nofpu.jffs2
32 * # dd of=flash bs=1k conv=notrunc seek=31744 if=uImage
33 * start it:
34 * # qemu-system-arm -M verdex -pflash flash -monitor null -nographic -m 289
35 */
balrog05ee37e2007-11-17 11:50:55 +000036
Peter Maydell12b16722015-12-07 16:23:45 +000037#include "qemu/osdep.h"
Philippe Mathieu-Daudé38cb3362023-01-09 12:53:09 +010038#include "qemu/units.h"
Alistair Francisc0dbca32018-02-03 09:43:03 +010039#include "qemu/error-report.h"
Paolo Bonzini0d09e412013-02-05 17:06:20 +010040#include "hw/arm/pxa.h"
Paolo Bonzini1422e322012-10-24 08:43:34 +020041#include "net/net.h"
Paolo Bonzini0d09e412013-02-05 17:06:20 +010042#include "hw/block/flash.h"
Philippe Mathieu-Daudé437cc272019-04-12 18:54:16 +020043#include "hw/net/smc91c111.h"
Paolo Bonzini83c9f4c2013-02-04 15:40:22 +010044#include "hw/boards.h"
Paolo Bonzini022c62c2012-12-17 18:19:49 +010045#include "exec/address-spaces.h"
Andreas Färberbdf921d2013-07-29 17:15:01 +020046#include "sysemu/qtest.h"
balrog05ee37e2007-11-17 11:50:55 +000047
Philippe Mathieu-Daudé38cb3362023-01-09 12:53:09 +010048#define CONNEX_FLASH_SIZE (16 * MiB)
49#define CONNEX_RAM_SIZE (64 * MiB)
50
51#define VERDEX_FLASH_SIZE (32 * MiB)
52#define VERDEX_RAM_SIZE (256 * MiB)
53
54#define FLASH_SECTOR_SIZE (128 * KiB)
balrog1fc678c2007-11-25 00:29:23 +000055
Marcel Apfelbaum3ef96222014-05-07 17:42:57 +030056static void connex_init(MachineState *machine)
balrog05ee37e2007-11-17 11:50:55 +000057{
Paul Brookbc24a222009-05-10 01:44:56 +010058 PXA2xxState *cpu;
Gerd Hoffmann751c6a12009-07-22 16:42:57 +020059 DriveInfo *dinfo;
balrog05ee37e2007-11-17 11:50:55 +000060
Philippe Mathieu-Daudé38cb3362023-01-09 12:53:09 +010061 cpu = pxa255_init(CONNEX_RAM_SIZE);
balrog05ee37e2007-11-17 11:50:55 +000062
Gerd Hoffmann751c6a12009-07-22 16:42:57 +020063 dinfo = drive_get(IF_PFLASH, 0, 0);
Andreas Färberbdf921d2013-07-29 17:15:01 +020064 if (!dinfo && !qtest_enabled()) {
Alistair Francisc0dbca32018-02-03 09:43:03 +010065 error_report("A flash image must be given with the "
66 "'pflash' parameter");
balrog05ee37e2007-11-17 11:50:55 +000067 exit(1);
68 }
69
Philippe Mathieu-Daudé1c2adde2023-01-09 12:53:08 +010070 /* Numonyx RC28F128J3F75 */
Philippe Mathieu-Daudé20f82222023-01-09 12:53:16 +010071 pflash_cfi01_register(0x00000000, "connext.rom", CONNEX_FLASH_SIZE,
72 dinfo ? blk_by_legacy_dinfo(dinfo) : NULL,
73 FLASH_SECTOR_SIZE, 2, 0, 0, 0, 0, 0);
balrog05ee37e2007-11-17 11:50:55 +000074
balrog5697ff62008-01-14 02:39:21 +000075 /* Interrupt line of NIC is connected to GPIO line 36 */
David Woodhousecd539912023-10-23 09:37:35 +010076 smc91c111_init(0x04000300, qdev_get_gpio_in(cpu->gpio, 36));
balrog05ee37e2007-11-17 11:50:55 +000077}
78
Marcel Apfelbaum3ef96222014-05-07 17:42:57 +030079static void verdex_init(MachineState *machine)
balrog05ee37e2007-11-17 11:50:55 +000080{
Paul Brookbc24a222009-05-10 01:44:56 +010081 PXA2xxState *cpu;
Gerd Hoffmann751c6a12009-07-22 16:42:57 +020082 DriveInfo *dinfo;
balrog3e3f6752007-11-24 23:47:38 +000083
Philippe Mathieu-Daudé38cb3362023-01-09 12:53:09 +010084 cpu = pxa270_init(VERDEX_RAM_SIZE, machine->cpu_type);
balrog3e3f6752007-11-24 23:47:38 +000085
Gerd Hoffmann751c6a12009-07-22 16:42:57 +020086 dinfo = drive_get(IF_PFLASH, 0, 0);
Andreas Färberbdf921d2013-07-29 17:15:01 +020087 if (!dinfo && !qtest_enabled()) {
Alistair Francisc0dbca32018-02-03 09:43:03 +010088 error_report("A flash image must be given with the "
89 "'pflash' parameter");
balrog3e3f6752007-11-24 23:47:38 +000090 exit(1);
91 }
92
Philippe Mathieu-Daudé1c2adde2023-01-09 12:53:08 +010093 /* Micron RC28F256P30TFA */
Philippe Mathieu-Daudé20f82222023-01-09 12:53:16 +010094 pflash_cfi01_register(0x00000000, "verdex.rom", VERDEX_FLASH_SIZE,
95 dinfo ? blk_by_legacy_dinfo(dinfo) : NULL,
96 FLASH_SECTOR_SIZE, 2, 0, 0, 0, 0, 0);
balrog3e3f6752007-11-24 23:47:38 +000097
balrog3e3f6752007-11-24 23:47:38 +000098 /* Interrupt line of NIC is connected to GPIO line 99 */
David Woodhousecd539912023-10-23 09:37:35 +010099 smc91c111_init(0x04000300, qdev_get_gpio_in(cpu->gpio, 99));
balrog05ee37e2007-11-17 11:50:55 +0000100}
101
Andreas Färber8a661ae2015-09-19 10:49:44 +0200102static void connex_class_init(ObjectClass *oc, void *data)
Anthony Liguorif80f9ec2009-05-20 18:38:09 -0500103{
Andreas Färber8a661ae2015-09-19 10:49:44 +0200104 MachineClass *mc = MACHINE_CLASS(oc);
105
Eduardo Habkoste264d292015-09-04 15:37:08 -0300106 mc->desc = "Gumstix Connex (PXA255)";
107 mc->init = connex_init;
Peter Maydell4672cbd2017-09-07 13:54:54 +0100108 mc->ignore_memory_transaction_failures = true;
Peter Maydella2531bb2024-03-08 17:16:21 +0000109 mc->deprecation_reason = "machine is old and unmaintained";
Anthony Liguorif80f9ec2009-05-20 18:38:09 -0500110}
111
Andreas Färber8a661ae2015-09-19 10:49:44 +0200112static const TypeInfo connex_type = {
113 .name = MACHINE_TYPE_NAME("connex"),
114 .parent = TYPE_MACHINE,
115 .class_init = connex_class_init,
116};
Eduardo Habkoste264d292015-09-04 15:37:08 -0300117
Andreas Färber8a661ae2015-09-19 10:49:44 +0200118static void verdex_class_init(ObjectClass *oc, void *data)
Eduardo Habkoste264d292015-09-04 15:37:08 -0300119{
Andreas Färber8a661ae2015-09-19 10:49:44 +0200120 MachineClass *mc = MACHINE_CLASS(oc);
121
Philippe Mathieu-Daudé1c2adde2023-01-09 12:53:08 +0100122 mc->desc = "Gumstix Verdex Pro XL6P COMs (PXA270)";
Eduardo Habkoste264d292015-09-04 15:37:08 -0300123 mc->init = verdex_init;
Peter Maydell4672cbd2017-09-07 13:54:54 +0100124 mc->ignore_memory_transaction_failures = true;
Peter Maydella2531bb2024-03-08 17:16:21 +0000125 mc->deprecation_reason = "machine is old and unmaintained";
Igor Mammedovba1ba5c2017-09-13 18:04:57 +0200126 mc->default_cpu_type = ARM_CPU_TYPE_NAME("pxa270-c0");
Eduardo Habkoste264d292015-09-04 15:37:08 -0300127}
128
Andreas Färber8a661ae2015-09-19 10:49:44 +0200129static const TypeInfo verdex_type = {
130 .name = MACHINE_TYPE_NAME("verdex"),
131 .parent = TYPE_MACHINE,
132 .class_init = verdex_class_init,
133};
134
135static void gumstix_machine_init(void)
136{
137 type_register_static(&connex_type);
138 type_register_static(&verdex_type);
139}
140
Eduardo Habkost0e6aac82016-02-16 18:59:04 -0200141type_init(gumstix_machine_init)