Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Fuxin Zhang <zhangfx@lemote.com>
To: tiansm@lemote.com
Cc: linux-mips@linux-mips.org
Subject: Re: [PATCH] override of arch/mips/mm/cache.c: __uncached_access
Date: Thu, 07 Jun 2007 14:22:59 +0800	[thread overview]
Message-ID: <4667A443.8060105@lemote.com> (raw)
In-Reply-To: <11811962573610-git-send-email-tiansm@lemote.com>

Recent Xorg depends on this hack/patch.

For example,if we are using this memory layout:
0-256MB phys mem
256-512M pci io/mem region
512-768MB phys mem
Xorg will crash due to pci video memory mapping problem.

So this is not really only for Fulong.

BTW:
Songmao, we'd better add a comment to justify this code.

tiansm@lemote.com 写道:
> From: Songmao Tian <tiansm@lemote.com>
>
> Signed-off-by: Songmao Tian <tiansm@lemote.com>
> ---
>  arch/mips/lemote/lm2e/Makefile |    2 +-
>  arch/mips/lemote/lm2e/mem.c    |   25 +++++++++++++++++++++++++
>  2 files changed, 26 insertions(+), 1 deletions(-)
>  create mode 100644 arch/mips/lemote/lm2e/mem.c
>
> diff --git a/arch/mips/lemote/lm2e/Makefile b/arch/mips/lemote/lm2e/Makefile
> index 0ba6f12..fb1b48c 100644
> --- a/arch/mips/lemote/lm2e/Makefile
> +++ b/arch/mips/lemote/lm2e/Makefile
> @@ -2,6 +2,6 @@
>  # Makefile for Lemote Fulong mini-PC board.
>  #
>  
> -obj-y += setup.o prom.o reset.o irq.o pci.o bonito-irq.o dbg_io.o
> +obj-y += setup.o prom.o reset.o irq.o pci.o bonito-irq.o dbg_io.o mem.o
>  EXTRA_AFLAGS := $(CFLAGS)
>  
> diff --git a/arch/mips/lemote/lm2e/mem.c b/arch/mips/lemote/lm2e/mem.c
> new file mode 100644
> index 0000000..6068a17
> --- /dev/null
> +++ b/arch/mips/lemote/lm2e/mem.c
> @@ -0,0 +1,25 @@
> +/*
> + * This program is free software; you can redistribute  it and/or modify it
> + * under  the terms of  the GNU General  Public License as published by the
> + * Free Software Foundation;  either version 2 of the  License, or (at your
> + * option) any later version.
> + */
> +
> +#include <linux/fs.h>
> +#include <linux/fcntl.h>
> +#include <linux/mm.h>
> +
> +/* override of arch/mips/mm/cache.c: __uncached_access */
> +int __uncached_access(struct file *file, unsigned long addr)
> +{
> +	if (file->f_flags & O_SYNC)
> +		return 1;
> +
> +	/* 
> +	 * on lemote loongson 2e system, peripheral register 
> +	 * reside between 0x1000 0000 and 0x2000 0000
> +	 */
> +	return addr >= __pa(high_memory) ||
> +		((addr >=0x10000000) && (addr < 0x20000000));
> +}
> +
>   

-- 
------------------------------------------------
张福新
江苏中科龙梦科技有限公司
地址:江苏省常熟市虞山镇梦兰工业园

General Manager
JiangSu Lemote Corp. Ltd.
MengLan, Yushan, Changshu, JiangSu Province, China
ZIP: 215500 
Tel: 86-512-52308679
Fax: 86-512-52308688
Email: zhangfx@lemote.com
http://www.lemote.com
------------------------------------------------
 

  reply	other threads:[~2007-06-07  6:24 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-06  6:52 Lemote Loongson 2E patch update [take 2] tiansm
2007-06-06  6:52 ` [PATCH 01/15] new files for lemote fulong mini-PC support tiansm
2007-06-11 15:40   ` Ralf Baechle
2007-06-06  6:52 ` [PATCH 02/15] arch related Makefile update for lemote fulong mini-PC tiansm
2007-06-06  6:52 ` [PATCH 03/15] Kconfig update for lemote fulong miniPC tiansm
2007-06-06  6:52 ` [PATCH 04/15] TO_PHYS_MASK for loongson2 tiansm
2007-06-06 17:41   ` Ralf Baechle
2007-06-06  6:52 ` [PATCH 05/15] add MACH_GROUP_LEMOTE & MACH_LEMOTE_FULONG tiansm
2007-06-06  6:52 ` [PATCH 06/15] define Hit_Invalidate_I to Index_Invalidate_I for loongson2 tiansm
2007-06-06  6:52 ` [PATCH 07/15] add Loongson processor definitions tiansm
2007-06-06  6:52 ` [PATCH 08/15] define MODULE_PROC_FAMILY for Loongson2 tiansm
2007-06-06  6:52 ` [PATCH 09/15] add serial port definition for lemote fulong tiansm
2007-06-12 12:34   ` Ralf Baechle
2007-06-12 12:57     ` Fuxin Zhang
2007-06-12 13:01       ` Ralf Baechle
2007-06-13 18:57       ` Ralf Baechle
2007-06-06  6:52 ` [PATCH 10/15] make cpu_probe recognize Loongson2 tiansm
2007-06-06  6:52 ` [PATCH 11/15] add Loongson support to /proc/cpuinfo tiansm
2007-06-06  6:52 ` [PATCH 12/15] cheat for support of more than 256MB memory tiansm
2007-06-06  6:52 ` [PATCH 13/15] define MODULE_PROC_FAMILY for Loongson2 tiansm
2007-06-06  6:52 ` [PATCH 14/15] tlb handling support for Loongson2 processor tiansm
2007-06-06  6:52 ` [PATCH 15/15] work around for more than 256MB memory support tiansm
2007-06-06  8:01   ` Franck Bui-Huu
2007-06-06 18:28     ` Ralf Baechle
2007-06-07  6:04       ` [PATCH] override of arch/mips/mm/cache.c: __uncached_access tiansm
2007-06-07  6:22         ` Fuxin Zhang [this message]
2007-06-07 17:05           ` 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=4667A443.8060105@lemote.com \
    --to=zhangfx@lemote.com \
    --cc=linux-mips@linux-mips.org \
    --cc=tiansm@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox