Re: [U-Boot] [Patch V3 1/4] [MIPS] Add support for MIPS64 cpus

2012-08-26 Thread Zhi-zhou Zhang


 with current master branch in git://git.denx.de/u-boot-mips.git you can
 drop the
 endianess flags which are now handled in arch/mips/config.mk

 Ok, I have done what you ask for. But I didn't find where does
CONFIG_SYS_LITTLE_ENDIAN or CONFIG_SYS_BIG_ENDIAN define.
Could you tell where should I put them?
It seem that putting it in qemu-mips64.h doesn't affect building flags.


 currently we cannot use interrupts or setup any interrupt handlers in
 u-boot-mips.
 Please leave those functions empty.



 calling a C function is not supposed to work here because no stack
 pointer has been setup yet.
 I checked with Sourcery 2011.09 and 2012.03. The stack is always
 utilized in cache_probe.
 Either you rewrite the cache_probe function in assembler or you use
 the existing config options
 and you could drop the cache probing.

 I'm afraid I don't say clearly just now. I mean could I call cache_probe
in  checkboard()?

-- 
Regards,
Zhizhou Zhang
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [Patch V3 1/4] [MIPS] Add support for MIPS64 cpus

2012-08-26 Thread Daniel Schwierzeck
2012/8/26 Zhi-zhou Zhang etou...@gmail.com:

 with current master branch in git://git.denx.de/u-boot-mips.git you can
 drop the
 endianess flags which are now handled in arch/mips/config.mk

 Ok, I have done what you ask for. But I didn't find where does
 CONFIG_SYS_LITTLE_ENDIAN or CONFIG_SYS_BIG_ENDIAN define.
 Could you tell where should I put them?
 It seem that putting it in qemu-mips64.h doesn't affect building flags.

have a look at commit
http://git.denx.de/?p=u-boot/u-boot-mips.git;a=commitdiff;h=748fd4a621a870d378e4e4f54df76a38fd5d3cba

CONFIG_SYS_LITTLE_ENDIAN or CONFIG_SYS_BIG_ENDIAN could be set in the
board config header file
or in boards.cfg. Usually the header file should be preferred. But for
qemu we want to use the same header file
for both endianess types. Thus we can use the possibilty to put config
options in boards.cfg like I did in my commit.

Adding these lines to boards.cfg should work:

qemu_mips64mipsmips64  qemu-mips
-  -   qemu-mips64:SYS_BIG_ENDIAN
qemu_mips64el  mipsmips64  qemu-mips
-  -   qemu-mips64:SYS_LITTLE_ENDIAN



 currently we cannot use interrupts or setup any interrupt handlers in
 u-boot-mips.
 Please leave those functions empty.



 calling a C function is not supposed to work here because no stack

 pointer has been setup yet.
 I checked with Sourcery 2011.09 and 2012.03. The stack is always
 utilized in cache_probe.
 Either you rewrite the cache_probe function in assembler or you use
 the existing config options
 and you could drop the cache probing.

 I'm afraid I don't say clearly just now. I mean could I call cache_probe in
 checkboard()?

no that is too late. The functions called by mips_cache_reset need to
know the cache sizes.
Currently we are configuring that with the options
CONFIG_SYS_DCACHE_SIZE, CONFIG_SYS_ICACHE_SIZE and
CONFIG_SYS_CACHELINE_SIZE. I suggest you do the same for MIPS64.

We can add a runtime cache probing later. But this has to be done in
assembler code. I already have this on my todo list.

-- 
Best regards,
Daniel
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [Patch V3 1/4] [MIPS] Add support for MIPS64 cpus

