Exemple #1
0
rtems_status_code mpc55xx_sd_card_init( bool mount)
{
    rtems_status_code sc = RTEMS_SUCCESSFUL;
    int rv = 0;
    sd_card_driver_entry *e = &sd_card_driver_table [0];

    RTEMS_DEBUG_PRINT( "Task started\n");

    sc = mpc55xx_dspi_init();
    RTEMS_CHECK_SC( rv, "Intitalize DSPI bus");

    e->bus = mpc55xx_dspi_bus_table [0].bus_number;

    sc = sd_card_register();
    RTEMS_CHECK_SC( sc, "Register SD Card");

    if (mount) {
        sc = rtems_bdpart_register_from_disk( MPC55XX_DEVICE_FILE);
        RTEMS_CHECK_SC( sc, "Initialize IDE partition table");

        rv = rtems_fsmount( mpc55xx_fs_table, sizeof( mpc55xx_fs_table) / sizeof( mpc55xx_fs_table [0]), NULL);
        RTEMS_CHECK_RV_SC( rv, "Mount file systems");
    }

    return RTEMS_SUCCESSFUL;
}
void bsp_predriver_hook()
{
	rtems_status_code sc = RTEMS_SUCCESSFUL;

	RTEMS_DEBUG_PRINT( "Initialize eDMA ...\n");
	sc = mpc55xx_edma_init();
	if (sc != RTEMS_SUCCESSFUL) {
		BSP_panic( "Cannot initialize eDMA");
	} else {
		DEBUG_DONE();
	}
}