Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Markos Chandras <markos.chandras@imgtec.com>, linux-mips@linux-mips.org
Subject: Re: [PATCH 3/4] MIPS: cpu-probe: Set the write-combine CCA value on per core basis
Date: Mon, 04 Aug 2014 15:54:49 -0700	[thread overview]
Message-ID: <53E00F39.7@gmail.com> (raw)
In-Reply-To: <1405677093-22591-4-git-send-email-markos.chandras@imgtec.com>

Hi Markos,

On 07/18/2014 02:51 AM, Markos Chandras wrote:
> Different cores use different CCA values to achieve write-combine
> memory writes. For cores that do not support write-combine we
> set the default value to CCA:2 (uncached, non-coherent) which is the
> default value as set by the kernel.
> 
> Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
> ---
[snip]
			break;
> @@ -765,67 +767,83 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu)
>  
>  static inline void cpu_probe_mips(struct cpuinfo_mips *c, unsigned int cpu)
>  {
> +	c->writecombine = _CACHE_UNCACHED_ACCELERATED;

Why do we set this writecombine setting by default, when later we are
going to override writecombine on a per-cpu basic.

In the end, we have the following:

cpu_probe()
	c->writecombine = _CACHE_UNCACHED;

	cpu_probe_mips()
		c->writecombine = _CACHE_UNCACHED_ACCELERATED:
		... per-cpu case ...
		c->writecombine = _CACHE_UNCACHED;

Can't we just eliminate the various assignments in cpu_probe_mips() and
only override c->writecombine if _CACHE_UNCACHED is not suitable?


>  	switch (c->processor_id & PRID_IMP_MASK) {
>  	case PRID_IMP_4KC:
>  		c->cputype = CPU_4KC;
> +		c->writecombine = _CACHE_UNCACHED;
>  		__cpu_name[cpu] = "MIPS 4Kc";
>  		break;
>  	case PRID_IMP_4KEC:
>  	case PRID_IMP_4KECR2:
>  		c->cputype = CPU_4KEC;
> +		c->writecombine = _CACHE_UNCACHED;
>  		__cpu_name[cpu] = "MIPS 4KEc";
>  		break;
>  	case PRID_IMP_4KSC:
>  	case PRID_IMP_4KSD:
>  		c->cputype = CPU_4KSC;
> +		c->writecombine = _CACHE_UNCACHED;
>  		__cpu_name[cpu] = "MIPS 4KSc";
>  		break;
>  	case PRID_IMP_5KC:
>  		c->cputype = CPU_5KC;
> +		c->writecombine = _CACHE_UNCACHED;
>  		__cpu_name[cpu] = "MIPS 5Kc";
>  		break;
>  	case PRID_IMP_5KE:
>  		c->cputype = CPU_5KE;
> +		c->writecombine = _CACHE_UNCACHED;
>  		__cpu_name[cpu] = "MIPS 5KE";
>  		break;
>  	case PRID_IMP_20KC:
>  		c->cputype = CPU_20KC;
> +		c->writecombine = _CACHE_UNCACHED;
>  		__cpu_name[cpu] = "MIPS 20Kc";
>  		break;
>  	case PRID_IMP_24K:
>  		c->cputype = CPU_24K;
> +		c->writecombine = _CACHE_UNCACHED;
>  		__cpu_name[cpu] = "MIPS 24Kc";
>  		break;
>  	case PRID_IMP_24KE:
>  		c->cputype = CPU_24K;
> +		c->writecombine = _CACHE_UNCACHED;
>  		__cpu_name[cpu] = "MIPS 24KEc";
>  		break;
>  	case PRID_IMP_25KF:
>  		c->cputype = CPU_25KF;
> +		c->writecombine = _CACHE_UNCACHED;
>  		__cpu_name[cpu] = "MIPS 25Kc";
>  		break;
>  	case PRID_IMP_34K:
>  		c->cputype = CPU_34K;
> +		c->writecombine = _CACHE_UNCACHED;
>  		__cpu_name[cpu] = "MIPS 34Kc";
>  		break;
>  	case PRID_IMP_74K:
>  		c->cputype = CPU_74K;
> +		c->writecombine = _CACHE_UNCACHED;
>  		__cpu_name[cpu] = "MIPS 74Kc";
>  		break;
>  	case PRID_IMP_M14KC:
>  		c->cputype = CPU_M14KC;
> +		c->writecombine = _CACHE_UNCACHED;
>  		__cpu_name[cpu] = "MIPS M14Kc";
>  		break;
>  	case PRID_IMP_M14KEC:
>  		c->cputype = CPU_M14KEC;
> +		c->writecombine = _CACHE_UNCACHED;
>  		__cpu_name[cpu] = "MIPS M14KEc";
>  		break;
>  	case PRID_IMP_1004K:
>  		c->cputype = CPU_1004K;
> +		c->writecombine = _CACHE_UNCACHED;
>  		__cpu_name[cpu] = "MIPS 1004Kc";
>  		break;
>  	case PRID_IMP_1074K:
>  		c->cputype = CPU_1074K;
> +		c->writecombine = _CACHE_UNCACHED;
>  		__cpu_name[cpu] = "MIPS 1074Kc";
>  		break;
>  	case PRID_IMP_INTERAPTIV_UP:
> @@ -899,6 +917,7 @@ static inline void cpu_probe_sibyte(struct cpuinfo_mips *c, unsigned int cpu)
>  {
>  	decode_configs(c);
>  
> +	c->writecombine = _CACHE_UNCACHED_ACCELERATED;
>  	switch (c->processor_id & PRID_IMP_MASK) {
>  	case PRID_IMP_SB1:
>  		c->cputype = CPU_SB1;
> @@ -1030,6 +1049,7 @@ static inline void cpu_probe_ingenic(struct cpuinfo_mips *c, unsigned int cpu)
>  	switch (c->processor_id & PRID_IMP_MASK) {
>  	case PRID_IMP_JZRISC:
>  		c->cputype = CPU_JZRISC;
> +		c->writecombine = _CACHE_UNCACHED_ACCELERATED;
>  		__cpu_name[cpu] = "Ingenic JZRISC";
>  		break;
>  	default:
> @@ -1136,6 +1156,7 @@ void cpu_probe(void)
>  	c->processor_id = PRID_IMP_UNKNOWN;
>  	c->fpu_id	= FPIR_IMP_NONE;
>  	c->cputype	= CPU_UNKNOWN;
> +	c->writecombine = _CACHE_UNCACHED;



>  
>  	c->processor_id = read_c0_prid();
>  	switch (c->processor_id & PRID_COMP_MASK) {
> 

  parent reply	other threads:[~2014-08-04 22:55 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-18  9:51 [PATCH 0/4] Add pgprot_writecombine function for MIPS Markos Chandras
2014-07-18  9:51 ` Markos Chandras
2014-07-18  9:51 ` [PATCH 1/4] MIPS: pgtable-bits: Move the CCA bits out of the core's ifdef blocks Markos Chandras
2014-07-18  9:51   ` Markos Chandras
2014-07-18  9:51 ` [PATCH 2/4] MIPS: pgtable-bits: Define the CCA bit for WC writes on Ingenic cores Markos Chandras
2014-07-18  9:51   ` Markos Chandras
2014-07-18  9:51 ` [PATCH 3/4] MIPS: cpu-probe: Set the write-combine CCA value on per core basis Markos Chandras
2014-07-18  9:51   ` Markos Chandras
2014-08-04 22:54   ` Florian Fainelli [this message]
2014-08-12  7:23     ` Markos Chandras
2014-08-12  7:23       ` Markos Chandras
2014-08-12 18:02       ` Florian Fainelli
2014-07-18  9:51 ` [PATCH 4/4] MIPS: pgtable.h: Implement the pgprot_writecombine function for MIPS Markos Chandras
2014-07-18  9:51   ` Markos Chandras
2014-08-27 11:16 ` [PATCH 0/4] Add " Ralf Baechle

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=53E00F39.7@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=linux-mips@linux-mips.org \
    --cc=markos.chandras@imgtec.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