mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Lucas Stach <dev@lynxeye.de>
To: Oleksij Rempel <o.rempel@pengutronix.de>,
	Antony Pavlov <antonynpavlov@gmail.com>,
	barebox@lists.infradead.org
Cc: Peter Mamonov <pmamonov@gmail.com>
Subject: Re: [RFC 3/5] net: e1000: make it work on MIPS
Date: Mon, 13 Jan 2020 20:06:43 +0100	[thread overview]
Message-ID: <b29aadb633dda02bb26b062338e1cd8f19f4dd61.camel@lynxeye.de> (raw)
In-Reply-To: <0e202cc5-a5af-309e-c55c-5c508592fa9d@pengutronix.de>

Am Montag, den 13.01.2020, 08:29 +0100 schrieb Oleksij Rempel:
> Hm... how was it working before? We was just lucky to have physical address equal to 
> virtual. I would say, it is not really MIPS only fix.

Yes, drivers using DMA_ADDRESS_BROKEN don't work on any
architecture/SoC that doesn't have a 1:1 CPU to DMA address mapping.
The name of that define might give a slight hint to that fact. ;)

Regards,
Lucas

> Reviewed-by: Oleksij Rempel <o.rempel@pengutronix.de>
> 
> On 09.01.20 08:28, Antony Pavlov wrote:
> > Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
> > ---
> >   drivers/net/e1000/e1000.h | 2 ++
> >   drivers/net/e1000/main.c  | 8 ++++----
> >   2 files changed, 6 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h
> > index 52ad3d4cdb..d26e6dcc02 100644
> > --- a/drivers/net/e1000/e1000.h
> > +++ b/drivers/net/e1000/e1000.h
> > @@ -2180,7 +2180,9 @@ struct e1000_hw {
> >   	struct mii_bus miibus;
> >   
> >   	struct e1000_tx_desc *tx_base;
> > +	dma_addr_t tx_base_phys;
> >   	struct e1000_rx_desc *rx_base;
> > +	dma_addr_t rx_base_phys;
> >   	unsigned char *packet;
> >   	dma_addr_t packet_dma;
> >   
> > diff --git a/drivers/net/e1000/main.c b/drivers/net/e1000/main.c
> > index f67c5d867b..69b1516640 100644
> > --- a/drivers/net/e1000/main.c
> > +++ b/drivers/net/e1000/main.c
> > @@ -3232,7 +3232,7 @@ static void e1000_configure_tx(struct
> > e1000_hw *hw)
> >   	unsigned long tctl;
> >   	unsigned long tipg, tarc;
> >   	uint32_t ipgr1, ipgr2;
> > -	const unsigned long tx_base = (unsigned long)hw->tx_base;
> > +	const unsigned long tx_base = (unsigned long)hw->tx_base_phys;
> >   
> >   	e1000_write_reg(hw, E1000_TDBAL, lower_32_bits(tx_base));
> >   	e1000_write_reg(hw, E1000_TDBAH, upper_32_bits(tx_base));
> > @@ -3351,7 +3351,7 @@ static void e1000_setup_rctl(struct e1000_hw
> > *hw)
> >   static void e1000_configure_rx(struct e1000_hw *hw)
> >   {
> >   	unsigned long rctl, ctrl_ext;
> > -	const unsigned long rx_base = (unsigned long)hw->rx_base;
> > +	const unsigned long rx_base = (unsigned long)hw->rx_base_phys;
> >   
> >   	hw->rx_tail = 0;
> >   	/* make sure receives are disabled while setting up the
> > descriptors */
> > @@ -3564,8 +3564,8 @@ static int e1000_probe(struct pci_dev *pdev,
> > const struct pci_device_id *id)
> >   
> >   	hw = xzalloc(sizeof(*hw));
> >   
> > -	hw->tx_base = dma_alloc_coherent(16 * sizeof(*hw->tx_base),
> > DMA_ADDRESS_BROKEN);
> > -	hw->rx_base = dma_alloc_coherent(16 * sizeof(*hw->rx_base),
> > DMA_ADDRESS_BROKEN);
> > +	hw->tx_base = dma_alloc_coherent(16 * sizeof(*hw->tx_base),
> > &hw->tx_base_phys);
> > +	hw->rx_base = dma_alloc_coherent(16 * sizeof(*hw->rx_base),
> > &hw->rx_base_phys);
> >   
> >   	edev = &hw->edev;
> >   
> > 
> 
> Kind regards,
> Oleksij Rempel
> 


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2020-01-13 19:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-09  7:28 [RFC 0/5] WIP: MIPS: implement dma mapping functions Antony Pavlov
2020-01-09  7:28 ` [RFC 1/5] WIP: MIPS: configure ebase according CONFIG_MMU Antony Pavlov
2020-01-13  6:48   ` Oleksij Rempel
2020-01-09  7:28 ` [RFC 2/5] WIP: MIPS: implement dma mapping functions Antony Pavlov
2020-01-13  8:26   ` Oleksij Rempel
2020-01-14 21:03     ` Antony Pavlov
2020-01-09  7:28 ` [RFC 3/5] net: e1000: make it work on MIPS Antony Pavlov
2020-01-13  7:29   ` Oleksij Rempel
2020-01-13 19:06     ` Lucas Stach [this message]
2020-01-09  7:28 ` [RFC 4/5] net: rtl8169: make it work on big-endian system Antony Pavlov
2020-01-13  7:21   ` Oleksij Rempel
2020-02-04 14:03   ` Oleksij Rempel
2020-02-09  6:30     ` Antony Pavlov
2020-02-09  8:17       ` Oleksij Rempel
2020-02-28  5:38     ` Antony Pavlov
2020-01-09  7:28 ` [RFC 5/5] MIPS: qemu-malta_defconfig: enable e1000 network driver Antony Pavlov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b29aadb633dda02bb26b062338e1cd8f19f4dd61.camel@lynxeye.de \
    --to=dev@lynxeye.de \
    --cc=antonynpavlov@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=o.rempel@pengutronix.de \
    --cc=pmamonov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox