X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=drivers%2Fblock%2Fsata_sil3114.c;h=3aa6fc9839e95eda30f372bfe2cceac60c1ad6a9;hb=87acf194a298f65a40c659036a5e413613d458e6;hp=d43064e0f166b3aa9463b53bcedd629b2514a938;hpb=fa82f871c8dbc9a15e8dc274b3f99dd5fa0da458;p=karo-tx-uboot.git diff --git a/drivers/block/sata_sil3114.c b/drivers/block/sata_sil3114.c index d43064e0f1..3aa6fc9839 100644 --- a/drivers/block/sata_sil3114.c +++ b/drivers/block/sata_sil3114.c @@ -2,20 +2,7 @@ * Copyright (C) Excito Elektronik i Skåne AB, All rights reserved. * Author: Tor Krill * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA + * SPDX-License-Identifier: GPL-2.0+ * * This is a driver for Silicon Image sil3114 sata chip modelled on * the ata_piix driver @@ -28,6 +15,7 @@ #include #include #include +#include #include #include "sata_sil3114.h" @@ -48,7 +36,6 @@ static u8 sata_chk_status (struct sata_ioports *ioaddr, u8 usealtstatus); static void msleep (int count); static u32 iobase[6] = { 0, 0, 0, 0, 0, 0}; /* PCI BAR registers for device */ -extern block_dev_desc_t sata_dev_desc[CONFIG_SYS_SATA_MAX_DEVICE]; static struct sata_port port[CONFIG_SYS_SATA_MAX_DEVICE]; @@ -171,7 +158,7 @@ static void sata_identify (int num, int dev) sata_dev_desc[devno].removable = 0; sata_dev_desc[devno].lba = (u32) n_sectors; - debug ("lba=0x%x\n", sata_dev_desc[devno].lba); + debug("lba=0x%lx\n", sata_dev_desc[devno].lba); #ifdef CONFIG_LBA48 if (iobuf[83] & (1 << 10)) { @@ -782,6 +769,7 @@ int scan_sata (int dev) (iobase[5] + VND_TF2_CH0) | ATA_PCI_CTL_OFS; port[0].ioaddr.bmdma_addr = iobase[5] + VND_BMDMA_CH0; break; +#if (CONFIG_SYS_SATA_MAX_DEVICE >= 1) case 1: port[1].port_no = 0; port[1].ioaddr.cmd_addr = iobase[5] + VND_TF0_CH1; @@ -789,6 +777,7 @@ int scan_sata (int dev) (iobase[5] + VND_TF2_CH1) | ATA_PCI_CTL_OFS; port[1].ioaddr.bmdma_addr = iobase[5] + VND_BMDMA_CH1; break; +#elif (CONFIG_SYS_SATA_MAX_DEVICE >= 2) case 2: port[2].port_no = 0; port[2].ioaddr.cmd_addr = iobase[5] + VND_TF0_CH2; @@ -796,6 +785,7 @@ int scan_sata (int dev) (iobase[5] + VND_TF2_CH2) | ATA_PCI_CTL_OFS; port[2].ioaddr.bmdma_addr = iobase[5] + VND_BMDMA_CH2; break; +#elif (CONFIG_SYS_SATA_MAX_DEVICE >= 3) case 3: port[3].port_no = 0; port[3].ioaddr.cmd_addr = iobase[5] + VND_TF0_CH3; @@ -803,6 +793,7 @@ int scan_sata (int dev) (iobase[5] + VND_TF2_CH3) | ATA_PCI_CTL_OFS; port[3].ioaddr.bmdma_addr = iobase[5] + VND_BMDMA_CH3; break; +#endif default: printf ("Tried to scan unknown port: ata%d\n", dev); return 1;