Esempio n. 1
0
void spl_sata_load_image(void)
{
	int err;
	block_dev_desc_t *stor_dev;

	err = init_sata(CONFIG_SPL_SATA_BOOT_DEVICE);
	if (err) {
#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
		printf("spl: sata init failed: err - %d\n", err);
#endif
		hang();
	} else {
		/* try to recognize storage devices immediately */
		scsi_scan(0);
		stor_dev = scsi_get_dev(0);
	}

#ifdef CONFIG_SPL_OS_BOOT
	if (spl_start_uboot() || spl_load_image_fat_os(stor_dev,
									CONFIG_SYS_SATA_FAT_BOOT_PARTITION))
#endif
	err = spl_load_image_fat(stor_dev,
				CONFIG_SYS_SATA_FAT_BOOT_PARTITION,
				CONFIG_SPL_FS_LOAD_PAYLOAD_NAME);
	if (err) {
		puts("Error loading sata device\n");
		hang();
	}
}
Esempio n. 2
0
int __sata_initialize(void)
{
	int rc;
	int i;

	for (i = 0; i < CONFIG_SYS_SATA_MAX_DEVICE; i++) {
		memset(&sata_dev_desc[i], 0, sizeof(struct blk_desc));
		sata_dev_desc[i].if_type = IF_TYPE_SATA;
		sata_dev_desc[i].devnum = i;
		sata_dev_desc[i].part_type = PART_TYPE_UNKNOWN;
		sata_dev_desc[i].type = DEV_TYPE_HARDDISK;
		sata_dev_desc[i].lba = 0;
		sata_dev_desc[i].blksz = 512;
		sata_dev_desc[i].log2blksz = LOG2(sata_dev_desc[i].blksz);
#ifndef CONFIG_BLK
		sata_dev_desc[i].block_read = sata_bread;
		sata_dev_desc[i].block_write = sata_bwrite;
#endif
		rc = init_sata(i);
		if (!rc) {
			rc = scan_sata(i);
			if (!rc && sata_dev_desc[i].lba > 0 &&
			    sata_dev_desc[i].blksz > 0)
				part_init(&sata_dev_desc[i]);
		}
	}

	return rc;
}
Esempio n. 3
0
int __sata_initialize(void)
{
	int rc;
	int i;

	for (i = 0; i < CONFIG_SYS_SATA_MAX_DEVICE; i++) {
		memset(&sata_dev_desc[i], 0, sizeof(struct block_dev_desc));
		sata_dev_desc[i].if_type = IF_TYPE_SATA;
		sata_dev_desc[i].dev = i;
		sata_dev_desc[i].part_type = PART_TYPE_UNKNOWN;
		sata_dev_desc[i].type = DEV_TYPE_HARDDISK;
		sata_dev_desc[i].lba = 0;
		sata_dev_desc[i].blksz = 512;
		sata_dev_desc[i].log2blksz = LOG2(sata_dev_desc[i].blksz);
		sata_dev_desc[i].block_read = sata_read;
		sata_dev_desc[i].block_write = sata_write;

		rc = init_sata(i);
		if (!rc) {
			rc = scan_sata(i);
			if (!rc && (sata_dev_desc[i].lba > 0) &&
				(sata_dev_desc[i].blksz > 0))
				init_part(&sata_dev_desc[i]);
		}
	}
	sata_curr_device = 0;
	return rc;
}
Esempio n. 4
0
void scsi_init(void)
{
#if defined(CONFIG_SATA_CEVA)
	init_sata(0);
#endif
	ahci_init((void __iomem *)ZYNQMP_SATA_BASEADDR);
	scsi_scan(1);
}
Esempio n. 5
0
int board_late_init(void)
{
	init_sata(0);
	/*
	 * DEV_CTRL.DEV_ON = 1 please - else palmas switches off in 8 seconds
	 * This is the POWERHOLD-in-Low behavior.
	 */
	palmas_i2c_write_u8(TPS65903X_CHIP_P1, 0xA0, 0x1);
	return 0;
}
Esempio n. 6
0
static int warp_ata_init(int dev, disk_partition_t * info,
                         block_dev_desc_t ** dev_desc)
{
    int ret;
    u32 lun, part;
    block_dev_desc_t *sata_get_dev(int dev);

    lun = WARP_DEV_TO_LUN(dev);
    part = WARP_DEV_TO_PART(dev);

    if (sata_dev_desc[lun].if_type != IF_TYPE_SATA) {
        memset(&sata_dev_desc[lun], 0, sizeof(struct block_dev_desc));
        sata_dev_desc[lun].if_type = IF_TYPE_SATA;
        sata_dev_desc[lun].dev = lun;
        sata_dev_desc[lun].part_type = PART_TYPE_UNKNOWN;
        sata_dev_desc[lun].type = DEV_TYPE_HARDDISK;
        sata_dev_desc[lun].lba = 0;
        sata_dev_desc[lun].blksz = 512;
        sata_dev_desc[lun].block_read = sata_read;
        sata_dev_desc[lun].block_write = sata_write;

        if ((ret = init_sata(lun)))
            return ret;
        if ((ret = scan_sata(lun)))
            return ret;
        if ((sata_dev_desc[lun].lba > 0) && (sata_dev_desc[lun].blksz > 0))
            init_part(&sata_dev_desc[lun]);
    }

    if ((*dev_desc = sata_get_dev(lun)) == NULL) {
        printf("device %d not found\n", lun);
        return -1;
    }

    if (part == 0) {
        info->start = 0;
        return 0;
    }

    if ((ret = get_partition_info(*dev_desc, part, info)) != 0) {
        printf("partition %d:%d not found\n", lun, part);
        return ret;
    }

    return 0;
}
Esempio n. 7
0
void env_relocate_spec(void)
{
	ulong buf[(CONFIG_ENV_SIZE + 511) / 128];
	unsigned int err, rc;

	err = init_sata(CONFIG_ENV_DEVICE);
	if (err) {
		set_default_env("!init_sata error");
		return;
	}

	err = sata_read(CONFIG_ENV_DEVICE, CONFIG_ENV_ADDR, CONFIG_ENV_SIZE, buf);
	if (err) {
		set_default_env("!sata_read error");
		return;
	}

	env_import(buf, 1);
}
Esempio n. 8
0
static int spl_sata_load_image(struct spl_image_info *spl_image,
			       struct spl_boot_device *bootdev)
{
	int err;
	struct blk_desc *stor_dev;

	err = init_sata(CONFIG_SPL_SATA_BOOT_DEVICE);
	if (err) {
#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
		printf("spl: sata init failed: err - %d\n", err);
#endif
		return err;
	} else {
		/* try to recognize storage devices immediately */
		scsi_scan(0);
		stor_dev = blk_get_devnum_by_type(IF_TYPE_SCSI, 0);
		if (!stor_dev)
			return -ENODEV;
	}

#ifdef CONFIG_SPL_OS_BOOT
	if (spl_start_uboot() ||
	    spl_load_image_fat_os(spl_image, stor_dev,
				  CONFIG_SYS_SATA_FAT_BOOT_PARTITION))
#endif
	{
		err = spl_load_image_fat(spl_image, stor_dev,
					CONFIG_SYS_SATA_FAT_BOOT_PARTITION,
				CONFIG_SPL_FS_LOAD_PAYLOAD_NAME);
	}
	if (err) {
		puts("Error loading sata device\n");
		return err;
	}

	return 0;
}
Esempio n. 9
0
/* On OMAP platforms SATA provides the SCSI subsystem */
void scsi_init(void)
{
	init_sata(0);
	scsi_scan(1);
}