836 |
836 |
{
|
837 |
837 |
}
|
838 |
838 |
|
839 |
|
static void sun4m_hw_init(const struct sun4m_hwdef *hwdef, ram_addr_t RAM_size,
|
840 |
|
const char *boot_device,
|
841 |
|
const char *kernel_filename,
|
842 |
|
const char *kernel_cmdline,
|
843 |
|
const char *initrd_filename, const char *cpu_model)
|
|
839 |
static void sun4m_hw_init(const struct sun4m_hwdef *hwdef,
|
|
840 |
QEMUMachineInitArgs *args)
|
844 |
841 |
{
|
|
842 |
const char *cpu_model = args->cpu_model;
|
845 |
843 |
unsigned int i;
|
846 |
844 |
void *iommu, *espdma, *ledma, *nvram;
|
847 |
845 |
qemu_irq *cpu_irqs[MAX_CPUS], slavio_irq[32], slavio_cpu_irq[MAX_CPUS],
|
... | ... | |
867 |
865 |
|
868 |
866 |
|
869 |
867 |
/* set up devices */
|
870 |
|
ram_init(0, RAM_size, hwdef->max_mem);
|
|
868 |
ram_init(0, args->ram_size, hwdef->max_mem);
|
871 |
869 |
/* models without ECC don't trap when missing ram is accessed */
|
872 |
870 |
if (!hwdef->ecc_base) {
|
873 |
|
empty_slot_init(RAM_size, hwdef->max_mem - RAM_size);
|
|
871 |
empty_slot_init(args->ram_size, hwdef->max_mem - args->ram_size);
|
874 |
872 |
}
|
875 |
873 |
|
876 |
874 |
prom_init(hwdef->slavio_base, bios_name);
|
... | ... | |
993 |
991 |
empty_slot_init(hwdef->bpp_base, 0x20);
|
994 |
992 |
}
|
995 |
993 |
|
996 |
|
kernel_size = sun4m_load_kernel(kernel_filename, initrd_filename,
|
997 |
|
RAM_size);
|
|
994 |
kernel_size = sun4m_load_kernel(args->kernel_filename,
|
|
995 |
args->initrd_filename,
|
|
996 |
args->ram_size);
|
998 |
997 |
|
999 |
|
nvram_init(nvram, (uint8_t *)&nd_table[0].macaddr, kernel_cmdline,
|
1000 |
|
boot_device, RAM_size, kernel_size, graphic_width,
|
|
998 |
nvram_init(nvram, (uint8_t *)&nd_table[0].macaddr, args->kernel_cmdline,
|
|
999 |
args->boot_device, args->ram_size, kernel_size, graphic_width,
|
1001 |
1000 |
graphic_height, graphic_depth, hwdef->nvram_machine_id,
|
1002 |
1001 |
"Sun4m");
|
1003 |
1002 |
|
... | ... | |
1015 |
1014 |
fw_cfg_add_i16(fw_cfg, FW_CFG_SUN4M_HEIGHT, graphic_height);
|
1016 |
1015 |
fw_cfg_add_i32(fw_cfg, FW_CFG_KERNEL_ADDR, KERNEL_LOAD_ADDR);
|
1017 |
1016 |
fw_cfg_add_i32(fw_cfg, FW_CFG_KERNEL_SIZE, kernel_size);
|
1018 |
|
if (kernel_cmdline) {
|
|
1017 |
if (args->kernel_cmdline) {
|
1019 |
1018 |
fw_cfg_add_i32(fw_cfg, FW_CFG_KERNEL_CMDLINE, CMDLINE_ADDR);
|
1020 |
|
pstrcpy_targphys("cmdline", CMDLINE_ADDR, TARGET_PAGE_SIZE, kernel_cmdline);
|
1021 |
|
fw_cfg_add_string(fw_cfg, FW_CFG_CMDLINE_DATA, kernel_cmdline);
|
|
1019 |
pstrcpy_targphys("cmdline", CMDLINE_ADDR, TARGET_PAGE_SIZE,
|
|
1020 |
args->kernel_cmdline);
|
|
1021 |
fw_cfg_add_string(fw_cfg, FW_CFG_CMDLINE_DATA, args->kernel_cmdline);
|
1022 |
1022 |
fw_cfg_add_i32(fw_cfg, FW_CFG_CMDLINE_SIZE,
|
1023 |
|
strlen(kernel_cmdline) + 1);
|
|
1023 |
strlen(args->kernel_cmdline) + 1);
|
1024 |
1024 |
} else {
|
1025 |
1025 |
fw_cfg_add_i32(fw_cfg, FW_CFG_KERNEL_CMDLINE, 0);
|
1026 |
1026 |
fw_cfg_add_i32(fw_cfg, FW_CFG_CMDLINE_SIZE, 0);
|
1027 |
1027 |
}
|
1028 |
1028 |
fw_cfg_add_i32(fw_cfg, FW_CFG_INITRD_ADDR, INITRD_LOAD_ADDR);
|
1029 |
1029 |
fw_cfg_add_i32(fw_cfg, FW_CFG_INITRD_SIZE, 0); // not used
|
1030 |
|
fw_cfg_add_i16(fw_cfg, FW_CFG_BOOT_DEVICE, boot_device[0]);
|
|
1030 |
fw_cfg_add_i16(fw_cfg, FW_CFG_BOOT_DEVICE, args->boot_device[0]);
|
1031 |
1031 |
qemu_register_boot_set(fw_cfg_boot_set, fw_cfg);
|
1032 |
1032 |
}
|
1033 |
1033 |
|
... | ... | |
1291 |
1291 |
/* SPARCstation 5 hardware initialisation */
|
1292 |
1292 |
static void ss5_init(QEMUMachineInitArgs *args)
|
1293 |
1293 |
{
|
1294 |
|
ram_addr_t RAM_size = args->ram_size;
|
1295 |
|
const char *cpu_model = args->cpu_model;
|
1296 |
|
const char *kernel_filename = args->kernel_filename;
|
1297 |
|
const char *kernel_cmdline = args->kernel_cmdline;
|
1298 |
|
const char *initrd_filename = args->initrd_filename;
|
1299 |
|
const char *boot_device = args->boot_device;
|
1300 |
|
sun4m_hw_init(&sun4m_hwdefs[0], RAM_size, boot_device, kernel_filename,
|
1301 |
|
kernel_cmdline, initrd_filename, cpu_model);
|
|
1294 |
sun4m_hw_init(&sun4m_hwdefs[0], args);
|
1302 |
1295 |
}
|
1303 |
1296 |
|
1304 |
1297 |
/* SPARCstation 10 hardware initialisation */
|
1305 |
1298 |
static void ss10_init(QEMUMachineInitArgs *args)
|
1306 |
1299 |
{
|
1307 |
|
ram_addr_t RAM_size = args->ram_size;
|
1308 |
|
const char *cpu_model = args->cpu_model;
|
1309 |
|
const char *kernel_filename = args->kernel_filename;
|
1310 |
|
const char *kernel_cmdline = args->kernel_cmdline;
|
1311 |
|
const char *initrd_filename = args->initrd_filename;
|
1312 |
|
const char *boot_device = args->boot_device;
|
1313 |
|
sun4m_hw_init(&sun4m_hwdefs[1], RAM_size, boot_device, kernel_filename,
|
1314 |
|
kernel_cmdline, initrd_filename, cpu_model);
|
|
1300 |
sun4m_hw_init(&sun4m_hwdefs[1], args);
|
1315 |
1301 |
}
|
1316 |
1302 |
|
1317 |
1303 |
/* SPARCserver 600MP hardware initialisation */
|
1318 |
1304 |
static void ss600mp_init(QEMUMachineInitArgs *args)
|
1319 |
1305 |
{
|
1320 |
|
ram_addr_t RAM_size = args->ram_size;
|
1321 |
|
const char *cpu_model = args->cpu_model;
|
1322 |
|
const char *kernel_filename = args->kernel_filename;
|
1323 |
|
const char *kernel_cmdline = args->kernel_cmdline;
|
1324 |
|
const char *initrd_filename = args->initrd_filename;
|
1325 |
|
const char *boot_device = args->boot_device;
|
1326 |
|
sun4m_hw_init(&sun4m_hwdefs[2], RAM_size, boot_device, kernel_filename,
|
1327 |
|
kernel_cmdline, initrd_filename, cpu_model);
|
|
1306 |
sun4m_hw_init(&sun4m_hwdefs[2], args);
|
1328 |
1307 |
}
|
1329 |
1308 |
|
1330 |
1309 |
/* SPARCstation 20 hardware initialisation */
|
1331 |
1310 |
static void ss20_init(QEMUMachineInitArgs *args)
|
1332 |
1311 |
{
|
1333 |
|
ram_addr_t RAM_size = args->ram_size;
|
1334 |
|
const char *cpu_model = args->cpu_model;
|
1335 |
|
const char *kernel_filename = args->kernel_filename;
|
1336 |
|
const char *kernel_cmdline = args->kernel_cmdline;
|
1337 |
|
const char *initrd_filename = args->initrd_filename;
|
1338 |
|
const char *boot_device = args->boot_device;
|
1339 |
|
sun4m_hw_init(&sun4m_hwdefs[3], RAM_size, boot_device, kernel_filename,
|
1340 |
|
kernel_cmdline, initrd_filename, cpu_model);
|
|
1312 |
sun4m_hw_init(&sun4m_hwdefs[3], args);
|
1341 |
1313 |
}
|
1342 |
1314 |
|
1343 |
1315 |
/* SPARCstation Voyager hardware initialisation */
|
1344 |
1316 |
static void vger_init(QEMUMachineInitArgs *args)
|
1345 |
1317 |
{
|
1346 |
|
ram_addr_t RAM_size = args->ram_size;
|
1347 |
|
const char *cpu_model = args->cpu_model;
|
1348 |
|
const char *kernel_filename = args->kernel_filename;
|
1349 |
|
const char *kernel_cmdline = args->kernel_cmdline;
|
1350 |
|
const char *initrd_filename = args->initrd_filename;
|
1351 |
|
const char *boot_device = args->boot_device;
|
1352 |
|
sun4m_hw_init(&sun4m_hwdefs[4], RAM_size, boot_device, kernel_filename,
|
1353 |
|
kernel_cmdline, initrd_filename, cpu_model);
|
|
1318 |
sun4m_hw_init(&sun4m_hwdefs[4], args);
|
1354 |
1319 |
}
|
1355 |
1320 |
|
1356 |
1321 |
/* SPARCstation LX hardware initialisation */
|
1357 |
1322 |
static void ss_lx_init(QEMUMachineInitArgs *args)
|
1358 |
1323 |
{
|
1359 |
|
ram_addr_t RAM_size = args->ram_size;
|
1360 |
|
const char *cpu_model = args->cpu_model;
|
1361 |
|
const char *kernel_filename = args->kernel_filename;
|
1362 |
|
const char *kernel_cmdline = args->kernel_cmdline;
|
1363 |
|
const char *initrd_filename = args->initrd_filename;
|
1364 |
|
const char *boot_device = args->boot_device;
|
1365 |
|
sun4m_hw_init(&sun4m_hwdefs[5], RAM_size, boot_device, kernel_filename,
|
1366 |
|
kernel_cmdline, initrd_filename, cpu_model);
|
|
1324 |
sun4m_hw_init(&sun4m_hwdefs[5], args);
|
1367 |
1325 |
}
|
1368 |
1326 |
|
1369 |
1327 |
/* SPARCstation 4 hardware initialisation */
|
1370 |
1328 |
static void ss4_init(QEMUMachineInitArgs *args)
|
1371 |
1329 |
{
|
1372 |
|
ram_addr_t RAM_size = args->ram_size;
|
1373 |
|
const char *cpu_model = args->cpu_model;
|
1374 |
|
const char *kernel_filename = args->kernel_filename;
|
1375 |
|
const char *kernel_cmdline = args->kernel_cmdline;
|
1376 |
|
const char *initrd_filename = args->initrd_filename;
|
1377 |
|
const char *boot_device = args->boot_device;
|
1378 |
|
sun4m_hw_init(&sun4m_hwdefs[6], RAM_size, boot_device, kernel_filename,
|
1379 |
|
kernel_cmdline, initrd_filename, cpu_model);
|
|
1330 |
sun4m_hw_init(&sun4m_hwdefs[6], args);
|
1380 |
1331 |
}
|
1381 |
1332 |
|
1382 |
1333 |
/* SPARCClassic hardware initialisation */
|
1383 |
1334 |
static void scls_init(QEMUMachineInitArgs *args)
|
1384 |
1335 |
{
|
1385 |
|
ram_addr_t RAM_size = args->ram_size;
|
1386 |
|
const char *cpu_model = args->cpu_model;
|
1387 |
|
const char *kernel_filename = args->kernel_filename;
|
1388 |
|
const char *kernel_cmdline = args->kernel_cmdline;
|
1389 |
|
const char *initrd_filename = args->initrd_filename;
|
1390 |
|
const char *boot_device = args->boot_device;
|
1391 |
|
sun4m_hw_init(&sun4m_hwdefs[7], RAM_size, boot_device, kernel_filename,
|
1392 |
|
kernel_cmdline, initrd_filename, cpu_model);
|
|
1336 |
sun4m_hw_init(&sun4m_hwdefs[7], args);
|
1393 |
1337 |
}
|
1394 |
1338 |
|
1395 |
1339 |
/* SPARCbook hardware initialisation */
|
1396 |
1340 |
static void sbook_init(QEMUMachineInitArgs *args)
|
1397 |
1341 |
{
|
1398 |
|
ram_addr_t RAM_size = args->ram_size;
|
1399 |
|
const char *cpu_model = args->cpu_model;
|
1400 |
|
const char *kernel_filename = args->kernel_filename;
|
1401 |
|
const char *kernel_cmdline = args->kernel_cmdline;
|
1402 |
|
const char *initrd_filename = args->initrd_filename;
|
1403 |
|
const char *boot_device = args->boot_device;
|
1404 |
|
sun4m_hw_init(&sun4m_hwdefs[8], RAM_size, boot_device, kernel_filename,
|
1405 |
|
kernel_cmdline, initrd_filename, cpu_model);
|
|
1342 |
sun4m_hw_init(&sun4m_hwdefs[8], args);
|
1406 |
1343 |
}
|
1407 |
1344 |
|
1408 |
1345 |
static QEMUMachine ss5_machine = {
|