Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: David Daney <ddaney@caviumnetworks.com>
To: James Hogan <james.hogan@imgtec.com>
Cc: Andreas Herrmann <andreas.herrmann@caviumnetworks.com>,
	<linux-mips@linux-mips.org>, David Daney <ddaney.cavm@gmail.com>,
	"Ralf Baechle" <ralf@linux-mips.org>, <kvm@vger.kernel.org>,
	David Daney <david.daney@cavium.com>
Subject: Re: [PATCH 06/15] MIPS: Add minimal support for OCTEON3 to c-r4k.c
Date: Wed, 21 May 2014 09:10:39 -0700	[thread overview]
Message-ID: <537CCFFF.2080707@caviumnetworks.com> (raw)
In-Reply-To: <537C7A12.7020606@imgtec.com>

On 05/21/2014 03:04 AM, James Hogan wrote:
> On 20/05/14 15:47, Andreas Herrmann wrote:
>> From: David Daney <david.daney@cavium.com>
>>
>> These are needed to boot a generic mips64r2 kernel on OCTEONIII.
>>
>> Signed-off-by: David Daney <david.daney@cavium.com>
>> Signed-off-by: Andreas Herrmann <andreas.herrmann@caviumnetworks.com>
>> ---
>>   arch/mips/include/asm/r4kcache.h |    2 ++
>>   arch/mips/mm/c-r4k.c             |   32 ++++++++++++++++++++++++++++++++
>>   2 files changed, 34 insertions(+)
>
>> diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c
>> index 1c74a6a..789ede9 100644
>> --- a/arch/mips/mm/c-r4k.c
>> +++ b/arch/mips/mm/c-r4k.c
>
>> @@ -1094,6 +1110,21 @@ static void probe_pcache(void)
>>   		c->dcache.waybit = 0;
>>   		break;
>>
>> +	case CPU_CAVIUM_OCTEON3:
>> +		/* For now lie about the number of ways. */
>
> Is this to work around the finite length of way_string[]?
>
> Can we fix that to be more dynamic instead? (admittedly special casing
> "direct mapped" looks like a bit of a pain).

The OCTEON ICache is a weird size that is not (and I think cannot be) 
represented by the CP0_Config* bits.  However, it doesn't matter, as any 
operation that attempts to invalidate any part of it, operates on the 
entire cache, so everything works out in the end.

The DCache is fully coherent, so any invalidate/flush operations are 
redundant.

So for both of these, we just need to supply values that are both 
plausible, and don't result in panics and/or OOPS messages being printed.


>
> Cheers
> James
>
>> +		c->icache.linesz = 128;
>> +		c->icache.sets = 16;
>> +		c->icache.ways = 8;
>> +		c->icache.flags |= MIPS_CACHE_VTAG;
>> +		icache_size = c->icache.sets * c->icache.ways * c->icache.linesz;
>> +
>> +		c->dcache.linesz = 128;
>> +		c->dcache.ways = 8;
>> +		c->dcache.sets = 8;
>> +		dcache_size = c->dcache.sets * c->dcache.ways * c->dcache.linesz;
>> +		c->options |= MIPS_CPU_PREFETCH;
>> +		break;
>> +

WARNING: multiple messages have this Message-ID (diff)
From: David Daney <ddaney@caviumnetworks.com>
To: James Hogan <james.hogan@imgtec.com>
Cc: Andreas Herrmann <andreas.herrmann@caviumnetworks.com>,
	linux-mips@linux-mips.org, David Daney <ddaney.cavm@gmail.com>,
	Ralf Baechle <ralf@linux-mips.org>,
	kvm@vger.kernel.org, David Daney <david.daney@cavium.com>
Subject: Re: [PATCH 06/15] MIPS: Add minimal support for OCTEON3 to c-r4k.c
Date: Wed, 21 May 2014 09:10:39 -0700	[thread overview]
Message-ID: <537CCFFF.2080707@caviumnetworks.com> (raw)
Message-ID: <20140521161039.o90Z6mV8oSAKECXNWYqk8H6JAoWJX15f8FCleztTbpI@z> (raw)
In-Reply-To: <537C7A12.7020606@imgtec.com>

