int board_init (void) { if (machine_is_omap_h2()) gd->bd->bi_arch_number = MACH_TYPE_OMAP_H2; else if (machine_is_omap_innovator()) gd->bd->bi_arch_number = MACH_TYPE_OMAP_INNOVATOR; else gd->bd->bi_arch_number = MACH_TYPE_OMAP_GENERIC; /* adress of boot parameters */ gd->bd->bi_boot_params = 0x10000100; /* Configure MUX settings */ set_muxconf_regs (); peripheral_power_enable (); /* this speeds up your boot a quite a bit. However to make it * work, you need make sure your kernel startup flush bug is fixed. * ... rkw ... */ icache_enable (); flash__init (); ether__init (); return 0; }
void s_init(void) { /* Configure MUX settings */ set_muxconf_regs (); peripheral_power_enable (); /* this speeds up your boot a quite a bit. However to make it * work, you need make sure your kernel startup flush bug is fixed. * ... rkw ... */ icache_enable (); }
int board_init (void) { /* arch number of OMAP 730 P2 Board - Same as the Innovator! */ gd->bd->bi_arch_number = MACH_TYPE_OMAP_PERSEUS2; /* adress of boot parameters */ gd->bd->bi_boot_params = 0x10000100; /* Configure MUX settings */ set_muxconf_regs (); peripheral_power_enable (); /* Backup LED indication via GPIO_140 -> Red led if MUX correctly setup */ toggle_backup_led(); /* Hold GSM in reset until needed */ *((volatile unsigned short *)M_CTL) &= ~1; /* * CSx timings, GPIO Mux ... setup */ /* Flash: CS0 timings setup */ *((volatile unsigned int *) FLASH_CFG_0) = 0x0000fff3; *((volatile unsigned int *) FLASH_ACFG_0_1) = 0x00000088; /* Ethernet support trough the debug board */ /* CS1 timings setup */ *((volatile unsigned int *) FLASH_CFG_1) = 0x0000fff3; *((volatile unsigned int *) FLASH_ACFG_0_1) = 0x00000000; /* this speeds up your boot a quite a bit. However to make it * work, you need make sure your kernel startup flush bug is fixed. * ... rkw ... */ icache_enable (); flash__init (); ether__init (); return 0; }
static void main_loop() { daemon_task = chThdGetSelfX(); /* switch to high priority for main loop */ chThdSetPriority(APM_MAIN_PRIORITY); #ifdef HAL_I2C_CLEAR_BUS // Clear all I2C Buses. This can be needed on some boards which // can get a stuck I2C peripheral on boot ChibiOS::I2CBus::clear_all(); #endif #if STM32_DMA_ADVANCED ChibiOS::Shared_DMA::init(); #endif peripheral_power_enable(); hal.uartA->begin(115200); #ifdef HAL_SPI_CHECK_CLOCK_FREQ // optional test of SPI clock frequencies ChibiOS::SPIDevice::test_clock_freq(); #endif hal.uartB->begin(38400); hal.uartC->begin(57600); hal.analogin->init(); hal.scheduler->init(); /* run setup() at low priority to ensure CLI doesn't hang the system, and to allow initial sensor read loops to run */ hal_chibios_set_priority(APM_STARTUP_PRIORITY); schedulerInstance.hal_initialized(); g_callbacks->setup(); hal.scheduler->system_initialized(); thread_running = true; chRegSetThreadName(SKETCHNAME); /* switch to high priority for main loop */ chThdSetPriority(APM_MAIN_PRIORITY); while (true) { g_callbacks->loop(); /* give up 50 microseconds of time if the INS loop hasn't called delay_microseconds_boost(), to ensure low priority drivers get a chance to run. Calling delay_microseconds_boost() means we have already given up time from the main loop, so we don't need to do it again here */ #ifndef HAL_DISABLE_LOOP_DELAY if (!schedulerInstance.check_called_boost()) { hal.scheduler->delay_microseconds(50); } #endif } thread_running = false; }