85xx/fsl-sata: Use is_serdes_configured() to determine if SATA is enabled
On the MPC85xx platform if we have SATA its connected on SERDES. Determing if SATA is enabled via sata_initialize should not be board specific and thus we move it out of the MPC8536DS board code. Additionally, now that we have is_serdes_configured() we can determine if the given SATA port is enabled and error out if its not in the driver. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2008 Freescale Semiconductor, Inc.
|
||||
* Copyright (C) 2008,2010 Freescale Semiconductor, Inc.
|
||||
* Dave Liu <daveliu@freescale.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <command.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/processor.h>
|
||||
#include <asm/fsl_serdes.h>
|
||||
#include <malloc.h>
|
||||
#include <libata.h>
|
||||
#include <fis.h>
|
||||
@@ -129,6 +130,17 @@ int init_sata(int dev)
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_MPC85xx
|
||||
if ((dev == 0) && (!is_serdes_configured(SATA1))) {
|
||||
printf("SATA%d [dev = %d] is not enabled\n", dev+1, dev);
|
||||
return -1;
|
||||
}
|
||||
if ((dev == 1) && (!is_serdes_configured(SATA2))) {
|
||||
printf("SATA%d [dev = %d] is not enabled\n", dev+1, dev);
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Allocate SATA device driver struct */
|
||||
sata = (fsl_sata_t *)malloc(sizeof(fsl_sata_t));
|
||||
if (!sata) {
|
||||
|
||||
Reference in New Issue
Block a user