Revision 5dcb6b91 hw/sun4m.c

b/hw/sun4m.c
48 48
#define MAX_CPUS 16
49 49

  
50 50
struct hwdef {
51
    target_ulong iommu_base, slavio_base;
52
    target_ulong intctl_base, counter_base, nvram_base, ms_kb_base, serial_base;
53
    target_ulong fd_base;
54
    target_ulong dma_base, esp_base, le_base;
55
    target_ulong tcx_base, cs_base;
51
    target_phys_addr_t iommu_base, slavio_base;
52
    target_phys_addr_t intctl_base, counter_base, nvram_base, ms_kb_base;
53
    target_phys_addr_t serial_base, fd_base;
54
    target_phys_addr_t dma_base, esp_base, le_base;
55
    target_phys_addr_t tcx_base, cs_base, power_base;
56 56
    long vram_size, nvram_size;
57 57
    // IRQ numbers are not PIL ones, but master interrupt controller register
58 58
    // bit numbers
......
289 289

  
290 290
    iommu = iommu_init(hwdef->iommu_base);
291 291
    slavio_intctl = slavio_intctl_init(hwdef->intctl_base,
292
                                       hwdef->intctl_base + 0x10000,
292
                                       hwdef->intctl_base + 0x10000ULL,
293 293
                                       &hwdef->intbit_to_level[0],
294 294
                                       &slavio_irq);
295 295
    for(i = 0; i < smp_cpus; i++) {
......
317 317
    nvram = m48t59_init(slavio_irq[0], hwdef->nvram_base, 0,
318 318
                        hwdef->nvram_size, 8);
319 319
    for (i = 0; i < MAX_CPUS; i++) {
320
        slavio_timer_init(hwdef->counter_base + i * TARGET_PAGE_SIZE,
320
        slavio_timer_init(hwdef->counter_base +
321
                          (target_phys_addr_t)(i * TARGET_PAGE_SIZE),
321 322
                          hwdef->clock_irq, 0, i, slavio_intctl);
322 323
    }
323
    slavio_timer_init(hwdef->counter_base + 0x10000, hwdef->clock1_irq, 2,
324
    slavio_timer_init(hwdef->counter_base + 0x10000ULL, hwdef->clock1_irq, 2,
324 325
                      (unsigned int)-1, slavio_intctl);
325 326
    slavio_serial_ms_kbd_init(hwdef->ms_kb_base, slavio_irq[hwdef->ms_kb_irq]);
326 327
    // Slavio TTYA (base+4, Linux ttyS0) is the first Qemu serial device
......
336 337
        }
337 338
    }
338 339

  
339
    slavio_misc = slavio_misc_init(hwdef->slavio_base, 
340
    slavio_misc = slavio_misc_init(hwdef->slavio_base, hwdef->power_base,
340 341
                                   slavio_irq[hwdef->me_irq]);
341
    if (hwdef->cs_base != (target_ulong)-1)
342
    if (hwdef->cs_base != (target_phys_addr_t)-1)
342 343
        cs_init(hwdef->cs_base, hwdef->cs_irq, slavio_intctl);
343 344
    sparc32_dma_set_reset_data(dma, main_esp, main_lance);
344 345
}
......
424 425
        .dma_base     = 0x78400000,
425 426
        .esp_base     = 0x78800000,
426 427
        .le_base      = 0x78c00000,
428
        .power_base   = 0x7a000000,
427 429
        .vram_size    = 0x00100000,
428 430
        .nvram_size   = 0x2000,
429 431
        .esp_irq = 18,
......
443 445
    },
444 446
    /* SS-10 */
445 447
    {
446
        .iommu_base   = 0xe0000000, // XXX Actually at 0xfe0000000ULL (36 bits)
447
        .tcx_base     = 0x20000000, // 0xe20000000ULL,
448
        .iommu_base   = 0xfe0000000ULL,
449
        .tcx_base     = 0xe20000000ULL,
448 450
        .cs_base      = -1,
449
        .slavio_base  = 0xf0000000, // 0xff0000000ULL,
450
        .ms_kb_base   = 0xf1000000, // 0xff1000000ULL,
451
        .serial_base  = 0xf1100000, // 0xff1100000ULL,
452
        .nvram_base   = 0xf1200000, // 0xff1200000ULL,
453
        .fd_base      = 0xf1700000, // 0xff1700000ULL,
454
        .counter_base = 0xf1300000, // 0xff1300000ULL,
455
        .intctl_base  = 0xf1400000, // 0xff1400000ULL,
456
        .dma_base     = 0xf0400000, // 0xef0400000ULL,
457
        .esp_base     = 0xf0800000, // 0xef0800000ULL,
458
        .le_base      = 0xf0c00000, // 0xef0c00000ULL,
451
        .slavio_base  = 0xff0000000ULL,
452
        .ms_kb_base   = 0xff1000000ULL,
453
        .serial_base  = 0xff1100000ULL,
454
        .nvram_base   = 0xff1200000ULL,
455
        .fd_base      = 0xff1700000ULL,
456
        .counter_base = 0xff1300000ULL,
457
        .intctl_base  = 0xff1400000ULL,
458
        .dma_base     = 0xef0400000ULL,
459
        .esp_base     = 0xef0800000ULL,
460
        .le_base      = 0xef0c00000ULL,
461
        .power_base   = 0xefa000000ULL,
459 462
        .vram_size    = 0x00100000,
460 463
        .nvram_size   = 0x2000,
461 464
        .esp_irq = 18,
......
480 483
                              const char *initrd_filename, const char *cpu_model,
481 484
                              unsigned int machine, int max_ram)
482 485
{
483
    if (ram_size > max_ram) {
486
    if ((unsigned int)ram_size > (unsigned int)max_ram) {
484 487
        fprintf(stderr, "qemu: Too much memory for this machine: %d, maximum %d\n",
485
                ram_size / (1024 * 1024), max_ram / (1024 * 1024));
488
                (unsigned int)ram_size / (1024 * 1024),
489
                (unsigned int)max_ram / (1024 * 1024));
486 490
        exit(1);
487 491
    }
488 492
    sun4m_hw_init(&hwdefs[machine], ram_size, ds, cpu_model);
......
515 519
        cpu_model = "TI SuperSparc II";
516 520
    sun4m_common_init(ram_size, boot_device, ds, kernel_filename,
517 521
                      kernel_cmdline, initrd_filename, cpu_model,
518
                      1, 0x20000000); // XXX tcx overlap, actually first 4GB ok
522
                      1, PROM_ADDR); // XXX prom overlap, actually first 4GB ok
519 523
}
520 524

  
521 525
QEMUMachine ss5_machine = {

Also available in: Unified diff