Пример #1
0
void arm_kernel_startup(void)
{
    printf("arm_kernel_startup entered \n");
    struct dcb *init_dcb;

    if (hal_cpu_is_bsp()) {
        printf("Doing BSP related bootup \n");

    	/* Initialize the location to allocate phys memory from */
    	bsp_init_alloc_addr = glbl_core_data->start_free_ram;

        // Bring up init
        init_dcb = spawn_bsp_init(BSP_INIT_MODULE_NAME, bsp_alloc_phys);

        // Not available on PandaBoard?        pit_start(0);

    } else {
        printf("Doing non-BSP related bootup \n");

        /* Initialize the allocator with the information passed to us */
        app_alloc_phys_start = glbl_core_data->memory_base_start;
        app_alloc_phys_end   = app_alloc_phys_start
                               + ((lpaddr_t)1 <<glbl_core_data->memory_bits);

        init_dcb = spawn_app_init(glbl_core_data, APP_INIT_MODULE_NAME, app_alloc_phys);

#ifndef __ARM_ARCH_7M__ //armv7-m does not use a gic and can not acknowledge interrupts
    	uint32_t irq = gic_get_active_irq();
    	gic_ack_irq(irq);
#endif
    }

    /* printf("Trying to enable interrupts\n"); */
    /* __asm volatile ("CPSIE aif"); // Enable interrups */
    /* printf("Done enabling interrupts\n"); */

    /* printf("HOLD BOOTUP - SPINNING\n"); */
    /* while (1); */
    /* printf("THIS SHOULD NOT HAPPEN\n"); */

    // enable interrupt forwarding to cpu
    // FIXME: PS: enable this as it is needed for multicore setup.
    // gic_cpu_interface_enable();

    // Should not return
    printf("Calling dispatch from arm_kernel_startup, start address is=%"PRIxLVADDR"\n",
           get_dispatcher_shared_arm(init_dcb->disp)->enabled_save_area.named.r0);
    dispatch(init_dcb);
    panic("Error spawning init!");

}
Пример #2
0
void arm_kernel_startup(void *pointer)
{
    /* Initialize the core_data */
    /* Used when bringing up other cores, must be at consistent global address
     * seen by all cores */

    // Initialize system timers
    timers_init(config_timeslice);

    struct dcb *init_dcb;

    if (cpu_is_bsp()) {
        MSG("Doing BSP related bootup \n");

        /* Initialize the location to allocate phys memory from */
        printf("start_free_ram = 0x%lx\n", armv8_glbl_core_data->start_free_ram);
        bsp_init_alloc_addr = armv8_glbl_core_data->start_free_ram;

        /* allocate initial KCB */
        kcb_current= (struct kcb *)local_phys_to_mem(
                bsp_alloc_phys(sizeof(*kcb_current)));
        assert(kcb_current);
        memset(kcb_current, 0, sizeof(*kcb_current));

        init_dcb = spawn_bsp_init(BSP_INIT_MODULE_NAME);

        platform_gic_init();
//        pit_start(0);
    } else {
        MSG("Doing non-BSP related bootup \n");
        struct armv8_core_data *core_data = (struct armv8_core_data *)pointer;

        my_core_id = core_data->dst_core_id;

        /* Initialize the allocator */


        app_alloc_phys_start = (core_data->memory.base);
        app_alloc_phys_end   = (core_data->memory.length + app_alloc_phys_start);

        MSG("Memory: %lx, %lx, size=%zu kB\n", app_alloc_phys_start, app_alloc_phys_end,
            (app_alloc_phys_end - app_alloc_phys_start + 1) >> 10);

        kcb_current= (struct kcb *)local_phys_to_mem(core_data->kcb);

        init_dcb = spawn_app_init(core_data, APP_INIT_MODULE_NAME);

       // uint32_t irq = gic_get_active_irq();
       // gic_ack_irq(irq);
    }
    // enable interrupt forwarding to cpu
    platform_gic_cpu_interface_enable();

    MSG("Calling dispatch from arm_kernel_startup, entry point %#"PRIxLVADDR"\n",
            get_dispatcher_shared_aarch64(init_dcb->disp)->disabled_save_area.named.pc);

    // Should not return
    dispatch(init_dcb);

    panic("Error spawning init!");

}
Пример #3
0
void arm_kernel_startup(void)
{
    printf("arm_kernel_startup entered \n");

    /* Initialize the core_data */
    /* Used when bringing up other cores, must be at consistent global address
     * seen by all cores */
    struct arm_core_data *core_data
        = (void *)((lvaddr_t)&kernel_first_byte - BASE_PAGE_SIZE);

    struct dcb *init_dcb;

    if(hal_cpu_is_bsp())
    {
        printf("Doing BSP related bootup \n");

        /* Initialize the location to allocate phys memory from */
        bsp_init_alloc_addr = glbl_core_data->start_free_ram;

        // Bring up init
        init_dcb = spawn_bsp_init(BSP_INIT_MODULE_NAME, bsp_alloc_phys);

        // Not available on PandaBoard?        pit_start(0);

    }
    else
    {
        printf("Doing non-BSP related bootup \n");

        my_core_id = core_data->dst_core_id;

        /* Initialize the allocator */
        app_alloc_phys_start = core_data->memory_base_start;
        app_alloc_phys_end   = ((lpaddr_t)1 << core_data->memory_bits) +
                               app_alloc_phys_start;

        init_dcb = spawn_app_init(core_data, APP_INIT_MODULE_NAME, app_alloc_phys);

        uint32_t irq = gic_get_active_irq();
        gic_ack_irq(irq);
    }

    /* printf("Trying to enable interrupts\n"); */
    /* __asm volatile ("CPSIE aif"); // Enable interrups */
    /* printf("Done enabling interrupts\n"); */

    /* printf("HOLD BOOTUP - SPINNING\n"); */
    /* while (1); */
    /* printf("THIS SHOULD NOT HAPPEN\n"); */

    // enable interrupt forwarding to cpu
    // FIXME: PS: enable this as it is needed for multicore setup.
    // gic_cpu_interface_enable();

    // Should not return
    printf("Calling dispatch from arm_kernel_startup, start address is=%"PRIxLVADDR"\n",
           get_dispatcher_shared_arm(init_dcb->disp)->enabled_save_area.named.r0);
    dispatch(init_dcb);
    panic("Error spawning init!");

}