Skip to contentSkip to conversation

Enable CAN peripheral support on AM3517

PATCH Superseded Sriramakrishnan 2 participants 5 messages Feb 23, 2010 – Feb 26, 2010

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover Enable CAN peripheral support on AM3517

AM3517 platform includes the ti-hecc CAN peripheral. This patch series enables support for the ti-hecc peripheral on AM3517 platform. This patch series has been validated on AM3517EVM.

The patch series is dependent on AM35x clock support patches submitted earlier. [1].http://marc.info/?l=linux-omap&m=126628362713703&w=2 [2].http://marc.info/?l=linux-omap&m=126628364013734&w=2

Sriramakrishnan (2):
can:ti_hecc: Enable CAN support on AM3517.
can:ti_hecc: board specific hookup on AM3517EVM

 arch/arm/configs/am3517_evm_defconfig     |   22 +++++++++++++---
 arch/arm/mach-omap2/board-am3517evm.c     |   38 +++++++++++++++++++++++++++++
 arch/arm/mach-omap2/include/mach/am35xx.h |   10 +++++++
 3 files changed, 66 insertions(+), 4 deletions(-)
#1 lore raw

PATCH 1/2 can:ti_hecc: Enable CAN support on AM3517.

Modify the default kernel configuration on AM3517 to enable CAN.

---
 arch/arm/configs/am3517_evm_defconfig |   22 ++++++++++++++++++----
 1 files changed, 18 insertions(+), 4 deletions(-)
arch/arm/configs/am3517_evm_defconfig +18 -4
index abe9966..d5e15ba 100644
@@ -422,15 +422,29 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 #
 # CONFIG_NET_PKTGEN is not set
 # CONFIG_HAMRADIO is not set
-# CONFIG_CAN is not set
+CONFIG_CAN=y
+CONFIG_CAN_RAW=y
+CONFIG_CAN_BCM=y
+
+#
+# CAN Device Drivers
+#
+CONFIG_CAN_VCAN=y
+CONFIG_CAN_DEV=y
+CONFIG_CAN_CALC_BITTIMING=y
+CONFIG_CAN_TI_HECC=y
+# CONFIG_CAN_SJA1000 is not set
+
+#
+# CAN USB interfaces
+#
+# CONFIG_CAN_EMS_USB is not set
+CONFIG_CAN_DEBUG_DEVICES=y
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
 # CONFIG_AF_RXRPC is not set
 CONFIG_WIRELESS=y
 # CONFIG_CFG80211 is not set
-CONFIG_CFG80211_DEFAULT_PS_VALUE=0
-# CONFIG_WIRELESS_OLD_REGULATORY is not set
-# CONFIG_WIRELESS_EXT is not set
 # CONFIG_LIB80211 is not set
 
 #
Signature · 1 line
1.6.2.4
#2 lore raw

PATCH 2/2 can:ti_hecc: board specific hookup on AM3517EVM

Add board specific hookup for TI HECC driver on
AM3517 EVM

---
The driver requires that CAN_STB signal be driven low to enable CAN PHY. Currently this is being managed from U-boot. Will submit a patch for handling this as part of board init sequence.

 arch/arm/mach-omap2/board-am3517evm.c     |   38 +++++++++++++++++++++++++++++
 arch/arm/mach-omap2/include/mach/am35xx.h |   10 +++++++
 2 files changed, 48 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/board-am3517evm.c +38 -0
index af99faf..42013b5 100644
@@ -20,6 +20,7 @@
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/gpio.h>
+#include <linux/can/platform/ti_hecc.h>
 
 #include <mach/hardware.h>
 #include <mach/am35xx.h>
