Changeset a73ebf0 in mainline for boot/arch/sparc32/src/main.c


Ignore:
Timestamp:
2013-10-15T16:34:04Z (11 years ago)
Author:
Jakub Klama <jakub.klama@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4d2dba7
Parents:
1f12fab
Message:

Pass AMBA P&P devices and memory size info from loader to kernel
using bootinfo_t structure.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • boot/arch/sparc32/src/main.c

    r1f12fab ra73ebf0  
    6262        amba_device_t *uart = ambapp_lookup_first(GAISLER, GAISLER_APBUART);
    6363        amba_uart_base = uart->bars[0].start;
     64        bootinfo.uart_base = amba_uart_base;
     65        bootinfo.uart_irq = uart->irq;
    6466
     67        /* Look up for IRQMP */
     68        amba_device_t *irqmp = ambapp_lookup_first(GAISLER, GAISLER_IRQMP);
     69        bootinfo.intc_base = irqmp->bars[0].start;
     70
     71        /* Look up for timer */
     72        amba_device_t *timer = ambapp_lookup_first(GAISLER, GAISLER_GPTIMER);
     73        bootinfo.timer_base = timer->bars[0].start;
     74        bootinfo.timer_irq = timer->irq;
     75       
     76        /* Lookp up for memory controller and obtain memory size */
     77        if (ambapp_fake()) {
     78                bootinfo.memsize = 64 * 1024 * 1024; // 64MB
     79        } else {
     80                amba_device_t *mctrl = ambapp_lookup_first(ESA, ESA_MCTRL);
     81                volatile mctrl_mcfg2_t *mcfg2 = (volatile mctrl_mcfg2_t *)(mctrl->bars[0].start + 0x4);
     82                bootinfo.memsize = (1 << (13 + mcfg2->bank_size));
     83        }
     84       
    6585        /* Standard output is now initialized */
    6686        version_print();
     
    7393
    7494        ambapp_print_devices();
     95
     96        printf("Memory size: %dMB\n", bootinfo.memsize >> 20);
    7597
    7698        mmu_init();
Note: See TracChangeset for help on using the changeset viewer.