root / hw / gumstix.c @ 38641a52
History | View | Annotate | Download (2 kB)
1 | 05ee37eb | balrog | /*
|
---|---|---|---|
2 | 05ee37eb | balrog | * Gumstix Platforms
|
3 | 05ee37eb | balrog | *
|
4 | 05ee37eb | balrog | * Copyright (c) 2007 by Thorsten Zitterell <info@bitmux.org>
|
5 | 05ee37eb | balrog | *
|
6 | 05ee37eb | balrog | * Code based on spitz platform by Andrzej Zaborowski <balrog@zabor.org>
|
7 | 05ee37eb | balrog | *
|
8 | 05ee37eb | balrog | * This code is licensed under the GNU GPL v2.
|
9 | 05ee37eb | balrog | */
|
10 | 05ee37eb | balrog | |
11 | 05ee37eb | balrog | #include "vl.h" |
12 | 05ee37eb | balrog | |
13 | 05ee37eb | balrog | /* Board init. */
|
14 | 05ee37eb | balrog | enum gumstix_model_e { connex };
|
15 | 05ee37eb | balrog | |
16 | 05ee37eb | balrog | static void gumstix_common_init(int ram_size, int vga_ram_size, |
17 | 05ee37eb | balrog | DisplayState *ds, const char *kernel_filename, |
18 | 05ee37eb | balrog | const char *kernel_cmdline, const char *initrd_filename, |
19 | 05ee37eb | balrog | const char *cpu_model, enum gumstix_model_e model) |
20 | 05ee37eb | balrog | { |
21 | 05ee37eb | balrog | struct pxa2xx_state_s *cpu;
|
22 | 05ee37eb | balrog | |
23 | 05ee37eb | balrog | uint32_t gumstix_rom = 0x02000000;
|
24 | 05ee37eb | balrog | uint32_t gumstix_ram = 0x08000000;
|
25 | 05ee37eb | balrog | |
26 | 05ee37eb | balrog | if (ram_size < (gumstix_ram + gumstix_rom + PXA2XX_INTERNAL_SIZE)) {
|
27 | 05ee37eb | balrog | fprintf(stderr, "This platform requires %i bytes of memory\n",
|
28 | 05ee37eb | balrog | gumstix_ram + gumstix_rom + PXA2XX_INTERNAL_SIZE); |
29 | 05ee37eb | balrog | exit(1);
|
30 | 05ee37eb | balrog | } |
31 | 05ee37eb | balrog | |
32 | 05ee37eb | balrog | cpu = pxa255_init(gumstix_ram, ds); |
33 | 05ee37eb | balrog | |
34 | 05ee37eb | balrog | if (pflash_table[0] == NULL) { |
35 | 05ee37eb | balrog | fprintf(stderr, "A flash image must be given with the "
|
36 | 05ee37eb | balrog | "'pflash' parameter\n");
|
37 | 05ee37eb | balrog | exit(1);
|
38 | 05ee37eb | balrog | } |
39 | 05ee37eb | balrog | |
40 | 05ee37eb | balrog | if (!pflash_register(0x00000000, gumstix_ram + PXA2XX_INTERNAL_SIZE, |
41 | 05ee37eb | balrog | pflash_table[0], 128 * 1024, 128, 2, 0, 0, 0, 0)) { |
42 | 05ee37eb | balrog | fprintf(stderr, "qemu: Error register flash memory.\n");
|
43 | 05ee37eb | balrog | exit(1);
|
44 | 05ee37eb | balrog | } |
45 | 05ee37eb | balrog | |
46 | 05ee37eb | balrog | cpu->env->regs[15] = 0x00000000; |
47 | 05ee37eb | balrog | |
48 | 38641a52 | balrog | /* Interrupt line of NIC is connected to GPIO line 36 */
|
49 | 38641a52 | balrog | smc91c111_init(&nd_table[0], 0x04000300, |
50 | 38641a52 | balrog | pxa2xx_gpio_in_get(cpu->gpio)[36]);
|
51 | 05ee37eb | balrog | } |
52 | 05ee37eb | balrog | |
53 | 05ee37eb | balrog | static void connex_init(int ram_size, int vga_ram_size, |
54 | 05ee37eb | balrog | const char *boot_device, DisplayState *ds, |
55 | 05ee37eb | balrog | const char **fd_filename, int snapshot, |
56 | 05ee37eb | balrog | const char *kernel_filename, const char *kernel_cmdline, |
57 | 05ee37eb | balrog | const char *initrd_filename, const char *cpu_model) |
58 | 05ee37eb | balrog | { |
59 | 05ee37eb | balrog | gumstix_common_init(ram_size, vga_ram_size, ds, kernel_filename, |
60 | 05ee37eb | balrog | kernel_cmdline, initrd_filename, cpu_model, connex); |
61 | 05ee37eb | balrog | } |
62 | 05ee37eb | balrog | |
63 | 05ee37eb | balrog | QEMUMachine connex_machine = { |
64 | 05ee37eb | balrog | "connex",
|
65 | 05ee37eb | balrog | "Gumstix Connex (PXA255)",
|
66 | 05ee37eb | balrog | connex_init, |
67 | 05ee37eb | balrog | }; |