Skip to content
Snippets Groups Projects
Commit 6609f35b authored by Michal Simek's avatar Michal Simek
Browse files

net: axi_emac: Put iobase to private structure


Saving iobase directly to private structure helps with moving to DM.
There is an option to load iobase from pdata but it is additional load.
Pointer to private structure is available all the time.

Signed-off-by: default avatarMichal Simek <michal.simek@xilinx.com>
Acked-by: default avatarJoe Hershberger <joe.hershberger@ni.com>
parent f36bbcce
No related branches found
No related tags found
No related merge requests found
...@@ -86,7 +86,7 @@ struct axidma_priv { ...@@ -86,7 +86,7 @@ struct axidma_priv {
struct axidma_reg *dmatx; struct axidma_reg *dmatx;
struct axidma_reg *dmarx; struct axidma_reg *dmarx;
int phyaddr; int phyaddr;
struct axi_regs *iobase;
struct phy_device *phydev; struct phy_device *phydev;
struct mii_dev *bus; struct mii_dev *bus;
}; };
...@@ -223,7 +223,7 @@ static int setup_phy(struct eth_device *dev) ...@@ -223,7 +223,7 @@ static int setup_phy(struct eth_device *dev)
u16 phyreg; u16 phyreg;
u32 i, speed, emmc_reg, ret; u32 i, speed, emmc_reg, ret;
struct axidma_priv *priv = dev->priv; struct axidma_priv *priv = dev->priv;
struct axi_regs *regs = (struct axi_regs *)dev->iobase; struct axi_regs *regs = priv->iobase;
struct phy_device *phydev; struct phy_device *phydev;
u32 supported = SUPPORTED_10baseT_Half | u32 supported = SUPPORTED_10baseT_Half |
...@@ -629,6 +629,7 @@ int xilinx_axiemac_initialize(bd_t *bis, unsigned long base_addr, ...@@ -629,6 +629,7 @@ int xilinx_axiemac_initialize(bd_t *bis, unsigned long base_addr,
sprintf(dev->name, "aximac.%lx", base_addr); sprintf(dev->name, "aximac.%lx", base_addr);
dev->iobase = base_addr; dev->iobase = base_addr;
priv->iobase = (struct axi_regs *)base_addr;
priv->dmatx = (struct axidma_reg *)dma_addr; priv->dmatx = (struct axidma_reg *)dma_addr;
/* RX channel offset is 0x30 */ /* RX channel offset is 0x30 */
priv->dmarx = (struct axidma_reg *)(dma_addr + 0x30); priv->dmarx = (struct axidma_reg *)(dma_addr + 0x30);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment