Re: [U-Boot-Users] [RFC][MIPS] Remove mips_cache_lock

2008-03-23 Thread Andrew Dyer
On Fri, Mar 21, 2008 at 8:45 AM, Shinya Kuribayashi
<[EMAIL PROTECTED]> wrote:
>
>  [MIPS] Request for the 'mips_cache_lock()' removal
>
>  The initial intension of having mips_cache_lock() was to use the cache
>  as memory for temporary stack use so that a C environment can be set up
>  as early as possible.
>
>  But now mips_cache_lock() follow lowlevel_init(). We've already have the
>  real memory initilaized at this point, therefore we could/should use it.
>  No reason to lock at all.
>
>  Other problems:
>
>  Cache locking is not consistent across MIPS implementaions. Some imple-
>  mentations don't support locking at all. The style of locking varies -
>  some support per line locking, others per way, etc. Some parts use bits
>  in status registers instead of cache ops. Current mips_cache_lock() is
>  not necessarily general-purpose.
>
>  And this is worthy of special mention; once U-Boot/MIPS locks the lines,
>  they are never get unlocked, so the code relies on whatever gets loaded
>  after U-Boot to re-initialize the cache and clear the locks. We're sup-
>  posed to have CFG_INIT_RAM_LOCK and unlock_ram_in_cache() implemented,
>  but leave the situation as it is for a long time.
>
>  For these reasons, I proposed the removal of mips_cache_lock() from the
>  global start-up code.
>
>  This patch adds CFG_INIT_RAM_LOCK_MIPS to make existing users aware that
>  *things have changed*. If he wants the same behavior as before, he needs
>  to have CFG_INIT_RAM_LOCK_MIPS in his config file.
>
>  If we don't have any regression report through several releases, then
>  we'll remove codes entirely.
>
>  Signed-off-by: Shinya Kuribayashi <[EMAIL PROTECTED]>

Acked-by: Andrew Dyer <[EMAIL PROTECTED]>

>  ---
>
>   cpu/mips/cache.S |2 ++
>   cpu/mips/start.S |2 ++
>   2 files changed, 4 insertions(+), 0 deletions(-)
>
>
>  diff --git a/cpu/mips/cache.S b/cpu/mips/cache.S
>  index 443240e..67ee19f 100644
>  --- a/cpu/mips/cache.S
>  +++ b/cpu/mips/cache.S
>  @@ -238,6 +238,7 @@ dcache_disable:
>
> .enddcache_disable
>
>  +#ifdef CFG_INIT_RAM_LOCK_MIPS
>   
> /***
>   *
>   * mips_cache_lock - lock RAM area pointed to by a0 in cache.
>  @@ -263,3 +264,4 @@ mips_cache_lock:
> j   ra
>
> .endmips_cache_lock
>  +#endif /* CFG_INIT_RAM_LOCK_MIPS */
>  diff --git a/cpu/mips/start.S b/cpu/mips/start.S
>  index c92b162..930f9b3 100644
>  --- a/cpu/mips/start.S
>  +++ b/cpu/mips/start.S
>  @@ -267,10 +267,12 @@ reset:
>
> /* Set up temporary stack.
>  */
>  +#ifdef CFG_INIT_RAM_LOCK_MIPS
> li  a0, CFG_INIT_SP_OFFSET
> la  t9, mips_cache_lock
> jalrt9
> nop
>  +#endif
>
> li  t0, CFG_SDRAM_BASE + CFG_INIT_SP_OFFSET
> la  sp, 0(t0)
>

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] NAND bad blocks scan unacceptable slow

2008-03-23 Thread Nikita V. Youshchenko
Hello.

I'm working on a board that has a 256-megabyte NAND chip connected to
cpu GPIO interface.
I wrote some code that provide hardware access methods for struct nand_chip,
and then u-boot recognized the NAND chip, and read/write/erase worked.

However, on-boot scan for bad blocks takes up to 20 seconds, which is
unacceptable slow. Linux kernel scans for bad blocks on the same board,
using almost same code to access hardware, almost immediately.

I was able to fix this using a patch included below.

