AM35xx : Add support for EMAC Peripheral
Subsystems (6)
cover AM35xx : Add support for EMAC Peripheral
This patch series adds support for EMAC peripheral on AM35xx platform. The EMAC peripheral is borrowed from the DaVinci platform and hence the same driver(davinci_emac) is used.
This patch series has been generated against tip of linux-omap and depends on the following patches submitted to netdev/linux-davinci list.
[1].http://patchwork.ozlabs.org/patch/47331/
[2].http://patchwork.ozlabs.org/patch/47332/
Sriramakrishnan (4):
AM35xx EMAC : define submodule offsets.
AM35xx : Platform specific hookup for EMAC module OMAP3 : clock data: Update name string for EMAC clocks. AM3517 defconfig update : enable EMAC support
arch/arm/configs/am3517_evm_defconfig | 70 ++++++++++++++++++++- arch/arm/mach-omap2/board-am3517evm.c | 98 +++++++++++++++++++++++++++++ arch/arm/mach-omap2/clock3xxx_data.c | 4 +- arch/arm/mach-omap2/include/mach/am35xx.h | 11 +++- 4 files changed, 179 insertions(+), 4 deletions(-)
PATCH 1/4 AM35xx EMAC : define submodule offsets.
Define offsets for EMAC sub modules.
--- arch/arm/mach-omap2/include/mach/am35xx.h | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/include/mach/am35xx.h +10 -1
@@ -23,4 +23,13 @@#define AM35XX_IPSS_HECC_BASE 0x5C050000#define AM35XX_IPSS_VPFE_BASE 0x5C060000 -#endif /* __ASM_ARCH_AM35XX_H */ +#define AM35XX_EMAC_CNTRL_OFFSET (0x10000) +#define AM35XX_EMAC_CNTRL_MOD_OFFSET (0x0) +#define AM35XX_EMAC_CNTRL_RAM_OFFSET (0x20000) +#define AM35XX_EMAC_MDIO_OFFSET (0x30000) +#define AM35XX_EMAC_CNTRL_RAM_SIZE (0x2000) +#define AM35XX_EMAC_RAM_ADDR (AM3517_EMAC_BASE + \ + AM3517_EMAC_CNTRL_RAM_OFFSET) +#define AM35XX_EMAC_HW_RAM_ADDR (0x01E20000) + +#endif /* __ASM_ARCH_AM35XX_H */
Signature · 1 line
1.6.2.4
PATCH 2/4 AM35xx : Platform specific hookup for EMAC module
Modified AM35xx EVM init sequence to handle EMAC
initialization.
--- arch/arm/mach-omap2/board-am3517evm.c | 98 +++++++++++++++++++++++++++++++++ 1 files changed, 98 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/board-am3517evm.c +98 -0
@@ -21,6 +21,7 @@#include <linux/platform_device.h> #include <linux/gpio.h> #include <linux/i2c/pca953x.h> +#include <linux/davinci_emac.h> #include <mach/hardware.h> #include <mach/am35xx.h>
@@ -30,11 +31,106 @@#include <plat/board.h> #include <plat/common.h> +#include <plat/control.h> #include <plat/usb.h> #include <plat/display.h> #include "mux.h" +#define AM35XX_EVM_PHY_MASK (0xF) +#define AM35XX_EVM_MDIO_FREQUENCY (1000000) + +static struct emac_platform_data am3517_evm_emac_pdata = { + .phy_mask =AM35XX_EVM_PHY_MASK , + .mdio_max_freq =AM35XX_EVM_MDIO_FREQUENCY , + .rmii_en =1 , +}; + +static struct resource am3517_emac_resources[] = { + { + .start =AM35XX_IPSS_EMAC_BASE , + .end =AM35XX_IPSS_EMAC_BASE +0x3FFFF , + .flags =IORESOURCE_MEM , + }, + { + .start =INT_35XX_EMAC_C0_RXTHRESH_IRQ , + .end =INT_35XX_EMAC_C0_RXTHRESH_IRQ , + .flags =IORESOURCE_IRQ , + }, + { + .start =INT_35XX_EMAC_C0_RX_PULSE_IRQ , + .end =INT_35XX_EMAC_C0_RX_PULSE_IRQ , + .flags =IORESOURCE_IRQ , + }, + { + .start =INT_35XX_EMAC_C0_TX_PULSE_IRQ , + .end =INT_35XX_EMAC_C0_TX_PULSE_IRQ , + .flags =IORESOURCE_IRQ , + }, + { + .start =INT_35XX_EMAC_C0_MISC_PULSE_IRQ , + .end =INT_35XX_EMAC_C0_MISC_PULSE_IRQ , + .flags =IORESOURCE_IRQ , + }, +}; + +static struct platform_device am3517_emac_device = { + .name ="davinci_emac" , + .id =-1 , + .num_resources =ARRAY_SIZE (am3517_emac_resources), + .resource = am3517_emac_resources, +}; + +static void am3517_enable_ethernet_int (void ) +{ +u32 regval; + + regval =omap_ctrl_readl (AM35XX_CONTROL_LVL_INTR_CLEAR ); + regval = (regval |AM35XX_CPGMAC_C0_RX_PULSE_CLR | +AM35XX_CPGMAC_C0_TX_PULSE_CLR | +AM35XX_CPGMAC_C0_MISC_PULSE_CLR | +AM35XX_CPGMAC_C0_RX_THRESH_CLR ); +omap_ctrl_writel (regval,AM35XX_CONTROL_LVL_INTR_CLEAR ); + regval =omap_ctrl_readl (AM35XX_CONTROL_LVL_INTR_CLEAR ); +} + +static void am3517_disable_ethernet_int (void ) +{ +u32 regval; + + regval =omap_ctrl_readl (AM35XX_CONTROL_LVL_INTR_CLEAR ); + regval = (regval |AM35XX_CPGMAC_C0_RX_PULSE_CLR | +AM35XX_CPGMAC_C0_TX_PULSE_CLR ); +omap_ctrl_writel (regval,AM35XX_CONTROL_LVL_INTR_CLEAR ); + regval =omap_ctrl_readl (AM35XX_CONTROL_LVL_INTR_CLEAR ); +} + +void am3517_evm_ethernet_init (struct emac_platform_data *pdata) +{ +unsigned int regval; + + pdata->ctrl_reg_offset =AM35XX_EMAC_CNTRL_OFFSET ; + pdata->ctrl_mod_reg_offset =AM35XX_EMAC_CNTRL_MOD_OFFSET ; + pdata->ctrl_ram_offset =AM35XX_EMAC_CNTRL_RAM_OFFSET ; + pdata->mdio_reg_offset =AM35XX_EMAC_MDIO_OFFSET ; + pdata->ctrl_ram_size =AM35XX_EMAC_CNTRL_RAM_SIZE ; + pdata->version =EMAC_VERSION_2 ; + pdata->hw_ram_addr =AM35XX_EMAC_HW_RAM_ADDR ; + pdata->interrupt_enable = am3517_enable_ethernet_int; + pdata->interrupt_disable = am3517_disable_ethernet_int; + am3517_emac_device.dev.platform_data = pdata; +platform_device_register (&am3517_emac_device); + + regval =omap_ctrl_readl (AM35XX_CONTROL_IP_SW_RESET ); + regval = regval & (~(AM35XX_CPGMACSS_SW_RST )); +omap_ctrl_writel (regval,AM35XX_CONTROL_IP_SW_RESET ); + regval =omap_ctrl_readl (AM35XX_CONTROL_IP_SW_RESET ); + +return ; +} + + +#define LCD_PANEL_PWR 176#define LCD_PANEL_BKLIGHT_PWR 182#define LCD_PANEL_PWM 181
@@ -313,6 +409,8 @@ static void __init am3517_evm_init(void)i2c_register_board_info (1 , am3517evm_i2c_boardinfo,ARRAY_SIZE (am3517evm_i2c_boardinfo)); +/*Ethernet*/ +am3517_evm_ethernet_init (&am3517_evm_emac_pdata); }static void __init am3517_evm_map_io (void )
Signature · 1 line
1.6.2.4
A message that is not in the archive (sent off-list or not yet received): 1268320422-32656-3-git-send-email-srk-l0cyMroinI0@public.gmane.org
PATCH 3/4 OMAP3 : clock data: Update name string for EMAC clocks.
The emac driver uses generic name for the module and phy clocks. Updated the omap3xxx_clks table to match the names used by the Davinci emac driver.
--- arch/arm/mach-omap2/clock3xxx_data.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/clock3xxx_data.c +2 -2
@@ -3472,8 +3472,8 @@ static struct omap_clk omap3xxx_clks[] = {CLK (NULL ,"ipss_ick" , &ipss_ick,CK_AM35XX ),CLK (NULL ,"rmii_ck" , &rmii_ck,CK_AM35XX ),CLK (NULL ,"pclk_ck" , &pclk_ck,CK_AM35XX ), -CLK ("davinci_emac" ,"ick" , &emac_ick,CK_AM35XX ), -CLK ("davinci_emac" ,"fck" , &emac_fck,CK_AM35XX ), +CLK ("davinci_emac" ,"emac_clk" , &emac_ick,CK_AM35XX ), +CLK ("davinci_emac" ,"phy_clk" , &emac_fck,CK_AM35XX ),CLK ("vpfe-capture" ,"master" , &vpfe_ick,CK_AM35XX ),CLK ("vpfe-capture" ,"slave" , &vpfe_fck,CK_AM35XX ), CLK("musb_hdrc", "ick", &hsotgusb_ick_am35xx, CK_AM35XX),
Signature · 1 line
1.6.2.4
PATCH 4/4 AM3517 defconfig update : enable EMAC support
Update the default configuration for AM3517EVM to enable support for EMAC peripheral.
--- arch/arm/configs/am3517_evm_defconfig | 70 ++++++++++++++++++++++++++++++++- 1 files changed, 69 insertions(+), 1 deletions(-)
arch/arm/configs/am3517_evm_defconfig +69 -1
@@ -517,7 +517,75 @@ CONFIG_SCSI_LOWLEVEL=y # CONFIG_SCSI_OSD_INITIATOR is not set # CONFIG_ATA is not set # CONFIG_MD is not set -# CONFIG_NETDEVICES is not set +CONFIG_NETDEVICES=y +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_MACVLAN is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set +# CONFIG_VETH is not set +CONFIG_PHYLIB=y + +# +# MII PHY device drivers +# +# CONFIG_MARVELL_PHY is not set +# CONFIG_DAVICOM_PHY is not set +# CONFIG_QSEMI_PHY is not set +# CONFIG_LXT_PHY is not set +# CONFIG_CICADA_PHY is not set +# CONFIG_VITESSE_PHY is not set +# CONFIG_SMSC_PHY is not set +# CONFIG_BROADCOM_PHY is not set +# CONFIG_ICPLUS_PHY is not set +# CONFIG_REALTEK_PHY is not set +# CONFIG_NATIONAL_PHY is not set +# CONFIG_STE10XP is not set +# CONFIG_LSI_ET1011C_PHY is not set +# CONFIG_FIXED_PHY is not set +# CONFIG_MDIO_BITBANG is not set +CONFIG_NET_ETHERNET=y +# CONFIG_MII is not set +# CONFIG_AX88796 is not set +# CONFIG_SMC91X is not set +CONFIG_TI_DAVINCI_EMAC=y +# CONFIG_DM9000 is not set +# CONFIG_ETHOC is not set +# CONFIG_SMC911X is not set +# CONFIG_SMSC911X is not set +# CONFIG_DNET is not set +# CONFIG_IBM_NEW_EMAC_ZMII is not set +# CONFIG_IBM_NEW_EMAC_RGMII is not set +# CONFIG_IBM_NEW_EMAC_TAH is not set +# CONFIG_IBM_NEW_EMAC_EMAC4 is not set +# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set +# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set +# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set +# CONFIG_B44 is not set +# CONFIG_KS8842 is not set +# CONFIG_KS8851_MLL is not set +# CONFIG_NETDEV_1000 is not set +# CONFIG_NETDEV_10000 is not set +# CONFIG_WLAN is not set + +# +# Enable WiMAX (Networking options) to see the WiMAX drivers +# + +# +# USB Network Adapters +# +# CONFIG_USB_CATC is not set +# CONFIG_USB_KAWETH is not set +# CONFIG_USB_PEGASUS is not set +# CONFIG_USB_RTL8150 is not set +# CONFIG_USB_USBNET is not set +# CONFIG_WAN is not set +# CONFIG_PPP is not set +# CONFIG_SLIP is not set +# CONFIG_NETCONSOLE is not set +# CONFIG_NETPOLL is not set +# CONFIG_NET_POLL_CONTROLLER is not set # CONFIG_ISDN is not set # CONFIG_PHONE is not set
Signature · 1 line
1.6.2.4
Tony Lindgren
maintainerPATCH 4/4 AM3517 defconfig update : enable EMAC support
This patch has been applied to the linux-omap
by youw fwiendly patch wobot.
Branch in linux-omap: for-next
Initial commit ID (Likely to change): 08f6edf343289846d1c04fd53949cdf5f5ea4fc2
PatchWorks
http://patchwork.kernel.org/patch/84920/
Git (Likely to change, and takes a while to get mirrored)
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=08f6edf343289846d1c04fd53949cdf5f5ea4fc2
Re: [PATCH 3/4] OMAP3 : clock data: Update name string for EMAC clocks.
In reply to SriramakrishnanQuoted 5 lines · Sriramakrishnan
The emac driver uses generic name for the module and phy clocks. Updated the
omap3xxx_clkstable to match the names used by the Davinci emac driver.Signed-off-by Sriramakrishnan <[email protected]>
At some point, someone should go through that davinci_emac.c driver and change the DaVinci references to "TI" or something generic, now that this core exists on DaVinci, OMAP, etc.
Quoted 27 lines
--- arch/arm/mach-omap2/clock3xxx_data.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)arch/arm/mach-omap2/clock3xxx_data.c +2
-2@@ -3472,8 +3472,8 @@ static struct omap_clk omap3xxx_clks[] = {CLK (NULL ,"ipss_ick" , &ipss_ick,CK_AM35XX ),CLK (NULL ,"rmii_ck" , &rmii_ck,CK_AM35XX ),CLK (NULL ,"pclk_ck" , &pclk_ck,CK_AM35XX ), -CLK ("davinci_emac" ,"ick" , &emac_ick,CK_AM35XX ), -CLK ("davinci_emac" ,"fck" , &emac_fck,CK_AM35XX ), +CLK ("davinci_emac" ,"emac_clk" , &emac_ick,CK_AM35XX ), +CLK ("davinci_emac" ,"phy_clk" , &emac_fck,CK_AM35XX ),CLK ("vpfe-capture" ,"master" , &vpfe_ick,CK_AM35XX ),CLK ("vpfe-capture" ,"slave" , &vpfe_fck,CK_AM35XX ), CLK("musb_hdrc", "ick", &hsotgusb_ick_am35xx, CK_AM35XX),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
- Paul
Re: [PATCH 3/4] OMAP3 : clock data: Update name string for EMAC clocks.
In reply to SriramakrishnanQuoted 14 lines · Sriramakrishnan
The emac driver uses generic name for the module and phy clocks. Updated the
omap3xxx_clkstable to match the names used by the Davinci emac driver.Signed-off-by Sriramakrishnan <[email protected]>--- arch/arm/mach-omap2/clock3xxx_data.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)arch/arm/mach-omap2/clock3xxx_data.c +0
-0
arch/arm/mach-omap2/clock3xxx_data.c static struct omap_clk omap3xxx_clks[] = { · line 3476
Quoted 7 lines
arch/arm/mach-omap2/clock3xxx_data.c +2
-2@@ -3472,8 +3472,8 @@ static struct omap_clk omap3xxx_clks[] = {CLK (NULL ,"ipss_ick" , &ipss_ick,CK_AM35XX ),CLK (NULL ,"rmii_ck" , &rmii_ck,CK_AM35XX ),CLK (NULL ,"pclk_ck" , &pclk_ck,CK_AM35XX ), -CLK ("davinci_emac" ,"ick" , &emac_ick,CK_AM35XX ), - CLK("davinci_emac", "fck", &emac_fck, CK_AM35XX), +CLK ("davinci_emac" ,"emac_clk" , &emac_ick,CK_AM35XX ), + CLK("davinci_emac", "phy_clk", &emac_fck, CK_AM35XX),
As I mentioned in the review of the equivalent davinci changes, I'm not crazy abou the _clk suffixes on the con_id. I think these should be called "main" (or "emac") and "phy".
Kevin
Tony Lindgren
maintainerPATCH 3/4 OMAP3 : clock data: Update name string for EMAC clocks.
In reply to SriramakrishnanThis patch has been applied to the linux-omap
by youw fwiendly patch wobot.
Branch in linux-omap: for-next
Initial commit ID (Likely to change): 6cf3b367fffb3c56baa8fbb7e1f29718ff197dc7
PatchWorks
http://patchwork.kernel.org/patch/84922/
Git (Likely to change, and takes a while to get mirrored)
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=6cf3b367fffb3c56baa8fbb7e1f29718ff197dc7