root / hw / ppc405_boards.c @ e612a1f7
History | View | Annotate | Download (19.3 kB)
1 | 1a6c0886 | j_mayer | /*
|
---|---|---|---|
2 | 1a6c0886 | j_mayer | * QEMU PowerPC 405 evaluation boards emulation
|
3 | 5fafdf24 | ths | *
|
4 | 1a6c0886 | j_mayer | * Copyright (c) 2007 Jocelyn Mayer
|
5 | 5fafdf24 | ths | *
|
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 | 87ecb68b | pbrook | #include "hw.h" |
25 | 87ecb68b | pbrook | #include "ppc.h" |
26 | 1a6c0886 | j_mayer | #include "ppc405.h" |
27 | 87ecb68b | pbrook | #include "nvram.h" |
28 | 87ecb68b | pbrook | #include "flash.h" |
29 | 87ecb68b | pbrook | #include "sysemu.h" |
30 | 87ecb68b | pbrook | #include "block.h" |
31 | 87ecb68b | pbrook | #include "boards.h" |
32 | 3b3fb322 | blueswir1 | #include "qemu-log.h" |
33 | 1a6c0886 | j_mayer | |
34 | 1a6c0886 | j_mayer | #define BIOS_FILENAME "ppc405_rom.bin" |
35 | 1a6c0886 | j_mayer | #undef BIOS_SIZE
|
36 | 1a6c0886 | j_mayer | #define BIOS_SIZE (2048 * 1024) |
37 | 1a6c0886 | j_mayer | |
38 | 1a6c0886 | j_mayer | #define KERNEL_LOAD_ADDR 0x00000000 |
39 | 1a6c0886 | j_mayer | #define INITRD_LOAD_ADDR 0x01800000 |
40 | 1a6c0886 | j_mayer | |
41 | 1a6c0886 | j_mayer | #define USE_FLASH_BIOS
|
42 | 1a6c0886 | j_mayer | |
43 | 1a6c0886 | j_mayer | #define DEBUG_BOARD_INIT
|
44 | 1a6c0886 | j_mayer | |
45 | 1a6c0886 | j_mayer | /*****************************************************************************/
|
46 | 1a6c0886 | j_mayer | /* PPC405EP reference board (IBM) */
|
47 | 1a6c0886 | j_mayer | /* Standalone board with:
|
48 | 1a6c0886 | j_mayer | * - PowerPC 405EP CPU
|
49 | 1a6c0886 | j_mayer | * - SDRAM (0x00000000)
|
50 | 1a6c0886 | j_mayer | * - Flash (0xFFF80000)
|
51 | 1a6c0886 | j_mayer | * - SRAM (0xFFF00000)
|
52 | 1a6c0886 | j_mayer | * - NVRAM (0xF0000000)
|
53 | 1a6c0886 | j_mayer | * - FPGA (0xF0300000)
|
54 | 1a6c0886 | j_mayer | */
|
55 | 1a6c0886 | j_mayer | typedef struct ref405ep_fpga_t ref405ep_fpga_t; |
56 | 1a6c0886 | j_mayer | struct ref405ep_fpga_t {
|
57 | 1a6c0886 | j_mayer | uint8_t reg0; |
58 | 1a6c0886 | j_mayer | uint8_t reg1; |
59 | 1a6c0886 | j_mayer | }; |
60 | 1a6c0886 | j_mayer | |
61 | 1a6c0886 | j_mayer | static uint32_t ref405ep_fpga_readb (void *opaque, target_phys_addr_t addr) |
62 | 1a6c0886 | j_mayer | { |
63 | 1a6c0886 | j_mayer | ref405ep_fpga_t *fpga; |
64 | 1a6c0886 | j_mayer | uint32_t ret; |
65 | 1a6c0886 | j_mayer | |
66 | 1a6c0886 | j_mayer | fpga = opaque; |
67 | 1a6c0886 | j_mayer | switch (addr) {
|
68 | 1a6c0886 | j_mayer | case 0x0: |
69 | 1a6c0886 | j_mayer | ret = fpga->reg0; |
70 | 1a6c0886 | j_mayer | break;
|
71 | 1a6c0886 | j_mayer | case 0x1: |
72 | 1a6c0886 | j_mayer | ret = fpga->reg1; |
73 | 1a6c0886 | j_mayer | break;
|
74 | 1a6c0886 | j_mayer | default:
|
75 | 1a6c0886 | j_mayer | ret = 0;
|
76 | 1a6c0886 | j_mayer | break;
|
77 | 1a6c0886 | j_mayer | } |
78 | 1a6c0886 | j_mayer | |
79 | 1a6c0886 | j_mayer | return ret;
|
80 | 1a6c0886 | j_mayer | } |
81 | 1a6c0886 | j_mayer | |
82 | 1a6c0886 | j_mayer | static void ref405ep_fpga_writeb (void *opaque, |
83 | 1a6c0886 | j_mayer | target_phys_addr_t addr, uint32_t value) |
84 | 1a6c0886 | j_mayer | { |
85 | 1a6c0886 | j_mayer | ref405ep_fpga_t *fpga; |
86 | 1a6c0886 | j_mayer | |
87 | 1a6c0886 | j_mayer | fpga = opaque; |
88 | 1a6c0886 | j_mayer | switch (addr) {
|
89 | 1a6c0886 | j_mayer | case 0x0: |
90 | 1a6c0886 | j_mayer | /* Read only */
|
91 | 1a6c0886 | j_mayer | break;
|
92 | 1a6c0886 | j_mayer | case 0x1: |
93 | 1a6c0886 | j_mayer | fpga->reg1 = value; |
94 | 1a6c0886 | j_mayer | break;
|
95 | 1a6c0886 | j_mayer | default:
|
96 | 1a6c0886 | j_mayer | break;
|
97 | 1a6c0886 | j_mayer | } |
98 | 1a6c0886 | j_mayer | } |
99 | 1a6c0886 | j_mayer | |
100 | 1a6c0886 | j_mayer | static uint32_t ref405ep_fpga_readw (void *opaque, target_phys_addr_t addr) |
101 | 1a6c0886 | j_mayer | { |
102 | 1a6c0886 | j_mayer | uint32_t ret; |
103 | 1a6c0886 | j_mayer | |
104 | 1a6c0886 | j_mayer | ret = ref405ep_fpga_readb(opaque, addr) << 8;
|
105 | 1a6c0886 | j_mayer | ret |= ref405ep_fpga_readb(opaque, addr + 1);
|
106 | 1a6c0886 | j_mayer | |
107 | 1a6c0886 | j_mayer | return ret;
|
108 | 1a6c0886 | j_mayer | } |
109 | 1a6c0886 | j_mayer | |
110 | 1a6c0886 | j_mayer | static void ref405ep_fpga_writew (void *opaque, |
111 | 1a6c0886 | j_mayer | target_phys_addr_t addr, uint32_t value) |
112 | 1a6c0886 | j_mayer | { |
113 | 1a6c0886 | j_mayer | ref405ep_fpga_writeb(opaque, addr, (value >> 8) & 0xFF); |
114 | 1a6c0886 | j_mayer | ref405ep_fpga_writeb(opaque, addr + 1, value & 0xFF); |
115 | 1a6c0886 | j_mayer | } |
116 | 1a6c0886 | j_mayer | |
117 | 1a6c0886 | j_mayer | static uint32_t ref405ep_fpga_readl (void *opaque, target_phys_addr_t addr) |
118 | 1a6c0886 | j_mayer | { |
119 | 1a6c0886 | j_mayer | uint32_t ret; |
120 | 1a6c0886 | j_mayer | |
121 | 1a6c0886 | j_mayer | ret = ref405ep_fpga_readb(opaque, addr) << 24;
|
122 | 1a6c0886 | j_mayer | ret |= ref405ep_fpga_readb(opaque, addr + 1) << 16; |
123 | 1a6c0886 | j_mayer | ret |= ref405ep_fpga_readb(opaque, addr + 2) << 8; |
124 | 1a6c0886 | j_mayer | ret |= ref405ep_fpga_readb(opaque, addr + 3);
|
125 | 1a6c0886 | j_mayer | |
126 | 1a6c0886 | j_mayer | return ret;
|
127 | 1a6c0886 | j_mayer | } |
128 | 1a6c0886 | j_mayer | |
129 | 1a6c0886 | j_mayer | static void ref405ep_fpga_writel (void *opaque, |
130 | 1a6c0886 | j_mayer | target_phys_addr_t addr, uint32_t value) |
131 | 1a6c0886 | j_mayer | { |
132 | 8de24106 | aurel32 | ref405ep_fpga_writeb(opaque, addr, (value >> 24) & 0xFF); |
133 | 8de24106 | aurel32 | ref405ep_fpga_writeb(opaque, addr + 1, (value >> 16) & 0xFF); |
134 | 8de24106 | aurel32 | ref405ep_fpga_writeb(opaque, addr + 2, (value >> 8) & 0xFF); |
135 | 1a6c0886 | j_mayer | ref405ep_fpga_writeb(opaque, addr + 3, value & 0xFF); |
136 | 1a6c0886 | j_mayer | } |
137 | 1a6c0886 | j_mayer | |
138 | 1a6c0886 | j_mayer | static CPUReadMemoryFunc *ref405ep_fpga_read[] = {
|
139 | 1a6c0886 | j_mayer | &ref405ep_fpga_readb, |
140 | 1a6c0886 | j_mayer | &ref405ep_fpga_readw, |
141 | 1a6c0886 | j_mayer | &ref405ep_fpga_readl, |
142 | 1a6c0886 | j_mayer | }; |
143 | 1a6c0886 | j_mayer | |
144 | 1a6c0886 | j_mayer | static CPUWriteMemoryFunc *ref405ep_fpga_write[] = {
|
145 | 1a6c0886 | j_mayer | &ref405ep_fpga_writeb, |
146 | 1a6c0886 | j_mayer | &ref405ep_fpga_writew, |
147 | 1a6c0886 | j_mayer | &ref405ep_fpga_writel, |
148 | 1a6c0886 | j_mayer | }; |
149 | 1a6c0886 | j_mayer | |
150 | 1a6c0886 | j_mayer | static void ref405ep_fpga_reset (void *opaque) |
151 | 1a6c0886 | j_mayer | { |
152 | 1a6c0886 | j_mayer | ref405ep_fpga_t *fpga; |
153 | 1a6c0886 | j_mayer | |
154 | 1a6c0886 | j_mayer | fpga = opaque; |
155 | 1a6c0886 | j_mayer | fpga->reg0 = 0x00;
|
156 | 1a6c0886 | j_mayer | fpga->reg1 = 0x0F;
|
157 | 1a6c0886 | j_mayer | } |
158 | 1a6c0886 | j_mayer | |
159 | 1a6c0886 | j_mayer | static void ref405ep_fpga_init (uint32_t base) |
160 | 1a6c0886 | j_mayer | { |
161 | 1a6c0886 | j_mayer | ref405ep_fpga_t *fpga; |
162 | 1a6c0886 | j_mayer | int fpga_memory;
|
163 | 1a6c0886 | j_mayer | |
164 | 1a6c0886 | j_mayer | fpga = qemu_mallocz(sizeof(ref405ep_fpga_t));
|
165 | 487414f1 | aliguori | fpga_memory = cpu_register_io_memory(0, ref405ep_fpga_read,
|
166 | 487414f1 | aliguori | ref405ep_fpga_write, fpga); |
167 | 487414f1 | aliguori | cpu_register_physical_memory(base, 0x00000100, fpga_memory);
|
168 | 487414f1 | aliguori | ref405ep_fpga_reset(fpga); |
169 | 487414f1 | aliguori | qemu_register_reset(&ref405ep_fpga_reset, fpga); |
170 | 1a6c0886 | j_mayer | } |
171 | 1a6c0886 | j_mayer | |
172 | 00f82b8a | aurel32 | static void ref405ep_init (ram_addr_t ram_size, int vga_ram_size, |
173 | 3023f332 | aliguori | const char *boot_device, |
174 | 5fafdf24 | ths | const char *kernel_filename, |
175 | 1a6c0886 | j_mayer | const char *kernel_cmdline, |
176 | 1a6c0886 | j_mayer | const char *initrd_filename, |
177 | 1a6c0886 | j_mayer | const char *cpu_model) |
178 | 1a6c0886 | j_mayer | { |
179 | 1a6c0886 | j_mayer | char buf[1024]; |
180 | 1a6c0886 | j_mayer | ppc4xx_bd_info_t bd; |
181 | 1a6c0886 | j_mayer | CPUPPCState *env; |
182 | 1a6c0886 | j_mayer | qemu_irq *pic; |
183 | 1a6c0886 | j_mayer | ram_addr_t sram_offset, bios_offset, bdloc; |
184 | 71db710f | blueswir1 | target_phys_addr_t ram_bases[2], ram_sizes[2]; |
185 | 1a6c0886 | j_mayer | target_ulong sram_size, bios_size; |
186 | 1a6c0886 | j_mayer | //int phy_addr = 0;
|
187 | 1a6c0886 | j_mayer | //static int phy_addr = 1;
|
188 | 1a6c0886 | j_mayer | target_ulong kernel_base, kernel_size, initrd_base, initrd_size; |
189 | 1a6c0886 | j_mayer | int linux_boot;
|
190 | 1a6c0886 | j_mayer | int fl_idx, fl_sectors, len;
|
191 | 6ac0e82d | balrog | int ppc_boot_device = boot_device[0]; |
192 | e4bcb14c | ths | int index;
|
193 | 1a6c0886 | j_mayer | |
194 | 1a6c0886 | j_mayer | /* XXX: fix this */
|
195 | 5c130f65 | pbrook | ram_bases[0] = qemu_ram_alloc(0x08000000); |
196 | 1a6c0886 | j_mayer | ram_sizes[0] = 0x08000000; |
197 | 1a6c0886 | j_mayer | ram_bases[1] = 0x00000000; |
198 | 1a6c0886 | j_mayer | ram_sizes[1] = 0x00000000; |
199 | 1a6c0886 | j_mayer | ram_size = 128 * 1024 * 1024; |
200 | 1a6c0886 | j_mayer | #ifdef DEBUG_BOARD_INIT
|
201 | 1a6c0886 | j_mayer | printf("%s: register cpu\n", __func__);
|
202 | 1a6c0886 | j_mayer | #endif
|
203 | 5c130f65 | pbrook | env = ppc405ep_init(ram_bases, ram_sizes, 33333333, &pic,
|
204 | 1a6c0886 | j_mayer | kernel_filename == NULL ? 0 : 1); |
205 | 1a6c0886 | j_mayer | /* allocate SRAM */
|
206 | 5c130f65 | pbrook | sram_size = 512 * 1024; |
207 | 5c130f65 | pbrook | sram_offset = qemu_ram_alloc(sram_size); |
208 | 1a6c0886 | j_mayer | #ifdef DEBUG_BOARD_INIT
|
209 | 1a6c0886 | j_mayer | printf("%s: register SRAM at offset %08lx\n", __func__, sram_offset);
|
210 | 1a6c0886 | j_mayer | #endif
|
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 | fl_idx = 0;
|
218 | 1a6c0886 | j_mayer | #ifdef USE_FLASH_BIOS
|
219 | e4bcb14c | ths | index = drive_get_index(IF_PFLASH, 0, fl_idx);
|
220 | e4bcb14c | ths | if (index != -1) { |
221 | e4bcb14c | ths | bios_size = bdrv_getlength(drives_table[index].bdrv); |
222 | 5c130f65 | pbrook | bios_offset = qemu_ram_alloc(bios_size); |
223 | 1a6c0886 | j_mayer | fl_sectors = (bios_size + 65535) >> 16; |
224 | 1a6c0886 | j_mayer | #ifdef DEBUG_BOARD_INIT
|
225 | 1a6c0886 | j_mayer | printf("Register parallel flash %d size " ADDRX " at offset %08lx " |
226 | 1a6c0886 | j_mayer | " addr " ADDRX " '%s' %d\n", |
227 | 1a6c0886 | j_mayer | fl_idx, bios_size, bios_offset, -bios_size, |
228 | e4bcb14c | ths | bdrv_get_device_name(drives_table[index].bdrv), fl_sectors); |
229 | 1a6c0886 | j_mayer | #endif
|
230 | 88eeee0a | balrog | pflash_cfi02_register((uint32_t)(-bios_size), bios_offset, |
231 | 4fbd24ba | balrog | drives_table[index].bdrv, 65536, fl_sectors, 1, |
232 | 4fbd24ba | balrog | 2, 0x0001, 0x22DA, 0x0000, 0x0000, 0x555, 0x2AA); |
233 | 1a6c0886 | j_mayer | fl_idx++; |
234 | 1a6c0886 | j_mayer | } else
|
235 | 1a6c0886 | j_mayer | #endif
|
236 | 1a6c0886 | j_mayer | { |
237 | 1a6c0886 | j_mayer | #ifdef DEBUG_BOARD_INIT
|
238 | 1a6c0886 | j_mayer | printf("Load BIOS from file\n");
|
239 | 1a6c0886 | j_mayer | #endif
|
240 | 1192dad8 | j_mayer | if (bios_name == NULL) |
241 | 1192dad8 | j_mayer | bios_name = BIOS_FILENAME; |
242 | 1192dad8 | j_mayer | snprintf(buf, sizeof(buf), "%s/%s", bios_dir, bios_name); |
243 | 5c130f65 | pbrook | bios_offset = qemu_ram_alloc(BIOS_SIZE); |
244 | 5c130f65 | pbrook | bios_size = load_image(buf, qemu_get_ram_ptr(bios_offset)); |
245 | 1a6c0886 | j_mayer | if (bios_size < 0 || bios_size > BIOS_SIZE) { |
246 | 1a6c0886 | j_mayer | fprintf(stderr, "qemu: could not load PowerPC bios '%s'\n", buf);
|
247 | 1a6c0886 | j_mayer | exit(1);
|
248 | 1a6c0886 | j_mayer | } |
249 | 1a6c0886 | j_mayer | bios_size = (bios_size + 0xfff) & ~0xfff; |
250 | 5fafdf24 | ths | cpu_register_physical_memory((uint32_t)(-bios_size), |
251 | 1a6c0886 | j_mayer | bios_size, bios_offset | IO_MEM_ROM); |
252 | 1a6c0886 | j_mayer | } |
253 | 1a6c0886 | j_mayer | /* Register FPGA */
|
254 | 1a6c0886 | j_mayer | #ifdef DEBUG_BOARD_INIT
|
255 | 1a6c0886 | j_mayer | printf("%s: register FPGA\n", __func__);
|
256 | 1a6c0886 | j_mayer | #endif
|
257 | 1a6c0886 | j_mayer | ref405ep_fpga_init(0xF0300000);
|
258 | 1a6c0886 | j_mayer | /* Register NVRAM */
|
259 | 1a6c0886 | j_mayer | #ifdef DEBUG_BOARD_INIT
|
260 | 1a6c0886 | j_mayer | printf("%s: register NVRAM\n", __func__);
|
261 | 1a6c0886 | j_mayer | #endif
|
262 | 1a6c0886 | j_mayer | m48t59_init(NULL, 0xF0000000, 0, 8192, 8); |
263 | 1a6c0886 | j_mayer | /* Load kernel */
|
264 | 1a6c0886 | j_mayer | linux_boot = (kernel_filename != NULL);
|
265 | 1a6c0886 | j_mayer | if (linux_boot) {
|
266 | 1a6c0886 | j_mayer | #ifdef DEBUG_BOARD_INIT
|
267 | 1a6c0886 | j_mayer | printf("%s: load kernel\n", __func__);
|
268 | 1a6c0886 | j_mayer | #endif
|
269 | 1a6c0886 | j_mayer | memset(&bd, 0, sizeof(bd)); |
270 | 1a6c0886 | j_mayer | bd.bi_memstart = 0x00000000;
|
271 | 1a6c0886 | j_mayer | bd.bi_memsize = ram_size; |
272 | 217fae2d | j_mayer | bd.bi_flashstart = -bios_size; |
273 | 1a6c0886 | j_mayer | bd.bi_flashsize = -bios_size; |
274 | 1a6c0886 | j_mayer | bd.bi_flashoffset = 0;
|
275 | 1a6c0886 | j_mayer | bd.bi_sramstart = 0xFFF00000;
|
276 | 1a6c0886 | j_mayer | bd.bi_sramsize = sram_size; |
277 | 1a6c0886 | j_mayer | bd.bi_bootflags = 0;
|
278 | 1a6c0886 | j_mayer | bd.bi_intfreq = 133333333;
|
279 | 1a6c0886 | j_mayer | bd.bi_busfreq = 33333333;
|
280 | 1a6c0886 | j_mayer | bd.bi_baudrate = 115200;
|
281 | 1a6c0886 | j_mayer | bd.bi_s_version[0] = 'Q'; |
282 | 1a6c0886 | j_mayer | bd.bi_s_version[1] = 'M'; |
283 | 1a6c0886 | j_mayer | bd.bi_s_version[2] = 'U'; |
284 | 1a6c0886 | j_mayer | bd.bi_s_version[3] = '\0'; |
285 | 1a6c0886 | j_mayer | bd.bi_r_version[0] = 'Q'; |
286 | 1a6c0886 | j_mayer | bd.bi_r_version[1] = 'E'; |
287 | 1a6c0886 | j_mayer | bd.bi_r_version[2] = 'M'; |
288 | 1a6c0886 | j_mayer | bd.bi_r_version[3] = 'U'; |
289 | 1a6c0886 | j_mayer | bd.bi_r_version[4] = '\0'; |
290 | 1a6c0886 | j_mayer | bd.bi_procfreq = 133333333;
|
291 | 1a6c0886 | j_mayer | bd.bi_plb_busfreq = 33333333;
|
292 | 1a6c0886 | j_mayer | bd.bi_pci_busfreq = 33333333;
|
293 | 1a6c0886 | j_mayer | bd.bi_opbfreq = 33333333;
|
294 | b8d3f5d1 | j_mayer | bdloc = ppc405_set_bootinfo(env, &bd, 0x00000001);
|
295 | 1a6c0886 | j_mayer | env->gpr[3] = bdloc;
|
296 | 1a6c0886 | j_mayer | kernel_base = KERNEL_LOAD_ADDR; |
297 | 1a6c0886 | j_mayer | /* now we can load the kernel */
|
298 | 5c130f65 | pbrook | kernel_size = load_image_targphys(kernel_filename, kernel_base, |
299 | 5c130f65 | pbrook | ram_size - kernel_base); |
300 | 1a6c0886 | j_mayer | if (kernel_size < 0) { |
301 | 5fafdf24 | ths | fprintf(stderr, "qemu: could not load kernel '%s'\n",
|
302 | 1a6c0886 | j_mayer | kernel_filename); |
303 | 1a6c0886 | j_mayer | exit(1);
|
304 | 1a6c0886 | j_mayer | } |
305 | 5c130f65 | pbrook | printf("Load kernel size " TARGET_FMT_ld " at " TARGET_FMT_lx, |
306 | 5c130f65 | pbrook | kernel_size, kernel_base); |
307 | 1a6c0886 | j_mayer | /* load initrd */
|
308 | 1a6c0886 | j_mayer | if (initrd_filename) {
|
309 | 1a6c0886 | j_mayer | initrd_base = INITRD_LOAD_ADDR; |
310 | 5c130f65 | pbrook | initrd_size = load_image_targphys(initrd_filename, initrd_base, |
311 | 5c130f65 | pbrook | ram_size - initrd_base); |
312 | 1a6c0886 | j_mayer | if (initrd_size < 0) { |
313 | 5fafdf24 | ths | 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 | 6ac0e82d | balrog | ppc_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 | 5c130f65 | pbrook | cpu_physical_memory_write(bdloc, (void *)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 | 5c130f65 | pbrook | printf("bdloc %016lx\n", (unsigned long)bdloc); |
346 | 1a6c0886 | j_mayer | } |
347 | 1a6c0886 | j_mayer | |
348 | 1a6c0886 | j_mayer | QEMUMachine ref405ep_machine = { |
349 | 4b32e168 | aliguori | .name = "ref405ep",
|
350 | 4b32e168 | aliguori | .desc = "ref405ep",
|
351 | 4b32e168 | aliguori | .init = ref405ep_init, |
352 | 1a6c0886 | j_mayer | }; |
353 | 1a6c0886 | j_mayer | |
354 | 1a6c0886 | j_mayer | /*****************************************************************************/
|
355 | 1a6c0886 | j_mayer | /* AMCC Taihu evaluation board */
|
356 | 1a6c0886 | j_mayer | /* - PowerPC 405EP processor
|
357 | 1a6c0886 | j_mayer | * - SDRAM 128 MB at 0x00000000
|
358 | 1a6c0886 | j_mayer | * - Boot flash 2 MB at 0xFFE00000
|
359 | 1a6c0886 | j_mayer | * - Application flash 32 MB at 0xFC000000
|
360 | 1a6c0886 | j_mayer | * - 2 serial ports
|
361 | 1a6c0886 | j_mayer | * - 2 ethernet PHY
|
362 | 1a6c0886 | j_mayer | * - 1 USB 1.1 device 0x50000000
|
363 | 1a6c0886 | j_mayer | * - 1 LCD display 0x50100000
|
364 | 1a6c0886 | j_mayer | * - 1 CPLD 0x50100000
|
365 | 1a6c0886 | j_mayer | * - 1 I2C EEPROM
|
366 | 1a6c0886 | j_mayer | * - 1 I2C thermal sensor
|
367 | 1a6c0886 | j_mayer | * - a set of LEDs
|
368 | 1a6c0886 | j_mayer | * - bit-bang SPI port using GPIOs
|
369 | 1a6c0886 | j_mayer | * - 1 EBC interface connector 0 0x50200000
|
370 | 1a6c0886 | j_mayer | * - 1 cardbus controller + expansion slot.
|
371 | 1a6c0886 | j_mayer | * - 1 PCI expansion slot.
|
372 | 1a6c0886 | j_mayer | */
|
373 | 1a6c0886 | j_mayer | typedef struct taihu_cpld_t taihu_cpld_t; |
374 | 1a6c0886 | j_mayer | struct taihu_cpld_t {
|
375 | 1a6c0886 | j_mayer | uint8_t reg0; |
376 | 1a6c0886 | j_mayer | uint8_t reg1; |
377 | 1a6c0886 | j_mayer | }; |
378 | 1a6c0886 | j_mayer | |
379 | 1a6c0886 | j_mayer | static uint32_t taihu_cpld_readb (void *opaque, target_phys_addr_t addr) |
380 | 1a6c0886 | j_mayer | { |
381 | 1a6c0886 | j_mayer | taihu_cpld_t *cpld; |
382 | 1a6c0886 | j_mayer | uint32_t ret; |
383 | 1a6c0886 | j_mayer | |
384 | 1a6c0886 | j_mayer | cpld = opaque; |
385 | 1a6c0886 | j_mayer | switch (addr) {
|
386 | 1a6c0886 | j_mayer | case 0x0: |
387 | 1a6c0886 | j_mayer | ret = cpld->reg0; |
388 | 1a6c0886 | j_mayer | break;
|
389 | 1a6c0886 | j_mayer | case 0x1: |
390 | 1a6c0886 | j_mayer | ret = cpld->reg1; |
391 | 1a6c0886 | j_mayer | break;
|
392 | 1a6c0886 | j_mayer | default:
|
393 | 1a6c0886 | j_mayer | ret = 0;
|
394 | 1a6c0886 | j_mayer | break;
|
395 | 1a6c0886 | j_mayer | } |
396 | 1a6c0886 | j_mayer | |
397 | 1a6c0886 | j_mayer | return ret;
|
398 | 1a6c0886 | j_mayer | } |
399 | 1a6c0886 | j_mayer | |
400 | 1a6c0886 | j_mayer | static void taihu_cpld_writeb (void *opaque, |
401 | 1a6c0886 | j_mayer | target_phys_addr_t addr, uint32_t value) |
402 | 1a6c0886 | j_mayer | { |
403 | 1a6c0886 | j_mayer | taihu_cpld_t *cpld; |
404 | 1a6c0886 | j_mayer | |
405 | 1a6c0886 | j_mayer | cpld = opaque; |
406 | 1a6c0886 | j_mayer | switch (addr) {
|
407 | 1a6c0886 | j_mayer | case 0x0: |
408 | 1a6c0886 | j_mayer | /* Read only */
|
409 | 1a6c0886 | j_mayer | break;
|
410 | 1a6c0886 | j_mayer | case 0x1: |
411 | 1a6c0886 | j_mayer | cpld->reg1 = value; |
412 | 1a6c0886 | j_mayer | break;
|
413 | 1a6c0886 | j_mayer | default:
|
414 | 1a6c0886 | j_mayer | break;
|
415 | 1a6c0886 | j_mayer | } |
416 | 1a6c0886 | j_mayer | } |
417 | 1a6c0886 | j_mayer | |
418 | 1a6c0886 | j_mayer | static uint32_t taihu_cpld_readw (void *opaque, target_phys_addr_t addr) |
419 | 1a6c0886 | j_mayer | { |
420 | 1a6c0886 | j_mayer | uint32_t ret; |
421 | 1a6c0886 | j_mayer | |
422 | 1a6c0886 | j_mayer | ret = taihu_cpld_readb(opaque, addr) << 8;
|
423 | 1a6c0886 | j_mayer | ret |= taihu_cpld_readb(opaque, addr + 1);
|
424 | 1a6c0886 | j_mayer | |
425 | 1a6c0886 | j_mayer | return ret;
|
426 | 1a6c0886 | j_mayer | } |
427 | 1a6c0886 | j_mayer | |
428 | 1a6c0886 | j_mayer | static void taihu_cpld_writew (void *opaque, |
429 | 1a6c0886 | j_mayer | target_phys_addr_t addr, uint32_t value) |
430 | 1a6c0886 | j_mayer | { |
431 | 1a6c0886 | j_mayer | taihu_cpld_writeb(opaque, addr, (value >> 8) & 0xFF); |
432 | 1a6c0886 | j_mayer | taihu_cpld_writeb(opaque, addr + 1, value & 0xFF); |
433 | 1a6c0886 | j_mayer | } |
434 | 1a6c0886 | j_mayer | |
435 | 1a6c0886 | j_mayer | static uint32_t taihu_cpld_readl (void *opaque, target_phys_addr_t addr) |
436 | 1a6c0886 | j_mayer | { |
437 | 1a6c0886 | j_mayer | uint32_t ret; |
438 | 1a6c0886 | j_mayer | |
439 | 1a6c0886 | j_mayer | ret = taihu_cpld_readb(opaque, addr) << 24;
|
440 | 1a6c0886 | j_mayer | ret |= taihu_cpld_readb(opaque, addr + 1) << 16; |
441 | 1a6c0886 | j_mayer | ret |= taihu_cpld_readb(opaque, addr + 2) << 8; |
442 | 1a6c0886 | j_mayer | ret |= taihu_cpld_readb(opaque, addr + 3);
|
443 | 1a6c0886 | j_mayer | |
444 | 1a6c0886 | j_mayer | return ret;
|
445 | 1a6c0886 | j_mayer | } |
446 | 1a6c0886 | j_mayer | |
447 | 1a6c0886 | j_mayer | static void taihu_cpld_writel (void *opaque, |
448 | 1a6c0886 | j_mayer | target_phys_addr_t addr, uint32_t value) |
449 | 1a6c0886 | j_mayer | { |
450 | 1a6c0886 | j_mayer | taihu_cpld_writel(opaque, addr, (value >> 24) & 0xFF); |
451 | 1a6c0886 | j_mayer | taihu_cpld_writel(opaque, addr + 1, (value >> 16) & 0xFF); |
452 | 1a6c0886 | j_mayer | taihu_cpld_writel(opaque, addr + 2, (value >> 8) & 0xFF); |
453 | 1a6c0886 | j_mayer | taihu_cpld_writeb(opaque, addr + 3, value & 0xFF); |
454 | 1a6c0886 | j_mayer | } |
455 | 1a6c0886 | j_mayer | |
456 | 1a6c0886 | j_mayer | static CPUReadMemoryFunc *taihu_cpld_read[] = {
|
457 | 1a6c0886 | j_mayer | &taihu_cpld_readb, |
458 | 1a6c0886 | j_mayer | &taihu_cpld_readw, |
459 | 1a6c0886 | j_mayer | &taihu_cpld_readl, |
460 | 1a6c0886 | j_mayer | }; |
461 | 1a6c0886 | j_mayer | |
462 | 1a6c0886 | j_mayer | static CPUWriteMemoryFunc *taihu_cpld_write[] = {
|
463 | 1a6c0886 | j_mayer | &taihu_cpld_writeb, |
464 | 1a6c0886 | j_mayer | &taihu_cpld_writew, |
465 | 1a6c0886 | j_mayer | &taihu_cpld_writel, |
466 | 1a6c0886 | j_mayer | }; |
467 | 1a6c0886 | j_mayer | |
468 | 1a6c0886 | j_mayer | static void taihu_cpld_reset (void *opaque) |
469 | 1a6c0886 | j_mayer | { |
470 | 1a6c0886 | j_mayer | taihu_cpld_t *cpld; |
471 | 1a6c0886 | j_mayer | |
472 | 1a6c0886 | j_mayer | cpld = opaque; |
473 | 1a6c0886 | j_mayer | cpld->reg0 = 0x01;
|
474 | 1a6c0886 | j_mayer | cpld->reg1 = 0x80;
|
475 | 1a6c0886 | j_mayer | } |
476 | 1a6c0886 | j_mayer | |
477 | 1a6c0886 | j_mayer | static void taihu_cpld_init (uint32_t base) |
478 | 1a6c0886 | j_mayer | { |
479 | 1a6c0886 | j_mayer | taihu_cpld_t *cpld; |
480 | 1a6c0886 | j_mayer | int cpld_memory;
|
481 | 1a6c0886 | j_mayer | |
482 | 1a6c0886 | j_mayer | cpld = qemu_mallocz(sizeof(taihu_cpld_t));
|
483 | 487414f1 | aliguori | cpld_memory = cpu_register_io_memory(0, taihu_cpld_read,
|
484 | 487414f1 | aliguori | taihu_cpld_write, cpld); |
485 | 487414f1 | aliguori | cpu_register_physical_memory(base, 0x00000100, cpld_memory);
|
486 | 487414f1 | aliguori | taihu_cpld_reset(cpld); |
487 | 487414f1 | aliguori | qemu_register_reset(&taihu_cpld_reset, cpld); |
488 | 1a6c0886 | j_mayer | } |
489 | 1a6c0886 | j_mayer | |
490 | 00f82b8a | aurel32 | static void taihu_405ep_init(ram_addr_t ram_size, int vga_ram_size, |
491 | 3023f332 | aliguori | const char *boot_device, |
492 | 5fafdf24 | ths | const char *kernel_filename, |
493 | 1a6c0886 | j_mayer | const char *kernel_cmdline, |
494 | 1a6c0886 | j_mayer | const char *initrd_filename, |
495 | 1a6c0886 | j_mayer | const char *cpu_model) |
496 | 1a6c0886 | j_mayer | { |
497 | 1a6c0886 | j_mayer | char buf[1024]; |
498 | 1a6c0886 | j_mayer | CPUPPCState *env; |
499 | 1a6c0886 | j_mayer | qemu_irq *pic; |
500 | 1a6c0886 | j_mayer | ram_addr_t bios_offset; |
501 | 71db710f | blueswir1 | target_phys_addr_t ram_bases[2], ram_sizes[2]; |
502 | 1a6c0886 | j_mayer | target_ulong bios_size; |
503 | 1a6c0886 | j_mayer | target_ulong kernel_base, kernel_size, initrd_base, initrd_size; |
504 | 1a6c0886 | j_mayer | int linux_boot;
|
505 | 1a6c0886 | j_mayer | int fl_idx, fl_sectors;
|
506 | 6ac0e82d | balrog | int ppc_boot_device = boot_device[0]; |
507 | e4bcb14c | ths | int index;
|
508 | 3b46e624 | ths | |
509 | 1a6c0886 | j_mayer | /* RAM is soldered to the board so the size cannot be changed */
|
510 | 5c130f65 | pbrook | ram_bases[0] = qemu_ram_alloc(0x04000000); |
511 | 1a6c0886 | j_mayer | ram_sizes[0] = 0x04000000; |
512 | 5c130f65 | pbrook | ram_bases[1] = qemu_ram_alloc(0x04000000); |
513 | 1a6c0886 | j_mayer | ram_sizes[1] = 0x04000000; |
514 | a0b753df | pbrook | ram_size = 0x08000000;
|
515 | 1a6c0886 | j_mayer | #ifdef DEBUG_BOARD_INIT
|
516 | 1a6c0886 | j_mayer | printf("%s: register cpu\n", __func__);
|
517 | 1a6c0886 | j_mayer | #endif
|
518 | 5c130f65 | pbrook | env = ppc405ep_init(ram_bases, ram_sizes, 33333333, &pic,
|
519 | 1a6c0886 | j_mayer | kernel_filename == NULL ? 0 : 1); |
520 | 1a6c0886 | j_mayer | /* allocate and load BIOS */
|
521 | 1a6c0886 | j_mayer | #ifdef DEBUG_BOARD_INIT
|
522 | 1a6c0886 | j_mayer | printf("%s: register BIOS\n", __func__);
|
523 | 1a6c0886 | j_mayer | #endif
|
524 | 1a6c0886 | j_mayer | fl_idx = 0;
|
525 | 1a6c0886 | j_mayer | #if defined(USE_FLASH_BIOS)
|
526 | e4bcb14c | ths | index = drive_get_index(IF_PFLASH, 0, fl_idx);
|
527 | e4bcb14c | ths | if (index != -1) { |
528 | e4bcb14c | ths | bios_size = bdrv_getlength(drives_table[index].bdrv); |
529 | 1a6c0886 | j_mayer | /* XXX: should check that size is 2MB */
|
530 | 1a6c0886 | j_mayer | // bios_size = 2 * 1024 * 1024;
|
531 | 1a6c0886 | j_mayer | fl_sectors = (bios_size + 65535) >> 16; |
532 | 5c130f65 | pbrook | bios_offset = qemu_ram_alloc(bios_size); |
533 | 1a6c0886 | j_mayer | #ifdef DEBUG_BOARD_INIT
|
534 | 1a6c0886 | j_mayer | printf("Register parallel flash %d size " ADDRX " at offset %08lx " |
535 | 1a6c0886 | j_mayer | " addr " ADDRX " '%s' %d\n", |
536 | 1a6c0886 | j_mayer | fl_idx, bios_size, bios_offset, -bios_size, |
537 | e4bcb14c | ths | bdrv_get_device_name(drives_table[index].bdrv), fl_sectors); |
538 | 1a6c0886 | j_mayer | #endif
|
539 | 88eeee0a | balrog | pflash_cfi02_register((uint32_t)(-bios_size), bios_offset, |
540 | 4fbd24ba | balrog | drives_table[index].bdrv, 65536, fl_sectors, 1, |
541 | 4fbd24ba | balrog | 4, 0x0001, 0x22DA, 0x0000, 0x0000, 0x555, 0x2AA); |
542 | 1a6c0886 | j_mayer | fl_idx++; |
543 | 1a6c0886 | j_mayer | } else
|
544 | 1a6c0886 | j_mayer | #endif
|
545 | 1a6c0886 | j_mayer | { |
546 | 1a6c0886 | j_mayer | #ifdef DEBUG_BOARD_INIT
|
547 | 1a6c0886 | j_mayer | printf("Load BIOS from file\n");
|
548 | 1a6c0886 | j_mayer | #endif
|
549 | 1192dad8 | j_mayer | if (bios_name == NULL) |
550 | 1192dad8 | j_mayer | bios_name = BIOS_FILENAME; |
551 | 5c130f65 | pbrook | bios_offset = qemu_ram_alloc(BIOS_SIZE); |
552 | 1192dad8 | j_mayer | snprintf(buf, sizeof(buf), "%s/%s", bios_dir, bios_name); |
553 | 5c130f65 | pbrook | bios_size = load_image(buf, qemu_get_ram_ptr(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 | 5fafdf24 | ths | 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 | /* Register Linux flash */
|
563 | e4bcb14c | ths | index = drive_get_index(IF_PFLASH, 0, fl_idx);
|
564 | e4bcb14c | ths | if (index != -1) { |
565 | e4bcb14c | ths | bios_size = bdrv_getlength(drives_table[index].bdrv); |
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 | e4bcb14c | ths | bdrv_get_device_name(drives_table[index].bdrv)); |
574 | 1a6c0886 | j_mayer | #endif
|
575 | 5c130f65 | pbrook | bios_offset = qemu_ram_alloc(bios_size); |
576 | 88eeee0a | balrog | pflash_cfi02_register(0xfc000000, bios_offset,
|
577 | 4fbd24ba | balrog | drives_table[index].bdrv, 65536, fl_sectors, 1, |
578 | 4fbd24ba | balrog | 4, 0x0001, 0x22DA, 0x0000, 0x0000, 0x555, 0x2AA); |
579 | 1a6c0886 | j_mayer | fl_idx++; |
580 | 1a6c0886 | j_mayer | } |
581 | 1a6c0886 | j_mayer | /* Register CLPD & LCD display */
|
582 | 1a6c0886 | j_mayer | #ifdef DEBUG_BOARD_INIT
|
583 | 1a6c0886 | j_mayer | printf("%s: register CPLD\n", __func__);
|
584 | 1a6c0886 | j_mayer | #endif
|
585 | 1a6c0886 | j_mayer | taihu_cpld_init(0x50100000);
|
586 | 1a6c0886 | j_mayer | /* Load kernel */
|
587 | 1a6c0886 | j_mayer | linux_boot = (kernel_filename != NULL);
|
588 | 1a6c0886 | j_mayer | if (linux_boot) {
|
589 | 1a6c0886 | j_mayer | #ifdef DEBUG_BOARD_INIT
|
590 | 1a6c0886 | j_mayer | printf("%s: load kernel\n", __func__);
|
591 | 1a6c0886 | j_mayer | #endif
|
592 | 1a6c0886 | j_mayer | kernel_base = KERNEL_LOAD_ADDR; |
593 | 1a6c0886 | j_mayer | /* now we can load the kernel */
|
594 | 5c130f65 | pbrook | kernel_size = load_image_targphys(kernel_filename, kernel_base, |
595 | 5c130f65 | pbrook | ram_size - kernel_base); |
596 | 1a6c0886 | j_mayer | if (kernel_size < 0) { |
597 | 5fafdf24 | ths | fprintf(stderr, "qemu: could not load kernel '%s'\n",
|
598 | 1a6c0886 | j_mayer | kernel_filename); |
599 | 1a6c0886 | j_mayer | exit(1);
|
600 | 1a6c0886 | j_mayer | } |
601 | 1a6c0886 | j_mayer | /* load initrd */
|
602 | 1a6c0886 | j_mayer | if (initrd_filename) {
|
603 | 1a6c0886 | j_mayer | initrd_base = INITRD_LOAD_ADDR; |
604 | 5c130f65 | pbrook | initrd_size = load_image_targphys(initrd_filename, initrd_base, |
605 | 5c130f65 | pbrook | ram_size - initrd_base); |
606 | 1a6c0886 | j_mayer | if (initrd_size < 0) { |
607 | 1a6c0886 | j_mayer | fprintf(stderr, |
608 | 5fafdf24 | ths | "qemu: could not load initial ram disk '%s'\n",
|
609 | 1a6c0886 | j_mayer | initrd_filename); |
610 | 1a6c0886 | j_mayer | exit(1);
|
611 | 1a6c0886 | j_mayer | } |
612 | 1a6c0886 | j_mayer | } else {
|
613 | 1a6c0886 | j_mayer | initrd_base = 0;
|
614 | 1a6c0886 | j_mayer | initrd_size = 0;
|
615 | 1a6c0886 | j_mayer | } |
616 | 6ac0e82d | balrog | ppc_boot_device = 'm';
|
617 | 1a6c0886 | j_mayer | } else {
|
618 | 1a6c0886 | j_mayer | kernel_base = 0;
|
619 | 1a6c0886 | j_mayer | kernel_size = 0;
|
620 | 1a6c0886 | j_mayer | initrd_base = 0;
|
621 | 1a6c0886 | j_mayer | initrd_size = 0;
|
622 | 1a6c0886 | j_mayer | } |
623 | 1a6c0886 | j_mayer | #ifdef DEBUG_BOARD_INIT
|
624 | 1a6c0886 | j_mayer | printf("%s: Done\n", __func__);
|
625 | 1a6c0886 | j_mayer | #endif
|
626 | 1a6c0886 | j_mayer | } |
627 | 1a6c0886 | j_mayer | |
628 | 1a6c0886 | j_mayer | QEMUMachine taihu_machine = { |
629 | b2ee0ce2 | pbrook | .name = "taihu",
|
630 | b2ee0ce2 | pbrook | .desc = "taihu",
|
631 | b2ee0ce2 | pbrook | .init = taihu_405ep_init, |
632 | 1a6c0886 | j_mayer | }; |