However, this all looks ugly. Look in nand_read_raw() in
drivers/mtd/nand/nand_base.c:

int nand_read_raw(struct mtd_info *mtd, uint8_t *buf, loff_t from, size_t len, 
size_t ooblen)
{
...
int pagesize = mtd->oobblock + mtd->oobsize;
...
len += ooblen;
while (len) {
...
len -= pagesize;
...
}
}

So, if len is not mtd->oobblock or ooblen is not mtd->oobsize, the loop most
likely won't terminate.
And of course all usages of nand_read_raw use exactly these parameters.

How to deal with this?

Nikita

P.S. The patch I used against slow bad block scan:

commit 9f09001529526e07ebb6e65a33baa4995198851c
Author: Nikita Youshchenko <[EMAIL PROTECTED]>
Date:   Fri Mar 21 21:08:06 2008 +

nand: when scanning for bad blocks, read only oob area of nand flash

This patch adds one more parameter to nand_read_raw(), which, when non-zero,
causes it to read oob area only.
It also renames nand_read_raw() to nand_read_raw_ext(), and provides
a wrapper nand_read_raw() that calls nand_read_raw_ext() with extra 
parameter
set to zero.
It also makes bad block scan routine to call nand_read_raw_ext(), if it is
going to check oob area only.

This makes scanning for bad blocks 100 times faster.