2012-08-25 Thread Zhi-zhou Zhang
On Fri, Aug 24, 2012 at 8:22 AM, Daniel Schwierzeck 
daniel.schwierz...@gmail.com wrote:

 2012/8/20 Zhizhou Zhang etou...@gmail.com:
  These files are derived from arch/mips/cpu/mips32/*. Howerver some
  Changes are made:
*.S: changes ABI o32 to n64
config.mk: add mips64 building cflags
cpu.c: add cache size probe
interrupts.c: implement enable_interrupts and disable_interrupts
 
  Signed-off-by: Zhizhou Zhang etou...@gmail.com
  ---
   arch/mips/cpu/mips64/Makefile |   47 +++
   arch/mips/cpu/mips64/config.mk|   39 ++
   arch/mips/cpu/mips64/cpu.c|  124 ++
   arch/mips/cpu/mips64/interrupts.c |   39 ++
   arch/mips/cpu/mips64/start.S  |  256
 +
   arch/mips/cpu/mips64/time.c   |   86 +
   6 files changed, 591 insertions(+)
   create mode 100644 arch/mips/cpu/mips64/Makefile
   create mode 100644 arch/mips/cpu/mips64/config.mk
   create mode 100644 arch/mips/cpu/mips64/cpu.c
   create mode 100644 arch/mips/cpu/mips64/interrupts.c
   create mode 100644 arch/mips/cpu/mips64/start.S
   create mode 100644 arch/mips/cpu/mips64/time.c
 
  diff --git a/arch/mips/cpu/mips64/Makefile
 b/arch/mips/cpu/mips64/Makefile
  new file mode 100644
  index 000..335fe88
  --- /dev/null
  +++ b/arch/mips/cpu/mips64/Makefile
  @@ -0,0 +1,47 @@
  +#
  +# (C) Copyright 2003-2006
  +# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
  +#
  +# 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 $(TOPDIR)/config.mk
  +
  +LIB= $(obj)lib$(CPU).o
  +
  +START  = start.o
  +COBJS-y= cpu.o interrupts.o time.o
  +
  +SRCS   := $(START:.o=.S) $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
  +OBJS   := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
  +START  := $(addprefix $(obj),$(START))
  +
  +all:   $(obj).depend $(START) $(LIB)
  +
  +$(LIB):$(OBJS)
  +   $(call cmd_link_o_target, $(OBJS))
  +
 
 +#
  +
  +# defines $(obj).depend target
  +include $(SRCTREE)/rules.mk
  +
  +sinclude $(obj).depend
  +
 
 +#
  diff --git a/arch/mips/cpu/mips64/config.mk b/arch/mips/cpu/mips64/
 config.mk
  new file mode 100644
  index 000..26f79e6
  --- /dev/null
  +++ b/arch/mips/cpu/mips64/config.mk
  @@ -0,0 +1,39 @@
  +#
  +# (C) Copyright 2003
  +# Wolfgang Denk, DENX Software Engineering, w...@denx.de
  +#
  +# 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
  +#
  +
  +#
  +# Default optimization level for MIPS64
  +#
  +# Note: Toolchains with binutils prior to v2.16
  +# are no longer supported by U-Boot MIPS tree!
  +#
  +MIPSFLAGS = -march=mips64
  +
  +ENDIANNESS = -EL
  +
  +MIPSFLAGS += $(ENDIANNESS)

 with current master branch in git://git.denx.de/u-boot-mips.git you can
 drop the
 endianess flags which are now handled in arch/mips/config.mk

  +
  +PLATFORM_CPPFLAGS += $(MIPSFLAGS)
  +PLATFORM_CPPFLAGS += -mabi=64 -DCONFIG_64BIT
  +PLATFORM_LDFLAGS  += -m elf64ltsmip
  +
  diff --git a/arch/mips/cpu/mips64/cpu.c b/arch/mips/cpu/mips64/cpu.c
  new file mode 100644
  index 000..348ccfe
  --- /dev/null
  +++ b/arch/mips/cpu/mips64/cpu.c
  @@ -0,0 +1,124 @@
  +/*
  + * (C) Copyright 2003
  + * Wolfgang Denk, DENX Software Engineering, w...@denx.de
  + * Zhi-zhou Zhang etou...@gmail.com
  + *
  + * See file CREDITS for list of 

Re: [U-Boot] [Patch V3 1/4] [MIPS] Add support for MIPS64 cpus

2012-08-23 Thread Zhi-zhou Zhang
On Thu, Aug 23, 2012 at 11:07 AM, Mike Frysinger vap...@gentoo.org wrote:

 On Monday 20 August 2012 10:22:23 Zhizhou Zhang wrote:
  +void __weak _machine_restart(void)
  +{
  +}

 this should be:
 void __noreturn __weak _machine_restart(void)
 {
 while (1);
 }

 there should also be a prototype for this in one of the mips64 headers

  +int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
  +{
  + _machine_restart();
  +
  + fprintf(stderr, *** reset failed ***\n);
  + return 0;
  +}

 then this would be:
 int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 _machine_restart();
 }
 -mike


Yes, you are right. thanks

-- 
Regards,
Zhizhou Zhang
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [Patch V3 1/4] [MIPS] Add support for MIPS64 cpus

2012-08-23 Thread Daniel Schwierzeck
2012/8/20 Zhizhou Zhang etou...@gmail.com:
 These files are derived from arch/mips/cpu/mips32/*. Howerver some
 Changes are made:
   *.S: changes ABI o32 to n64
   config.mk: add mips64 building cflags
   cpu.c: add cache size probe
   interrupts.c: implement enable_interrupts and disable_interrupts

 Signed-off-by: Zhizhou Zhang etou...@gmail.com
 ---
  arch/mips/cpu/mips64/Makefile |   47 +++
  arch/mips/cpu/mips64/config.mk|   39 ++
  arch/mips/cpu/mips64/cpu.c|  124 ++
  arch/mips/cpu/mips64/interrupts.c |   39 ++
  arch/mips/cpu/mips64/start.S  |  256 
 +
  arch/mips/cpu/mips64/time.c   |   86 +
  6 files changed, 591 insertions(+)
  create mode 100644 arch/mips/cpu/mips64/Makefile
  create mode 100644 arch/mips/cpu/mips64/config.mk
  create mode 100644 arch/mips/cpu/mips64/cpu.c
  create mode 100644 arch/mips/cpu/mips64/interrupts.c
  create mode 100644 arch/mips/cpu/mips64/start.S
  create mode 100644 arch/mips/cpu/mips64/time.c

 diff --git a/arch/mips/cpu/mips64/Makefile b/arch/mips/cpu/mips64/Makefile
 new file mode 100644
 index 000..335fe88
 --- /dev/null
 +++ b/arch/mips/cpu/mips64/Makefile
 @@ -0,0 +1,47 @@
 +#
 +# (C) Copyright 2003-2006
 +# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
 +#
 +# 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 $(TOPDIR)/config.mk
 +
 +LIB= $(obj)lib$(CPU).o
 +
 +START  = start.o
 +COBJS-y= cpu.o interrupts.o time.o
 +
 +SRCS   := $(START:.o=.S) $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
 +OBJS   := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
 +START  := $(addprefix $(obj),$(START))
 +
 +all:   $(obj).depend $(START) $(LIB)
 +
 +$(LIB):$(OBJS)
 +   $(call cmd_link_o_target, $(OBJS))
 +
 +#
 +
 +# defines $(obj).depend target
 +include $(SRCTREE)/rules.mk
 +
 +sinclude $(obj).depend
 +
 +#
 diff --git a/arch/mips/cpu/mips64/config.mk b/arch/mips/cpu/mips64/config.mk
 new file mode 100644
 index 000..26f79e6
 --- /dev/null
 +++ b/arch/mips/cpu/mips64/config.mk
 @@ -0,0 +1,39 @@
 +#
 +# (C) Copyright 2003
 +# Wolfgang Denk, DENX Software Engineering, w...@denx.de
 +#
 +# 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
 +#
 +
 +#
 +# Default optimization level for MIPS64
 +#
 +# Note: Toolchains with binutils prior to v2.16
 +# are no longer supported by U-Boot MIPS tree!
 +#
 +MIPSFLAGS = -march=mips64
 +
 +ENDIANNESS = -EL
 +
 +MIPSFLAGS += $(ENDIANNESS)

with current master branch in git://git.denx.de/u-boot-mips.git you can drop the
endianess flags which are now handled in arch/mips/config.mk

 +
 +PLATFORM_CPPFLAGS += $(MIPSFLAGS)
 +PLATFORM_CPPFLAGS += -mabi=64 -DCONFIG_64BIT
 +PLATFORM_LDFLAGS  += -m elf64ltsmip
 +
 diff --git a/arch/mips/cpu/mips64/cpu.c b/arch/mips/cpu/mips64/cpu.c
 new file mode 100644
 index 000..348ccfe
 --- /dev/null
 +++ b/arch/mips/cpu/mips64/cpu.c
 @@ -0,0 +1,124 @@
 +/*
 + * (C) Copyright 2003
 + * Wolfgang Denk, DENX Software Engineering, w...@denx.de
 + * Zhi-zhou Zhang etou...@gmail.com
 + *
 + * 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; 

Re: [U-Boot] [Patch V3 1/4] [MIPS] Add support for MIPS64 cpus

2012-08-22 Thread Mike Frysinger
On Monday 20 August 2012 10:22:23 Zhizhou Zhang wrote:
 +void __weak _machine_restart(void)
 +{
 +}

this should be:
void __noreturn __weak _machine_restart(void)
{
while (1);
}

there should also be a prototype for this in one of the mips64 headers

 +int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 +{
 + _machine_restart();
 +
 + fprintf(stderr, *** reset failed ***\n);
 + return 0;
 +}

then this would be:
int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
_machine_restart();
}
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot