Skip to content

Commit 2a369ae

Browse files
committed
Merge branch 'net-ll_temac-x86_64-support'
Esben Haabendal says: ==================== net: ll_temac: x86_64 support This patch series adds support for use of ll_temac driver with platform_data configuration and fixes endianess and 64-bit problems so that it can be used on x86_64 platform. A few bugfixes are also included. Changes since v2: - Fixed lp->indirect_mutex initialization regression for OF platforms introduced in v2 Changes since v1: - Make indirect_mutex specification mandatory when using platform_data - Move header to include/linux/platform_data - Enable COMPILE_TEST for XILINX_LL_TEMAC - Rebased to v5.1-rc7 ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents ac97a35 + 73f7375 commit 2a369ae

File tree

5 files changed

+432
-203
lines changed

5 files changed

+432
-203
lines changed

drivers/net/ethernet/xilinx/Kconfig

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
config NET_VENDOR_XILINX
66
bool "Xilinx devices"
77
default y
8-
depends on PPC || PPC32 || MICROBLAZE || ARCH_ZYNQ || MIPS
8+
depends on PPC || PPC32 || MICROBLAZE || ARCH_ZYNQ || MIPS || X86 || COMPILE_TEST
99
---help---
1010
If you have a network (Ethernet) card belonging to this class, say Y.
1111

@@ -33,8 +33,7 @@ config XILINX_AXI_EMAC
3333

3434
config XILINX_LL_TEMAC
3535
tristate "Xilinx LL TEMAC (LocalLink Tri-mode Ethernet MAC) driver"
36-
depends on (PPC || MICROBLAZE)
37-
depends on !64BIT || BROKEN
36+
depends on PPC || MICROBLAZE || X86 || COMPILE_TEST
3837
select PHYLIB
3938
---help---
4039
This driver supports the Xilinx 10/100/1000 LocalLink TEMAC

drivers/net/ethernet/xilinx/ll_temac.h

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,9 @@ struct temac_local {
334334

335335
/* Connection to PHY device */
336336
struct device_node *phy_node;
337+
/* For non-device-tree devices */
338+
char phy_name[MII_BUS_ID_SIZE + 3];
339+
phy_interface_t phy_interface;
337340

338341
/* MDIO bus data */
339342
struct mii_bus *mii_bus; /* MII bus reference */
@@ -344,16 +347,21 @@ struct temac_local {
344347
#ifdef CONFIG_PPC_DCR
345348
dcr_host_t sdma_dcrs;
346349
#endif
347-
u32 (*dma_in)(struct temac_local *, int);
348-
void (*dma_out)(struct temac_local *, int, u32);
350+
u32 (*temac_ior)(struct temac_local *lp, int offset);
351+
void (*temac_iow)(struct temac_local *lp, int offset, u32 value);
352+
u32 (*dma_in)(struct temac_local *lp, int reg);
353+
void (*dma_out)(struct temac_local *lp, int reg, u32 value);
349354

350355
int tx_irq;
351356
int rx_irq;
352357
int emac_num;
353358

354359
struct sk_buff **rx_skb;
355360
spinlock_t rx_lock;
356-
struct mutex indirect_mutex;
361+
/* For synchronization of indirect register access. Must be
362+
* shared mutex between interfaces in same TEMAC block.
363+
*/
364+
struct mutex *indirect_mutex;
357365
u32 options; /* Current options word */
358366
int last_link;
359367
unsigned int temac_features;
@@ -367,18 +375,24 @@ struct temac_local {
367375
int tx_bd_next;
368376
int tx_bd_tail;
369377
int rx_bd_ci;
378+
379+
/* DMA channel control setup */
380+
u32 tx_chnl_ctrl;
381+
u32 rx_chnl_ctrl;
370382
};
371383

384+
/* Wrappers for temac_ior()/temac_iow() function pointers above */
385+
#define temac_ior(lp, o) ((lp)->temac_ior(lp, o))
386+
#define temac_iow(lp, o, v) ((lp)->temac_iow(lp, o, v))
387+
372388
/* xilinx_temac.c */
373-
u32 temac_ior(struct temac_local *lp, int offset);
374-
void temac_iow(struct temac_local *lp, int offset, u32 value);
375389
int temac_indirect_busywait(struct temac_local *lp);
376390
u32 temac_indirect_in32(struct temac_local *lp, int reg);
377391
void temac_indirect_out32(struct temac_local *lp, int reg, u32 value);
378392

379393

380394
/* xilinx_temac_mdio.c */
381-
int temac_mdio_setup(struct temac_local *lp, struct device_node *np);
395+
int temac_mdio_setup(struct temac_local *lp, struct platform_device *pdev);
382396
void temac_mdio_teardown(struct temac_local *lp);
383397

384398
#endif /* XILINX_LL_TEMAC_H */

0 commit comments

Comments
 (0)