mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Renaud Barbier <renaud.barbier@ge.com>
To: Sascha Hauer <s.hauer@pengutronix.de>, barebox@lists.infradead.org
Subject: Re: [PATCH] gianfar: prevent resource conflict
Date: Tue, 04 Jun 2013 18:01:29 +0100	[thread overview]
Message-ID: <51AE1D69.4050205@ge.com> (raw)
In-Reply-To: <51AC6286.5030001@ge.com>

Hello Sacha,
I applied your patch and try it on our mpc8544 based board
with a few modification.
This board uses eTSEC1. This means all 3 regions have the same
base address.

I just did the following update to your patch.
It only maps the eTSEC registers and mdio bus registers.

  static int fsl_phy_init(void)
{
          add_generic_device("gfar-phy", 0, NULL, MDIO_BASE_ADDR, 0x1000,
                          IORESOURCE_MEM, NULL);
          return 0;
  }

  coredevice_initcall(fsl_phy_init);

   int fsl_eth_init(int num, struct gfar_info_struct *gf)
  {

          printf("FSL_ETH_INIT: num = %d, 0x%x\n", num - 1,
                          GFAR_BASE_ADDR + (num - 1) * 0x1000);
          add_generic_device("gfar", num - 1, NULL,
                          GFAR_BASE_ADDR + (num - 1) * 0x1000, 0x1000,
                          IORESOURCE_MEM, gf);

           return 0;
   }


I added a few debug messages in request_region and got:

barebox 2013.05.0-00706-g87df6ec-dirty #13 Tue Jun 4 17:17:34 BST 2013

Board: DA923RC

dev_request_mem_region:got resource
request_region:name = gfar-phy0, parent = 1ffa6494
request_region ok: 0xe0024000:0xe0024fff
gfar_phy_probe:phy->regs= e0024000, 0
gfar_phy_probe: id = 0
mdio_bus: miibus0: probed
...
FSL_ETH_INIT: num = 0, 0xe0024000
dev_request_mem_region:got resource
request_region:name = gfar0, parent = 1ffa6494
request_region: 0xe0024000:0xe0024fff conflicts with 0xe0024000:0xe0024fff
gfar_probe:priv->regs 00000000, 0
gfar_halt:regs = 00000000

Even though, two devices have been added, both have the same parent 
iomem and the same region is compared. A conflict is then detected.
When gfar_probe requests its Ethernet register region, NULL is returned.



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

  reply	other threads:[~2013-06-04 17:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-30 15:15 Renaud Barbier
2013-06-01  9:20 ` Sascha Hauer
2013-06-03  9:31   ` Renaud Barbier
2013-06-04 17:01     ` Renaud Barbier [this message]
2013-06-05  7:12       ` Sascha Hauer
2013-06-05  9:05         ` Renaud Barbier
2013-06-25 13:09 ` [PATCH v2 0/2] " Renaud Barbier
2013-06-25 13:09 ` [PATCH 1/2] ppc: gianfar MDIO buses Renaud Barbier
2013-06-26  6:44   ` Sascha Hauer
2013-06-25 13:10 ` [PATCH 2/2] P2020RDB: update build configuration Renaud Barbier

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=51AE1D69.4050205@ge.com \
    --to=renaud.barbier@ge.com \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /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