summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Warren <biggerbadderben@gmail.com>2008-06-08 23:28:33 -0700
committerWolfgang Denk <wd@denx.de>2008-07-01 21:02:11 +0200
commitf8cc312bbee69257d741dc9f4062f4a0f5adf609 (patch)
tree3368d2d4fa192b0274d9ed9dd9c84f07482710ab
parentd92ea21bafb674ee2bf27447970b047845e7b0a2 (diff)
downloadu-boot-imx-f8cc312bbee69257d741dc9f4062f4a0f5adf609.zip
u-boot-imx-f8cc312bbee69257d741dc9f4062f4a0f5adf609.tar.gz
u-boot-imx-f8cc312bbee69257d741dc9f4062f4a0f5adf609.tar.bz2
Move conditional compilation of MPC8XXX SPI driver to Makefile
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
-rw-r--r--board/freescale/mpc8349emds/mpc8349emds.c2
-rw-r--r--drivers/spi/Makefile2
-rw-r--r--drivers/spi/mpc8xxx_spi.c2
-rw-r--r--include/configs/MPC8349EMDS.h1
-rw-r--r--include/spi.h9
-rw-r--r--lib_ppc/board.c2
6 files changed, 11 insertions, 7 deletions
diff --git a/board/freescale/mpc8349emds/mpc8349emds.c b/board/freescale/mpc8349emds/mpc8349emds.c
index 4d57faf..9a312c3 100644
--- a/board/freescale/mpc8349emds/mpc8349emds.c
+++ b/board/freescale/mpc8349emds/mpc8349emds.c
@@ -253,7 +253,7 @@ void sdram_init(void)
/*
* The following are used to control the SPI chip selects for the SPI command.
*/
-#ifdef CONFIG_HARD_SPI
+#ifdef CONFIG_MPC8XXX_SPI
#define SPI_CS_MASK 0x80000000
diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile
index e66e0ee..4f7b679 100644
--- a/drivers/spi/Makefile
+++ b/drivers/spi/Makefile
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
LIB := $(obj)libspi.a
-COBJS-y += mpc8xxx_spi.o
+COBJS-$(CONFIG_MPC8XXX_SPI) += mpc8xxx_spi.o
COBJS-$(CONFIG_ATMEL_SPI) += atmel_spi.o
COBJS-$(CONFIG_MXC_SPI) += mxc_spi.o
diff --git a/drivers/spi/mpc8xxx_spi.c b/drivers/spi/mpc8xxx_spi.c
index 136fb50..9eaf986 100644
--- a/drivers/spi/mpc8xxx_spi.c
+++ b/drivers/spi/mpc8xxx_spi.c
@@ -22,7 +22,6 @@
*/
#include <common.h>
-#if defined(CONFIG_MPC8XXX_SPI) && defined(CONFIG_HARD_SPI)
#include <malloc.h>
#include <spi.h>
@@ -180,4 +179,3 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout,
return 0;
}
-#endif /* CONFIG_HARD_SPI */
diff --git a/include/configs/MPC8349EMDS.h b/include/configs/MPC8349EMDS.h
index 37e3ca4..8705838 100644
--- a/include/configs/MPC8349EMDS.h
+++ b/include/configs/MPC8349EMDS.h
@@ -355,7 +355,6 @@
/* SPI */
#define CONFIG_MPC8XXX_SPI
-#define CONFIG_HARD_SPI /* SPI with hardware support */
#undef CONFIG_SOFT_SPI /* SPI bit-banged */
/* GPIOs. Used as SPI chip selects */
diff --git a/include/spi.h b/include/spi.h
index 7744c2e..320e50e 100644
--- a/include/spi.h
+++ b/include/spi.h
@@ -24,6 +24,15 @@
#ifndef _SPI_H_
#define _SPI_H_
+/* Controller-specific definitions: */
+
+/* CONFIG_HARD_SPI triggers SPI bus initialization in PowerPC */
+#ifdef CONFIG_MPC8XXX_SPI
+# ifndef CONFIG_HARD_SPI
+# define CONFIG_HARD_SPI
+# endif
+#endif
+
/* SPI mode flags */
#define SPI_CPHA 0x01 /* clock phase */
#define SPI_CPOL 0x02 /* clock polarity */
diff --git a/lib_ppc/board.c b/lib_ppc/board.c
index c42e088..96c573c 100644
--- a/lib_ppc/board.c
+++ b/lib_ppc/board.c
@@ -90,9 +90,7 @@ void doc_init (void);
defined(CONFIG_SOFT_I2C)
#include <i2c.h>
#endif
-#if defined(CONFIG_HARD_SPI)
#include <spi.h>
-#endif
#include <nand.h>
static char *failed = "*** failed ***\n";