From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Mon, 4 Aug 2014 15:10:48 +0200 Subject: [U-Boot] [PATCH 06/18] sata: dwc_ahsata: implement sata_port_status In-Reply-To: <53DF8169.9000507@compulab.co.il> References: <1407051288-17324-1-git-send-email-nikita@compulab.co.il> <201408031549.02532.marex@denx.de> <53DF8169.9000507@compulab.co.il> Message-ID: <201408041510.48925.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Monday, August 04, 2014 at 02:49:45 PM, Nikita Kiryanov wrote: > On 03/08/14 16:49, Marek Vasut wrote: > > On Sunday, August 03, 2014 at 09:34:36 AM, Nikita Kiryanov wrote: > >> Define the new common function sata_port_status() which can be > >> used to query the sata driver for the state of ports, and implement it > >> for dwc_ahsata. > >> > >> Cc: Stefano Babic > >> Cc: Tom Rini > >> Signed-off-by: Nikita Kiryanov > >> --- > >> > >> drivers/block/dwc_ahsata.c | 17 +++++++++++++++++ > >> include/sata.h | 1 + > >> 2 files changed, 18 insertions(+) > >> > >> diff --git a/drivers/block/dwc_ahsata.c b/drivers/block/dwc_ahsata.c > >> index 15d65d7..e122ed9 100644 > >> --- a/drivers/block/dwc_ahsata.c > >> +++ b/drivers/block/dwc_ahsata.c > >> @@ -864,6 +864,23 @@ u32 ata_low_level_rw_lba28(int dev, u32 blknr, > >> lbaint_t blkcnt, return blkcnt; > >> > >> } > >> > >> +int sata_port_status(int dev, int port) > >> +{ > >> + struct sata_port_regs *port_mmio; > >> + struct ahci_probe_ent *probe_ent = NULL; > >> + > >> + if (dev < 0 || dev > (CONFIG_SYS_SATA_MAX_DEVICE - 1)) > >> + return -1; > > > > Please lets use values from errno.h here , let's set a good example and > > just do that please. > > Will do... Thanks! Best regards, Marek Vasut