All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: Huacai Chen <chenhc@lemote.com>
Cc: John Crispin <john@phrozen.org>,
	"Steven J. Hill" <Steven.Hill@imgtec.com>,
	Aurelien Jarno <aurelien@aurel32.net>,
	linux-mips@linux-mips.org, Fuxin Zhang <zhangfx@lemote.com>,
	Zhangjin Wu <wuzhangjin@gmail.com>,
	Hongliang Tao <taohl@lemote.com>, Hua Yan <yanh@lemote.com>
Subject: Re: [PATCH V19 02/13] MIPS: Loongson: Add basic Loongson-3 definition
Date: Tue, 18 Mar 2014 15:04:27 +0100	[thread overview]
Message-ID: <20140318140427.GC17197@linux-mips.org> (raw)
In-Reply-To: <1392537690-5961-3-git-send-email-chenhc@lemote.com>

On Sun, Feb 16, 2014 at 04:01:19PM +0800, Huacai Chen wrote:

> diff --git a/arch/mips/include/asm/addrspace.h b/arch/mips/include/asm/addrspace.h
> index 3f74545..41c030e 100644
> --- a/arch/mips/include/asm/addrspace.h
> +++ b/arch/mips/include/asm/addrspace.h
> @@ -116,7 +116,9 @@
>  #define K_CALG_UNCACHED		2
>  #define K_CALG_NONCOHERENT	3
>  #define K_CALG_COH_EXCL		4
> +#ifndef K_CALG_COH_SHAREABLE
>  #define K_CALG_COH_SHAREABLE	5
> +#endif

It seems this segment isn't even necessary - can we just drop it?

Octeon also uses cache mode 3 for coherent.

Just to avoid yet another ifdef.

>  #define K_CALG_NOTUSED		6
>  #define K_CALG_UNCACHED_ACCEL	7
>  
> diff --git a/arch/mips/include/asm/cpu.h b/arch/mips/include/asm/cpu.h
> index e195de5..35a4e18 100644
> --- a/arch/mips/include/asm/cpu.h
> +++ b/arch/mips/include/asm/cpu.h
> @@ -230,6 +230,7 @@
>  #define PRID_REV_LOONGSON1B	0x0020
>  #define PRID_REV_LOONGSON2E	0x0002
>  #define PRID_REV_LOONGSON2F	0x0003
> +#define PRID_REV_LOONGSON3A	0x0005
>  
>  /*
>   * Older processors used to encode processor version and revision in two
> @@ -303,8 +304,8 @@ enum cpu_type_enum {
>  	 * MIPS64 class processors
>  	 */
>  	CPU_5KC, CPU_5KE, CPU_20KC, CPU_25KF, CPU_SB1, CPU_SB1A, CPU_LOONGSON2,
> -	CPU_CAVIUM_OCTEON, CPU_CAVIUM_OCTEON_PLUS, CPU_CAVIUM_OCTEON2,
> -	CPU_CAVIUM_OCTEON3, CPU_XLR, CPU_XLP,
> +	CPU_LOONGSON3, CPU_CAVIUM_OCTEON, CPU_CAVIUM_OCTEON_PLUS,
> +	CPU_CAVIUM_OCTEON2, CPU_CAVIUM_OCTEON3, CPU_XLR, CPU_XLP,
>  
>  	CPU_LAST
>  };
> diff --git a/arch/mips/include/asm/mach-loongson/spaces.h b/arch/mips/include/asm/mach-loongson/spaces.h
> new file mode 100644
> index 0000000..d368d95
> --- /dev/null
> +++ b/arch/mips/include/asm/mach-loongson/spaces.h
> @@ -0,0 +1,13 @@
> +#ifndef __ASM_MACH_LOONGSON_SPACES_H_
> +#define __ASM_MACH_LOONGSON_SPACES_H_
> +
> +#ifndef CAC_BASE

This file should only be included from the top of <asm/addrspace.h> where
CAC_BASE should not be defined yet.

> +#if defined(CONFIG_64BIT)
> +#define CAC_BASE        _AC(0x9800000000000000, UL)
> +#endif /* CONFIG_64BIT */
> +#endif /* CONFIG_CAC_BASE */

The Symbol in this comment doesn't match the symbol used in the opening #ifndef.

> +
> +#define K_CALG_COH_SHAREABLE	3
> +
> +#include <asm/mach-generic/spaces.h>
> +#endif
> diff --git a/arch/mips/include/asm/module.h b/arch/mips/include/asm/module.h
> index 44b705d..c2edae3 100644
> --- a/arch/mips/include/asm/module.h
> +++ b/arch/mips/include/asm/module.h
> @@ -126,6 +126,8 @@ search_module_dbetables(unsigned long addr)
>  #define MODULE_PROC_FAMILY "LOONGSON1 "
>  #elif defined CONFIG_CPU_LOONGSON2
>  #define MODULE_PROC_FAMILY "LOONGSON2 "
> +#elif defined CONFIG_CPU_LOONGSON3
> +#define MODULE_PROC_FAMILY "LOONGSON3 "
>  #elif defined CONFIG_CPU_CAVIUM_OCTEON
>  #define MODULE_PROC_FAMILY "OCTEON "
>  #elif defined CONFIG_CPU_XLR
> diff --git a/arch/mips/include/asm/pgtable-bits.h b/arch/mips/include/asm/pgtable-bits.h
> index 32aea48..e592f36 100644
> --- a/arch/mips/include/asm/pgtable-bits.h
> +++ b/arch/mips/include/asm/pgtable-bits.h
> @@ -235,6 +235,15 @@ static inline uint64_t pte_to_entrylo(unsigned long pte_val)
>  #define _CACHE_CACHABLE_NONCOHERENT (5<<_CACHE_SHIFT)
>  #define _CACHE_UNCACHED_ACCELERATED (7<<_CACHE_SHIFT)
>  
> +#elif defined(CONFIG_CPU_LOONGSON3)
> +
> +/* Using COHERENT flag for NONCOHERENT doesn't hurt. */
> +
> +#define _CACHE_UNCACHED             (2<<_CACHE_SHIFT)  /* LOONGSON       */
> +#define _CACHE_CACHABLE_NONCOHERENT (3<<_CACHE_SHIFT)  /* LOONGSON       */
> +#define _CACHE_CACHABLE_COHERENT    (3<<_CACHE_SHIFT)  /* LOONGSON-3     */
> +#define _CACHE_UNCACHED_ACCELERATED (7<<_CACHE_SHIFT)  /* LOONGSON       */
> +
>  #else

Ok.

Yes, it adds another #ifdef but cleaning up this should not be subject of
this patch.

  Ralf

  reply	other threads:[~2014-03-18 14:04 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-16  8:01 [PATCH V19 00/13] MIPS: Add Loongson-3 based machines support Huacai Chen
2014-02-16  8:01 ` [PATCH V19 01/13] MIPS: Loongson: Rename PRID_IMP_LOONGSON1 and PRID_IMP_LOONGSON2 Huacai Chen
2014-03-18 12:13   ` Ralf Baechle
2014-02-16  8:01 ` [PATCH V19 02/13] MIPS: Loongson: Add basic Loongson-3 definition Huacai Chen
2014-03-18 14:04   ` Ralf Baechle [this message]
2014-03-19  1:14     ` "陈华才"
2014-02-16  8:01 ` [PATCH V19 03/13] MIPS: Loongson: Add basic Loongson-3 CPU support Huacai Chen
2014-03-18 14:05   ` Ralf Baechle
2014-02-16  8:01 ` [PATCH V19 04/13] MIPS: Loongson 3: Add Lemote-3A machtypes definition Huacai Chen
2014-02-16  8:01 ` [PATCH V19 05/13] MIPS: Loongson: Add UEFI-like firmware interface (LEFI) support Huacai Chen
2014-02-16 21:12   ` Aurelien Jarno
2014-02-17  5:15     ` "陈华才"
2014-02-16  8:01 ` [PATCH V19 06/13] MIPS: Loongson 3: Add HT-linked PCI support Huacai Chen
2014-02-16  8:01 ` [PATCH V19 07/13] MIPS: Loongson 3: Add IRQ init and dispatch support Huacai Chen
2014-03-18 14:59   ` Ralf Baechle
2014-03-19  3:05     ` "陈华才"
2014-03-19 16:49       ` Ralf Baechle
2014-02-16  8:01 ` [PATCH V19 08/13] MIPS: Loongson 3: Add serial port support Huacai Chen
2014-02-16  8:01 ` [PATCH V19 09/13] MIPS: Loongson: Add swiotlb to support All-Memory DMA Huacai Chen
2014-02-16 21:12   ` Aurelien Jarno
2014-02-17  5:41     ` "陈华才"
2014-02-19 21:39       ` Aurelien Jarno
2014-02-20  1:00         ` "陈华才"
2014-02-16  8:01 ` [PATCH V19 10/13] MIPS: Loongson: Add Loongson-3 Kconfig options Huacai Chen
2014-02-16  8:01 ` [PATCH V19 11/13] MIPS: Loongson 3: Add Loongson-3 SMP support Huacai Chen
2014-03-18 15:52   ` Ralf Baechle
2014-02-16  8:01 ` [PATCH V19 12/13] MIPS: Loongson 3: Add CPU hotplug support Huacai Chen
2014-03-18 17:20   ` Ralf Baechle
2014-02-16  8:01 ` [PATCH V19 13/13] MIPS: Loongson: Add a Loongson-3 default config file Huacai Chen
2014-02-16 22:26 ` [PATCH V19 00/13] MIPS: Add Loongson-3 based machines support Andreas Barth
2014-03-06 10:30 ` Andreas Barth
2014-03-06 13:22   ` Huacai Chen
     [not found]   ` <532076A7.1040606@phrozen.org>
2014-03-12 23:31     ` Andreas Barth
2014-03-12 17:21 ` Aurelien Jarno

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=20140318140427.GC17197@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=Steven.Hill@imgtec.com \
    --cc=aurelien@aurel32.net \
    --cc=chenhc@lemote.com \
    --cc=john@phrozen.org \
    --cc=linux-mips@linux-mips.org \
    --cc=taohl@lemote.com \
    --cc=wuzhangjin@gmail.com \
    --cc=yanh@lemote.com \
    --cc=zhangfx@lemote.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.