root / hw / ppc405_boards.c @ 7f27bae6
History | View | Annotate | Download (18.9 kB)
1 | 1a6c0886 | j_mayer | /*
|
---|---|---|---|
2 | 1a6c0886 | j_mayer | * QEMU PowerPC 405 evaluation boards emulation
|
3 | 1a6c0886 | j_mayer | *
|
4 | 1a6c0886 | j_mayer | * Copyright (c) 2007 Jocelyn Mayer
|
5 | 1a6c0886 | j_mayer | *
|
6 | 1a6c0886 | j_mayer | * Permission is hereby granted, free of charge, to any person obtaining a copy
|
7 | 1a6c0886 | j_mayer | * of this software and associated documentation files (the "Software"), to deal
|
8 | 1a6c0886 | j_mayer | * in the Software without restriction, including without limitation the rights
|
9 | 1a6c0886 | j_mayer | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10 | 1a6c0886 | j_mayer | * copies of the Software, and to permit persons to whom the Software is
|
11 | 1a6c0886 | j_mayer | * furnished to do so, subject to the following conditions:
|
12 | 1a6c0886 | j_mayer | *
|
13 | 1a6c0886 | j_mayer | * The above copyright notice and this permission notice shall be included in
|
14 | 1a6c0886 | j_mayer | * all copies or substantial portions of the Software.
|
15 | 1a6c0886 | j_mayer | *
|
16 | 1a6c0886 | j_mayer | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17 | 1a6c0886 | j_mayer | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18 | 1a6c0886 | j_mayer | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
19 | 1a6c0886 | j_mayer | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20 | 1a6c0886 | j_mayer | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21 | 1a6c0886 | j_mayer | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22 | 1a6c0886 | j_mayer | * THE SOFTWARE.
|
23 | 1a6c0886 | j_mayer | */
|
24 | 1a6c0886 | j_mayer | #include "vl.h" |
25 | 1a6c0886 | j_mayer | #include "ppc405.h" |
26 | 1a6c0886 | j_mayer | |
27 | 1a6c0886 | j_mayer | extern int loglevel; |
28 | 1a6c0886 | j_mayer | extern FILE *logfile;
|
29 | 1a6c0886 | j_mayer | |
30 | 1a6c0886 | j_mayer | #define BIOS_FILENAME "ppc405_rom.bin" |
31 | 1a6c0886 | j_mayer | #undef BIOS_SIZE
|
32 | 1a6c0886 | j_mayer | #define BIOS_SIZE (2048 * 1024) |
33 | 1a6c0886 | j_mayer | |
34 | 1a6c0886 | j_mayer | #define KERNEL_LOAD_ADDR 0x00000000 |
35 | 1a6c0886 | j_mayer | #define INITRD_LOAD_ADDR 0x01800000 |
36 | 1a6c0886 | j_mayer | |
37 | 1a6c0886 | j_mayer | #define USE_FLASH_BIOS
|
38 | 1a6c0886 | j_mayer | |
39 | 1a6c0886 | j_mayer | #define DEBUG_BOARD_INIT
|
40 | 1a6c0886 | j_mayer | |
41 | 1a6c0886 | j_mayer | /*****************************************************************************/
|
42 | 1a6c0886 | j_mayer | /* PPC405EP reference board (IBM) */
|
43 | 1a6c0886 | j_mayer | /* Standalone board with:
|
44 | 1a6c0886 | j_mayer | * - PowerPC 405EP CPU
|
45 | 1a6c0886 | j_mayer | * - SDRAM (0x00000000)
|
46 | 1a6c0886 | j_mayer | * - Flash (0xFFF80000)
|
47 | 1a6c0886 | j_mayer | * - SRAM (0xFFF00000)
|
48 | 1a6c0886 | j_mayer | * - NVRAM (0xF0000000)
|
49 | 1a6c0886 | j_mayer | * - FPGA (0xF0300000)
|
50 | 1a6c0886 | j_mayer | */
|
51 | 1a6c0886 | j_mayer | typedef struct ref405ep_fpga_t ref405ep_fpga_t; |
52 | 1a6c0886 | j_mayer | struct ref405ep_fpga_t {
|
53 | 1a6c0886 | j_mayer | uint32_t base; |
54 | 1a6c0886 | j_mayer | uint8_t reg0; |
55 | 1a6c0886 | j_mayer | uint8_t reg1; |
56 | 1a6c0886 | j_mayer | }; |
57 | 1a6c0886 | j_mayer | |
58 | 1a6c0886 | j_mayer | static uint32_t ref405ep_fpga_readb (void *opaque, target_phys_addr_t addr) |
59 | 1a6c0886 | j_mayer | { |
60 | 1a6c0886 | j_mayer | ref405ep_fpga_t *fpga; |
61 | 1a6c0886 | j_mayer | uint32_t ret; |
62 | 1a6c0886 | j_mayer | |
63 | 1a6c0886 | j_mayer | fpga = opaque; |
64 | 1a6c0886 | j_mayer | addr -= fpga->base; |
65 | 1a6c0886 | j_mayer | switch (addr) {
|
66 | 1a6c0886 | j_mayer | case 0x0: |
67 | 1a6c0886 | j_mayer | ret = fpga->reg0; |
68 | 1a6c0886 | j_mayer | break;
|
69 | 1a6c0886 | j_mayer | case 0x1: |
70 | 1a6c0886 | j_mayer | ret = fpga->reg1; |
71 | 1a6c0886 | j_mayer | break;
|
72 | 1a6c0886 | j_mayer | default:
|
73 | 1a6c0886 | j_mayer | ret = 0;
|
74 | 1a6c0886 | j_mayer | break;
|
75 | 1a6c0886 | j_mayer | } |
76 | 1a6c0886 | j_mayer | |
77 | 1a6c0886 | j_mayer | return ret;
|
78 | 1a6c0886 | j_mayer | } |
79 | 1a6c0886 | j_mayer | |
80 | 1a6c0886 | j_mayer | static void ref405ep_fpga_writeb (void *opaque, |
81 | 1a6c0886 | j_mayer | target_phys_addr_t addr, uint32_t value) |
82 | 1a6c0886 | j_mayer | { |
83 | 1a6c0886 | j_mayer | ref405ep_fpga_t *fpga; |
84 | 1a6c0886 | j_mayer | |
85 | 1a6c0886 | j_mayer | fpga = opaque; |
86 | 1a6c0886 | j_mayer | addr -= fpga->base; |
87 | 1a6c0886 | j_mayer | switch (addr) {
|
88 | 1a6c0886 | j_mayer | case 0x0: |
89 | 1a6c0886 | j_mayer | /* Read only */
|
90 | 1a6c0886 | j_mayer | break;
|
91 | 1a6c0886 | j_mayer | case 0x1: |
92 | 1a6c0886 | j_mayer | fpga->reg1 = value; |
93 | 1a6c0886 | j_mayer | break;
|
94 | 1a6c0886 | j_mayer | default:
|
95 | 1a6c0886 | j_mayer | break;
|
96 | 1a6c0886 | j_mayer | } |
97 | 1a6c0886 | j_mayer | } |
98 | 1a6c0886 | j_mayer | |
99 | 1a6c0886 | j_mayer | static uint32_t ref405ep_fpga_readw (void *opaque, target_phys_addr_t addr) |
100 | 1a6c0886 | j_mayer | { |
101 | 1a6c0886 | j_mayer | uint32_t ret; |
102 | 1a6c0886 | j_mayer | |
103 | 1a6c0886 | j_mayer | ret = ref405ep_fpga_readb(opaque, addr) << 8;
|
104 | 1a6c0886 | j_mayer | ret |= ref405ep_fpga_readb(opaque, addr + 1);
|
105 | 1a6c0886 | j_mayer | |
106 | 1a6c0886 | j_mayer | return ret;
|
107 | 1a6c0886 | j_mayer | } |
108 | 1a6c0886 | j_mayer | |
109 | 1a6c0886 | j_mayer | static void ref405ep_fpga_writew (void *opaque, |
110 | 1a6c0886 | j_mayer | target_phys_addr_t addr, uint32_t value) |
111 | 1a6c0886 | j_mayer | { |
112 | 1a6c0886 | j_mayer | ref405ep_fpga_writeb(opaque, addr, (value >> 8) & 0xFF); |
113 | 1a6c0886 | j_mayer | ref405ep_fpga_writeb(opaque, addr + 1, value & 0xFF); |
114 | 1a6c0886 | j_mayer | } |
115 | 1a6c0886 | j_mayer | |
116 | 1a6c0886 | j_mayer | static uint32_t ref405ep_fpga_readl (void *opaque, target_phys_addr_t addr) |
117 | 1a6c0886 | j_mayer | { |
118 | 1a6c0886 | j_mayer | uint32_t ret; |
119 | 1a6c0886 | j_mayer | |
120 | 1a6c0886 | j_mayer | ret = ref405ep_fpga_readb(opaque, addr) << 24;
|
121 | 1a6c0886 | j_mayer | ret |= ref405ep_fpga_readb(opaque, addr + 1) << 16; |
122 | 1a6c0886 | j_mayer | ret |= ref405ep_fpga_readb(opaque, addr + 2) << 8; |
123 | 1a6c0886 | j_mayer | ret |= ref405ep_fpga_readb(opaque, addr + 3);
|
124 | 1a6c0886 | j_mayer | |
125 | 1a6c0886 | j_mayer | return ret;
|
126 | 1a6c0886 | j_mayer | } |
127 | 1a6c0886 | j_mayer | |
128 | 1a6c0886 | j_mayer | static void ref405ep_fpga_writel (void *opaque, |
129 | 1a6c0886 | j_mayer | target_phys_addr_t addr, uint32_t value) |
130 | 1a6c0886 | j_mayer | { |
131 | 1a6c0886 | j_mayer | ref405ep_fpga_writel(opaque, addr, (value >> 24) & 0xFF); |
132 | 1a6c0886 | j_mayer | ref405ep_fpga_writel(opaque, addr + 1, (value >> 16) & 0xFF); |
133 | 1a6c0886 | j_mayer | ref405ep_fpga_writel(opaque, addr + 2, (value >> 8) & 0xFF); |
134 | 1a6c0886 | j_mayer | ref405ep_fpga_writeb(opaque, addr + 3, value & 0xFF); |
135 | 1a6c0886 | j_mayer | } |
136 | 1a6c0886 | j_mayer | |
137 | 1a6c0886 | j_mayer | static CPUReadMemoryFunc *ref405ep_fpga_read[] = {
|
138 | 1a6c0886 | j_mayer | &ref405ep_fpga_readb, |
139 | 1a6c0886 | j_mayer | &ref405ep_fpga_readw, |
140 | 1a6c0886 | j_mayer | &ref405ep_fpga_readl, |
141 | 1a6c0886 | j_mayer | }; |
142 | 1a6c0886 | j_mayer | |
143 | 1a6c0886 | j_mayer | static CPUWriteMemoryFunc *ref405ep_fpga_write[] = {
|
144 | 1a6c0886 | j_mayer | &ref405ep_fpga_writeb, |
145 | 1a6c0886 | j_mayer | &ref405ep_fpga_writew, |
146 | 1a6c0886 | j_mayer | &ref405ep_fpga_writel, |
147 | 1a6c0886 | j_mayer | }; |
148 | 1a6c0886 | j_mayer | |
149 | 1a6c0886 | j_mayer | static void ref405ep_fpga_reset (void *opaque) |
150 | 1a6c0886 | j_mayer | { |
151 | 1a6c0886 | j_mayer | ref405ep_fpga_t *fpga; |
152 | 1a6c0886 | j_mayer | |
153 | 1a6c0886 | j_mayer | fpga = opaque; |
154 | 1a6c0886 | j_mayer | fpga->reg0 = 0x00;
|
155 | 1a6c0886 | j_mayer | fpga->reg1 = 0x0F;
|
156 | 1a6c0886 | j_mayer | } |
157 | 1a6c0886 | j_mayer | |
158 | 1a6c0886 | j_mayer | static void ref405ep_fpga_init (uint32_t base) |
159 | 1a6c0886 | j_mayer | { |
160 | 1a6c0886 | j_mayer | ref405ep_fpga_t *fpga; |
161 | 1a6c0886 | j_mayer | int fpga_memory;
|
162 | 1a6c0886 | j_mayer | |
163 | 1a6c0886 | j_mayer | fpga = qemu_mallocz(sizeof(ref405ep_fpga_t));
|
164 | 1a6c0886 | j_mayer | if (fpga != NULL) { |
165 | 1a6c0886 | j_mayer | fpga->base = base; |
166 | 1a6c0886 | j_mayer | fpga_memory = cpu_register_io_memory(0, ref405ep_fpga_read,
|
167 | 1a6c0886 | j_mayer | ref405ep_fpga_write, fpga); |
168 | 1a6c0886 | j_mayer | cpu_register_physical_memory(base, 0x00000100, fpga_memory);
|
169 | 1a6c0886 | j_mayer | ref405ep_fpga_reset(fpga); |
170 | 1a6c0886 | j_mayer | qemu_register_reset(&ref405ep_fpga_reset, fpga); |
171 | 1a6c0886 | j_mayer | } |
172 | 1a6c0886 | j_mayer | } |
173 | 1a6c0886 | j_mayer | |
174 | 1a6c0886 | j_mayer | static void ref405ep_init (int ram_size, int vga_ram_size, int boot_device, |
175 | 1a6c0886 | j_mayer | DisplayState *ds, const char **fd_filename, |
176 | 1a6c0886 | j_mayer | int snapshot,
|
177 | 1a6c0886 | j_mayer | const char *kernel_filename, |
178 | 1a6c0886 | j_mayer | const char *kernel_cmdline, |
179 | 1a6c0886 | j_mayer | const char *initrd_filename, |
180 | 1a6c0886 | j_mayer | const char *cpu_model) |
181 | 1a6c0886 | j_mayer | { |
182 | 1a6c0886 | j_mayer | char buf[1024]; |
183 | 1a6c0886 | j_mayer | ppc4xx_bd_info_t bd; |
184 | 1a6c0886 | j_mayer | CPUPPCState *env; |
185 | 1a6c0886 | j_mayer | qemu_irq *pic; |
186 | 1a6c0886 | j_mayer | ram_addr_t sram_offset, bios_offset, bdloc; |
187 | 71db710f | blueswir1 | target_phys_addr_t ram_bases[2], ram_sizes[2]; |
188 | 1a6c0886 | j_mayer | target_ulong sram_size, bios_size; |
189 | 1a6c0886 | j_mayer | //int phy_addr = 0;
|
190 | 1a6c0886 | j_mayer | //static int phy_addr = 1;
|
191 | 1a6c0886 | j_mayer | target_ulong kernel_base, kernel_size, initrd_base, initrd_size; |
192 | 1a6c0886 | j_mayer | int linux_boot;
|
193 | 1a6c0886 | j_mayer | int fl_idx, fl_sectors, len;
|
194 | 1a6c0886 | j_mayer | |
195 | 1a6c0886 | j_mayer | /* XXX: fix this */
|
196 | 1a6c0886 | j_mayer | ram_bases[0] = 0x00000000; |
197 | 1a6c0886 | j_mayer | ram_sizes[0] = 0x08000000; |
198 | 1a6c0886 | j_mayer | ram_bases[1] = 0x00000000; |
199 | 1a6c0886 | j_mayer | ram_sizes[1] = 0x00000000; |
200 | 1a6c0886 | j_mayer | ram_size = 128 * 1024 * 1024; |
201 | 1a6c0886 | j_mayer | #ifdef DEBUG_BOARD_INIT
|
202 | 1a6c0886 | j_mayer | printf("%s: register cpu\n", __func__);
|
203 | 1a6c0886 | j_mayer | #endif
|
204 | 1a6c0886 | j_mayer | env = ppc405ep_init(ram_bases, ram_sizes, 33333333, &pic, &sram_offset,
|
205 | 1a6c0886 | j_mayer | kernel_filename == NULL ? 0 : 1); |
206 | 1a6c0886 | j_mayer | /* allocate SRAM */
|
207 | 1a6c0886 | j_mayer | #ifdef DEBUG_BOARD_INIT
|
208 | 1a6c0886 | j_mayer | printf("%s: register SRAM at offset %08lx\n", __func__, sram_offset);
|
209 | 1a6c0886 | j_mayer | #endif
|
210 | 1a6c0886 | j_mayer | sram_size = 512 * 1024; |
211 | 1a6c0886 | j_mayer | cpu_register_physical_memory(0xFFF00000, sram_size,
|
212 | 1a6c0886 | j_mayer | sram_offset | IO_MEM_RAM); |
213 | 1a6c0886 | j_mayer | /* allocate and load BIOS */
|
214 | 1a6c0886 | j_mayer | #ifdef DEBUG_BOARD_INIT
|
215 | 1a6c0886 | j_mayer | printf("%s: register BIOS\n", __func__);
|
216 | 1a6c0886 | j_mayer | #endif
|
217 | 1a6c0886 | j_mayer | bios_offset = sram_offset + sram_size; |
218 | 1a6c0886 | j_mayer | fl_idx = 0;
|
219 | 1a6c0886 | j_mayer | #ifdef USE_FLASH_BIOS
|
220 | 1a6c0886 | j_mayer | if (pflash_table[fl_idx] != NULL) { |
221 | 1a6c0886 | j_mayer | bios_size = bdrv_getlength(pflash_table[fl_idx]); |
222 | 1a6c0886 | j_mayer | fl_sectors = (bios_size + 65535) >> 16; |
223 | 1a6c0886 | j_mayer | #ifdef DEBUG_BOARD_INIT
|
224 | 1a6c0886 | j_mayer | printf("Register parallel flash %d size " ADDRX " at offset %08lx " |
225 | 1a6c0886 | j_mayer | " addr " ADDRX " '%s' %d\n", |
226 | 1a6c0886 | j_mayer | fl_idx, bios_size, bios_offset, -bios_size, |
227 | 1a6c0886 | j_mayer | bdrv_get_device_name(pflash_table[fl_idx]), fl_sectors); |
228 | 1a6c0886 | j_mayer | #endif
|
229 | 1a6c0886 | j_mayer | pflash_register(-(bios_size), bios_offset, pflash_table[fl_idx], |
230 | 1a6c0886 | j_mayer | 65536, fl_sectors, 2, |
231 | 1a6c0886 | j_mayer | 0x0001, 0x22DA, 0x0000, 0x0000); |
232 | 1a6c0886 | j_mayer | fl_idx++; |
233 | 1a6c0886 | j_mayer | } else
|
234 | 1a6c0886 | j_mayer | #endif
|
235 | 1a6c0886 | j_mayer | { |
236 | 1a6c0886 | j_mayer | #ifdef DEBUG_BOARD_INIT
|
237 | 1a6c0886 | j_mayer | printf("Load BIOS from file\n");
|
238 | 1a6c0886 | j_mayer | #endif
|
239 | 1a6c0886 | j_mayer | snprintf(buf, sizeof(buf), "%s/%s", bios_dir, BIOS_FILENAME); |
240 | 1a6c0886 | j_mayer | bios_size = load_image(buf, phys_ram_base + bios_offset); |
241 | 1a6c0886 | j_mayer | if (bios_size < 0 || bios_size > BIOS_SIZE) { |
242 | 1a6c0886 | j_mayer | fprintf(stderr, "qemu: could not load PowerPC bios '%s'\n", buf);
|
243 | 1a6c0886 | j_mayer | exit(1);
|
244 | 1a6c0886 | j_mayer | } |
245 | 1a6c0886 | j_mayer | bios_size = (bios_size + 0xfff) & ~0xfff; |
246 | 1a6c0886 | j_mayer | cpu_register_physical_memory((uint32_t)(-bios_size), |
247 | 1a6c0886 | j_mayer | bios_size, bios_offset | IO_MEM_ROM); |
248 | 1a6c0886 | j_mayer | } |
249 | 1a6c0886 | j_mayer | bios_offset += bios_size; |
250 | 1a6c0886 | j_mayer | /* Register FPGA */
|
251 | 1a6c0886 | j_mayer | #ifdef DEBUG_BOARD_INIT
|
252 | 1a6c0886 | j_mayer | printf("%s: register FPGA\n", __func__);
|
253 | 1a6c0886 | j_mayer | #endif
|
254 | 1a6c0886 | j_mayer | ref405ep_fpga_init(0xF0300000);
|
255 | 1a6c0886 | j_mayer | /* Register NVRAM */
|
256 | 1a6c0886 | j_mayer | #ifdef DEBUG_BOARD_INIT
|
257 | 1a6c0886 | j_mayer | printf("%s: register NVRAM\n", __func__);
|
258 | 1a6c0886 | j_mayer | #endif
|
259 | 1a6c0886 | j_mayer | m48t59_init(NULL, 0xF0000000, 0, 8192, 8); |
260 | 1a6c0886 | j_mayer | /* Load kernel */
|
261 | 1a6c0886 | j_mayer | linux_boot = (kernel_filename != NULL);
|
262 | 1a6c0886 | j_mayer | if (linux_boot) {
|
263 | 1a6c0886 | j_mayer | #ifdef DEBUG_BOARD_INIT
|
264 | 1a6c0886 | j_mayer | printf("%s: load kernel\n", __func__);
|
265 | 1a6c0886 | j_mayer | #endif
|
266 | 1a6c0886 | j_mayer | memset(&bd, 0, sizeof(bd)); |
267 | 1a6c0886 | j_mayer | bd.bi_memstart = 0x00000000;
|
268 | 1a6c0886 | j_mayer | bd.bi_memsize = ram_size; |
269 | 1a6c0886 | j_mayer | bd.bi_flashstart = -(bios_size); |
270 | 1a6c0886 | j_mayer | bd.bi_flashsize = -bios_size; |
271 | 1a6c0886 | j_mayer | bd.bi_flashoffset = 0;
|
272 | 1a6c0886 | j_mayer | bd.bi_sramstart = 0xFFF00000;
|
273 | 1a6c0886 | j_mayer | bd.bi_sramsize = sram_size; |
274 | 1a6c0886 | j_mayer | bd.bi_bootflags = 0;
|
275 | 1a6c0886 | j_mayer | bd.bi_intfreq = 133333333;
|
276 | 1a6c0886 | j_mayer | bd.bi_busfreq = 33333333;
|
277 | 1a6c0886 | j_mayer | bd.bi_baudrate = 115200;
|
278 | 1a6c0886 | j_mayer | bd.bi_s_version[0] = 'Q'; |
279 | 1a6c0886 | j_mayer | bd.bi_s_version[1] = 'M'; |
280 | 1a6c0886 | j_mayer | bd.bi_s_version[2] = 'U'; |
281 | 1a6c0886 | j_mayer | bd.bi_s_version[3] = '\0'; |
282 | 1a6c0886 | j_mayer | bd.bi_r_version[0] = 'Q'; |
283 | 1a6c0886 | j_mayer | bd.bi_r_version[1] = 'E'; |
284 | 1a6c0886 | j_mayer | bd.bi_r_version[2] = 'M'; |
285 | 1a6c0886 | j_mayer | bd.bi_r_version[3] = 'U'; |
286 | 1a6c0886 | j_mayer | bd.bi_r_version[4] = '\0'; |
287 | 1a6c0886 | j_mayer | bd.bi_procfreq = 133333333;
|
288 | 1a6c0886 | j_mayer | bd.bi_plb_busfreq = 33333333;
|
289 | 1a6c0886 | j_mayer | bd.bi_pci_busfreq = 33333333;
|
290 | 1a6c0886 | j_mayer | bd.bi_opbfreq = 33333333;
|
291 | 1a6c0886 | j_mayer | bdloc = ppc405_set_bootinfo(env, &bd); |
292 | 1a6c0886 | j_mayer | env->gpr[3] = bdloc;
|
293 | 1a6c0886 | j_mayer | kernel_base = KERNEL_LOAD_ADDR; |
294 | 1a6c0886 | j_mayer | /* now we can load the kernel */
|
295 | 1a6c0886 | j_mayer | kernel_size = load_image(kernel_filename, phys_ram_base + kernel_base); |
296 | 1a6c0886 | j_mayer | if (kernel_size < 0) { |
297 | 1a6c0886 | j_mayer | fprintf(stderr, "qemu: could not load kernel '%s'\n",
|
298 | 1a6c0886 | j_mayer | kernel_filename); |
299 | 1a6c0886 | j_mayer | exit(1);
|
300 | 1a6c0886 | j_mayer | } |
301 | 1a6c0886 | j_mayer | printf("Load kernel size " TARGET_FMT_ld " at " TARGET_FMT_lx |
302 | 1a6c0886 | j_mayer | " %02x %02x %02x %02x\n", kernel_size, kernel_base,
|
303 | 1a6c0886 | j_mayer | *(char *)(phys_ram_base + kernel_base),
|
304 | 1a6c0886 | j_mayer | *(char *)(phys_ram_base + kernel_base + 1), |
305 | 1a6c0886 | j_mayer | *(char *)(phys_ram_base + kernel_base + 2), |
306 | 1a6c0886 | j_mayer | *(char *)(phys_ram_base + kernel_base + 3)); |
307 | 1a6c0886 | j_mayer | /* load initrd */
|
308 | 1a6c0886 | j_mayer | if (initrd_filename) {
|
309 | 1a6c0886 | j_mayer | initrd_base = INITRD_LOAD_ADDR; |
310 | 1a6c0886 | j_mayer | initrd_size = load_image(initrd_filename, |
311 | 1a6c0886 | j_mayer | phys_ram_base + initrd_base); |
312 | 1a6c0886 | j_mayer | if (initrd_size < 0) { |
313 | 1a6c0886 | j_mayer | fprintf(stderr, "qemu: could not load initial ram disk '%s'\n",
|
314 | 1a6c0886 | j_mayer | initrd_filename); |
315 | 1a6c0886 | j_mayer | exit(1);
|
316 | 1a6c0886 | j_mayer | } |
317 | 1a6c0886 | j_mayer | } else {
|
318 | 1a6c0886 | j_mayer | initrd_base = 0;
|
319 | 1a6c0886 | j_mayer | initrd_size = 0;
|
320 | 1a6c0886 | j_mayer | } |
321 | 1a6c0886 | j_mayer | env->gpr[4] = initrd_base;
|
322 | 1a6c0886 | j_mayer | env->gpr[5] = initrd_size;
|
323 | 1a6c0886 | j_mayer | boot_device = 'm';
|
324 | 1a6c0886 | j_mayer | if (kernel_cmdline != NULL) { |
325 | 1a6c0886 | j_mayer | len = strlen(kernel_cmdline); |
326 | 1a6c0886 | j_mayer | bdloc -= ((len + 255) & ~255); |
327 | 1a6c0886 | j_mayer | memcpy(phys_ram_base + bdloc, kernel_cmdline, len + 1);
|
328 | 1a6c0886 | j_mayer | env->gpr[6] = bdloc;
|
329 | 1a6c0886 | j_mayer | env->gpr[7] = bdloc + len;
|
330 | 1a6c0886 | j_mayer | } else {
|
331 | 1a6c0886 | j_mayer | env->gpr[6] = 0; |
332 | 1a6c0886 | j_mayer | env->gpr[7] = 0; |
333 | 1a6c0886 | j_mayer | } |
334 | 1a6c0886 | j_mayer | env->nip = KERNEL_LOAD_ADDR; |
335 | 1a6c0886 | j_mayer | } else {
|
336 | 1a6c0886 | j_mayer | kernel_base = 0;
|
337 | 1a6c0886 | j_mayer | kernel_size = 0;
|
338 | 1a6c0886 | j_mayer | initrd_base = 0;
|
339 | 1a6c0886 | j_mayer | initrd_size = 0;
|
340 | 1a6c0886 | j_mayer | bdloc = 0;
|
341 | 1a6c0886 | j_mayer | } |
342 | 1a6c0886 | j_mayer | #ifdef DEBUG_BOARD_INIT
|
343 | 1a6c0886 | j_mayer | printf("%s: Done\n", __func__);
|
344 | 1a6c0886 | j_mayer | #endif
|
345 | 1a6c0886 | j_mayer | printf("bdloc %016lx %s\n",
|
346 | 1a6c0886 | j_mayer | (unsigned long)bdloc, (char *)(phys_ram_base + bdloc)); |
347 | 1a6c0886 | j_mayer | } |
348 | 1a6c0886 | j_mayer | |
349 | 1a6c0886 | j_mayer | QEMUMachine ref405ep_machine = { |
350 | 1a6c0886 | j_mayer | "ref405ep",
|
351 | 1a6c0886 | j_mayer | "ref405ep",
|
352 | 1a6c0886 | j_mayer | ref405ep_init, |
353 | 1a6c0886 | j_mayer | }; |
354 | 1a6c0886 | j_mayer | |
355 | 1a6c0886 | j_mayer | /*****************************************************************************/
|
356 | 1a6c0886 | j_mayer | /* AMCC Taihu evaluation board */
|
357 | 1a6c0886 | j_mayer | /* - PowerPC 405EP processor
|
358 | 1a6c0886 | j_mayer | * - SDRAM 128 MB at 0x00000000
|
359 | 1a6c0886 | j_mayer | * - Boot flash 2 MB at 0xFFE00000
|
360 | 1a6c0886 | j_mayer | * - Application flash 32 MB at 0xFC000000
|
361 | 1a6c0886 | j_mayer | * - 2 serial ports
|
362 | 1a6c0886 | j_mayer | * - 2 ethernet PHY
|
363 | 1a6c0886 | j_mayer | * - 1 USB 1.1 device 0x50000000
|
364 | 1a6c0886 | j_mayer | * - 1 LCD display 0x50100000
|
365 | 1a6c0886 | j_mayer | * - 1 CPLD 0x50100000
|
366 | 1a6c0886 | j_mayer | * - 1 I2C EEPROM
|
367 | 1a6c0886 | j_mayer | * - 1 I2C thermal sensor
|
368 | 1a6c0886 | j_mayer | * - a set of LEDs
|
369 | 1a6c0886 | j_mayer | * - bit-bang SPI port using GPIOs
|
370 | 1a6c0886 | j_mayer | * - 1 EBC interface connector 0 0x50200000
|
371 | 1a6c0886 | j_mayer | * - 1 cardbus controller + expansion slot.
|
372 | 1a6c0886 | j_mayer | * - 1 PCI expansion slot.
|
373 | 1a6c0886 | j_mayer | */
|
374 | 1a6c0886 | j_mayer | typedef struct taihu_cpld_t taihu_cpld_t; |
375 | 1a6c0886 | j_mayer | struct taihu_cpld_t {
|
376 | 1a6c0886 | j_mayer | uint32_t base; |
377 | 1a6c0886 | j_mayer | uint8_t reg0; |
378 | 1a6c0886 | j_mayer | uint8_t reg1; |
379 | 1a6c0886 | j_mayer | }; |
380 | 1a6c0886 | j_mayer | |
381 | 1a6c0886 | j_mayer | static uint32_t taihu_cpld_readb (void *opaque, target_phys_addr_t addr) |
382 | 1a6c0886 | j_mayer | { |
383 | 1a6c0886 | j_mayer | taihu_cpld_t *cpld; |
384 | 1a6c0886 | j_mayer | uint32_t ret; |
385 | 1a6c0886 | j_mayer | |
386 | 1a6c0886 | j_mayer | cpld = opaque; |
387 | 1a6c0886 | j_mayer | addr -= cpld->base; |
388 | 1a6c0886 | j_mayer | switch (addr) {
|
389 | 1a6c0886 | j_mayer | case 0x0: |
390 | 1a6c0886 | j_mayer | ret = cpld->reg0; |
391 | 1a6c0886 | j_mayer | break;
|
392 | 1a6c0886 | j_mayer | case 0x1: |
393 | 1a6c0886 | j_mayer | ret = cpld->reg1; |
394 | 1a6c0886 | j_mayer | break;
|
395 | 1a6c0886 | j_mayer | default:
|
396 | 1a6c0886 | j_mayer | ret = 0;
|
397 | 1a6c0886 | j_mayer | break;
|
398 | 1a6c0886 | j_mayer | } |
399 | 1a6c0886 | j_mayer | |
400 | 1a6c0886 | j_mayer | return ret;
|
401 | 1a6c0886 | j_mayer | } |
402 | 1a6c0886 | j_mayer | |
403 | 1a6c0886 | j_mayer | static void taihu_cpld_writeb (void *opaque, |
404 | 1a6c0886 | j_mayer | target_phys_addr_t addr, uint32_t value) |
405 | 1a6c0886 | j_mayer | { |
406 | 1a6c0886 | j_mayer | taihu_cpld_t *cpld; |
407 | 1a6c0886 | j_mayer | |
408 | 1a6c0886 | j_mayer | cpld = opaque; |
409 | 1a6c0886 | j_mayer | addr -= cpld->base; |
410 | 1a6c0886 | j_mayer | switch (addr) {
|
411 | 1a6c0886 | j_mayer | case 0x0: |
412 | 1a6c0886 | j_mayer | /* Read only */
|
413 | 1a6c0886 | j_mayer | break;
|
414 | 1a6c0886 | j_mayer | case 0x1: |
415 | 1a6c0886 | j_mayer | cpld->reg1 = value; |
416 | 1a6c0886 | j_mayer | break;
|
417 | 1a6c0886 | j_mayer | default:
|
418 | 1a6c0886 | j_mayer | break;
|
419 | 1a6c0886 | j_mayer | } |
420 | 1a6c0886 | j_mayer | } |
421 | 1a6c0886 | j_mayer | |
422 | 1a6c0886 | j_mayer | static uint32_t taihu_cpld_readw (void *opaque, target_phys_addr_t addr) |
423 | 1a6c0886 | j_mayer | { |
424 | 1a6c0886 | j_mayer | uint32_t ret; |
425 | 1a6c0886 | j_mayer | |
426 | 1a6c0886 | j_mayer | ret = taihu_cpld_readb(opaque, addr) << 8;
|
427 | 1a6c0886 | j_mayer | ret |= taihu_cpld_readb(opaque, addr + 1);
|
428 | 1a6c0886 | j_mayer | |
429 | 1a6c0886 | j_mayer | return ret;
|
430 | 1a6c0886 | j_mayer | } |
431 | 1a6c0886 | j_mayer | |
432 | 1a6c0886 | j_mayer | static void taihu_cpld_writew (void *opaque, |
433 | 1a6c0886 | j_mayer | target_phys_addr_t addr, uint32_t value) |
434 | 1a6c0886 | j_mayer | { |
435 | 1a6c0886 | j_mayer | taihu_cpld_writeb(opaque, addr, (value >> 8) & 0xFF); |
436 | 1a6c0886 | j_mayer | taihu_cpld_writeb(opaque, addr + 1, value & 0xFF); |
437 | 1a6c0886 | j_mayer | } |
438 | 1a6c0886 | j_mayer | |
439 | 1a6c0886 | j_mayer | static uint32_t taihu_cpld_readl (void *opaque, target_phys_addr_t addr) |
440 | 1a6c0886 | j_mayer | { |
441 | 1a6c0886 | j_mayer | uint32_t ret; |
442 | 1a6c0886 | j_mayer | |
443 | 1a6c0886 | j_mayer | ret = taihu_cpld_readb(opaque, addr) << 24;
|
444 | 1a6c0886 | j_mayer | ret |= taihu_cpld_readb(opaque, addr + 1) << 16; |
445 | 1a6c0886 | j_mayer | ret |= taihu_cpld_readb(opaque, addr + 2) << 8; |
446 | 1a6c0886 | j_mayer | ret |= taihu_cpld_readb(opaque, addr + 3);
|
447 | 1a6c0886 | j_mayer | |
448 | 1a6c0886 | j_mayer | return ret;
|
449 | 1a6c0886 | j_mayer | } |
450 | 1a6c0886 | j_mayer | |
451 | 1a6c0886 | j_mayer | static void taihu_cpld_writel (void *opaque, |
452 | 1a6c0886 | j_mayer | target_phys_addr_t addr, uint32_t value) |
453 | 1a6c0886 | j_mayer | { |
454 | 1a6c0886 | j_mayer | taihu_cpld_writel(opaque, addr, (value >> 24) & 0xFF); |
455 | 1a6c0886 | j_mayer | taihu_cpld_writel(opaque, addr + 1, (value >> 16) & 0xFF); |
456 | 1a6c0886 | j_mayer | taihu_cpld_writel(opaque, addr + 2, (value >> 8) & 0xFF); |
457 | 1a6c0886 | j_mayer | taihu_cpld_writeb(opaque, addr + 3, value & 0xFF); |
458 | 1a6c0886 | j_mayer | } |
459 | 1a6c0886 | j_mayer | |
460 | 1a6c0886 | j_mayer | static CPUReadMemoryFunc *taihu_cpld_read[] = {
|
461 | 1a6c0886 | j_mayer | &taihu_cpld_readb, |
462 | 1a6c0886 | j_mayer | &taihu_cpld_readw, |
463 | 1a6c0886 | j_mayer | &taihu_cpld_readl, |
464 | 1a6c0886 | j_mayer | }; |
465 | 1a6c0886 | j_mayer | |
466 | 1a6c0886 | j_mayer | static CPUWriteMemoryFunc *taihu_cpld_write[] = {
|
467 | 1a6c0886 | j_mayer | &taihu_cpld_writeb, |
468 | 1a6c0886 | j_mayer | &taihu_cpld_writew, |
469 | 1a6c0886 | j_mayer | &taihu_cpld_writel, |
470 | 1a6c0886 | j_mayer | }; |
471 | 1a6c0886 | j_mayer | |
472 | 1a6c0886 | j_mayer | static void taihu_cpld_reset (void *opaque) |
473 | 1a6c0886 | j_mayer | { |
474 | 1a6c0886 | j_mayer | taihu_cpld_t *cpld; |
475 | 1a6c0886 | j_mayer | |
476 | 1a6c0886 | j_mayer | cpld = opaque; |
477 | 1a6c0886 | j_mayer | cpld->reg0 = 0x01;
|
478 | 1a6c0886 | j_mayer | cpld->reg1 = 0x80;
|
479 | 1a6c0886 | j_mayer | } |
480 | 1a6c0886 | j_mayer | |
481 | 1a6c0886 | j_mayer | static void taihu_cpld_init (uint32_t base) |
482 | 1a6c0886 | j_mayer | { |
483 | 1a6c0886 | j_mayer | taihu_cpld_t *cpld; |
484 | 1a6c0886 | j_mayer | int cpld_memory;
|
485 | 1a6c0886 | j_mayer | |
486 | 1a6c0886 | j_mayer | cpld = qemu_mallocz(sizeof(taihu_cpld_t));
|
487 | 1a6c0886 | j_mayer | if (cpld != NULL) { |
488 | 1a6c0886 | j_mayer | cpld->base = base; |
489 | 1a6c0886 | j_mayer | cpld_memory = cpu_register_io_memory(0, taihu_cpld_read,
|
490 | 1a6c0886 | j_mayer | taihu_cpld_write, cpld); |
491 | 1a6c0886 | j_mayer | cpu_register_physical_memory(base, 0x00000100, cpld_memory);
|
492 | 1a6c0886 | j_mayer | taihu_cpld_reset(cpld); |
493 | 1a6c0886 | j_mayer | qemu_register_reset(&taihu_cpld_reset, cpld); |
494 | 1a6c0886 | j_mayer | } |
495 | 1a6c0886 | j_mayer | } |
496 | 1a6c0886 | j_mayer | |
497 | 1a6c0886 | j_mayer | static void taihu_405ep_init(int ram_size, int vga_ram_size, int boot_device, |
498 | 1a6c0886 | j_mayer | DisplayState *ds, const char **fd_filename, |
499 | 1a6c0886 | j_mayer | int snapshot,
|
500 | 1a6c0886 | j_mayer | const char *kernel_filename, |
501 | 1a6c0886 | j_mayer | const char *kernel_cmdline, |
502 | 1a6c0886 | j_mayer | const char *initrd_filename, |
503 | 1a6c0886 | j_mayer | const char *cpu_model) |
504 | 1a6c0886 | j_mayer | { |
505 | 1a6c0886 | j_mayer | char buf[1024]; |
506 | 1a6c0886 | j_mayer | CPUPPCState *env; |
507 | 1a6c0886 | j_mayer | qemu_irq *pic; |
508 | 1a6c0886 | j_mayer | ram_addr_t bios_offset; |
509 | 71db710f | blueswir1 | target_phys_addr_t ram_bases[2], ram_sizes[2]; |
510 | 1a6c0886 | j_mayer | target_ulong bios_size; |
511 | 1a6c0886 | j_mayer | target_ulong kernel_base, kernel_size, initrd_base, initrd_size; |
512 | 1a6c0886 | j_mayer | int linux_boot;
|
513 | 1a6c0886 | j_mayer | int fl_idx, fl_sectors;
|
514 | 1a6c0886 | j_mayer | |
515 | 1a6c0886 | j_mayer | /* RAM is soldered to the board so the size cannot be changed */
|
516 | 1a6c0886 | j_mayer | ram_bases[0] = 0x00000000; |
517 | 1a6c0886 | j_mayer | ram_sizes[0] = 0x04000000; |
518 | 1a6c0886 | j_mayer | ram_bases[1] = 0x04000000; |
519 | 1a6c0886 | j_mayer | ram_sizes[1] = 0x04000000; |
520 | 1a6c0886 | j_mayer | #ifdef DEBUG_BOARD_INIT
|
521 | 1a6c0886 | j_mayer | printf("%s: register cpu\n", __func__);
|
522 | 1a6c0886 | j_mayer | #endif
|
523 | 1a6c0886 | j_mayer | env = ppc405ep_init(ram_bases, ram_sizes, 33333333, &pic, &bios_offset,
|
524 | 1a6c0886 | j_mayer | kernel_filename == NULL ? 0 : 1); |
525 | 1a6c0886 | j_mayer | /* allocate and load BIOS */
|
526 | 1a6c0886 | j_mayer | #ifdef DEBUG_BOARD_INIT
|
527 | 1a6c0886 | j_mayer | printf("%s: register BIOS\n", __func__);
|
528 | 1a6c0886 | j_mayer | #endif
|
529 | 1a6c0886 | j_mayer | fl_idx = 0;
|
530 | 1a6c0886 | j_mayer | #if defined(USE_FLASH_BIOS)
|
531 | 1a6c0886 | j_mayer | if (pflash_table[fl_idx] != NULL) { |
532 | 1a6c0886 | j_mayer | bios_size = bdrv_getlength(pflash_table[fl_idx]); |
533 | 1a6c0886 | j_mayer | /* XXX: should check that size is 2MB */
|
534 | 1a6c0886 | j_mayer | // bios_size = 2 * 1024 * 1024;
|
535 | 1a6c0886 | j_mayer | fl_sectors = (bios_size + 65535) >> 16; |
536 | 1a6c0886 | j_mayer | #ifdef DEBUG_BOARD_INIT
|
537 | 1a6c0886 | j_mayer | printf("Register parallel flash %d size " ADDRX " at offset %08lx " |
538 | 1a6c0886 | j_mayer | " addr " ADDRX " '%s' %d\n", |
539 | 1a6c0886 | j_mayer | fl_idx, bios_size, bios_offset, -bios_size, |
540 | 1a6c0886 | j_mayer | bdrv_get_device_name(pflash_table[fl_idx]), fl_sectors); |
541 | 1a6c0886 | j_mayer | #endif
|
542 | 1a6c0886 | j_mayer | pflash_register(-(bios_size), bios_offset, pflash_table[fl_idx], |
543 | 1a6c0886 | j_mayer | 65536, fl_sectors, 4, |
544 | 1a6c0886 | j_mayer | 0x0001, 0x22DA, 0x0000, 0x0000); |
545 | 1a6c0886 | j_mayer | fl_idx++; |
546 | 1a6c0886 | j_mayer | } else
|
547 | 1a6c0886 | j_mayer | #endif
|
548 | 1a6c0886 | j_mayer | { |
549 | 1a6c0886 | j_mayer | #ifdef DEBUG_BOARD_INIT
|
550 | 1a6c0886 | j_mayer | printf("Load BIOS from file\n");
|
551 | 1a6c0886 | j_mayer | #endif
|
552 | 1a6c0886 | j_mayer | snprintf(buf, sizeof(buf), "%s/%s", bios_dir, BIOS_FILENAME); |
553 | 1a6c0886 | j_mayer | bios_size = load_image(buf, phys_ram_base + bios_offset); |
554 | 1a6c0886 | j_mayer | if (bios_size < 0 || bios_size > BIOS_SIZE) { |
555 | 1a6c0886 | j_mayer | fprintf(stderr, "qemu: could not load PowerPC bios '%s'\n", buf);
|
556 | 1a6c0886 | j_mayer | exit(1);
|
557 | 1a6c0886 | j_mayer | } |
558 | 1a6c0886 | j_mayer | bios_size = (bios_size + 0xfff) & ~0xfff; |
559 | 1a6c0886 | j_mayer | cpu_register_physical_memory((uint32_t)(-bios_size), |
560 | 1a6c0886 | j_mayer | bios_size, bios_offset | IO_MEM_ROM); |
561 | 1a6c0886 | j_mayer | } |
562 | 1a6c0886 | j_mayer | bios_offset += bios_size; |
563 | 1a6c0886 | j_mayer | /* Register Linux flash */
|
564 | 1a6c0886 | j_mayer | if (pflash_table[fl_idx] != NULL) { |
565 | 1a6c0886 | j_mayer | bios_size = bdrv_getlength(pflash_table[fl_idx]); |
566 | 1a6c0886 | j_mayer | /* XXX: should check that size is 32MB */
|
567 | 1a6c0886 | j_mayer | bios_size = 32 * 1024 * 1024; |
568 | 1a6c0886 | j_mayer | fl_sectors = (bios_size + 65535) >> 16; |
569 | 1a6c0886 | j_mayer | #ifdef DEBUG_BOARD_INIT
|
570 | 1a6c0886 | j_mayer | printf("Register parallel flash %d size " ADDRX " at offset %08lx " |
571 | 1a6c0886 | j_mayer | " addr " ADDRX " '%s'\n", |
572 | 1a6c0886 | j_mayer | fl_idx, bios_size, bios_offset, (target_ulong)0xfc000000,
|
573 | 1a6c0886 | j_mayer | bdrv_get_device_name(pflash_table[fl_idx])); |
574 | 1a6c0886 | j_mayer | #endif
|
575 | 1a6c0886 | j_mayer | pflash_register(0xfc000000, bios_offset, pflash_table[fl_idx],
|
576 | 1a6c0886 | j_mayer | 65536, fl_sectors, 4, |
577 | 1a6c0886 | j_mayer | 0x0001, 0x22DA, 0x0000, 0x0000); |
578 | 1a6c0886 | j_mayer | fl_idx++; |
579 | 1a6c0886 | j_mayer | } |
580 | 1a6c0886 | j_mayer | /* Register CLPD & LCD display */
|
581 | 1a6c0886 | j_mayer | #ifdef DEBUG_BOARD_INIT
|
582 | 1a6c0886 | j_mayer | printf("%s: register CPLD\n", __func__);
|
583 | 1a6c0886 | j_mayer | #endif
|
584 | 1a6c0886 | j_mayer | taihu_cpld_init(0x50100000);
|
585 | 1a6c0886 | j_mayer | /* Load kernel */
|
586 | 1a6c0886 | j_mayer | linux_boot = (kernel_filename != NULL);
|
587 | 1a6c0886 | j_mayer | if (linux_boot) {
|
588 | 1a6c0886 | j_mayer | #ifdef DEBUG_BOARD_INIT
|
589 | 1a6c0886 | j_mayer | printf("%s: load kernel\n", __func__);
|
590 | 1a6c0886 | j_mayer | #endif
|
591 | 1a6c0886 | j_mayer | kernel_base = KERNEL_LOAD_ADDR; |
592 | 1a6c0886 | j_mayer | /* now we can load the kernel */
|
593 | 1a6c0886 | j_mayer | kernel_size = load_image(kernel_filename, phys_ram_base + kernel_base); |
594 | 1a6c0886 | j_mayer | if (kernel_size < 0) { |
595 | 1a6c0886 | j_mayer | fprintf(stderr, "qemu: could not load kernel '%s'\n",
|
596 | 1a6c0886 | j_mayer | kernel_filename); |
597 | 1a6c0886 | j_mayer | exit(1);
|
598 | 1a6c0886 | j_mayer | } |
599 | 1a6c0886 | j_mayer | /* load initrd */
|
600 | 1a6c0886 | j_mayer | if (initrd_filename) {
|
601 | 1a6c0886 | j_mayer | initrd_base = INITRD_LOAD_ADDR; |
602 | 1a6c0886 | j_mayer | initrd_size = load_image(initrd_filename, |
603 | 1a6c0886 | j_mayer | phys_ram_base + initrd_base); |
604 | 1a6c0886 | j_mayer | if (initrd_size < 0) { |
605 | 1a6c0886 | j_mayer | fprintf(stderr, |
606 | 1a6c0886 | j_mayer | "qemu: could not load initial ram disk '%s'\n",
|
607 | 1a6c0886 | j_mayer | initrd_filename); |
608 | 1a6c0886 | j_mayer | exit(1);
|
609 | 1a6c0886 | j_mayer | } |
610 | 1a6c0886 | j_mayer | } else {
|
611 | 1a6c0886 | j_mayer | initrd_base = 0;
|
612 | 1a6c0886 | j_mayer | initrd_size = 0;
|
613 | 1a6c0886 | j_mayer | } |
614 | 1a6c0886 | j_mayer | boot_device = 'm';
|
615 | 1a6c0886 | j_mayer | } else {
|
616 | 1a6c0886 | j_mayer | kernel_base = 0;
|
617 | 1a6c0886 | j_mayer | kernel_size = 0;
|
618 | 1a6c0886 | j_mayer | initrd_base = 0;
|
619 | 1a6c0886 | j_mayer | initrd_size = 0;
|
620 | 1a6c0886 | j_mayer | } |
621 | 1a6c0886 | j_mayer | #ifdef DEBUG_BOARD_INIT
|
622 | 1a6c0886 | j_mayer | printf("%s: Done\n", __func__);
|
623 | 1a6c0886 | j_mayer | #endif
|
624 | 1a6c0886 | j_mayer | } |
625 | 1a6c0886 | j_mayer | |
626 | 1a6c0886 | j_mayer | QEMUMachine taihu_machine = { |
627 | 1a6c0886 | j_mayer | "taihu",
|
628 | 1a6c0886 | j_mayer | "taihu",
|
629 | 1a6c0886 | j_mayer | taihu_405ep_init, |
630 | 1a6c0886 | j_mayer | }; |