public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 2/2] Add SPI helpers to Sequoia
@ 2008-12-08 17:35 Steven A. Falco
  2008-12-08 20:31 ` Wolfgang Denk
  0 siblings, 1 reply; 2+ messages in thread
From: Steven A. Falco @ 2008-12-08 17:35 UTC (permalink / raw)
  To: u-boot

This patch adds SPI helper routines for the Sequoia board.

Signed-off-by: Steven A. Falco <sfalco@harris.com>
---
 board/amcc/sequoia/sequoia.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/board/amcc/sequoia/sequoia.c b/board/amcc/sequoia/sequoia.c
index d6668e2..01ddb5e 100644
--- a/board/amcc/sequoia/sequoia.c
+++ b/board/amcc/sequoia/sequoia.c
@@ -26,6 +26,7 @@
 #include <libfdt.h>
 #include <fdt_support.h>
 #include <ppc4xx.h>
+#include <spi.h>
 #include <asm/gpio.h>
 #include <asm/processor.h>
 #include <asm/io.h>
@@ -513,3 +514,22 @@ int post_hotkeys_pressed(void)
 	return 0;	/* No hotkeys supported */
 }
 #endif /* CONFIG_POST */
+
+#if defined(CONFIG_HARD_SPI)
+int spi_cs_is_valid(unsigned int bus, unsigned int cs)
+{
+	return bus == 0 && cs >= 0 && cs < 64;
+}
+
+void spi_cs_activate(struct spi_slave *slave)
+{
+	/* Assumes chip-selects are active-low. */
+	gpio_write_bit(slave->cs, 0);
+}
+
+void spi_cs_deactivate(struct spi_slave *slave)
+{
+	gpio_write_bit(slave->cs, 1);
+}
+#endif /* CONFIG_HARD_SPI */
+
-- 
1.6.0.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot] [PATCH 2/2] Add SPI helpers to Sequoia
  2008-12-08 17:35 [U-Boot] [PATCH 2/2] Add SPI helpers to Sequoia Steven A. Falco
@ 2008-12-08 20:31 ` Wolfgang Denk
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Denk @ 2008-12-08 20:31 UTC (permalink / raw)
  To: u-boot

Dear "Steven A. Falco",

In message <493D5AFD.7010803@harris.com> you wrote:
> This patch adds SPI helper routines for the Sequoia board.
> 
> Signed-off-by: Steven A. Falco <sfalco@harris.com>
> ---
>  board/amcc/sequoia/sequoia.c |   20 ++++++++++++++++++++
>  1 files changed, 20 insertions(+), 0 deletions(-)

What are these functions needed for?

In which way are these really sequoia-specific?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Man did not weave the web of life; he  is  merely  a  strand  in  it.
Whatever he does to the web, he does to himself.     - Seattle [1854]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-12-08 20:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-08 17:35 [U-Boot] [PATCH 2/2] Add SPI helpers to Sequoia Steven A. Falco
2008-12-08 20:31 ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox