* __ATTR(cdirq_cnt, S_IRUGO, get_cdirq_cnt, NULL);
*/
+int add_fake_boot_partition(struct gendisk *disk, char *name, int idx)
+{
+ u64 boot_size = (u64)get_capacity(disk) - 1;
+ char fake_name[80];
+ int offset = 1;
+ struct hd_struct *ret = NULL;
+ struct disk_part_iter piter;
+ struct hd_struct *part;
+
+ sprintf(fake_name, name, idx);
+ ret = add_emmc_each_part(disk, 1 + idx,
+ offset, boot_size, 0, fake_name);
+ if (IS_ERR(ret))
+ pr_info("%s added failed\n", fake_name);
+
+ disk_part_iter_init(&piter, disk, 0);
+ while ((part = disk_part_iter_next(&piter))) {
+ dev_set_uevent_suppress(part_to_dev(part), 0);
+ kobject_uevent(&part_to_dev(part)->kobj, KOBJ_ADD);
+ }
+ disk_part_iter_exit(&piter);
+
+ return 0;
+}
+
int aml_emmc_partition_ops(struct mmc_card *card, struct gendisk *disk)
{
int ret = 0;
{
struct mmc_blk_data *md, *part_md;
char cap_str[10];
+#ifdef CONFIG_AMLOGIC_MMC
+ int idx = 0;
+#endif
/*
* Check that the card supports the command class(es) we need.
list_for_each_entry(part_md, &md->part, part) {
if (mmc_add_disk(part_md))
goto out;
+#ifdef CONFIG_AMLOGIC_MMC
+ if (part_md->area_type == MMC_BLK_DATA_AREA_BOOT)
+ add_fake_boot_partition(part_md->disk,
+ "bootloader%d", idx++);
+#endif
}
pm_runtime_set_autosuspend_delay(&card->dev, 3000);
};
/*#ifdef CONFIG_MMC_AML*/
int aml_emmc_partition_ops(struct mmc_card *card, struct gendisk *disk);
+int add_fake_boot_partition(struct gendisk *disk, char *name, int idx);
/*
*#else
*static inline int aml_emmc_partition_ops(struct mmc_card *card,