[U-Boot] [RFC 5/5] CAN interface support for the TQM855L module

Wolfgang Grandegger wg at grandegger.com
Sun Nov 1 12:33:37 CET 2009


From: Wolfgang Grandegger <wg at denx.de>

Signed-off-by: Wolfgang Grandegger <wg at denx.de>
---
 board/tqc/tqm8xx/tqm8xx.c |   17 +++++++++++++++++
 include/configs/TQM855L.h |    8 +++++++-
 2 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/board/tqc/tqm8xx/tqm8xx.c b/board/tqc/tqm8xx/tqm8xx.c
index f92c598..f1aab43 100644
--- a/board/tqc/tqm8xx/tqm8xx.c
+++ b/board/tqc/tqm8xx/tqm8xx.c
@@ -26,6 +26,10 @@
 #ifdef CONFIG_PS2MULT
 #include <ps2mult.h>
 #endif
+#ifdef	CONFIG_CAN
+#include <can.h>
+#include <i82527.h>
+#endif
 
 extern flash_info_t flash_info[];	/* FLASH chips info */
 
@@ -447,6 +451,19 @@ int board_early_init_r (void)
 
 #endif /* CONFIG_PS2MULT */
 
+#if defined(CONFIG_CAN_DRIVER) && defined(CONFIG_CAN)
+static struct can_dev tqm8xx_can[2];
+
+#ifdef CONFIG_BOARD_EARLY_INIT_R
+int board_early_init_r (void)
+{
+	i82527_register (&tqm8xx_can[0], CONFIG_SYS_CAN_BASE);
+	i82527_register( &tqm8xx_can[1], CONFIG_SYS_CAN_BASE + 0x100);
+
+	return (0);
+}
+#endif
+#endif
 
 #ifdef CONFIG_MISC_INIT_R
 extern void load_sernum_ethaddr(void);
diff --git a/include/configs/TQM855L.h b/include/configs/TQM855L.h
index 1255928..1603d30 100644
--- a/include/configs/TQM855L.h
+++ b/include/configs/TQM855L.h
@@ -88,7 +88,13 @@
 
 #define	CONFIG_STATUS_LED	1	/* Status LED enabled		*/
 
-#undef	CONFIG_CAN_DRIVER		/* CAN Driver support disabled	*/
+#define	CONFIG_CAN_DRIVER			/* CAN Driver support enabled	*/
+#ifdef CONFIG_CAN_DRIVER
+#define CONFIG_CAN
+#define CONFIG_CAN_I82527
+#define CONFIG_CMD_CAN
+#define CONFIG_BOARD_EARLY_INIT_R
+#endif
 
 /*
  * BOOTP options
-- 
1.6.2.5



More information about the U-Boot mailing list