/*-------------------------------------------------------------------------+ | Function: bsp_start | Description: Called before main is invoked. | Global Variables: None. | Arguments: None. | Returns: Nothing. +--------------------------------------------------------------------------*/ void bsp_start_default( void ) { int pci_init_retval; /* * We need to determine how much memory there is in the system. */ bsp_size_memory(); /* * Calibrate variable for 1ms-loop (see timer.c) */ Calibrate_loop_1ms(); /* * Init rtems interrupt management */ rtems_irq_mngt_init(); /* * Init rtems exceptions management */ rtems_exception_init_mngt(); /* * init PCI Bios interface... */ pci_init_retval = pci_initialize(); if (pci_init_retval != PCIB_ERR_SUCCESS) { printk("PCI bus: could not initialize PCI BIOS interface\n"); } bsp_ide_cmdline_init (); } /* bsp_start */
/* * bsp_start_default - BSP initialization function * * This function is called before RTEMS is initialized and used * adjust the kernel's configuration. * * This function also configures the CPU's memory protection unit. * * RESTRICTIONS/LIMITATIONS: * Since RTEMS is not configured, no RTEMS functions can be called. */ static void bsp_start_default( void ) { PINSEL2 =0x0f814914; BCFG0 = 0x1000ffef; BCFG1 = 0x1000ffef; MEMMAP = 0x2; //debug and excute outside chip PLLCON = 1; #if (Fpclk / (Fcclk / 4)) == 1 VPBDIV = 0; #endif #if (Fpclk / (Fcclk / 4)) == 2 VPBDIV = 2; #endif #if (Fpclk / (Fcclk / 4)) == 4 VPBDIV = 1; #endif #if (Fcco / Fcclk) == 2 PLLCFG = ((Fcclk / Fosc) - 1) | (0 << 5); #endif #if (Fcco / Fcclk) == 4 PLLCFG = ((Fcclk / Fosc) - 1) | (1 << 5); #endif #if (Fcco / Fcclk) == 8 PLLCFG = ((Fcclk / Fosc) - 1) | (2 << 5); #endif #if (Fcco / Fcclk) == 16 PLLCFG = ((Fcclk / Fosc) - 1) | (3 << 5); #endif PLLFEED = 0xaa; PLLFEED = 0x55; while((PLLSTAT & (1 << 10)) == 0); PLLCON = 3; PLLFEED = 0xaa; PLLFEED = 0x55; /* memory configure */ /* it is not needed in my formatter board */ //MAMCR = 0; // MAMTIM = 3; //MAMCR = 2; UART0_Ini(); /* * Init rtems exceptions management */ /* FIXME: Use shared start.S */ rtems_exception_init_mngt(); /* * Init rtems interrupt management */ bsp_interrupt_initialize(); } /* bsp_start */
/* * * NAME: bsp_start_default - BSP initialization function * * DESCRIPTION: * This function is called before RTEMS is initialized and used * adjust the kernel's configuration. * * This function also configures the CPU's memory protection unit. * * RESTRICTIONS/LIMITATIONS: * Since RTEMS is not configured, no RTEMS functions can be called. * */ void bsp_start_default( void ) { /* disable interrupts */ XSCALE_INT_ICMR = 0x0; rtems_exception_init_mngt(); if (bsp_interrupt_initialize() != RTEMS_SUCCESSFUL) { _CPU_Fatal_halt(0xe); } } /* bsp_start */
/* * NAME: bsp_start_default - BSP initialization function * * This function is called before RTEMS is initialized * This function also configures the CPU's memory protection unit. * * * RESTRICTIONS/LIMITATIONS: * Since RTEMS is not configured, no RTEMS functions can be called. * */ void bsp_start_default( void ) { /* disable interrupts */ *EP7312_INTMR1 = 0; *EP7312_INTMR2 = 0; /* * Init rtems exceptions management */ rtems_exception_init_mngt(); /* * Init rtems interrupt management */ bsp_interrupt_initialize(); } /* bsp_start */
void bsp_start_default( void ) { /* disable interrupts */ *EP7312_INTMR1 = 0; *EP7312_INTMR2 = 0; Cpu_table.pretasking_hook = bsp_pretasking_hook; Cpu_table.postdriver_hook = bsp_postdriver_hook; /* Place RTEMS workspace at beginning of free memory. */ BSP_Configuration.work_space_start = (void *)&_bss_free_start; free_mem_start = ((uint32_t)&_bss_free_start + BSP_Configuration.work_space_size); free_mem_end = ((uint32_t)&_sdram_base + (uint32_t)&_sdram_size); /* * Init rtems exceptions management */ rtems_exception_init_mngt(); /* * Init rtems interrupt management */ rtems_irq_mngt_init(); /* * The following information is very useful when debugging. */ #if 0 printk( "work_space_size = 0x%x\n", BSP_Configuration.work_space_size ); printk( "maximum_extensions = 0x%x\n", BSP_Configuration.maximum_extensions ); printk( "microseconds_per_tick = 0x%x\n", BSP_Configuration.microseconds_per_tick ); printk( "ticks_per_timeslice = 0x%x\n", BSP_Configuration.ticks_per_timeslice ); printk( "number_of_device_drivers = 0x%x\n", BSP_Configuration.number_of_device_drivers ); printk( "Device_driver_table = 0x%x\n", BSP_Configuration.Device_driver_table ); /* printk( "_stack_size = 0x%x\n", _stack_size );*/ printk( "work_space_start = 0x%x\n", BSP_Configuration.work_space_start ); printk( "work_space_size = 0x%x\n", BSP_Configuration.work_space_size ); #endif } /* bsp_start */
/*-------------------------------------------------------------------------+ | Function: bsp_start | Description: Called before main is invoked. | Global Variables: None. | Arguments: None. | Returns: Nothing. +--------------------------------------------------------------------------*/ void bsp_start_default( void ) { mmu_sect_map_t mem_map[] = { {0x00000000, 0x0c000000, 1, MMU_CACHE_NONE}, /* Mirror of SDRAM for the vector handler*/ {0x0c000000, 0x0c000000, 8, MMU_CACHE_WTHROUGH}, /* SDRAM */ {0x14000000, 0x14000000, 1, MMU_CACHE_NONE}, /* Internals Regs - */ {0x15000000, 0x15000000, 1, MMU_CACHE_NONE}, /* Specials Internal Regs - */ }; /* If we don't have command line arguments set default program name. */ Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */ Cpu_table.predriver_hook = NULL; /* use system's */ Cpu_table.postdriver_hook = bsp_postdriver_hook; Cpu_table.idle_task = NULL; /* do not override system IDLE task */ Cpu_table.do_zero_of_workspace = TRUE; Cpu_table.interrupt_stack_size = 4096; Cpu_table.extra_mpci_receive_server_stack = 0; /*disable interrupts */ rINTMSK=0xffffffff;//unmasked by dirvers /* Place RTEMS workspace at beginning of free memory. */ BSP_Configuration.work_space_start = (void *)&_bss_free_start; free_mem_start = ((unsigned32)&_bss_free_start + BSP_Configuration.work_space_size); free_mem_end = ((unsigned32)&_sdram_base + (unsigned32)&_sdram_size); /*enable the MMU*/ mmu_init(mem_map, (sizeof(mem_map) / sizeof(mmu_sect_map_t))); /* * Init rtems exceptions management */ rtems_exception_init_mngt(); /* * Init rtems interrupt management */ rtems_irq_mngt_init(); /* * The following information is very useful when debugging. */ #if 0 printk( "work_space_size = 0x%x\n", BSP_Configuration.work_space_size ); printk( "maximum_extensions = 0x%x\n", BSP_Configuration.maximum_extensions ); printk( "microseconds_per_tick = 0x%x\n", BSP_Configuration.microseconds_per_tick ); printk( "ticks_per_timeslice = 0x%x\n", BSP_Configuration.ticks_per_timeslice ); printk( "maximum_devices = 0x%x\n", BSP_Configuration.maximum_devices ); printk( "number_of_device_drivers = 0x%x\n", BSP_Configuration.number_of_device_drivers ); printk( "Device_driver_table = 0x%x\n", BSP_Configuration.Device_driver_table ); printk( "_heap_size = 0x%x\n", _heap_size ); /* printk( "_stack_size = 0x%x\n", _stack_size );*/ printk( "rtemsFreeMemStart = 0x%x\n", rtemsFreeMemStart ); printk( "work_space_start = 0x%x\n", BSP_Configuration.work_space_start ); printk( "work_space_size = 0x%x\n", BSP_Configuration.work_space_size ); #endif } /* bsp_start */