summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorMarcel Ziswiler <marcel.ziswiler@toradex.com>2013-03-12 08:56:29 +0100
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2013-03-12 08:56:29 +0100
commitd4be58791a6358e85fa1bf139d46f7e80c65eec4 (patch)
tree7802382d7412eb28bc9fb906b617b8f2dcee4719 /drivers/net
parent5dcf120a31010d2d64846c259ddeb7187cb41cda (diff)
colibri_t20/30: can: integrate mcp251x and sja1000 support
Integrate CAN support for the Colibri Evaluation Board V3.1a with built-in MCP2515 SPI CAN controller resp. the Colibri Evaluation Board V2.1c with its built-in SJA1000 CAN controller connected to the GMI bus. The following kernel configuration needs to be enabled as well: CONFIG_CAN CONFIG_CAN_RAW CONFIG_CAN_BCM CONFIG_CAN_DEV Plus depending on the Evaluation Board revision: CONFIG_CAN_MCP251X or CONFIG_CAN_SJA1000 CONFIG_CAN_SJA1000_PLATFORM Optional support for 32-bit GMI as well as xPOD CAN on MECS Tellurium for Colibri T20 is provided via commented defines in arch/arm/mach-tegra/board-colibri_t20.h.
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/can/sja1000/sja1000_platform.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/can/sja1000/sja1000_platform.c b/drivers/net/can/sja1000/sja1000_platform.c
index d9fadc489b32..c8428f25d914 100644
--- a/drivers/net/can/sja1000/sja1000_platform.c
+++ b/drivers/net/can/sja1000/sja1000_platform.c
@@ -38,12 +38,24 @@ MODULE_LICENSE("GPL v2");
static u8 sp_read_reg8(const struct sja1000_priv *priv, int reg)
{
+#if !defined(CONFIG_MACH_COLIBRI_T20) && !defined(CONFIG_MACH_COLIBRI_T30)
return ioread8(priv->reg_base + reg);
+#else
+ u8 value;
+ iowrite8(reg, priv->reg_base);
+ value = ioread8(priv->reg_base + 8);
+ return value;
+#endif
}
static void sp_write_reg8(const struct sja1000_priv *priv, int reg, u8 val)
{
+#if !defined(CONFIG_MACH_COLIBRI_T20) && !defined(CONFIG_MACH_COLIBRI_T30)
iowrite8(val, priv->reg_base + reg);
+#else
+ iowrite8(reg, priv->reg_base);
+ iowrite8(val, priv->reg_base + 8);
+#endif
}
static u8 sp_read_reg16(const struct sja1000_priv *priv, int reg)