On 05/21/2014 03:04 AM, James Hogan wrote:
> On 20/05/14 15:47, Andreas Herrmann wrote:
>> From: David Daney <david.daney@cavium.com>
>>
>> These are needed to boot a generic mips64r2 kernel on OCTEONIII.
>>
>> Signed-off-by: David Daney <david.daney@cavium.com>
>> Signed-off-by: Andreas Herrmann <andreas.herrmann@caviumnetworks.com>
>> ---
>>   arch/mips/include/asm/r4kcache.h |    2 ++
>>   arch/mips/mm/c-r4k.c             |   32 ++++++++++++++++++++++++++++++++
>>   2 files changed, 34 insertions(+)
>
>> diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c
>> index 1c74a6a..789ede9 100644
>> --- a/arch/mips/mm/c-r4k.c
>> +++ b/arch/mips/mm/c-r4k.c
>
>> @@ -1094,6 +1110,21 @@ static void probe_pcache(void)
>>   		c->dcache.waybit = 0;
>>   		break;
>>
>> +	case CPU_CAVIUM_OCTEON3:
>> +		/* For now lie about the number of ways. */
>
> Is this to work around the finite length of way_string[]?
>
> Can we fix that to be more dynamic instead? (admittedly special casing
> "direct mapped" looks like a bit of a pain).

The OCTEON ICache is a weird size that is not (and I think cannot be) 
represented by the CP0_Config* bits.  However, it doesn't matter, as any 
operation that attempts to invalidate any part of it, operates on the 
entire cache, so everything works out in the end.

The DCache is fully coherent, so any invalidate/flush operations are 
redundant.

So for both of these, we just need to supply values that are both 
plausible, and don't result in panics and/or OOPS messages being printed.


>
> Cheers
> James
>
>> +		c->icache.linesz = 128;
>> +		c->icache.sets = 16;
>> +		c->icache.ways = 8;
>> +		c->icache.flags |= MIPS_CACHE_VTAG;
>> +		icache_size = c->icache.sets * c->icache.ways * c->icache.linesz;
>> +
>> +		c->dcache.linesz = 128;
>> +		c->dcache.ways = 8;
>> +		c->dcache.sets = 8;
>> +		dcache_size = c->dcache.sets * c->dcache.ways * c->dcache.linesz;
>> +		c->options |= MIPS_CPU_PREFETCH;
>> +		break;
>> +

  parent reply	other threads:[~2014-05-21 16:10 UTC|newest]