Signed-off-by: Nikita Youshchenko <[EMAIL PROTECTED]>

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 151f535..ed93a20 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -1468,7 +1468,7 @@ static int nand_read_oob (struct mtd_info *mtd, loff_t 
from, size_t len, size_t
  *
  * Read raw data including oob into buffer
  */
-int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_t 
len, size_t ooblen)
+int nand_read_raw_ext (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_t 
len, size_t ooblen, int oob_only)
 {
struct nand_chip *this = mtd->priv;
int page = (int) (from >> this->page_shift);
@@ -1477,6 +1477,7 @@ int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, 
loff_t from, size_t len,
int cnt = 0;
int pagesize = mtd->oobblock + mtd->oobsize;
int blockcheck = (1 << (this->phys_erase_shift - this->page_shift)) 
- 1;
+   int column;
 
/* Do not allow reads past end of device */
if ((from + len) > mtd->size) {
@@ -1493,11 +1494,19 @@ int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, 
loff_t from, size_t len,
len += ooblen;
 
while (len) {
+   if (oob_only)
+   column = mtd->oobblock;
+   else
+   column = 0;
+
if (sndcmd)
-   this->cmdfunc (mtd, NAND_CMD_READ0, 0, page & 
this->pagemask);
+   this->cmdfunc (mtd, NAND_CMD_READ0, column, page & 
this->pagemask);
sndcmd = 0;
 
-   this->read_buf (mtd, &buf[cnt], pagesize);
+   if (oob_only)
+   this->read_buf (mtd, &buf[cnt + mtd->oobblock], ooblen);
+   else
+   this->read_buf (mtd, &buf[cnt], pagesize);
 
len -= pagesize;
cnt += pagesize;
@@ -1518,6 +1527,10 @@ int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, 
loff_t from, size_t len,
return 0;
 }
 
+int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_t 
len, size_t ooblen)
+{
+   return nand_read_raw_ext(mtd, buf, from, len, ooblen, 0);
+}
 
 /**
  * nand_prepare_oobbuf - [GENERIC] Prepare the out of band buffer
diff --git a/drivers/mtd/nand/nand_bbt.c b/drivers/mtd/nand/nand_bbt.c
index 19a9bc2..fcac13f 100644
--- a/drivers/mtd/nand/nand_bbt.c
+++ b/drivers/mtd/nand/nand_bbt.c
@@ -292,7 +292,10 @@ static void create_bbt (struct mtd_info *mtd, uint8_t 
*buf, struct nand_bbt_desc
}
 
for (i = startblock; i < numblocks;) {
-   nand_read_raw (mtd, buf, from, readlen, ooblen);
+   if (bd->options & NAND_BBT_SCANEMPTY)
+   nand_read_raw (mtd, buf, from, readlen, ooblen);
+   else
+   nand_read_raw_ext (mtd, buf, from, readlen, ooblen, 1);
for (j = 0; j < len; j++) {
if (check_pattern (&buf[j * scanlen], scanlen, 
mtd->oobblock, bd)) {
this->bbt[i >> 3] |= 0x03 << (i & 0x6);
diff --git a/include/linux/mtd

[U-Boot-Users] (no subject)

2008-03-23 Thread 钟文辉
 


   各位老总:您们好!

   诚祝:您们在2008年里;有鼠不尽的快乐!鼠不尽的收获!鼠不尽的钞票! 
 
   鼠不尽的幸福!鼠不尽的美满生活!愿:您们阖家欢乐!幸福安康!

   我是(深圳市珊湖岛进出口有限公司)的负责人;可以提供:出口报关单,
 
   核销单等等一系列手续;代理:出口报关,商检,境内外运输..等等;还可

   以代办:出口欧盟许可证,欧盟产地证;并且还有(广州国际贸易交易会)的摊

   位可以转让;有意者请来邮件或来电联系。
 
 电话:0755-81153047。
 
 传真:0755-81172940。
 
 手机:15817477278。
 
 联系人:钟文辉。
 
 此致:
 

  敬礼!
 

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] Doctors Recommend This

2008-03-23 Thread df Ken

Every male has the inner potential to be 9 inches long – unleash that potential 
today.

http://www.Perfectgzones.com/
Sex tube – real videos

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH] sh: Remove a warning when compiling drivers/serial/serial_sh.c

2008-03-23 Thread Nobuhiro Iwamatsu
Hi,  Mark.

On Sat, 22 Mar 2008 19:27:52 +0100
"Mark Jonas" <[EMAIL PROTECTED]> wrote:

> Hello,
> 
> The attached patch removes a warning when compiling 
> drivers/serial/serial_sh.c.
> 
> Regards,
> Mark Jonas
> 
> CHANGELOG:
> --
> sh: Removed warning when compiling drivers/serial/serial_sh.c.
> 
> Signed-off-by: Mark Jonas <[EMAIL PROTECTED]>
> 
Applied, thanks.
I put testing branch.

Best regards,
 Nobuhiro

-- 
Nobuhiro Iwamatsu
iwamatsu @ nigauri.org / debian.or.jp / superh.org
GPG ID : 3170EBE9

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH v2] sh: Add support Renesas Solutions R2D plus board

2008-03-23 Thread Nobuhiro Iwamatsu
R2D plus is SH reference board used with SH7751R.
This board has 266Mhz CPU, 64MB SDRAM, Cardbus, CF interface,
one PCI bus, VGA, and two Ethernet controller.

Signed-off-by: Nobuhiro Iwamatsu <[EMAIL PROTECTED]>
---
 MAINTAINERS   |1 +
 MAKEALL   |1 +
 Makefile  |5 ++
 board/r2dplus/Makefile|   43 +++
 board/r2dplus/config.mk   |   23 ++
 board/r2dplus/lowlevel_init.S |  154 +
 board/r2dplus/r2dplus.c   |   76 
 board/r2dplus/u-boot.lds  |  105 
 include/configs/r2dplus.h |  152 
 9 files changed, 560 insertions(+), 0 deletions(-)
 create mode 100644 board/r2dplus/Makefile
 create mode 100644 board/r2dplus/config.mk
 create mode 100644 board/r2dplus/lowlevel_init.S
 create mode 100644 board/r2dplus/r2dplus.c
 create mode 100644 board/r2dplus/u-boot.lds
 create mode 100644 include/configs/r2dplus.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 5add085..4e4c358 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -696,6 +696,7 @@ Nobuhiro Iwmaatsu <[EMAIL PROTECTED]>
 
MS7750SESH7750
MS7722SESH7722
+   R2DPlus SH7751R
 
 Mark Jonas <[EMAIL PROTECTED]>
 
diff --git a/MAKEALL b/MAKEALL
index 7668aee..97f91cb 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -698,6 +698,7 @@ LIST_sh4="  \
ms7722se\
Migo-R  \
r7780mp \
+   r2dplus \
 "
 
 LIST_sh3=" \
diff --git a/Makefile b/Makefile
index 62b5d2e..1cc6c84 100644
--- a/Makefile
+++ b/Makefile
@@ -2850,6 +2850,11 @@ r7780mp_config: unconfig
@echo "#define CONFIG_R7780MP 1" >> include/config.h
@./mkconfig -a $(@:_config=) sh sh4 r7780mp
 
+r2dplus_config  :   unconfig
+   @ >include/config.h
+   @echo "#define CONFIG_R2DPLUS 1" >> include/config.h
+   @./mkconfig -a $(@:_config=) sh sh4 r2dplus
+
 #
 #
 #
diff --git a/board/r2dplus/Makefile b/board/r2dplus/Makefile
new file mode 100644
index 000..ed609ea
--- /dev/null
+++ b/board/r2dplus/Makefile
@@ -0,0 +1,43 @@
+#
+# Copyright (C) 2007,2008
+# Nobuhiro Iwamatsu <[EMAIL PROTECTED]>
+#
+# 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.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+include $(TOPDIR)/config.mk
+
+LIB= lib$(BOARD).a
+
+OBJS   := r2dplus.o
+SOBJS  := lowlevel_init.o
+
+$(LIB):$(OBJS) $(SOBJS)
+   $(AR) crv $@ $(OBJS) $(SOBJS)
+
+clean:
+   rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak .depend
+
+#
+
+.depend:   Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
+   $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+
+-include .depend
+
+#
diff --git a/board/r2dplus/config.mk b/board/r2dplus/config.mk
new file mode 100644
index 000..1ec7dcc
--- /dev/null
+++ b/board/r2dplus/config.mk
@@ -0,0 +1,23 @@
+#
+# Copyright (C) 2007,2008
+# Nobuhiro Iwamatsu <[EMAIL PROTECTED]>
+#
+# 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.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# NOTE: Must match value used in u-boot.lds (in this directory).
+#
+TEXT_BASE = 0x0FFC
diff --git a/board/r2dplus/lowlevel_init.S b/board/r2dplus/lowlevel_init.S
new file mode 100644
index 000..5755de8
--- /dev/null
+++ b/board/r

[U-Boot-Users] [PATCH v2] sh: Add support PCI host driver for SH7751/SH7751R

2008-03-23 Thread Nobuhiro Iwamatsu
Signed-off-by: Nobuhiro Iwamatsu <[EMAIL PROTECTED]>
---
 drivers/pci/Makefile |1 +
 drivers/pci/pci_sh7751.c |  199 ++
 include/asm-sh/pci.h |7 +-
 3 files changed, 204 insertions(+), 3 deletions(-)
 create mode 100644 drivers/pci/pci_sh7751.c

diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile
index ef7781f..ad1b7dd 100644
--- a/drivers/pci/Makefile
+++ b/drivers/pci/Makefile
@@ -32,6 +32,7 @@ COBJS-y += pci_indirect.o
 COBJS-y += tsi108_pci.o
 COBJS-y += w83c553f.o
 COBJS-$(CONFIG_SH4_PCI) += pci_sh4.o
+COBJS-$(CONFIG_SH7751_PCI) +=pci_sh7751.o
 COBJS-$(CONFIG_SH7780_PCI) +=pci_sh7780.o
 
 COBJS  := $(COBJS-y)
diff --git a/drivers/pci/pci_sh7751.c b/drivers/pci/pci_sh7751.c
new file mode 100644
index 000..13b2193
--- /dev/null
+++ b/drivers/pci/pci_sh7751.c
@@ -0,0 +1,199 @@
+/*
+ * SH7751 PCI Controller (PCIC) for U-Boot.
+ * (C) Dustin McIntire ([EMAIL PROTECTED])
+ * (C) 2007,2008 Nobuhiro Iwamatsu <[EMAIL PROTECTED]>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+/* Register addresses and such */
+#define SH7751_BCR (vu_long *)0xFF80
+#define SH7751_BCR2(vu_short*)0xFF84
+#define SH7751_WCR1(vu_long *)0xFF88
+#define SH7751_WCR2(vu_long *)0xFF8C
+#define SH7751_WCR3(vu_long *)0xFF800010
+#define SH7751_MCR (vu_long *)0xFF800014
+#define SH7751_BCR3(vu_short*)0xFF800050
+#define SH7751_PCICONF0 (vu_long *)0xFE20
+#define SH7751_PCICONF1 (vu_long *)0xFE24
+#define SH7751_PCICONF2 (vu_long *)0xFE28
+#define SH7751_PCICONF3 (vu_long *)0xFE2C
+#define SH7751_PCICONF4 (vu_long *)0xFE200010
+#define SH7751_PCICONF5 (vu_long *)0xFE200014
+#define SH7751_PCICONF6 (vu_long *)0xFE200018
+#define SH7751_PCICR(vu_long *)0xFE200100
+#define SH7751_PCILSR0  (vu_long *)0xFE200104
+#define SH7751_PCILSR1  (vu_long *)0xFE200108
+#define SH7751_PCILAR0  (vu_long *)0xFE20010C
+#define SH7751_PCILAR1  (vu_long *)0xFE200110
+#define SH7751_PCIMBR   (vu_long *)0xFE2001C4
+#define SH7751_PCIIOBR  (vu_long *)0xFE2001C8
+#define SH7751_PCIPINT  (vu_long *)0xFE2001CC
+#define SH7751_PCIPINTM (vu_long *)0xFE2001D0
+#define SH7751_PCICLKR  (vu_long *)0xFE2001D4
+#define SH7751_PCIBCR1  (vu_long *)0xFE2001E0
+#define SH7751_PCIBCR2  (vu_long *)0xFE2001E4
+#define SH7751_PCIWCR1  (vu_long *)0xFE2001E8
+#define SH7751_PCIWCR2  (vu_long *)0xFE2001EC
+#define SH7751_PCIWCR3  (vu_long *)0xFE2001F0
+#define SH7751_PCIMCR   (vu_long *)0xFE2001F4
+#define SH7751_PCIBCR3  (vu_long *)0xFE2001F8
+
+#define BCR1_BREQEN0x0008
+#define PCI_SH7751_ID  0x35051054
+#define PCI_SH7751R_ID 0x350E1054
+#define SH7751_PCICONF1_WCC0x0080
+#define SH7751_PCICONF1_PER0x0040
+#define SH7751_PCICONF1_BUM0x0004
+#define SH7751_PCICONF1_MES0x0002
+#define SH7751_PCICONF1_CMDS   0x00C6
+#define SH7751_PCI_HOST_BRIDGE 0x6
+#define SH7751_PCICR_PREFIX0xa500
+#define SH7751_PCICR_PRST  0x0002
+#define SH7751_PCICR_CFIN  0x0001
+#define SH7751_PCIPINT_D3  0x0002
+#define SH7751_PCIPINT_D0  0x0001
+#define SH7751_PCICLKR_PREFIX   0xa500
+
+#define SH7751_PCI_MEM_BASE0xFD00
+#define SH7751_PCI_MEM_SIZE0x0100
+#define SH7751_PCI_IO_BASE 0xFE24
+#define SH7751_PCI_IO_SIZE 0x0004
+
+#define SH7751_CS3_BASE_ADDR0x0C00
+#define SH7751_P2CS3_BASE_ADDR  0xAC00
+
+#define SH7751_PCIPAR   (vu_long *)0xFE2001C0
+#define SH7751_PCIPDR   (vu_long *)0xFE200220
+
+#define p4_in(addr) *(addr)
+#define p4_out(data,addr) *(addr) = (data)
+
+/* Double word */
+int pci_sh4_read_config_dword(struct pci_controller *hose,
+ pci_dev_t dev, int offset, u32 * value)
+{
+   u32 par_data = 0x8000 | dev;
+
+   p4_out(par_data | (offset & 0xfc), SH7751_PCIPAR);
+   *value = p4_in(SH7751_PCIPDR);
+
+   return 0;
+}
+
+int pci_sh4_write_config_dword(struct pci_controller *hose,
+  pci_dev_t de

[U-Boot-Users] [PATCH] sh: Remove disable_ctrlc function from R7780MP

2008-03-23 Thread Nobuhiro Iwamatsu
 Signed-off-by: Nobuhiro Iwamatsu <[EMAIL PROTECTED]>
---
 board/r7780mp/r7780mp.c |5 +
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/board/r7780mp/r7780mp.c b/board/r7780mp/r7780mp.c
index 1e0f536..1a37711 100644
--- a/board/r7780mp/r7780mp.c
+++ b/board/r7780mp/r7780mp.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007 Nobuhiro Iwamatsu
+ * Copyright (C) 2007,2008 Nobuhiro Iwamatsu <[EMAIL PROTECTED]>
  * Copyright (C) 2008 Yusuke Goda <[EMAIL PROTECTED]>
  *
  * This program is free software; you can redistribute it and/or
@@ -40,9 +40,6 @@ int board_init(void)
/* SCIF Enable */
*(vu_short*)PHCR = 0x;
 
-   /* Disable Control-C */
-   disable_ctrlc(1);
-
return 0;
 }
 
-- 
1.5.4.3


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH] sh: Add maintainer of R7780MP to MAINTAINER file

