Skip to content

Commit 1d899fd

Browse files
soniczrealmz
authored andcommitted
blackfin: Add STMMAC platform data to enable dwmac1000 driver on BF60x.
- Enable GMAC - Set propler DMA PBL - Disable DMA store and forward mode - Select PTP input clock from MII clock. Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Steven Miao <realmz6@gmail.com>
1 parent e578609 commit 1d899fd

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

‎arch/blackfin/mach-bf609/boards/ezkit.c‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,18 +104,34 @@ static struct platform_device bfin_rotary_device = {
104104

105105
#if defined(CONFIG_STMMAC_ETH) || defined(CONFIG_STMMAC_ETH_MODULE)
106106
#include <linux/stmmac.h>
107+
#include <linux/phy.h>
107108

108109
static unsigned short pins[] = P_RMII0;
109110

110111
static struct stmmac_mdio_bus_data phy_private_data = {
111112
.phy_mask = 1,
112113
};
113114

115+
static struct stmmac_dma_cfg eth_dma_cfg = {
116+
.pbl = 2,
117+
};
118+
119+
int stmmac_ptp_clk_init(struct platform_device *pdev)
120+
{
121+
bfin_write32(PADS0_EMAC_PTP_CLKSEL, 0);
122+
return 0;
123+
}
124+
114125
static struct plat_stmmacenet_data eth_private_data = {
126+
.has_gmac = 1,
115127
.bus_id = 0,
116128
.enh_desc = 1,
117129
.phy_addr = 1,
118130
.mdio_bus_data = &phy_private_data,
131+
.dma_cfg = &eth_dma_cfg,
132+
.force_thresh_dma_mode = 1,
133+
.interface = PHY_INTERFACE_MODE_RMII,
134+
.init = stmmac_ptp_clk_init,
119135
};
120136

121137
static struct platform_device bfin_eth_device = {

‎arch/blackfin/mach-bf609/include/mach/defBF60x_base.h‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,16 @@
839839
#define PORTG_LOCK 0xFFC03344 /* PORTG Port x GPIO Lock Register */
840840
#define PORTG_REVID 0xFFC0337C /* PORTG Port x GPIO Revision ID */
841841

842+
/* ==================================================
843+
Pads Controller Registers
844+
================================================== */
845+
846+
/* =========================
847+
PADS0
848+
========================= */
849+
#define PADS0_EMAC_PTP_CLKSEL 0xFFC03404 /* PADS0 Clock Selection for EMAC and PTP */
850+
#define PADS0_TWI_VSEL 0xFFC03408 /* PADS0 TWI Voltage Selection */
851+
#define PADS0_PORTS_HYST 0xFFC03440 /* PADS0 Hysteresis Enable Register */
842852

843853
/* =========================
844854
PINT Registers

0 commit comments

Comments
 (0)