Thread overview: 90+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-20 14:47 [PATCH 00/15] MIPS: Add mips_paravirt Andreas Herrmann
2014-05-20 14:47 ` Andreas Herrmann
2014-05-20 14:47 ` [PATCH 01/15] MIPS: OCTEON: Enable use of FPU Andreas Herrmann
2014-05-20 14:47   ` Andreas Herrmann
2014-05-20 14:47 ` [PATCH 02/15] MIPS: Move system level config items from CPU_CAVIUM_OCTEON to CAVIUM_OCTEON_SOC Andreas Herrmann
2014-05-20 14:47   ` Andreas Herrmann
2014-05-20 14:47 ` [PATCH 03/15] MIPS: OCTEON: Move CAVIUM_OCTEON_CVMSEG_SIZE to CPU_CAVIUM_OCTEON Andreas Herrmann
2014-05-20 14:47   ` Andreas Herrmann
2014-05-20 22:52   ` James Hogan
2014-05-20 23:23     ` David Daney
2014-05-20 23:23       ` David Daney
2014-05-21  6:22       ` Andreas Herrmann
2014-05-21  6:22         ` Andreas Herrmann
2014-05-20 14:47 ` [PATCH 04/15] MIPS: Don't use RI/XI with 32-bit kernels on 64-bit CPUs Andreas Herrmann
2014-05-20 14:47   ` Andreas Herrmann
2014-05-20 14:47 ` [PATCH 05/15] MIPS: Don't build fast TLB refill handler with 32-bit kernels Andreas Herrmann
2014-05-20 14:47   ` Andreas Herrmann
2014-05-21  9:38   ` James Hogan
2014-05-21  9:38     ` James Hogan
2014-05-21 13:04     ` Ralf Baechle
2014-05-21 13:17       ` Andreas Herrmann
2014-05-21 13:17         ` Andreas Herrmann
2014-05-20 14:47 ` [PATCH 06/15] MIPS: Add minimal support for OCTEON3 to c-r4k.c Andreas Herrmann
2014-05-20 14:47   ` Andreas Herrmann
2014-05-21 10:04   ` James Hogan
2014-05-21 10:04     ` James Hogan
2014-05-21 16:10     ` David Daney [this message]
2014-05-21 16:10       ` David Daney
2014-05-21 12:40   ` Ralf Baechle
2014-05-21 21:02     ` Andreas Herrmann
2014-05-21 21:02       ` Andreas Herrmann
2014-05-22  7:59       ` Ralf Baechle
2014-05-20 14:47 ` [PATCH 07/15] MIPS: Add mips_cpunum() function Andreas Herrmann
2014-05-20 14:47   ` Andreas Herrmann
2014-05-21 11:10   ` James Hogan
2014-05-21 11:10     ` James Hogan
2014-05-22 16:13     ` Andreas Herrmann
2014-05-22 16:13       ` Andreas Herrmann
2014-05-22 16:15       ` James Hogan
2014-05-22 16:15         ` James Hogan
2014-05-20 14:47 ` [PATCH 08/15] MIPS: OCTEON: Add OCTEON3 to __get_cpu_type Andreas Herrmann
2014-05-20 14:47   ` Andreas Herrmann
2014-05-20 14:47 ` [PATCH 09/15] MIPS: Add functions for hypervisor call Andreas Herrmann
2014-05-20 14:47   ` Andreas Herrmann
2014-05-21  0:16   ` James Hogan
2014-05-21  7:30     ` Andreas Herrmann
2014-05-21  7:30       ` Andreas Herrmann
2014-05-20 14:47 ` [PATCH 10/15] MIPS: Add code for new system 'paravirt' Andreas Herrmann
2014-05-20 14:47   ` Andreas Herrmann
2014-05-21 13:39   ` James Hogan
2014-05-21 13:39     ` James Hogan
2014-05-21 16:31     ` David Daney
2014-05-21 16:31       ` David Daney
2014-05-21 16:46       ` James Hogan
2014-05-21 16:46         ` James Hogan
2014-05-23 20:31       ` Andreas Herrmann
2014-05-23 20:31         ` Andreas Herrmann
2014-05-22 16:54     ` Andreas Herrmann
2014-05-22 16:54       ` Andreas Herrmann
2014-05-23 20:28     ` Andreas Herrmann
2014-05-23 20:28       ` Andreas Herrmann
2014-05-23 21:47       ` Ralf Baechle
2014-05-20 14:47 ` [PATCH 11/15] MIPS: paravirt: Add pci controller for virtio Andreas Herrmann
2014-05-20 14:47   ` Andreas Herrmann
2014-05-21 11:42   ` James Hogan
2014-05-21 11:42     ` James Hogan
2014-05-22 20:17     ` Andreas Herrmann
2014-05-22 20:17       ` Andreas Herrmann
2014-05-28 22:10       ` Andreas Herrmann
2014-05-28 22:10         ` Andreas Herrmann
2014-05-21 13:34   ` Ralf Baechle
2014-05-20 14:47 ` [PATCH 12/15] MIPS: Enable build for new system 'paravirt' Andreas Herrmann
2014-05-20 14:47   ` Andreas Herrmann
2014-05-20 14:47 ` [PATCH 13/15] MIPS: Add defconfig for mips_paravirt Andreas Herrmann
2014-05-20 14:47   ` Andreas Herrmann
2014-05-20 23:14   ` James Hogan
2014-05-21  6:29     ` Andreas Herrmann
2014-05-21  6:29       ` Andreas Herrmann
2014-05-20 14:47 ` [PATCH 14/15] MIPS: paravirt: Update mips_paravirt_defconfig Andreas Herrmann
2014-05-20 14:47   ` Andreas Herrmann
2014-05-20 23:17   ` James Hogan
2014-05-21  6:36     ` Andreas Herrmann
2014-05-21  6:36       ` Andreas Herrmann
2014-05-20 14:47 ` [PATCH 15/15] MIPS: paravirt: Provide _machine_halt function to exit VM on shutdown of guest Andreas Herrmann
2014-05-20 14:47   ` Andreas Herrmann
2014-05-21 13:44   ` James Hogan
2014-05-21 13:44     ` James Hogan
2014-05-28 22:04     ` Andreas Herrmann
2014-05-28 22:04       ` Andreas Herrmann
2014-05-28 23:18       ` James Hogan

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=537CCFFF.2080707@caviumnetworks.com \
    --to=ddaney@caviumnetworks.com \
    --cc=andreas.herrmann@caviumnetworks.com \
    --cc=david.daney@cavium.com \
    --cc=ddaney.cavm@gmail.com \
    --cc=james.hogan@imgtec.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    /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