public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Dirk Eibach <dirk.eibach@gdsys.cc>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 06/10] powerpc/ppc4xx: Use generic FPGA accessors on all gdsys 405ep/ex boards
Date: Mon, 06 May 2013 17:55:22 +0200	[thread overview]
Message-ID: <449c45a6a9978c55e84d3fe7efe6f0ac@gdsys.cc> (raw)
In-Reply-To: <20130506152259.E8260380E6C@gemini.denx.de>

Hi Wolfgang,

Am 06.05.2013 17:22, schrieb Wolfgang Denk:
> Dear Dirk Eibach,
> 
> In message <e8fccb4d422d619744521268691e5a9b@gdsys.cc> you wrote:
>> 
>>> You had the this, and now attempt to throw it away.  This makes no
>>> sense.
>> 
>> In fact it does.
>> We have FPGAs that are memory mapped and others that are not. They 
>> must
>> be accessed by the same drivers. So the alternative would be to 
>> create
>> FPGA instances at address NULL and getting the register offesets by
>> casting pointers to u16. Not very nice either.
> 
> Your new code still boils down to using the same standard I/O
> accessors.
> 
> So your FPGA registers must be mapped somehow to I/O memory.
> 
> When you can do something like
> 
> +u16 fpga_get_reg(unsigned int fpga, u16 reg)
> +{
> +	return in_le16((u16 *)CONFIG_SYS_FPGA_BASE(fpga) + reg / 
> sizeof(u16));
> +}
> 
> why would you not be able to continue using in_le16() directly?
> 
> Sorry, I don't get it.

Read the source, Luke :)

On our iocon platform you find:

+void fpga_set_reg(unsigned int fpga, u16 reg, u16 data)
+{
+	int res;
+	struct ihs_fpga *fpga_0 = (struct ihs_fpga *)CONFIG_SYS_FPGA_BASE(0);
+
+	switch (fpga) {
+	case 0:
+		out_le16((u16 *)fpga_0 + reg / sizeof(u16), data);
+		break;
+	default:
+		res = mclink_send(fpga - 1, reg, data);
+		if (res < 0)
+			printf("mclink_send reg %02x data %04x returned %d\n",
+			       reg, data, res);
+		break;
+	}
+}

So no memory mapping here. That's the reason for all this fuzz.

And sorry for the messed up series. Sometimes rebase can make things 
worse :)

Cheers
Dirk

  reply	other threads:[~2013-05-06 15:55 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-06 13:35 [U-Boot] [PATCH v2 0/10] Update gdsys ppc4xx-based boards dirk.eibach at gdsys.cc
2013-05-06 13:35 ` [U-Boot] [PATCH v2 01/10] powerpc/ppc4xx: Add generic accessor functions for gdsys FPGA dirk.eibach at gdsys.cc
2013-05-06 14:01   ` Wolfgang Denk
2013-05-06 14:02   ` Wolfgang Denk
2013-05-06 13:35 ` [U-Boot] [PATCH v2 02/10] powerpc/ppc4xx: Add gdsys mclink interface dirk.eibach at gdsys.cc
2013-05-06 13:35 ` [U-Boot] [PATCH v2 03/10] powerpc/ppc4xx: Add fpgad command for dumping gdsys fpga registers dirk.eibach at gdsys.cc
2013-05-06 13:35 ` [U-Boot] [PATCH v2 04/10] powerpc/ppc4xx: Use generic FPGA accessors in gdsys common code dirk.eibach at gdsys.cc
2013-05-06 14:07   ` Wolfgang Denk
2013-05-06 14:57     ` Tom Rini
2013-05-06 15:02       ` Dirk Eibach
2013-05-06 15:09         ` Tom Rini
2013-05-06 15:51           ` Dirk Eibach
2013-05-06 13:35 ` [U-Boot] [PATCH v2 05/10] powerpc/ppc4xx: Support gdsys multichannel iocon hardware dirk.eibach at gdsys.cc
2013-05-06 14:12   ` Wolfgang Denk
2013-05-06 14:16     ` Dirk Eibach
2013-05-06 15:18       ` Wolfgang Denk
2013-05-06 15:49         ` Dirk Eibach
2013-05-06 19:15           ` Wolfgang Denk
2013-05-06 19:31             ` Joe Hershberger
2013-05-06 13:35 ` [U-Boot] [PATCH v2 06/10] powerpc/ppc4xx: Use generic FPGA accessors on all gdsys 405ep/ex boards dirk.eibach at gdsys.cc
2013-05-06 14:10   ` Wolfgang Denk
2013-05-06 14:50     ` Dirk Eibach
2013-05-06 15:22       ` Wolfgang Denk
2013-05-06 15:55         ` Dirk Eibach [this message]
2013-05-06 19:23           ` Wolfgang Denk
2013-05-07  8:32             ` Dirk Eibach
2013-05-07 11:36               ` Wolfgang Denk
2013-05-07 12:08                 ` Dirk Eibach
2013-05-07 19:18                   ` Wolfgang Denk
2013-05-07 20:45                     ` Dirk Eibach
2013-05-08 10:13                       ` Wolfgang Denk
2013-05-08 11:17                         ` Dirk Eibach
2013-05-08 15:37                           ` Wolfgang Denk
2013-05-15  9:23                         ` Dirk Eibach
2013-05-28  7:39                           ` Dirk Eibach
2013-05-28  7:47                           ` Dirk Eibach
2013-05-28 11:47                           ` Wolfgang Denk
2013-05-06 13:35 ` [U-Boot] [PATCH v2 07/10] powerpc/ppc4xx: Fixup phy erratum on gdsys iocon hardware dirk.eibach at gdsys.cc
2013-05-06 13:35 ` [U-Boot] [PATCH v2 08/10] powerpc/ppc4xx: Increase timeout for gdsys mclink bus startup dirk.eibach at gdsys.cc
2013-05-06 13:35 ` [U-Boot] [PATCH v2 09/10] powerpc/ppc4xx: Consider gdsys FPGA OSD size dirk.eibach at gdsys.cc
2013-05-06 13:35 ` [U-Boot] [PATCH v2 10/10] powerpc/ppc4xx: Remove CONFIG_SYS_FLASH_PROTECTION from gdsys boards dirk.eibach at gdsys.cc
2013-05-06 14:03 ` [U-Boot] [PATCH v2 0/10] Update gdsys ppc4xx-based boards Wolfgang Denk

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=449c45a6a9978c55e84d3fe7efe6f0ac@gdsys.cc \
    --to=dirk.eibach@gdsys.cc \
    --cc=u-boot@lists.denx.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