Revision 3e3f6754 hw/gumstix.c
b/hw/gumstix.c | ||
---|---|---|
7 | 7 |
* |
8 | 8 |
* This code is licensed under the GNU GPL v2. |
9 | 9 |
*/ |
10 |
|
|
11 |
/* |
|
12 |
* Example usage: |
|
13 |
* |
|
14 |
* connex: |
|
15 |
* ======= |
|
16 |
* create image: |
|
17 |
* # dd of=flash bs=1k count=16k if=/dev/zero |
|
18 |
* # dd of=flash bs=1k conv=notrunc if=u-boot.bin |
|
19 |
* # dd of=flash bs=1k conv=notrunc seek=256 if=rootfs.arm_nofpu.jffs2 |
|
20 |
* start it: |
|
21 |
* # qemu-system-arm -M connex -pflash flash -monitor null -nographic |
|
22 |
* |
|
23 |
* verdex: |
|
24 |
* ======= |
|
25 |
* create image: |
|
26 |
* # dd of=flash bs=1k count=32k if=/dev/zero |
|
27 |
* # dd of=flash bs=1k conv=notrunc if=u-boot.bin |
|
28 |
* # dd of=flash bs=1k conv=notrunc seek=256 if=rootfs.arm_nofpu.jffs2 |
|
29 |
* # dd of=flash bs=1k conv=notrunc seek=31744 if=uImage |
|
30 |
* start it: |
|
31 |
* # qemu-system-arm -M verdex -pflash flash -monitor null -nographic -m 289 |
|
32 |
*/ |
|
10 | 33 |
|
11 | 34 |
#include "hw.h" |
12 | 35 |
#include "pxa.h" |
... | ... | |
16 | 39 |
#include "devices.h" |
17 | 40 |
#include "boards.h" |
18 | 41 |
|
19 |
/* Board init. */ |
|
20 |
enum gumstix_model_e { connex }; |
|
21 |
|
|
22 |
static void gumstix_common_init(int ram_size, int vga_ram_size, |
|
23 |
DisplayState *ds, const char *kernel_filename, |
|
24 |
const char *kernel_cmdline, const char *initrd_filename, |
|
25 |
const char *cpu_model, enum gumstix_model_e model) |
|
42 |
static void connex_init(int ram_size, int vga_ram_size, |
|
43 |
const char *boot_device, DisplayState *ds, |
|
44 |
const char **fd_filename, int snapshot, |
|
45 |
const char *kernel_filename, const char *kernel_cmdline, |
|
46 |
const char *initrd_filename, const char *cpu_model) |
|
26 | 47 |
{ |
27 | 48 |
struct pxa2xx_state_s *cpu; |
28 | 49 |
|
29 |
uint32_t gumstix_rom = 0x02000000;
|
|
30 |
uint32_t gumstix_ram = 0x08000000;
|
|
50 |
uint32_t connex_rom = 0x01000000;
|
|
51 |
uint32_t connex_ram = 0x04000000;
|
|
31 | 52 |
|
32 |
if (ram_size < (gumstix_ram + gumstix_rom + PXA2XX_INTERNAL_SIZE)) {
|
|
53 |
if (ram_size < (connex_ram + connex_rom + PXA2XX_INTERNAL_SIZE)) {
|
|
33 | 54 |
fprintf(stderr, "This platform requires %i bytes of memory\n", |
34 |
gumstix_ram + gumstix_rom + PXA2XX_INTERNAL_SIZE);
|
|
55 |
connex_ram + connex_rom + PXA2XX_INTERNAL_SIZE);
|
|
35 | 56 |
exit(1); |
36 | 57 |
} |
37 | 58 |
|
38 |
cpu = pxa255_init(gumstix_ram, ds);
|
|
59 |
cpu = pxa255_init(connex_ram, ds);
|
|
39 | 60 |
|
40 | 61 |
if (pflash_table[0] == NULL) { |
41 | 62 |
fprintf(stderr, "A flash image must be given with the " |
... | ... | |
43 | 64 |
exit(1); |
44 | 65 |
} |
45 | 66 |
|
46 |
if (!pflash_register(0x00000000, gumstix_ram + PXA2XX_INTERNAL_SIZE,
|
|
67 |
if (!pflash_register(0x00000000, connex_ram + PXA2XX_INTERNAL_SIZE,
|
|
47 | 68 |
pflash_table[0], 128 * 1024, 128, 2, 0, 0, 0, 0)) { |
48 |
fprintf(stderr, "qemu: Error register flash memory.\n"); |
|
69 |
fprintf(stderr, "qemu: Error registering flash memory.\n");
|
|
49 | 70 |
exit(1); |
50 | 71 |
} |
51 | 72 |
|
... | ... | |
56 | 77 |
pxa2xx_gpio_in_get(cpu->gpio)[36]); |
57 | 78 |
} |
58 | 79 |
|
59 |
static void connex_init(int ram_size, int vga_ram_size,
|
|
80 |
static void verdex_init(int ram_size, int vga_ram_size,
|
|
60 | 81 |
const char *boot_device, DisplayState *ds, |
61 | 82 |
const char *kernel_filename, const char *kernel_cmdline, |
62 | 83 |
const char *initrd_filename, const char *cpu_model) |
63 | 84 |
{ |
64 |
gumstix_common_init(ram_size, vga_ram_size, ds, kernel_filename, |
|
65 |
kernel_cmdline, initrd_filename, cpu_model, connex); |
|
85 |
struct pxa2xx_state_s *cpu; |
|
86 |
|
|
87 |
uint32_t verdex_rom = 0x02000000; |
|
88 |
uint32_t verdex_ram = 0x10000000; |
|
89 |
|
|
90 |
if (ram_size < (verdex_ram + verdex_rom + PXA2XX_INTERNAL_SIZE)) { |
|
91 |
fprintf(stderr, "This platform requires %i bytes of memory\n", |
|
92 |
verdex_ram + verdex_rom + PXA2XX_INTERNAL_SIZE); |
|
93 |
exit(1); |
|
94 |
} |
|
95 |
|
|
96 |
cpu = pxa270_init(verdex_ram, ds, "pxa270-c0"); |
|
97 |
|
|
98 |
if (pflash_table[0] == NULL) { |
|
99 |
fprintf(stderr, "A flash image must be given with the " |
|
100 |
"'pflash' parameter\n"); |
|
101 |
exit(1); |
|
102 |
} |
|
103 |
|
|
104 |
if (!pflash_register(0x00000000, verdex_ram + PXA2XX_INTERNAL_SIZE, |
|
105 |
pflash_table[0], 128 * 1024, 256, 2, 0, 0, 0, 0)) { |
|
106 |
fprintf(stderr, "qemu: Error registering flash memory.\n"); |
|
107 |
exit(1); |
|
108 |
} |
|
109 |
|
|
110 |
cpu->env->regs[15] = 0x00000000; |
|
111 |
|
|
112 |
/* Interrupt line of NIC is connected to GPIO line 99 */ |
|
113 |
smc91c111_init(&nd_table[0], 0x04000300, |
|
114 |
pxa2xx_gpio_in_get(cpu->gpio)[99]); |
|
66 | 115 |
} |
67 | 116 |
|
68 | 117 |
QEMUMachine connex_machine = { |
... | ... | |
70 | 119 |
"Gumstix Connex (PXA255)", |
71 | 120 |
connex_init, |
72 | 121 |
}; |
122 |
|
|
123 |
QEMUMachine verdex_machine = { |
|
124 |
"verdex", |
|
125 |
"Gumstix Verdex (PXA270)", |
|
126 |
verdex_init, |
|
127 |
}; |
Also available in: Unified diff