From 8ee2bf9ab792d0c02b13ca3acbd036debb7745d9 Mon Sep 17 00:00:00 2001 From: Sriramakrishnan Date: Thu, 19 Nov 2009 15:58:25 +0530 Subject: TI Davinci EMAC : Re-use driver for other platforms. The davinci EMAC peripheral is also available on other TI platforms -notably TI AM3517 SoC. This patch modifies the config option and the platform structure header files so that the driver can be reused on non-davinci platforms as well. Signed-off-by: Sriramakrishnan Acked-by: Chaithrika U S Acked-by: David S. Miller Signed-off-by: Kevin Hilman --- include/linux/davinci_emac.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 include/linux/davinci_emac.h (limited to 'include/linux') diff --git a/include/linux/davinci_emac.h b/include/linux/davinci_emac.h new file mode 100644 index 000000000000..ff5548747df4 --- /dev/null +++ b/include/linux/davinci_emac.h @@ -0,0 +1,36 @@ +/* + * TI DaVinci EMAC platform support + * + * Author: Kevin Hilman, Deep Root Systems, LLC + * + * 2007 (c) Deep Root Systems, LLC. This file is licensed under + * the terms of the GNU General Public License version 2. This program + * is licensed "as is" without any warranty of any kind, whether express + * or implied. + */ +#ifndef _LINUX_DAVINCI_EMAC_H +#define _LINUX_DAVINCI_EMAC_H + +#include +#include + +struct emac_platform_data { + char mac_addr[ETH_ALEN]; + u32 ctrl_reg_offset; + u32 ctrl_mod_reg_offset; + u32 ctrl_ram_offset; + u32 mdio_reg_offset; + u32 ctrl_ram_size; + u32 phy_mask; + u32 mdio_max_freq; + u8 rmii_en; + u8 version; +}; + +enum { + EMAC_VERSION_1, /* DM644x */ + EMAC_VERSION_2, /* DM646x */ +}; + +void davinci_get_mac_addr(struct memory_accessor *mem_acc, void *context); +#endif -- cgit v1.2.3 From 01a9af36cd9d25fc71e28192974732d8053bd1c0 Mon Sep 17 00:00:00 2001 From: Sriramakrishnan Date: Thu, 19 Nov 2009 15:58:26 +0530 Subject: TI Davinci EMAC : add platform specific interrupt enable/disable logic. On certain SOCs, the EMAC controller is interfaced with a wrapper logic for handling interrupts. This patch implements a platform specific hook to cater to platforms that require custom interrupt handling logic Signed-off-by: Sriramakrishnan Acked-by: Chaithrika U S Acked-by: David S. Miller Signed-off-by: Kevin Hilman --- include/linux/davinci_emac.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/linux') diff --git a/include/linux/davinci_emac.h b/include/linux/davinci_emac.h index ff5548747df4..6d894efd8a3f 100644 --- a/include/linux/davinci_emac.h +++ b/include/linux/davinci_emac.h @@ -25,6 +25,8 @@ struct emac_platform_data { u32 mdio_max_freq; u8 rmii_en; u8 version; + void (*interrupt_enable) (void); + void (*interrupt_disable) (void); }; enum { -- cgit v1.2.3 From ad021ae8862209864dc8ebd3b7d3a55ce84b9ea2 Mon Sep 17 00:00:00 2001 From: Sriramakrishnan Date: Thu, 19 Nov 2009 15:58:27 +0530 Subject: TI Davinci EMAC : Abstract Buffer address translation logic. When programming the DMA engine, the next pointers must be programmed with physical address as seen from the DMA master address space. This address may be different from physical address of the buffer RAM area. This patch abstracts the buffer address translation logic. Signed-off-by: Sriramakrishnan Acked-by: Chaithrika U S Acked-by: David S. Miller Signed-off-by: Kevin Hilman --- include/linux/davinci_emac.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/linux') diff --git a/include/linux/davinci_emac.h b/include/linux/davinci_emac.h index 6d894efd8a3f..7c930dba477c 100644 --- a/include/linux/davinci_emac.h +++ b/include/linux/davinci_emac.h @@ -19,6 +19,7 @@ struct emac_platform_data { u32 ctrl_reg_offset; u32 ctrl_mod_reg_offset; u32 ctrl_ram_offset; + u32 hw_ram_addr; u32 mdio_reg_offset; u32 ctrl_ram_size; u32 phy_mask; -- cgit v1.2.3