Re: [U-Boot] [PATCH v5 1/8] those files are jz4740 base files

2011-02-27 Thread Xiangfu Liu
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi 

find out. using global_data.

On 02/28/2011 12:54 PM, Xiangfu Liu wrote:
 +static ulong timestamp;
   +static ulong lastdec;
  As already has been pointed out several times before: this will not
  work because BSS cannot be accessed before relocation.
 
 
 can you give me some tips how to fix this?
 
 thanks
 


- -- 
Best Regards
Xiangfu Liu
http://www.openmobilefree.net
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1rQlQACgkQRRAEFRxkgLTzBgCdH/ijv6fHispAkQxoppfX5qSO
9IMAnR2nW6nZVz7OFjPZ7aZ38SlZsb/d
=rg9P
-END PGP SIGNATURE-
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v5 1/8] those files are jz4740 base files

2011-01-17 Thread Wolfgang Denk
Dear Xiangfu Liu,

In message 1294589925-32639-2-git-send-email-xian...@openmobilefree.net you 
wrote:
 Signed-off-by: Xiangfu Liu xian...@openmobilefree.net
 Acked-by: Daniel z...@ingenic.cn
 Acked-by: ChangWei Jia cw...@ingenic.cn
 
 ---
  arch/mips/cpu/xburst/Makefile|   50 +++
  arch/mips/cpu/xburst/config.mk   |   33 ++
...

There is no description of the changes in this version of the patch.
The notes in the introductory message are _not_ sufficient, please see
http://www.denx.de/wiki/view/U-Boot/Patches#Sending_updated_patch_versions
(bullet 2)

...
 + while (1) {
 + cache_op(Hit_Writeback_Inv_D, addr);
 + cache_op(Hit_Invalidate_I, addr);

We do not allow CamelCase identifiers in U-Boot.  Please fix globally.


 + while ( !__rtc_write_ready())
 + ;

No space after the paren; please fix globally.

...
 +int serial_init (void)
 +{
 +#if !defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_NAND_SPL)
 + volatile u8 *uart_fcr = (volatile u8 *)(CONFIG_SYS_UART_BASE + OFF_FCR);
 + volatile u8 *uart_lcr = (volatile u8 *)(CONFIG_SYS_UART_BASE + OFF_LCR);
 + volatile u8 *uart_ier = (volatile u8 *)(CONFIG_SYS_UART_BASE + OFF_IER);
 + volatile u8 *uart_sircr = (volatile u8 *)(CONFIG_SYS_UART_BASE + 
 OFF_SIRCR);

Please do not use base + offset notation.  Declare a proper C struct
instead.  Please fix globally.

 + /* Disable port interrupts while changing hardware */
 + *uart_ier = 0;

And use proper I/O accessors to access device registers. Please fix
globally.

...
 +static ulong timestamp;
 +static ulong lastdec;

As already has been pointed out several times before: this will not
work because BSS cannot be accessed before relocation.


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
We don't have to protect the environment -- the Second Coming is  at
hand.   - James Watt
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v5 1/8] those files are jz4740 base files

2011-01-09 Thread Xiangfu Liu
Signed-off-by: Xiangfu Liu xian...@openmobilefree.net
Acked-by: Daniel z...@ingenic.cn
Acked-by: ChangWei Jia cw...@ingenic.cn

---
 arch/mips/cpu/xburst/Makefile|   50 +++
 arch/mips/cpu/xburst/config.mk   |   33 ++
 arch/mips/cpu/xburst/cpu.c   |  160 
 arch/mips/cpu/xburst/jz4740.c|  266 
 arch/mips/cpu/xburst/jz_serial.c |  128 ++
 arch/mips/cpu/xburst/start.S |  164 
 arch/mips/cpu/xburst/start_spl.S |   63 +++
 arch/mips/cpu/xburst/timer.c |  172 
 arch/mips/cpu/xburst/usbboot.S   |  841 ++
 9 files changed, 1877 insertions(+), 0 deletions(-)
 create mode 100644 arch/mips/cpu/xburst/Makefile
 create mode 100644 arch/mips/cpu/xburst/config.mk
 create mode 100644 arch/mips/cpu/xburst/cpu.c
 create mode 100644 arch/mips/cpu/xburst/jz4740.c
 create mode 100644 arch/mips/cpu/xburst/jz_serial.c
 create mode 100644 arch/mips/cpu/xburst/start.S
 create mode 100644 arch/mips/cpu/xburst/start_spl.S
 create mode 100644 arch/mips/cpu/xburst/timer.c
 create mode 100644 arch/mips/cpu/xburst/usbboot.S

diff --git a/arch/mips/cpu/xburst/Makefile b/arch/mips/cpu/xburst/Makefile
new file mode 100644
index 000..a9a6e77
--- /dev/null
+++ b/arch/mips/cpu/xburst/Makefile
@@ -0,0 +1,50 @@
+#
+# (C) Copyright 2000-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
+SOBJS-y= 
+COBJS-y = cpu.o timer.o jz_serial.o 
+
+COBJS-$(CONFIG_JZ4740) += jz4740.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/xburst/config.mk b/arch/mips/cpu/xburst/config.mk
new file mode 100644
index 000..fc9b255
--- /dev/null
+++ b/arch/mips/cpu/xburst/config.mk
@@ -0,0 +1,33 @@
+#
+# (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
+#
+v=$(shell $(AS) --version | grep 'GNU assembler' | egrep -o '2\.[0-9\.]+' | 
cut -d. -f2)
+MIPSFLAGS:=$(shell \
+if [ $v -lt 14 ]; then \
+   echo -mcpu=4kc; \
+else \
+   echo -march=4kc -mtune=4kc; \
+fi)
+
+MIPSFLAGS += -mabicalls -mips32
+
+PLATFORM_CPPFLAGS += $(MIPSFLAGS)
diff --git a/arch/mips/cpu/xburst/cpu.c b/arch/mips/cpu/xburst/cpu.c
new file mode 100644
index 000..7b87f8b
--- /dev/null
+++ b/arch/mips/cpu/xburst/cpu.c
@@ -0,0 +1,160 @@
+/*
+ * (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