Re: [PATCH 1/4] edac, altera: Generalize driver to use DT Memory size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday 13 May 2015 16:49:44 tthayer@xxxxxxxxxxxxxxxxxxxxx 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-doc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux