Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
To: sjhill@mips.com
Cc: linux-mips@linux-mips.org, ralf@linux-mips.org, douglas@mips.com,
	chris@mips.com
Subject: Re: [PATCH 01/10] MIPS: Add core files for MIPS SEAD-3 development platform.
Date: Tue, 10 Apr 2012 10:03:04 +0900	[thread overview]
Message-ID: <4F8386C8.9020401@renesas.com> (raw)
In-Reply-To: <1333817315-30091-2-git-send-email-sjhill@mips.com>

Hello,

On 4/8/2012 1:48 AM, Steven J. Hill wrote:
> diff --git a/arch/mips/include/asm/mach-sead3/cpu-feature-overrides.h b/arch/mips/include/asm/mach-sead3/cpu-feature-overrides.h
> new file mode 100644
> index 0000000..7f3e3f9
> --- /dev/null
> +++ b/arch/mips/include/asm/mach-sead3/cpu-feature-overrides.h
> @@ -0,0 +1,72 @@
[...]
> +/*
> + * CPU feature overrides for MIPS boards
> + */
> +#ifdef CONFIG_CPU_MIPS32
> +#define cpu_has_tlb		1
> +#define cpu_has_4kex		1
> +#define cpu_has_4k_cache	1
> +/* #define cpu_has_fpu		? */
> +/* #define cpu_has_32fpr	? */
> +#define cpu_has_counter		1
> +/* #define cpu_has_watch	? */
> +#define cpu_has_divec		1
> +#define cpu_has_vce		0
> +/* #define cpu_has_cache_cdex_p	? */
> +/* #define cpu_has_cache_cdex_s	? */
> +/* #define cpu_has_prefetch	? */
> +#define cpu_has_mcheck		1
> +/* #define cpu_has_ejtag	? */
> +#ifdef CONFIG_CPU_HAS_LLSC
> +#define cpu_has_llsc		1
> +#else
> +#define cpu_has_llsc		0
> +#endif

This Ralf's commit maybe be still valid for sead3 board?

http://git.kernel.org/linus/b8d6f78cd058e34ec706f7cb353fdb2eb743c050
MIPS: Malta: Remove pointless use use of CONFIG_CPU_HAS_LLSC

> +/* #define cpu_has_vtag_icache	? */
> +/* #define cpu_has_dc_aliases	? */
> +/* #define cpu_has_ic_fills_f_dc ? */
> +#define cpu_has_nofpuex		0
> +/* #define cpu_has_64bits	? */
> +/* #define cpu_has_64bit_zero_reg ? */
> +/* #define cpu_has_inclusive_pcaches ? */
> +#define cpu_icache_snoops_remote_store 1
> +#endif

Also you might be interested in fls/ffs optimization using CLO/CLZ
instruction, that will be used in irq_ffs() at plat_irq_dispatch:

https://patchwork.linux-mips.org/patch/1453/
MIPS: Enable cpu_has_clo_clz for MIPS Technologies' platforms

Some discussions on this is found at:
http://www.linux-mips.org/archives/linux-mips/2010-07/msg00000.html

> diff --git a/arch/mips/mti-sead3/sead3-int.c b/arch/mips/mti-sead3/sead3-int.c
> new file mode 100644
> index 0000000..4cd569e
> --- /dev/null
> +++ b/arch/mips/mti-sead3/sead3-int.c
> @@ -0,0 +1,146 @@
[...]
> +/*
> + * Version of ffs that only looks at bits 8..15
> + */
> +static inline unsigned int irq_ffs(unsigned int pending)
> +{
> +#if defined(CONFIG_CPU_MIPS32) || defined(CONFIG_CPU_MIPS64)
> +	return fls(pending) - CAUSEB_IP - 1;
> +#else
> +	unsigned int a0 = 7;
> +	unsigned int t0;
> +
> +	t0 = pending & 0xf000;
> +	t0 = t0 < 1;
> +	t0 = t0 << 2;
> +	a0 = a0 - t0;
> +	pending = pending << t0;
> +
> +	t0 = pending & 0xc000;
> +	t0 = t0 < 1;
> +	t0 = t0 << 1;
> +	a0 = a0 - t0;
> +	pending = pending << t0;
> +
> +	t0 = pending & 0x8000;
> +	t0 = t0 < 1;
> +	/* t0 = t0 << 2; */
> +	a0 = a0 - t0;
> +	/* pending = pending << t0; */
> +
> +	return a0;
> +#endif
> +}
> +
> +asmlinkage void plat_irq_dispatch(void)
> +{
> +	unsigned int pending = read_c0_cause() & read_c0_status() & ST0_IM;
> +	int irq;
> +
> +	irq = irq_ffs(pending);
> +
> +	if (irq >= 0)
> +		do_IRQ(MIPS_CPU_IRQ_BASE + irq);
> +	else
> +		spurious_interrupt();
> +}

-- 
Shinya Kuribayashi
Renesas Electronics

  reply	other threads:[~2012-04-10  1:03 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-07 16:48 [PATCH 00/10] Add support MIPS SEAD-3 Development Platform Steven J. Hill
2012-04-07 16:48 ` [PATCH 01/10] MIPS: Add core files for MIPS SEAD-3 development platform Steven J. Hill
2012-04-10  1:03   ` Shinya Kuribayashi [this message]
2012-05-07 20:16     ` Hill, Steven
2012-05-08  4:01       ` Shinya Kuribayashi
2012-05-08 11:16       ` Maciej W. Rozycki
2012-05-08 20:38         ` Hill, Steven
2012-05-11  7:37           ` Maciej W. Rozycki
2012-04-07 16:48 ` [PATCH 02/10] MIPS: Changes to configuration files for SEAD-3 platform Steven J. Hill
2012-04-10  1:19   ` Shinya Kuribayashi
2012-04-07 16:48 ` [PATCH 03/10] MIPS: Add support for the M14K core Steven J. Hill
2012-04-07 16:48 ` [PATCH 04/10] MIPS: Add micro-assembler support for 'ins' and 'ext' instructions Steven J. Hill
2012-05-01  0:26   ` Maciej W. Rozycki
2012-05-01  0:51     ` David Daney
2012-05-07  5:18       ` Maciej W. Rozycki
2012-05-07 13:33         ` Hill, Steven
2012-05-01  0:49   ` David Daney
2012-04-07 16:48 ` [PATCH 05/10] MIPS: GIC interrupt changes for M14K and SEAD-3 support Steven J. Hill
2012-04-07 16:48 ` [PATCH 06/10] MIPS: Code formatting fixes Steven J. Hill
2012-04-07 16:48 ` [PATCH 07/10] MIPS: Add support for early serial debug and LCD device on SEAD-3 Steven J. Hill
2012-04-07 16:48 ` [PATCH 08/10] MIPS: MIPS32R2 optimisations for pipeline stalls and code size Steven J. Hill
2012-04-07 16:48 ` [PATCH 09/10] cobalt_lcdfb: LCD panel framebuffer support for SEAD-3 platform Steven J. Hill
2012-04-07 16:48 ` [PATCH 10/10] usb: host: mips: sead3: USB Host controller " Steven J. Hill

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=4F8386C8.9020401@renesas.com \
    --to=shinya.kuribayashi.px@renesas.com \
    --cc=chris@mips.com \
    --cc=douglas@mips.com \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    --cc=sjhill@mips.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