2008-03-23 Thread Nobuhiro Iwamatsu
Update MAINTAINER entry for R7780MP. And fix maintainer's name.

Signed-off-by: Nobuhiro Iwamatsu <[EMAIL PROTECTED]>
---
 MAINTAINERS |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 4e4c358..3084872 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -692,10 +692,11 @@ Haavard Skinnemoen <[EMAIL PROTECTED]>
 #  Board   CPU #
 #
 
-Nobuhiro Iwmaatsu <[EMAIL PROTECTED]>
+Nobuhiro Iwamatsu <[EMAIL PROTECTED]>
 
MS7750SESH7750
MS7722SESH7722
+   R7780MP SH7780
R2DPlus SH7751R
 
 Mark Jonas <[EMAIL PROTECTED]>
-- 
1.5.4.3


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH] sh: Move SuperH PCI driver from cpu/sh4 to drivers/pci

2008-03-23 Thread Nobuhiro Iwamatsu
Signed-off-by: Nobuhiro Iwamatsu <[EMAIL PROTECTED]>
---
 cpu/sh4/Makefile  |3 +-
 cpu/sh4/pci-sh4.c |   81 -
 cpu/sh4/pci-sh7780.c  |  111 -
 drivers/pci/Makefile  |2 +
 drivers/pci/pci_sh4.c |   76 +++
 drivers/pci/pci_sh7780.c  |  107 +++
 include/configs/r7780mp.h |1 +
 7 files changed, 187 insertions(+), 194 deletions(-)
 delete mode 100644 cpu/sh4/pci-sh4.c
 delete mode 100644 cpu/sh4/pci-sh7780.c
 create mode 100644 drivers/pci/pci_sh4.c
 create mode 100644 drivers/pci/pci_sh7780.c

diff --git a/cpu/sh4/Makefile b/cpu/sh4/Makefile
index 7a53cb6..82789fe 100644
--- a/cpu/sh4/Makefile
+++ b/cpu/sh4/Makefile
@@ -29,8 +29,7 @@ include $(TOPDIR)/config.mk
 LIB= $(obj)lib$(CPU).a
 
 START  = start.o
-OBJS   = cpu.o interrupts.o watchdog.o time.o cache.o \
-   pci-sh4.o pci-sh7780.o
+OBJS   = cpu.o interrupts.o watchdog.o time.o cache.o 
 
 all:   .depend $(START) $(LIB)
 
diff --git a/cpu/sh4/pci-sh4.c b/cpu/sh4/pci-sh4.c
deleted file mode 100644
index 9d14f8d..000
--- a/cpu/sh4/pci-sh4.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * SH4 PCI Controller (PCIC) for U-Boot.
- * (C) Dustin McIntire ([EMAIL PROTECTED])
- * (C) 2007 Nobuhiro Iwamatsu
- * (C) 2008 Yusuke Goda <[EMAIL PROTECTED]>
- *
- * u-boot/cpu/sh4/pci-sh4.c
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * 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.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-#include 
-
-#if defined(CONFIG_PCI) && \
-   defined(CONFIG_SH4_PCI)
-
-#include 
-#include 
-#include 
-#include 
-
-int pci_sh4_init(struct pci_controller *hose)
-{
-   hose->first_busno = 0;
-   hose->region_count = 0;
-   hose->last_busno = 0xff;
-
-   /* PCI memory space */
-   pci_set_region(hose->regions + 0,
-   CONFIG_PCI_MEM_BUS,
-   CONFIG_PCI_MEM_PHYS,
-   CONFIG_PCI_MEM_SIZE,
-   PCI_REGION_MEM);
-   hose->region_count++;
-
-   /* PCI IO space */
-   pci_set_region(hose->regions + 1,
-   CONFIG_PCI_IO_BUS,
-   CONFIG_PCI_IO_PHYS,
-   CONFIG_PCI_IO_SIZE,
-   PCI_REGION_IO);
-   hose->region_count++;
-
-   udelay(1000);
-
-   pci_set_ops(hose,
-   pci_hose_read_config_byte_via_dword,
-   pci_hose_read_config_word_via_dword,
-   pci_sh4_read_config_dword,
-   pci_hose_write_config_byte_via_dword,
-   pci_hose_write_config_word_via_dword,
-   pci_sh4_write_config_dword);
-
-   pci_register_hose(hose);
-
-   udelay(1000);
-
-#ifdef CONFIG_PCI_SCAN_SHOW
-   printf("PCI:   Bus Dev VenId DevId Class Int\n");
-#endif
-   hose->last_busno = pci_hose_scan(hose);
-   return 0;
-}
-
-#endif /* defined(CONFIG_PCI) && defined(CONFIG_SH4_PCI) */
diff --git a/cpu/sh4/pci-sh7780.c b/cpu/sh4/pci-sh7780.c
deleted file mode 100644
index 851d767..000
--- a/cpu/sh4/pci-sh7780.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * SH7780 PCI Controller (PCIC) for U-Boot.
- * (C) Dustin McIntire ([EMAIL PROTECTED])
- * (C) 2007 Nobuhiro Iwamatsu
- * (C) 2008 Yusuke Goda <[EMAIL PROTECTED]>
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * 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.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-#include 
-
-#if defined(CONFIG_PCI) && defined(CONFIG_SH4_PCI) \
-   && defined(CONFIG_CPU_SH7780)
-
-#include 
-#include 
-#include 
-
-#define SH7780_VE