@@ -223,6 +224,42 @@ static struct omap_board_mux board_mux[] __initdata = {
 #define board_mux	NULL
 #endif
 
+
+static struct resource am3517_hecc_resources[] = {
+	{
+		.start  = AM35XX_IPSS_HECC_BASE,
+		.end    = AM35XX_IPSS_HECC_BASE + 0x3FFF,
+		.flags  = IORESOURCE_MEM,
+	},
+	{
+		.start  = INT_35XX_HECC0_IRQ,
+		.end    = INT_35XX_HECC0_IRQ,
+		.flags  = IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device am3517_hecc_device = {
+	.name           = "ti_hecc",
+	.id             = -1,
+	.num_resources  = ARRAY_SIZE(am3517_hecc_resources),
+	.resource       = am3517_hecc_resources,
+};
+
+static struct ti_hecc_platform_data am3517_evm_hecc_pdata = {
+	.scc_hecc_offset        = AM35XX_HECC_SCC_HECC_OFFSET,
+	.scc_ram_offset         = AM35XX_HECC_SCC_RAM_OFFSET,
+	.hecc_ram_offset        = AM35XX_HECC_RAM_OFFSET,
+	.mbx_offset            = AM35XX_HECC_MBOX_OFFSET,
+	.int_line               = AM35XX_HECC_INT_LINE,
+	.version                = AM35XX_HECC_VERSION,
+};
+
+static void am3517_evm_hecc_init(struct ti_hecc_platform_data *pdata)
+{
+	am3517_hecc_device.dev.platform_data = pdata;
+	platform_device_register(&am3517_hecc_device);
+}
+
 static void __init am3517_evm_init(void)
 {
 	am3517_evm_i2c_init();
@@ -233,6 +270,7 @@ static void __init am3517_evm_init(void)
 
 	omap_serial_init();
 	usb_ehci_init(&ehci_pdata);
+	am3517_evm_hecc_init(&am3517_evm_hecc_pdata);
 	/* DSS */
 	am3517_evm_display_init();
 }
arch/arm/mach-omap2/include/mach/am35xx.h +10 -0
index a705f94..6d5429b 100644
@@ -23,4 +23,14 @@
 #define AM35XX_IPSS_HECC_BASE		0x5C050000
 #define AM35XX_IPSS_VPFE_BASE		0x5C060000
 
+
+/* HECC module specifc offset definitions */
+#define AM35XX_HECC_SCC_HECC_OFFSET	(0x0)
+#define AM35XX_HECC_SCC_RAM_OFFSET	(0x3000)
+#define AM35XX_HECC_RAM_OFFSET		(0x3000)
+#define AM35XX_HECC_MBOX_OFFSET		(0x2000)
+#define AM35XX_HECC_INT_LINE		(0x0)
+#define AM35XX_HECC_VERSION		(0x1)
+
+
 #endif /*  __ASM_ARCH_AM35XX_H */
Signature · 1 line
1.6.2.4
maintainer
#3 lore raw

Re: [PATCH 2/2] can:ti_hecc: board specific hookup on AM3517EVM

Quoted 49 lines · Sriramakrishnan

Add board specific hookup for TI HECC driver on
AM3517 EVM

---
The driver requires that CAN_STB signal be driven low to enable CAN PHY. Currently this is being managed from U-boot. Will submit a patch for handling this as part of board init sequence.

 arch/arm/mach-omap2/board-am3517evm.c     |   38 +++++++++++++++++++++++++++++
 arch/arm/mach-omap2/include/mach/am35xx.h |   10 +++++++
 2 files changed, 48 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/board-am3517evm.c +20 -0
index af99faf..42013b5 100644
@@ -20,6 +20,7 @@
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/gpio.h>
+#include <linux/can/platform/ti_hecc.h>
 
 #include <mach/hardware.h>
 #include <mach/am35xx.h>
@@ -223,6 +224,42 @@ static struct omap_board_mux board_mux[] __initdata = {
 #define board_mux	NULL
 #endif
 
+
+static struct resource am3517_hecc_resources[] = {
+	{
+		.start  = AM35XX_IPSS_HECC_BASE,
+		.end    = AM35XX_IPSS_HECC_BASE + 0x3FFF,
+		.flags  = IORESOURCE_MEM,
+	},
+	{
+		.start  = INT_35XX_HECC0_IRQ,
+		.end    = INT_35XX_HECC0_IRQ,
+		.flags  = IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device am3517_hecc_device = {
+	.name           = "ti_hecc",
+	.id             = -1,
+	.num_resources  = ARRAY_SIZE(am3517_hecc_resources),
+	.resource       = am3517_hecc_resources,

arch/arm/mach-omap2/board-am3517evm.c static struct omap_board_mux board_mux[] __initdata = { · line 255

Quoted 10 lines
arch/arm/mach-omap2/board-am3517evm.c +10 -0
+};
+
+static struct ti_hecc_platform_data am3517_evm_hecc_pdata = {
+	.scc_hecc_offset        = AM35XX_HECC_SCC_HECC_OFFSET,
+	.scc_ram_offset         = AM35XX_HECC_SCC_RAM_OFFSET,
+	.hecc_ram_offset        = AM35XX_HECC_RAM_OFFSET,
+	.mbx_offset            = AM35XX_HECC_MBOX_OFFSET,
+	.int_line               = AM35XX_HECC_INT_LINE,
+	.version                = AM35XX_HECC_VERSION,
+};

The formatting above should use tabs instead of spaces. Please check and run checkpatch.pl --strict on this.

Also, sounds like the Kconfig changes should be 2/2, not 1/2 to enable this.

Tony

Quoted 44 lines
arch/arm/mach-omap2/board-am3517evm.c +8 -0
+
+static void am3517_evm_hecc_init(struct ti_hecc_platform_data *pdata)
+{
+	am3517_hecc_device.dev.platform_data = pdata;
+	platform_device_register(&am3517_hecc_device);
+}
+
 static void __init am3517_evm_init(void)
 {
 	am3517_evm_i2c_init();
@@ -233,6 +270,7 @@ static void __init am3517_evm_init(void)
 
 	omap_serial_init();
 	usb_ehci_init(&ehci_pdata);
+	am3517_evm_hecc_init(&am3517_evm_hecc_pdata);
 	/* DSS */
 	am3517_evm_display_init();
 }
arch/arm/mach-omap2/include/mach/am35xx.h +10 -0
index a705f94..6d5429b 100644
@@ -23,4 +23,14 @@
 #define AM35XX_IPSS_HECC_BASE		0x5C050000
 #define AM35XX_IPSS_VPFE_BASE		0x5C060000
 
+
+/* HECC module specifc offset definitions */
+#define AM35XX_HECC_SCC_HECC_OFFSET	(0x0)
+#define AM35XX_HECC_SCC_RAM_OFFSET	(0x3000)
+#define AM35XX_HECC_RAM_OFFSET		(0x3000)
+#define AM35XX_HECC_MBOX_OFFSET		(0x2000)
+#define AM35XX_HECC_INT_LINE		(0x0)
+#define AM35XX_HECC_VERSION		(0x1)
+
+
 #endif /*  __ASM_ARCH_AM35XX_H */
Signature · 6 lines
1.6.2.4

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#4 lore raw

RE: [PATCH 2/2] can:ti_hecc: board specific hookup on AM3517EVM

Quoted 27 lines

-----Original Message-----
From: Tony Lindgren [mailto:[email protected]]
Sent: Friday, February 26, 2010 3:34 AM
To: Govindarajan, Sriramakrishnan
Cc: [email protected]; Gole, Anant
Subject: Re: [PATCH 2/2] can:ti_hecc: board specific hookup on AM3517EVM

Quoted 8 lines · Sriramakrishnan

Add board specific hookup for TI HECC driver on
AM3517 EVM

---
The driver requires that CAN_STB signal be driven low to enable CAN PHY. Currently this is being managed from U-boot. Will submit a

patch

Quoted 3 lines

for handling this as part of board init sequence.

 arch/arm/mach-omap2/board-am3517evm.c     |   38

+++++++++++++++++++++++++++++

arch/arm/mach-

Quoted 4 lines
 arch/arm/mach-omap2/include/mach/am35xx.h |   10 +++++++
 2 files changed, 48 insertions(+), 0 deletions(-)
arch/arm/mach- renamed from arch/arm/mach-omap2/board-am3517evm.c +0 -0

omap2/board-am3517evm.c

Quoted 9 lines

arch/arm/mach-omap2/board-am3517evm.c line 24

Quoted 9 lines

index af99faf..42013b5 100644

arch/arm/mach-omap2/board-am3517evm.c +1 -0
@@ -20,6 +20,7 @@
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/gpio.h>
+#include <linux/can/platform/ti_hecc.h>
 

--- snip ----

Quoted 13 lines

arch/arm/mach-omap2/board-am3517evm.c static struct omap_board_mux board_mux[] __initdata = { · line 255

Quoted 9 lines
arch/arm/mach-omap2/board-am3517evm.c +9 -0
+
+static struct ti_hecc_platform_data am3517_evm_hecc_pdata = {
+	.scc_hecc_offset        = AM35XX_HECC_SCC_HECC_OFFSET,
+	.scc_ram_offset         = AM35XX_HECC_SCC_RAM_OFFSET,
+	.hecc_ram_offset        = AM35XX_HECC_RAM_OFFSET,
+	.mbx_offset            = AM35XX_HECC_MBOX_OFFSET,
+	.int_line               = AM35XX_HECC_INT_LINE,
+	.version                = AM35XX_HECC_VERSION,
+};

The formatting above should use tabs instead of spaces. Please check and run checkpatch.pl --strict on this.

Quoted 5 lines

Also, sounds like the Kconfig changes should be 2/2, not 1/2 to enable this.

Tony

[Sriram] Tony, I did verify the patch with checkpatch(log below) but
Somehow, it didn't flag any formatting errors. I realize that there are spaces that need to be converted to tabs. I will re-generate the patch and also re-order the patches as pointed out.

$scripts/checkpatch.pl --strict 2-2-can-ti_hecc-board-specific-hookup-on-AM3517EVM.patch
total: 0 errors, 0 warnings, 0 checks, 70 lines checked

2-2-can-ti_hecc-board-specific-hookup-on-AM3517EVM.patch has no obvious style problems and is ready for submission.