public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steffen Trumtrar <s.trumtrar@pengutronix.de>
To: Mark Rutland <mark.rutland@arm.com>
Cc: "tthayer@altera.com" <tthayer@altera.com>,
	"robherring2@gmail.com" <robherring2@gmail.com>,
	"dougthompson@xmission.com" <dougthompson@xmission.com>,
	"grant.likely@linaro.org" <grant.likely@linaro.org>,
	Pawel Moll <Pawel.Moll@arm.com>,
	"ijc+devicetree@hellion.org.uk" <ijc+devicetree@hellion.org.uk>,
	"galak@codeaurora.org" <galak@codeaurora.org>,
	"rob@landley.net" <rob@landley.net>,
	"linux@arm.linux.org.uk" <linux@arm.linux.org.uk>,
	"dinguyen@altera.com" <dinguyen@altera.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/3] edac: altera: Add SDRAM EDAC support for CycloneV/ArriaV
Date: Tue, 8 Apr 2014 14:45:41 +0200	[thread overview]
Message-ID: <20140408124541.GA16054@pengutronix.de> (raw)
In-Reply-To: <20140408104525.GA11876@e106331-lin.cambridge.arm.com>

On Tue, Apr 08, 2014 at 11:45:25AM +0100, Mark Rutland wrote:
> On Mon, Apr 07, 2014 at 10:54:09PM +0100, tthayer@altera.com wrote:
> > From: Thor Thayer <tthayer@altera.com>
> > 
> > Added EDAC support for reporting ECC errors of CycloneV
> > and ArriaV SDRAM controller.
> > - The SDRAM Controller registers are used by the FPGA bridge so
> >   these are accessed through the syscon interface.
> > - The configuration of the SDRAM memory size for the EDAC framework
> >   is discovered from the memory node of the device tree.
> > - Documentation of the bindings in devicetree/bindings/arm/altera/
> >   socfpga-sdram-edac.txt
> > - Correction of single bit errors, detection of double bit errors.
> > 
> > Signed-off-by: Thor Thayer <tthayer@altera.com>
> > To: Rob Herring <robherring2@gmail.com>
> > To: Doug Thompson <dougthompson@xmission.com>
> > To: Grant Likely <grant.likely@linaro.org>
> > Cc: Dinh Nguyen <dinguyen@altera.com>
> > Cc: devicetree@vger.kernel.org
> > Cc: linux-edac@vger.kernel.org
> > Cc: linux-kernel@vger.kernel.org
> > ---
> >  drivers/edac/Kconfig          |    9 ++
> >  drivers/edac/Makefile         |    2 +
> >  drivers/edac/altera_mc_edac.c |  360 +++++++++++++++++++++++++++++++++++++++++
> >  3 files changed, 371 insertions(+)
> >  create mode 100644 drivers/edac/altera_mc_edac.c
> 
> [...]
> 
> > +/* Get total memory size from Open Firmware DTB */
> > +static u32 altr_sdram_get_total_mem_size(void)
> > +{
> > +       struct device_node *np;
> > +       u32 retcode, reg_array[2];
> > +
> > +       np = of_find_node_by_type(NULL, "memory");
> > +       if (!np)
> > +               return 0;
> > +
> > +       retcode = of_property_read_u32_array(np, "reg",
> > +                                            reg_array, ARRAY_SIZE(reg_array));
> 
> There's no requirement that #address-cells = <1> or #size-cells = <1>,
> even if any values in either would fit into 32 bits. If we must read
> this from the DTB rather than elsewhere, please check
> of_n_{addr,size}_cells.
> 
> Additionally, it's possible that the physical memory might be described
> over multiple reg entries, or multiple memory nodes for some arbitrary
> reason.
> 
> Can we not get this info from elsewhere rather than having to parse the
> memory node within a driver?
> 

It should be possible to calculate this from the dramaddrw register in the
SDRAM controller.

Regards,
Steffen

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

  reply	other threads:[~2014-04-08 12:46 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1396907649-20212-1-git-send-email-tthayer@altera.com>
2014-04-07 21:54 ` [PATCH 1/3] dts: socfpga: Add bindings for Altera SoC SDRAM controller tthayer
2014-04-08 10:48   ` Mark Rutland
2014-04-08 13:38   ` Steffen Trumtrar
2014-04-08 14:29     ` Thor Thayer
2014-04-08 14:33       ` Steffen Trumtrar
2014-04-08 16:02         ` delicious quinoa
2014-04-08 18:52           ` Rob Herring
2014-04-11 14:21             ` Thor Thayer
2014-04-11 14:43             ` Thor Thayer
2014-04-11 14:49             ` Thor Thayer
2014-07-10 21:02             ` Alan Tull
2014-04-07 21:54 ` [PATCH 2/3] dts: socfpga: Add bindings for Altera SoC SDRAM EDAC tthayer
2014-04-08 10:51   ` Mark Rutland
2014-04-07 21:54 ` [PATCH 3/3] edac: altera: Add SDRAM EDAC support for CycloneV/ArriaV tthayer
2014-04-08 10:08   ` Borislav Petkov
2014-04-08 13:57     ` Thor Thayer
2014-04-08 15:24       ` Borislav Petkov
2014-04-08 15:40         ` Mark Rutland
2014-04-08 16:03           ` Borislav Petkov
2014-04-08 16:10             ` Mark Rutland
2014-04-08 16:22               ` Borislav Petkov
2014-04-08 21:15                 ` Thor Thayer
2014-04-08 10:45   ` Mark Rutland
2014-04-08 12:45     ` Steffen Trumtrar [this message]
2014-04-08 14:00       ` Thor Thayer

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=20140408124541.GA16054@pengutronix.de \
    --to=s.trumtrar@pengutronix.de \
    --cc=Pawel.Moll@arm.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dinguyen@altera.com \
    --cc=dougthompson@xmission.com \
    --cc=galak@codeaurora.org \
    --cc=grant.likely@linaro.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=rob@landley.net \
    --cc=robherring2@gmail.com \
    --cc=tthayer@altera.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