[U-Boot-Users] [MIPS] Extend MIPS_MAX_CACHE_SIZE upto 64kB

2008-03-23 Thread Shinya Kuribayashi
Signed-off-by: Shinya Kuribayashi <[EMAIL PROTECTED]>
---

 cpu/mips/cache.S |9 +
 1 files changed, 5 insertions(+), 4 deletions(-)


diff --git a/cpu/mips/cache.S b/cpu/mips/cache.S
index bda9bb1..2998a3b 100644
--- a/cpu/mips/cache.S
+++ b/cpu/mips/cache.S
@@ -32,10 +32,11 @@
 
 #define RA t8
 
-   /* 16KB is the maximum size of instruction and data caches on
-* MIPS 4K.
-*/
-#define MIPS_MAX_CACHE_SIZE0x4000
+/*
+ * 16kB is the maximum size of instruction and data caches on MIPS 4K,
+ * 64kB is on 4KE, 24K, 5K, 34K, etc. Set bigger size for convenience.
+ */
+#define MIPS_MAX_CACHE_SIZE0x1
 
 #define INDEX_BASE KSEG0
 

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [MIPS] Fix dcache_status()

2008-03-23 Thread Shinya Kuribayashi
You can't judge UNCACHED by Config.K0 LSB.

Signed-off-by: Shinya Kuribayashi <[EMAIL PROTECTED]>
---

 cpu/mips/cache.S |   10 +++---
 1 files changed, 7 insertions(+), 3 deletions(-)


