lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 16 Jan 2015 11:26:51 +0100
From:	Alexandre Belloni <alexandre.belloni@...e-electrons.com>
To:	"Yang, Wenyou" <Wenyou.Yang@...el.com>
Cc:	"Ferre, Nicolas" <Nicolas.FERRE@...el.com>,
	Boris Brezillon <boris.brezillon@...e-electrons.com>,
	Arnd Bergmann <arnd@...db.de>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Jean-Christophe Plagniol-Villard <plagnioj@...osoft.com>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH v2 1/8] ARM: at91: pm: rework cpu detection

Hi,

On 16/01/2015 at 02:44:39 +0000, Yang, Wenyou wrote :
> > -	/* AT91RM9200 SDRAM low-power mode cannot be used with self-refresh.
> > */
> > -	if (cpu_is_at91rm9200())
> > +	at91_pm_data.memctrl = AT91_MEMCTRL_SDRAMC;
> > +
> > +	if (of_machine_is_compatible("atmel,at91rm9200")) {
> > +		/*
> > +		 * AT91RM9200 SDRAM low-power mode cannot be used with
> > +		 * self-refresh.
> > +		 */
> >  		at91_ramc_write(0, AT91RM9200_SDRAMC_LPR, 0);
> > -
> > +
> > +		at91_pm_data.uhp_udp_mask = AT91RM9200_PMC_UHP |
> > +					    AT91RM9200_PMC_UDP;
> > +		at91_pm_data.memctrl = AT91_MEMCTRL_MC;
> > +	} else if (of_machine_is_compatible("atmel,at91sam9260") ||
> > +		   of_machine_is_compatible("atmel,at91sam9g20") ||
> > +		   of_machine_is_compatible("atmel,at91sam9261") ||
> > +		   of_machine_is_compatible("atmel,at91sam9g10") ||
> > +		   of_machine_is_compatible("atmel,at91sam9263")) {
> > +		at91_pm_data.uhp_udp_mask = AT91SAM926x_PMC_UHP |
> > +					    AT91SAM926x_PMC_UDP;
> > +	} else if (of_machine_is_compatible("atmel,at91sam9g45")) {
> > +		at91_pm_data.memctrl = AT91_MEMCTRL_DDRSDR;
> > +	}
> > +
> About the memory controller type, I prefer to get it during the memory controller initialization, from the sram_ids[].data which defined in the setup.c,
> As this,
> static const struct at91_ramc_of_data at91rm9200_ramc_of_data = {
> 	.ramc_type = AT91_MEMCTRL_MC,
> };
> ...
> static struct of_device_id ramc_ids[] = {
> 	{ .compatible = "atmel,at91rm9200-sdramc", .data = &at91rm9200_ramc_of_data},
> 	... ...
> 	{ /*sentinel*/ }
> };
> 
> What about you? 

Yes, we agreed that using of_machine_is_compatible is not nice and that
is why I remove that usage in patch 4.

We still have to fill the uhp_udp_mask and that would mean adding a
match on the pmc compatible string. I would prefer not doing that. Or
maybe we can just remove the check, I don't think it it necessary
anymore.

At some point in time, I would like to be able to get rid of the
ramc_ids in mach-at91 but I'm not sure how yet.

Maybe we can do what you suggest after
http://lists.infradead.org/pipermail/linux-arm-kernel/2015-January/316771.html
Because then, the ram detection is local to pm.c


-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