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