diff --git a/cpu/mips/cache.S b/cpu/mips/cache.S
index bb42616..e6f3175 100644
--- a/cpu/mips/cache.S
+++ b/cpu/mips/cache.S
@@ -256,9 +256,13 @@ NESTED(mips_cache_reset, 0, ra)
 *
 */
 LEAF(dcache_status)
-   mfc0v0, CP0_CONFIG
-   andiv0, v0, 1
-   j   ra
+   mfc0t0, CP0_CONFIG
+   li  t1, CONF_CM_UNCACHED
+   andit0, t0, CONF_CM_CMASK
+   movev0, zero
+   beq t0, t1, 2f
+   li  v0, 1
+2: jr  ra
END(dcache_status)
 
 
/***

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [MIPS] Implement flush_cache()

2008-03-23 Thread Shinya Kuribayashi
Shinya Kuribayashi wrote:
> Andrew Dyer wrote:
>> looking at how cache_flush() is used (see common/cmd_load.c,
>> common/cmd_elf.c, etc), I believe this loop should also do a cache_op
>> with Hit_Invalidate_I to invalidate the icache.
>>
>> seems like it would be easier to read if the condition was included in
>> the while() statement
> 
> Hm, then is this ok?

> @@ -41,6 +52,17 @@ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char 
> *argv[])
>  
>  void flush_cache(ulong start_addr, ulong size)
>  {
> + unsigned long lsize = CFG_DCACHE_SIZE;
  ^^^
Oops, this should have been cache line size.

Patch updated.

P.S. I'll introduce  and remove cache_op macro in the
 future. But it takes some time.

>

[MIPS] Implement flush_cache()

Signed-off-by: Shinya Kuribayashi <[EMAIL PROTECTED]>
---

 cpu/mips/cpu.c |   22 ++
 1 files changed, 22 insertions(+), 0 deletions(-)


diff --git a/cpu/mips/cpu.c b/cpu/mips/cpu.c
index 7559ac6..de70c4d 100644
--- a/cpu/mips/cpu.c
+++ b/cpu/mips/cpu.c
@@ -25,6 +25,17 @@
 #include 
 #include 
 #include 
+#include 
+
+#define cache_op(op,addr)  \
+   __asm__ __volatile__(   \
+   "   .setpush\n" \
+   "   .setnoreorder   \n" \
+   "   .setmips3\n\t   \n" \
+   "   cache   %0, %1  \n" \
+   "   .setpop \n" \
+   :   \
+   : "i" (op), "R" (*(unsigned char *)(addr)))
 
 int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
@@ -41,6 +52,17 @@ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
 
 void flush_cache(ulong start_addr, ulong size)
 {
+   unsigned long lsize = CFG_CACHELINE_SIZE;
+   unsigned long addr = start_addr & ~(lsize - 1);
+   unsigned long aend = (start_addr + size - 1) & ~(lsize - 1);
+
+   while (1) {
+   cache_op(Hit_Writeback_Inv_D, start_addr);
+   cache_op(Hit_Invalidate_I, start_addr);
+   if (addr == aend)
+   break;
+   addr += lsize;
+   }
 }
 
 void write_one_tlb(int index, u32 pagemask, u32 hi, u32 low0, u32 low1)

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH] sh: Add support PCI host driver for SH7751/SH7751R

2008-03-23 Thread Nobuhiro Iwamatsu
Hi ,

Thank you for your check.

On Wed, 12 Mar 2008 23:09:50 +0100
Jean-Christophe PLAGNIOL-VILLARD <[EMAIL PROTECTED]> wrote:

> >  START  = start.o
> >  OBJS   = cpu.o interrupts.o watchdog.o time.o cache.o \
> > -   pci-sh4.o pci-sh7780.o
> > +   pci-sh4.o pci-sh7751.o pci-sh7780.o
> Could you split it to one line for one file
> > +#if defined(CONFIG_PCI) && defined(CONFIG_SH4_PCI) \
> > +   && defined(CONFIG_SH7751_PCI)
> Could you move it to the Makefile
[snip]
> > +
> > +#include 
> > +#include 
> > +#include 
> 
> I think it will be good to move the pci drivers to drivers/pci
OK, I will fix this, send patch .

regards,
 Nobuhiro

-- 
Nobuhiro Iwamatsu
iwamatsu @ nigauri.org / superh.org / debian.or.jp
GPG ID : 3170EBE9

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users