コード例 #1
0
ファイル: ahci_sunxi.c プロジェクト: Noltari/u-boot
static int sunxi_sata_probe(struct udevice *dev)
{
	ulong base;
	u8 *reg;
	int ret;

	base = dev_read_addr(dev);
	if (base == FDT_ADDR_T_NONE) {
		debug("%s: Failed to find address (err=%d\n)", __func__, ret);
		return -EINVAL;
	}
	reg = (u8 *)base;
	ret = sunxi_ahci_phy_init(reg);
	if (ret) {
		debug("%s: Failed to init phy (err=%d\n)", __func__, ret);
		return ret;
	}
	ret = ahci_probe_scsi(dev, base);
	if (ret) {
		debug("%s: Failed to probe (err=%d\n)", __func__, ret);
		return ret;
	}

	return 0;
}
コード例 #2
0
ファイル: ahci.c プロジェクト: Gateworks/u-boot-cns3xxx
void scsi_init(void)
{
	printf("SUNXI SCSI INIT\n");
#ifdef CONFIG_SATAPWR
	gpio_direction_output(CONFIG_SATAPWR, 1);
#endif

	if (sunxi_ahci_phy_init(SUNXI_SATA_BASE) < 0)
		return;

	ahci_init(SUNXI_SATA_BASE);
}
コード例 #3
0
void scsi_init(void)
{
	printf("SUNXI SCSI INIT\n");
#ifdef CONFIG_SATAPWR
	gpio_request(CONFIG_SATAPWR, "satapwr");
	gpio_direction_output(CONFIG_SATAPWR, 1);
	/* Give attached sata device time to power-up to avoid link timeouts */
	mdelay(500);
#endif

	if (sunxi_ahci_phy_init(SUNXI_SATA_BASE) < 0)
		return;

	ahci_init((void __iomem *)SUNXI_SATA_BASE);
}