Exemplo n.º 1
0
int mmc_init(int verbose)
{
	unsigned char ret;

	ret = configure_mmc(&cur_card_data);

	if (ret == 1) {
		mmc_blk_dev.if_type = IF_TYPE_MMC;
		mmc_blk_dev.part_type = PART_TYPE_DOS;
		mmc_blk_dev.dev = 0;
		mmc_blk_dev.lun = 0;
		mmc_blk_dev.type = 0;

		/* FIXME fill in the correct size (is set to 32MByte) */
		mmc_blk_dev.blksz = MMCSD_SECTOR_SIZE;
		mmc_blk_dev.lba = 0x10000;
		mmc_blk_dev.removable = 0;
		mmc_blk_dev.block_read = mmc_bread;

		fat_register_device(&mmc_blk_dev, 1);
		return 1;
	}
	else 
		return 0;
}
Exemplo n.º 2
0
Arquivo: mmc.c Projeto: UAVXP/A10
int mmc_init(int slot)
{
	int result = -1;

	switch (slot) {
	case 0:
		configure_controller(&cur_controller_data[slot], slot);
		configure_mmc(&cur_card_data[slot], &cur_controller_data[slot]);
		mmc_blk_dev[slot].if_type = IF_TYPE_MMC;
		mmc_blk_dev[slot].part_type = PART_TYPE_DOS;
		mmc_blk_dev[slot].dev = cur_controller_data[slot].slot;
		mmc_blk_dev[slot].lun = 0;
		mmc_blk_dev[slot].type = 0;

		/* FIXME fill in the correct size (is set to 32MByte) */
		mmc_blk_dev[slot].blksz = MMCSD_SECTOR_SIZE;
		mmc_blk_dev[slot].lba = 0x10000;
		mmc_blk_dev[slot].removable = 0;
		mmc_blk_dev[slot].block_read = mmc_bread;
		result = fat_register_device(&mmc_blk_dev[slot], 1);
		break;
	case 1:
		configure_controller(&cur_controller_data[slot], slot);
		configure_mmc(&cur_card_data[slot], &cur_controller_data[slot]);
		mmc_blk_dev[slot].if_type = IF_TYPE_MMC;
		mmc_blk_dev[slot].part_type = PART_TYPE_DOS;
		mmc_blk_dev[slot].dev = cur_controller_data[slot].slot;
		mmc_blk_dev[slot].lun = 0;
		mmc_blk_dev[slot].type = 0;

		/* FIXME fill in the correct size (is set to 32MByte) */
		mmc_blk_dev[slot].blksz = MMCSD_SECTOR_SIZE;
		mmc_blk_dev[slot].lba = 0x10000;
		mmc_blk_dev[slot].removable = 0;
		mmc_blk_dev[slot].block_read = mmc_bread;
		fat_register_device(&mmc_blk_dev[slot], 1);
		result = 0;
		break;
	default:
		printf("mmc_init:mmc slot is not supported%d\n", slot);
	}
	return result;
}
Exemplo n.º 3
0
int mmc_init(int slot)
{
	configure_controller(&cur_controller_data, slot);
	configure_mmc(&cur_card_data, &cur_controller_data);

#ifdef CFG_CMD_FAT
	mmc_blk_dev.if_type = IF_TYPE_MMC;
	mmc_blk_dev.part_type = PART_TYPE_DOS;
	mmc_blk_dev.dev = slot;
	mmc_blk_dev.lun = 0;
	mmc_blk_dev.type = 0;

	/* FIXME fill in the correct size (is set to 32MByte) */
	mmc_blk_dev.blksz = MMCSD_SECTOR_SIZE;
	mmc_blk_dev.lba = 0x10000;
	mmc_blk_dev.removable = 0;
	mmc_blk_dev.block_read = mmc_bread;

	fat_register_device(&mmc_blk_dev, 1);
#endif
	return 0;
}
Exemplo n.º 4
0
int mmc_legacy_init(int dev)
{
	if (mmc_set_dev(dev) != 0)
		return 1;

	if (configure_mmc(&cur_card_data) != 1)
		return 1;

	mmc_blk_dev.if_type = IF_TYPE_MMC;
	mmc_blk_dev.part_type = PART_TYPE_DOS;
	mmc_blk_dev.dev = 0;
	mmc_blk_dev.lun = 0;
	mmc_blk_dev.type = 0;

	/* FIXME fill in the correct size (is set to 32MByte) */
	mmc_blk_dev.blksz = MMCSD_SECTOR_SIZE;
	mmc_blk_dev.lba = 0x10000;
	mmc_blk_dev.removable = 0;
	mmc_blk_dev.block_read = mmc_bread;

	fat_register_device(&mmc_blk_dev, 1);
	return 0;
}