From: Arnd Bergmann <arnd@arndb.de>
To: linux-arm-kernel@lists.infradead.org
Cc: tthayer@opensource.altera.com, bp@alien8.de,
dougthompson@xmission.com, m.chehab@samsung.com,
robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com,
ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
linux@arm.linux.org.uk, dinguyen@opensource.altera.com,
grant.likely@linaro.org, devicetree@vger.kernel.org,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
tthayer.linux@gmail.com, linux-edac@vger.kernel.org
Subject: Re: [PATCH 1/4] edac, altera: Generalize driver to use DT Memory size
Date: Fri, 15 May 2015 13:00:42 +0200 [thread overview]
Message-ID: <2878194.MyPRW1b9ti@wuerfel> (raw)
In-Reply-To: <1431553787-27741-2-git-send-email-tthayer@opensource.altera.com>
On Wednesday 13 May 2015 16:49:44 tthayer@opensource.altera.com wrote:
> -static u32 altr_sdram_get_total_mem_size(struct regmap *mc_vbase)
> +/* Get total memory size from Open Firmware DTB */
> +static unsigned long get_total_mem(void)
> {
> - u32 size, read_reg, row, bank, col, cs, width;
> + struct device_node *np = NULL;
> + const unsigned int *reg, *reg_end;
> + int len, sw, aw;
> + unsigned long start, size, total_mem;
>
> - if (regmap_read(mc_vbase, DRAMADDRW_OFST, &read_reg) < 0)
> + np = of_find_node_by_type(NULL, "memory");
> + if (!np)
> return 0;
There can be multiple memory nodes, I think you need to have a loop
using for_each_node_by_type.
Arnd
next prev parent reply other threads:[~2015-05-15 11:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-13 21:49 [PATCH 0/4] Add Altera Arria10 EDAC Support tthayer
2015-05-13 21:49 ` [PATCH 1/4] edac, altera: Generalize driver to use DT Memory size tthayer
2015-05-14 3:25 ` Dinh Nguyen
2015-05-15 11:00 ` Arnd Bergmann [this message]
2015-05-13 21:49 ` [PATCH 2/4] edac, altera: Refactor EDAC for Altera CycloneV SoC tthayer
2015-05-14 20:13 ` Dinh Nguyen
2015-05-13 21:49 ` [PATCH 3/4] edac, altera: Addition of Arria10 EDAC tthayer
2015-05-14 20:20 ` Dinh Nguyen
2015-05-14 20:38 ` Thor Thayer
2015-05-15 10:57 ` Arnd Bergmann
2015-05-13 21:49 ` [PATCH 4/4] dts, altera: Arria10 SDRAM EDAC DTS additions tthayer
2015-05-15 10:55 ` Arnd Bergmann
2015-05-15 21:01 ` 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=2878194.MyPRW1b9ti@wuerfel \
--to=arnd@arndb.de \
--cc=bp@alien8.de \
--cc=devicetree@vger.kernel.org \
--cc=dinguyen@opensource.altera.com \
--cc=dougthompson@xmission.com \
--cc=galak@codeaurora.org \
--cc=grant.likely@linaro.org \
--cc=ijc+devicetree@hellion.org.uk \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=m.chehab@samsung.com \
--cc=mark.rutland@arm.com \
--cc=pawel.moll@arm.com \
--cc=robh+dt@kernel.org \
--cc=tthayer.linux@gmail.com \
--cc=tthayer@opensource.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;
as well as URLs for NNTP newsgroup(s).