[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2878194.MyPRW1b9ti@wuerfel>
Date: Fri, 15 May 2015 13:00:42 +0200
From: Arnd Bergmann <arnd@...db.de>
To: linux-arm-kernel@...ts.infradead.org
Cc: tthayer@...nsource.altera.com, bp@...en8.de,
dougthompson@...ssion.com, m.chehab@...sung.com,
robh+dt@...nel.org, pawel.moll@....com, mark.rutland@....com,
ijc+devicetree@...lion.org.uk, galak@...eaurora.org,
linux@....linux.org.uk, dinguyen@...nsource.altera.com,
grant.likely@...aro.org, devicetree@...r.kernel.org,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
tthayer.linux@...il.com, linux-edac@...r.kernel.org
Subject: Re: [PATCH 1/4] edac, altera: Generalize driver to use DT Memory size
On Wednesday 13 May 2015 16:49:44 tthayer@...nsource.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists