1 this patch include the u-boot2009.11 change files
3 From: Xiangfu Liu <xiangfu@sharism.cc>
9 common/env_common.c | 2
10 common/lcd.c | 45 ++++
13 cpu/mips/cache.S | 280 ++++++++++----------------
14 cpu/mips/config.mk | 6 -
15 cpu/mips/cpu.c | 75 +++++++
16 cpu/mips/start.S | 432 ++++++++++++++++++++++++++++++++--------
17 drivers/mtd/nand/nand_base.c | 88 ++++++++
18 examples/standalone/mips.lds | 2
19 include/asm-mips/addrspace.h | 2
20 include/asm-mips/global_data.h | 11 +
21 include/lcd.h | 56 +++++
22 lib_mips/board.c | 18 +-
23 lib_mips/bootm.c | 7 +
25 20 files changed, 800 insertions(+), 333 deletions(-)
28 diff --git a/Makefile b/Makefile
29 index f06a97c..a318eb4 100644
32 @@ -3439,6 +3439,22 @@ qemu_mips_config : unconfig
33 @$(MKCONFIG) -a qemu-mips mips mips qemu-mips
35 #########################################################################
37 +#########################################################################
38 +qi_lb60_config : unconfig
39 + @echo "#define CONFIG_NAND_U_BOOT" > $(obj)include/config.h
40 + @echo "Compile NAND boot image for QI LB60"
41 + @$(MKCONFIG) -a qi_lb60 mips mips nanonote
42 + @echo "TEXT_BASE = 0x80100000" > $(obj)board/nanonote/config.tmp
43 + @echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk
45 +avt2_config : unconfig
46 + @echo "#define CONFIG_NAND_U_BOOT" > $(obj)include/config.h
47 + @echo "Compile NAND boot image for AVT2"
48 + @$(MKCONFIG) -a avt2 mips mips nanonote
49 + @echo "TEXT_BASE = 0x80100000" > $(obj)board/nanonote/config.tmp
50 + @echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk
51 +#########################################################################
53 #########################################################################
55 diff --git a/common/env_common.c b/common/env_common.c
56 index 439a4a9..6cfe30b 100644
57 --- a/common/env_common.c
58 +++ b/common/env_common.c
59 @@ -134,7 +134,10 @@ uchar default_environment[] = {
60 "pcidelay=" MK_STR(CONFIG_PCI_BOOTDELAY) "\0"
62 -#ifdef CONFIG_EXTRA_ENV_SETTINGS
63 - CONFIG_EXTRA_ENV_SETTINGS
64 +#ifdef CONFIG_BOOTARGSFROMSD
65 + "bootargsfromsd=" CONFIG_BOOTARGSFROMSD "\0"
67 +#ifdef CONFIG_BOOTCOMMANDFROMSD
68 + "bootcmdfromsd=" CONFIG_BOOTCOMMANDFROMSD "\0"
72 diff --git a/common/lcd.c b/common/lcd.c
73 index 4e31618..ddd5aa8 100644
77 #ifdef CONFIG_LCD_LOGO
78 # include <bmp_logo.h> /* Get logo data, width and height */
79 # if (CONSOLE_COLOR_WHITE >= BMP_LOGO_OFFSET)
80 -# error Default Color Map overlaps with Logo Color Map
81 +# ifndef CONFIG_JzRISC /* JzRISC core */
82 +# error Default Color Map overlaps with Logo Color Map
87 @@ -249,6 +251,14 @@ static void lcd_drawchars (ushort x, ushort y, uchar *str, int count)
88 lcd_color_fg : lcd_color_bg;
91 +#elif LCD_BPP == LCD_COLOR32
92 + uint *m = (uint *)d;
93 + for (c=0; c<32; ++c) {
94 + *m++ = (bits & 0x80) ?
95 + lcd_color_fg : lcd_color_bg;
101 #if LCD_BPP == LCD_MONOCHROME
102 @@ -315,6 +325,9 @@ static void test_pattern (void)
104 #endif /* LCD_TEST_PATTERN */
106 +#ifdef CONFIG_JzRISC /* JzRISC core */
107 +extern int flush_cache_all(void);
110 /************************************************************************/
111 /* ** GENERIC Initialization Routines */
112 @@ -381,6 +394,7 @@ static int lcd_clear (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
113 COLOR_MASK(lcd_getbgcolor()),
114 lcd_line_length*panel_info.vl_row);
117 /* Paint the logo and retrieve LCD base address */
118 debug ("[LCD] Drawing the logo...\n");
119 lcd_console_address = lcd_logo ();
120 @@ -458,6 +472,8 @@ static void lcd_setfgcolor (int color)
122 #ifdef CONFIG_ATMEL_LCD
123 lcd_color_fg = color;
124 +#elif LCD_BPP == LCD_COLOR32
125 + lcd_color_fg = color & 0xFFFFFFFF;
127 lcd_color_fg = color & 0x0F;
129 @@ -469,6 +485,8 @@ static void lcd_setbgcolor (int color)
131 #ifdef CONFIG_ATMEL_LCD
132 lcd_color_bg = color;
133 +#elif LCD_BPP == LCD_COLOR32
134 + lcd_color_bg = color & 0xFFFFFFFF;
136 lcd_color_bg = color & 0x0F;
138 @@ -507,6 +525,7 @@ void bitmap_plot (int x, int y)
143 #if defined(CONFIG_PXA250)
144 struct pxafb_info *fbi = &panel_info.pxa;
145 #elif defined(CONFIG_MPC823)
146 @@ -567,13 +586,25 @@ void bitmap_plot (int x, int y)
149 else { /* true color mode */
150 - fb16 = (ushort *)(lcd_base + y * lcd_line_length + x);
151 - for (i=0; i<BMP_LOGO_HEIGHT; ++i) {
152 - for (j=0; j<BMP_LOGO_WIDTH; j++) {
153 - fb16[j] = bmp_logo_palette[(bmap[j])];
154 + if(NBITS(panel_info.vl_bpix) == 16){
155 + fb16 = (ushort *)(lcd_base + y * lcd_line_length + x);
156 + for (i=0; i<BMP_LOGO_HEIGHT; ++i) {
157 + for (j=0; j<BMP_LOGO_WIDTH; j++) {
158 + fb16[j] = bmp_logo_palette[(bmap[j])];
160 - bmap += BMP_LOGO_WIDTH;
161 - fb16 += panel_info.vl_col;
162 + bmap += BMP_LOGO_WIDTH;
163 + fb16 += panel_info.vl_col;
167 + fb32 = (uint *)(lcd_base + y * lcd_line_length + x);
168 + for (i=0; i<BMP_LOGO_HEIGHT; ++i) {
169 + for (j=0; j<BMP_LOGO_WIDTH; j++) {
170 + fb32[j] = bmp_logo_palette[(bmap[j])];
172 + bmap += BMP_LOGO_WIDTH;
173 + fb32 += panel_info.vl_col;
178 diff --git a/common/main.c b/common/main.c
179 index 10d8904..ff11ad7 100644
182 @@ -372,7 +372,9 @@ void main_loop (void)
183 #if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0)
184 s = getenv ("bootdelay");
185 bootdelay = s ? (int)simple_strtol(s, NULL, 10) : CONFIG_BOOTDELAY;
187 + DECLARE_GLOBAL_DATA_PTR;
188 + if (gd->boot_option == 5)
189 + bootdelay = gd->boot_option;
190 debug ("### main_loop entered: bootdelay=%d\n\n", bootdelay);
192 # ifdef CONFIG_BOOT_RETRY_TIME
193 @@ -393,7 +395,9 @@ void main_loop (void)
196 #endif /* CONFIG_BOOTCOUNT_LIMIT */
197 - s = getenv ("bootcmd");
198 + s = gd->boot_option == 1 ?
199 + getenv ("bootcmdfromsd"):
200 + getenv ("bootcmd") ;
202 debug ("### main_loop: bootcmd=\"%s\"\n", s ? s : "<UNDEFINED>");
204 diff --git a/cpu/mips/Makefile b/cpu/mips/Makefile
205 index 28a1cbb..5207bc5 100644
206 --- a/cpu/mips/Makefile
207 +++ b/cpu/mips/Makefile
208 @@ -33,6 +33,9 @@ SOBJS-$(CONFIG_INCA_IP) += incaip_wdt.o
209 COBJS-$(CONFIG_INCA_IP) += asc_serial.o incaip_clock.o
210 COBJS-$(CONFIG_PURPLE) += asc_serial.o
211 COBJS-$(CONFIG_SOC_AU1X00) += au1x00_eth.o au1x00_serial.o au1x00_usb_ohci.o
212 +COBJS-$(CONFIG_JZSOC) += jz4740.o jz_serial.o jz_mmc.o jz4740_nand.o
213 +COBJS-$(CONFIG_NANONOTE) += nanonote_gpm940b0.o
216 SRCS := $(START:.o=.S) $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
217 OBJS := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
218 diff --git a/cpu/mips/cache.S b/cpu/mips/cache.S
219 index ff4f11c..cb3baff 100644
220 --- a/cpu/mips/cache.S
221 +++ b/cpu/mips/cache.S
226 -#include <asm/asm.h>
227 +#include <version.h>
228 #include <asm/regdef.h>
229 #include <asm/mipsregs.h>
230 #include <asm/addrspace.h>
231 #include <asm/cacheops.h>
234 +#ifndef CONFIG_JzRISC
237 - * 16kB is the maximum size of instruction and data caches on MIPS 4K,
238 - * 64kB is on 4KE, 24K, 5K, etc. Set bigger size for convenience.
240 - * Note that the above size is the maximum size of primary cache. U-Boot
241 - * doesn't have L2 cache support for now.
243 -#define MIPS_MAX_CACHE_SIZE 0x10000
245 -#define INDEX_BASE CKSEG0
246 + /* 16KB is the maximum size of instruction and data caches on
249 +#define MIPS_MAX_CACHE_SIZE 0x4000
251 - .macro cache_op op addr
255 - cache \op, 0(\addr)
260 * cacheop macro to automate cache operations
262 #define icacheop(kva, n, cacheSize, cacheLineSize, op) \
263 icacheopn(kva, n, cacheSize, cacheLineSize, 1, (op))
265 - .macro f_fill64 dst, offset, val
266 - LONG_S \val, (\offset + 0 * LONGSIZE)(\dst)
267 - LONG_S \val, (\offset + 1 * LONGSIZE)(\dst)
268 - LONG_S \val, (\offset + 2 * LONGSIZE)(\dst)
269 - LONG_S \val, (\offset + 3 * LONGSIZE)(\dst)
270 - LONG_S \val, (\offset + 4 * LONGSIZE)(\dst)
271 - LONG_S \val, (\offset + 5 * LONGSIZE)(\dst)
272 - LONG_S \val, (\offset + 6 * LONGSIZE)(\dst)
273 - LONG_S \val, (\offset + 7 * LONGSIZE)(\dst)
275 - LONG_S \val, (\offset + 8 * LONGSIZE)(\dst)
276 - LONG_S \val, (\offset + 9 * LONGSIZE)(\dst)
277 - LONG_S \val, (\offset + 10 * LONGSIZE)(\dst)
278 - LONG_S \val, (\offset + 11 * LONGSIZE)(\dst)
279 - LONG_S \val, (\offset + 12 * LONGSIZE)(\dst)
280 - LONG_S \val, (\offset + 13 * LONGSIZE)(\dst)
281 - LONG_S \val, (\offset + 14 * LONGSIZE)(\dst)
282 - LONG_S \val, (\offset + 15 * LONGSIZE)(\dst)
287 - * mips_init_icache(uint PRId, ulong icache_size, unchar icache_linesz)
289 -LEAF(mips_init_icache)
291 - mtc0 zero, CP0_TAGLO
292 - /* clear tag to invalidate */
293 - PTR_LI t0, INDEX_BASE
294 - PTR_ADDU t1, t0, a1
295 -1: cache_op Index_Store_Tag_I t0
298 - /* fill once, so data field parity is correct */
299 - PTR_LI t0, INDEX_BASE
303 - /* invalidate again - prudent but not strictly neccessary */
304 - PTR_LI t0, INDEX_BASE
305 -1: cache_op Index_Store_Tag_I t0
309 - END(mips_init_icache)
312 - * mips_init_dcache(uint PRId, ulong dcache_size, unchar dcache_linesz)
314 -LEAF(mips_init_dcache)
316 - mtc0 zero, CP0_TAGLO
317 - /* clear all tags */
318 - PTR_LI t0, INDEX_BASE
319 - PTR_ADDU t1, t0, a1
320 -1: cache_op Index_Store_Tag_D t0
323 - /* load from each line (in cached space) */
324 - PTR_LI t0, INDEX_BASE
325 -2: LONG_L zero, 0(t0)
328 - /* clear all tags */
329 - PTR_LI t0, INDEX_BASE
330 -1: cache_op Index_Store_Tag_D t0
334 - END(mips_init_dcache)
336 -/*******************************************************************************
338 * mips_cache_reset - low level initialisation of the primary caches
340 * This routine initialises the primary caches to ensure that they
341 @@ -204,112 +119,129 @@ LEAF(mips_init_dcache)
342 * a source of parity.
347 -NESTED(mips_cache_reset, 0, ra)
349 + .globl mips_cache_reset
350 + .ent mips_cache_reset
353 li t2, CONFIG_SYS_ICACHE_SIZE
354 li t3, CONFIG_SYS_DCACHE_SIZE
355 li t4, CONFIG_SYS_CACHELINE_SIZE
359 li v0, MIPS_MAX_CACHE_SIZE
362 - * Now clear that much memory starting from zero.
363 + /* Now clear that much memory starting from zero.
366 - PTR_ADDU a1, a0, v0
368 - f_fill64 a0, -64, zero
372 - * The caches are probably in an indeterminate state,
373 - * so we force good parity into them by doing an
374 - * invalidate, load/fill, invalidate for each line.
390 + /* Set invalid tag.
394 - * Assume bottom of RAM will generate good parity for the cache.
395 + mtc0 zero, CP0_TAGLO
398 + * The caches are probably in an indeterminate state,
399 + * so we force good parity into them by doing an
400 + * invalidate, load/fill, invalidate for each line.
403 + /* Assume bottom of RAM will generate good parity for the cache.
407 - * Initialize the I-cache first,
409 + move a2, t2 # icacheSize
410 + move a3, t4 # icacheLineSize
412 + icacheopn(a0,a1,a2,a3,121,(Index_Store_Tag_I,Fill))
414 + /* To support Orion/R4600, we initialise the data cache in 3 passes.
418 - PTR_LA t7, mips_init_icache
422 - * then initialize D-cache.
423 + /* 1: initialise dcache tags.
427 - PTR_LA t7, mips_init_dcache
431 - END(mips_cache_reset)
433 + move a2, t3 # dcacheSize
434 + move a3, t5 # dcacheLineSize
436 + icacheop(a0,a1,a2,a3,Index_Store_Tag_D)
438 -/*******************************************************************************
440 -* dcache_status - get cache status
442 -* RETURNS: 0 - cache disabled; 1 - cache enabled
446 - mfc0 t0, CP0_CONFIG
447 - li t1, CONF_CM_UNCACHED
448 - andi t0, t0, CONF_CM_CMASK
455 -/*******************************************************************************
461 + move a2, t3 # dcacheSize
462 + move a3, t5 # dcacheLineSize
464 + icacheopn(a0,a1,a2,a3,1lw,(dummy))
466 + /* 3: clear dcache tags.
470 + move a2, t3 # dcacheSize
471 + move a3, t5 # dcacheLineSize
473 + icacheop(a0,a1,a2,a3,Index_Store_Tag_D)
476 + .end mips_cache_reset
480 + * dcache_status - get cache status
482 + * RETURNS: 0 - cache disabled; 1 - cache enabled
484 + .globl dcache_status
488 + mfc0 v0, CP0_CONFIG
495 * dcache_disable - disable cache
500 -LEAF(dcache_disable)
501 + .globl dcache_disable
502 + .ent dcache_disable
508 ori t0, t0, CONF_CM_UNCACHED
509 - mtc0 t0, CP0_CONFIG
511 - END(dcache_disable)
512 + mtc0 t0, CP0_CONFIG
515 -/*******************************************************************************
517 -* dcache_enable - enable cache
523 - mfc0 t0, CP0_CONFIG
524 - ori t0, CONF_CM_CMASK
525 - xori t0, CONF_CM_CMASK
526 - ori t0, CONF_CM_CACHABLE_NONCOHERENT
527 - mtc0 t0, CP0_CONFIG
531 -#ifdef CONFIG_SYS_INIT_RAM_LOCK_MIPS
532 -/*******************************************************************************
534 -* mips_cache_lock - lock RAM area pointed to by a0 in cache.
539 + .end dcache_disable
543 + * mips_cache_lock - lock RAM area pointed to by a0 in cache.
547 #if defined(CONFIG_PURPLE)
548 # define CACHE_LOCK_SIZE (CONFIG_SYS_DCACHE_SIZE/2)
550 @@ -318,14 +250,14 @@ LEAF(dcache_enable)
551 .globl mips_cache_lock
554 - li a1, CKSEG0 - CACHE_LOCK_SIZE
555 + li a1, K0BASE - CACHE_LOCK_SIZE
557 li a2, CACHE_LOCK_SIZE
558 li a3, CONFIG_SYS_CACHELINE_SIZE
560 icacheop(a0,a1,a2,a3,0x1d)
566 -#endif /* CONFIG_SYS_INIT_RAM_LOCK_MIPS */
568 +#endif /* CONFIG_JzRISC */
569 diff --git a/cpu/mips/config.mk b/cpu/mips/config.mk
570 index a173c54..8d27e52 100644
571 --- a/cpu/mips/config.mk
572 +++ b/cpu/mips/config.mk
573 @@ -25,15 +25,15 @@ MIPSFLAGS:=$(shell \
574 if [ "$v" -lt "14" ]; then \
577 - echo "-march=4kc -mtune=4kc"; \
578 + echo "-march=4kc -mtune=r4600"; \
581 ifneq (,$(findstring 4KCle,$(CROSS_COMPILE)))
588 -MIPSFLAGS += $(ENDIANNESS)
589 +MIPSFLAGS += $(ENDIANNESS) -mabicalls -mips32 -O2
591 PLATFORM_CPPFLAGS += $(MIPSFLAGS)
592 diff --git a/cpu/mips/cpu.c b/cpu/mips/cpu.c
593 index d5a1604..48e1cea 100644
597 #include <asm/cacheops.h>
598 #include <asm/reboot.h>
600 +#ifdef CONFIG_JZ4740
601 +#include <asm/jz4740.h>
604 +#if !defined (CONFIG_NAND_SPL) && !defined (CONFIG_MSC_SPL)
606 #define cache_op(op,addr) \
607 __asm__ __volatile__( \
611 void __attribute__((weak)) _machine_restart(void)
613 +#ifdef CONFIG_JZ4740
614 + __wdt_select_extalclk();
615 + __wdt_select_clk_div64();
616 + __wdt_set_data(100);
617 + __wdt_set_count(0);
618 + __tcu_start_wdt_clock();
622 +#if defined(CONFIG_JzRISC)
623 + void (*f)(void) = (void *) 0xbfc00000;
628 int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
629 @@ -110,3 +129,59 @@ int cpu_eth_init(bd_t *bis)
634 +#endif /* !CONFIG_NAND_SPL !CONFIG_MSC_SPL */
636 +#ifdef CONFIG_JzRISC
637 +void flush_icache_all(void)
641 + asm volatile ("mtc0 $0, $28"); /* Clear Taglo */
642 + asm volatile ("mtc0 $0, $29"); /* Clear TagHi */
644 + for (addr = KSEG0; addr < KSEG0 + CONFIG_SYS_ICACHE_SIZE;
645 + addr += CONFIG_SYS_CACHELINE_SIZE) {
648 + " cache %0, 0(%1)\n\t"
651 + : "I" (Index_Store_Tag_I), "r"(addr));
654 + /* invalicate btb */
657 + "mfc0 %0, $16, 7\n\t"
660 + "mtc0 %0, $16, 7\n\t"
666 +void flush_dcache_all(void)
670 + for (addr = KSEG0; addr < KSEG0 + CONFIG_SYS_DCACHE_SIZE;
671 + addr += CONFIG_SYS_CACHELINE_SIZE) {
674 + " cache %0, 0(%1)\n\t"
677 + : "I" (Index_Writeback_Inv_D), "r"(addr));
680 + asm volatile ("sync");
683 +void flush_cache_all(void)
685 + flush_dcache_all();
686 + flush_icache_all();
688 +#endif /* CONFIG_JzRISC */
689 diff --git a/cpu/mips/start.S b/cpu/mips/start.S
690 index 57db589..fa6e352 100644
691 --- a/cpu/mips/start.S
692 +++ b/cpu/mips/start.S
697 +#include <version.h>
698 #include <asm/regdef.h>
699 #include <asm/mipsregs.h>
700 +#include <asm/addrspace.h>
701 +#include <asm/cacheops.h>
704 - * For the moment disable interrupts, mark the kernel mode and
705 - * set ST0_KX so that the CPU does not spit fire when using
706 - * 64-bit addresses.
708 - .macro setup_c0_status set clr
710 - mfc0 t0, CP0_STATUS
711 - or t0, ST0_CU0 | \set | 0x1f | \clr
712 - xor t0, 0x1f | \clr
713 - mtc0 t0, CP0_STATUS
719 - .macro setup_c0_status_reset
721 - setup_c0_status ST0_KX 0
723 - setup_c0_status 0 0
724 +#ifdef CONFIG_JZ4730
725 +#include <asm/jz4730.h>
728 +#ifdef CONFIG_JZ4740
729 +#include <asm/jz4740.h>
732 +#ifdef CONFIG_JZ4750
733 +#include <asm/jz4750.h>
736 +#ifdef CONFIG_JZ4750D
737 +#include <asm/jz4750d.h>
740 +#if defined(CONFIG_JZ4750) || defined(CONFIG_JZ4750D)
741 +#define JZ4750_NANDBOOT_CFG0 (0x55555500 | (CFG_NAND_BW8*0xff))
742 +#define JZ4750_NANDBOOT_CFG1 0x55555555
743 +#define JZ4750_NANDBOOT_CFG2 ((CFG_NAND_PAGE_SIZE==2048)&0xff0000) | ((CFG_NAND_PAGE_SIZE!=512)&0xff00) | ((CFG_NAND_ROW_CYCLE==3)&0xff)
747 #define RVECENT(f,n) \
753 +#if defined(CONFIG_JZ4740)
754 +#if !defined(CONFIG_NAND_SPL) && !defined(CONFIG_NAND_U_BOOT)
755 + .word JZ4740_NORBOOT_CFG /* fetched during NOR Boot */
757 +#if defined(CONFIG_NAND_SPL)
758 + .word JZ4740_NANDBOOT_CFG /* fetched during NAND Boot */
761 +#endif /* CONFIG_JZ4740 */
762 +#if defined(CONFIG_JZ4750) || defined(CONFIG_JZ4750D)
763 +#if !defined(CONFIG_NAND_SPL) && !defined(CONFIG_NAND_U_BOOT)
764 + .word JZ4750_NORBOOT_CFG /* fetched during NOR Boot */
766 +#if defined(CONFIG_NAND_SPL) && !defined(CONFIG_MSC_SPL)
767 + /* First three words fetched by CPU during NAND Boot */
768 + .word JZ4750_NANDBOOT_CFG0
769 + .word JZ4750_NANDBOOT_CFG1
770 + .word JZ4750_NANDBOOT_CFG2
773 +#endif /* CONFIG_JZ4750 || CONFIG_JZ4750D */
774 +#if !defined(CONFIG_JzRISC)
775 RVECENT(reset,0) /* U-boot entry point */
776 RVECENT(reset,1) /* software reboot */
777 #if defined(CONFIG_INCA_IP)
778 @@ -213,7 +236,7 @@ _start:
787 @@ -224,74 +247,192 @@ _start:
793 #endif /* CONFIG_PURPLE */
795 +#endif /* CONFIG_JzRISC */
799 +#if !defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_NAND_SPL)
801 +#ifdef CONFIG_JZ4730
803 + /* Disable interrupts */
818 + * Set usb port0 as host
822 + ori t1, HARB_HAPOR_UCHSEL
826 + * Check reset status
831 + bnez t1, resume_from_hibernate
833 +#endif /* CONFIG_JZ4730 */
835 +#ifndef CONFIG_NAND_SPL
836 /* Clear watch registers.
838 mtc0 zero, CP0_WATCHLO
839 mtc0 zero, CP0_WATCHHI
842 - /* WP(Watch Pending), SW0/1 should be cleared. */
843 - mtc0 zero, CP0_CAUSE
844 + /* STATUS register */
845 +#ifdef CONFIG_JzRISC
847 + * CU0=UM=EXL=IE=0, BEV=ERL=1, IP2~7=1
850 + mtc0 t0, CP0_STATUS
852 +#ifdef CONFIG_TB0229
855 + mfc0 k0, CP0_STATUS
859 + mtc0 k0, CP0_STATUS
862 - setup_c0_status_reset
863 + /* CAUSE register */
864 +#ifdef CONFIG_JzRISC
865 + /* IV=1, use the specical interrupt vector (0x200) */
869 + mtc0 zero, CP0_CAUSE
872 +#ifndef CONFIG_JzRISC
875 mtc0 zero, CP0_COMPARE
878 -#if !defined(CONFIG_SKIP_LOWLEVEL_INIT)
879 +#endif /* !defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_NAND_SPL) */
881 +#if !defined(CONFIG_NAND_SPL) && !defined(CONFIG_NAND_U_BOOT)
882 /* CONFIG0 register */
883 li t0, CONF_CM_UNCACHED
885 -#endif /* !CONFIG_SKIP_LOWLEVEL_INIT */
889 + /* Initialize GOT pointer.
893 + .word _GLOBAL_OFFSET_TABLE_
899 +#ifdef CONFIG_INCA_IP
900 + /* Disable INCA-IP Watchdog.
903 + la t9, disable_incaip_wdt
911 -#if !defined(CONFIG_SKIP_LOWLEVEL_INIT)
912 +/* JzRISC will init external memory in board_init_f,
913 + which uses cache as stack and calls into C code. */
914 +#ifndef CONFIG_JzRISC
915 /* Initialize any external memory.
917 - la t9, lowlevel_init
919 + la t9, lowlevel_init
924 +#if !defined(CONFIG_NAND_SPL) && !defined(CONFIG_NAND_U_BOOT)
925 /* Initialize caches...
927 - la t9, mips_cache_reset
929 +#ifdef CONFIG_JzRISC
931 + mtc0 zero, CP0_TAGLO
932 + mtc0 zero, CP0_TAGHI
935 + ori t1, t0, CONFIG_SYS_DCACHE_SIZE
937 + cache Index_Store_Tag_D, 0(t0)
939 + addiu t0, t0, CONFIG_SYS_CACHELINE_SIZE
942 + ori t1, t0, CONFIG_SYS_ICACHE_SIZE
944 + cache Index_Store_Tag_I, 0(t0)
946 + addiu t0, t0, CONFIG_SYS_CACHELINE_SIZE
948 + /* Invalidate BTB */
949 + mfc0 t0, CP0_CONFIG, 7
952 + mtc0 t0, CP0_CONFIG, 7
957 + la t9, mips_cache_reset
962 /* ... and enable them.
964 li t0, CONF_CM_CACHABLE_NONCOHERENT
966 -#endif /* !CONFIG_SKIP_LOWLEVEL_INIT */
969 +#endif /* !defined(CONFIG_NAND_SPL) && !defined(CONFIG_NAND_U_BOOT) */
971 /* Set up temporary stack.
973 -#ifdef CONFIG_SYS_INIT_RAM_LOCK_MIPS
974 +#ifndef CONFIG_JzRISC
975 li a0, CONFIG_SYS_INIT_SP_OFFSET
976 - la t9, mips_cache_lock
978 + la t9, mips_cache_lock
983 +#ifdef CONFIG_NAND_SPL
989 li t0, CONFIG_SYS_SDRAM_BASE + CONFIG_SYS_INIT_SP_OFFSET
999 * void relocate_code (addr_sp, gd, addr_moni)
1001 @@ -305,37 +446,28 @@ reset:
1002 .globl relocate_code
1005 - move sp, a0 /* Set new stack pointer */
1006 + move sp, a0 /* Set new stack pointer */
1008 - li t0, CONFIG_SYS_MONITOR_BASE
1011 lw t2, -12(t3) /* t2 <-- uboot_end_data */
1013 - move s2, a2 /* s2 <-- destination address */
1017 + * Fix GOT pointer:
1019 - * New $gp = (Old $gp - CONFIG_SYS_MONITOR_BASE) + Destination Address
1020 + * New GOT-PTR = (old GOT-PTR - TEXT_BASE) + Destination Address
1023 - sub gp, CONFIG_SYS_MONITOR_BASE
1024 - add gp, a2 /* gp now adjusted */
1025 - sub s1, gp, t6 /* s1 <-- relocation offset */
1027 + add gp, a2 /* gp now adjusted */
1028 + sub t6, gp, t6 /* t6 <-- relocation offset */
1031 * t0 = source address
1032 * t1 = target address
1033 * t2 = source end address
1037 - * Save destination address and size for later usage in flush_cache()
1039 - move s0, a1 /* save gd in s0 */
1040 - move a0, t1 /* a0 <-- destination addr */
1041 - sub a1, t2, t0 /* a1 <-- size */
1043 /* On the purple board we copy the code earlier in a special way
1044 * in order to solve flash problems
1046 @@ -345,47 +477,61 @@ relocate_code:
1050 - addu t1, 4 /* delay slot */
1051 + addu t1, 4 /* delay slot */
1054 /* If caches were enabled, we would have to flush them here.
1057 - /* a0 & a1 are already set up for flush_cache(start, size) */
1058 - la t9, flush_cache
1060 +#ifdef CONFIG_JzRISC
1061 + /* flush d-cache */
1064 + addi t1, t0, CONFIG_SYS_DCACHE_SIZE
1066 + cache Index_Writeback_Inv_D, 0(t0)
1068 + addi t0, CONFIG_SYS_CACHELINE_SIZE
1072 + /* flush i-cache */
1074 + addi t1, t0, CONFIG_SYS_ICACHE_SIZE
1076 + cache Index_Invalidate_I, 0(t0)
1078 + addi t0, CONFIG_SYS_CACHELINE_SIZE
1080 + /* Invalidate BTB */
1081 + mfc0 t0, CP0_CONFIG, 7
1084 + mtc0 t0, CP0_CONFIG, 7
1090 /* Jump to where we've relocated ourselves.
1092 - addi t0, s2, in_ram - _start
1094 + addi t0, a2, in_ram - _start
1099 - .word _GLOBAL_OFFSET_TABLE_
1100 .word uboot_end_data
1102 .word num_got_entries
1106 - * Now we want to update GOT.
1108 - * GOT[0] is reserved. GOT[1] is also reserved for the dynamic object
1109 - * generated by GNU ld. Skip these reserved entries from relocation.
1110 + /* Now we want to update GOT.
1112 lw t3, -4(t0) /* t3 <-- num_got_entries */
1113 - lw t4, -16(t0) /* t4 <-- _GLOBAL_OFFSET_TABLE_ */
1114 - lw t5, -20(t0) /* t5 <-- _gp */
1115 - sub t4, t5 /* compute offset*/
1116 - add t4, t4, gp /* t4 now holds relocated _GLOBAL_OFFSET_TABLE_ */
1117 - addi t4, t4, 8 /* Skipping first two entries. */
1118 + addi t4, gp, 8 /* Skipping first two entries. */
1128 @@ -396,26 +542,134 @@ in_ram:
1130 lw t1, -12(t0) /* t1 <-- uboot_end_data */
1131 lw t2, -8(t0) /* t2 <-- uboot_end */
1132 - add t1, s1 /* adjust pointers */
1134 + add t1, t6 /* adjust pointers */
1142 sw zero, 0(t1) /* delay slot */
1144 - move a0, s0 /* a0 <-- gd */
1148 - move a1, s2 /* delay slot */
1150 + move a1, a2 /* delay slot */
1154 +#endif /* CONFIG_NAND_SPL */
1156 +#if !defined(CONFIG_JzRISC)
1157 /* Exception handlers.
1168 +#ifdef CONFIG_JZ4730
1170 +/* These are the runtime values, modify them according to your platform. */
1171 +#define PLCR1_VAL 0x1b000520
1172 +#define CFCR_VAL 0x0c526220
1174 +#define DMCR_VAL0 0x042a3211
1175 +#define DMCR_VAL1 0x05aa3211 /*(DMCR_VAL0|EMC_DMCR_RFSH|EMC_DMCR_MRSET)*/
1177 +#define RTCOR_VAL 0x10
1178 +#define RTCSR_VAL 0x83
1181 + * cpu was reset from hibernate mode
1183 +resume_from_hibernate:
1187 + la t0, 0xB0000000 /* CFCR */
1191 + la t0, 0xB0000010 /* PLCR1 */
1198 + mtc0 zero, CP0_TAGLO
1199 + mtc0 zero, CP0_TAGHI
1202 + ori t1, t0, CONFIG_SYS_DCACHE_SIZE
1204 + cache Index_Store_Tag_D, 0(t0)
1205 + cache Index_Store_Tag_I, 0(t0)
1207 + addiu t0, t0, CONFIG_SYS_CACHELINE_SIZE
1212 + la t0, 0xB0010070 /* GPALR2 */
1220 + la t0, 0xB0010074 /* GPAUR2 */
1228 + la t0, 0xB3010000 /* EMC base address */
1230 + li t1, DMCR_VAL0 /* DMCR */
1234 + sh t1, 0x8c(t0) /* RTCOR */
1237 + sh t1, 0x84(t0) /* RTCSR */
1239 + /* precharge all chip-selects */
1240 + ori t1, t0, 0xa088
1242 + ori t1, t0, 0xb088
1245 + /* delay about 200us */
1251 + la t1, DMCR_VAL1 /* DMCR */
1254 + /* write sdram mode register for each chip-select */
1255 + ori t1, t0, 0xa088
1257 + ori t1, t0, 0xb088
1261 + * jump to resume entry point
1271 +#endif /* CONFIG_JZ4730 */
1272 diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
1273 index 426bb95..6e5fbd3 100644
1274 --- a/drivers/mtd/nand/nand_base.c
1275 +++ b/drivers/mtd/nand/nand_base.c
1276 @@ -109,6 +109,22 @@ static struct nand_ecclayout nand_oob_16 = {
1280 +#if defined(CONFIG_JZ4740)
1281 +static struct nand_ecclayout nand_oob_64 = {
1284 + 6, 7, 8, 9, 10, 11, 12, 13,
1285 + 14, 15, 16, 17, 18, 19, 20, 21,
1286 + 22, 23, 24, 25, 26, 27, 28, 29,
1287 + 30, 31, 32, 33, 34, 35, 36, 37,
1296 static struct nand_ecclayout nand_oob_64 = {
1299 @@ -119,6 +135,7 @@ static struct nand_ecclayout nand_oob_64 = {
1305 static struct nand_ecclayout nand_oob_128 = {
1307 @@ -1116,6 +1133,60 @@ static int nand_read_page_hwecc_oob_first(struct mtd_info *mtd,
1311 + * nand_read_page_hwecc_rs - [REPLACABLE] hardware rs ecc based page read function
1312 + * @mtd: mtd info structure
1313 + * @chip: nand chip info structure
1314 + * @buf: buffer to store read data
1316 + * Not for syndrome calculating ecc controllers which need a special oob layout
1318 +static int nand_read_page_hwecc_rs(struct mtd_info *mtd, struct nand_chip *chip,
1321 + int i, eccsize = chip->ecc.size;
1322 + int eccbytes = chip->ecc.bytes;
1323 + int eccsteps = chip->ecc.steps;
1325 + uint8_t *ecc_calc = chip->buffers->ecccalc;
1326 + uint8_t *ecc_code = chip->buffers->ecccode;
1327 + uint32_t *eccpos = chip->ecc.layout->eccpos;
1331 + page = (buf[3]<<24) + (buf[2]<<16) + (buf[1]<<8) + buf[0];
1333 + chip->cmdfunc(mtd, NAND_CMD_READOOB, 0, page);
1334 + chip->read_buf(mtd, chip->oob_poi, mtd->oobsize);
1336 + for (i = 0; i < chip->ecc.total; i++) {
1337 + ecc_code[i] = chip->oob_poi[CONFIG_SYS_NAND_ECC_POS + i];
1338 + if (ecc_code[i] != 0xff)
1342 + eccsteps = chip->ecc.steps;
1345 + chip->cmdfunc(mtd, NAND_CMD_RNDOUT, 0x00, -1);
1346 + for (i = 0 ; eccsteps; eccsteps--, i += eccbytes, p += eccsize) {
1349 + chip->ecc.hwctl(mtd, NAND_ECC_READ);
1350 + chip->read_buf(mtd, p, eccsize);
1351 + stat = chip->ecc.correct(mtd, p, &ecc_code[i], &ecc_calc[i]);
1353 + mtd->ecc_stats.failed++;
1355 + mtd->ecc_stats.corrected += stat;
1358 + chip->ecc.hwctl(mtd, NAND_ECC_READ);
1359 + chip->read_buf(mtd, p, eccsize);
1365 * nand_read_page_syndrome - [REPLACABLE] hardware ecc syndrom based page read
1366 * @mtd: mtd info structure
1367 * @chip: nand chip info structure
1368 @@ -1271,9 +1342,17 @@ static int nand_do_read_ops(struct mtd_info *mtd, loff_t from,
1370 else if (!aligned && NAND_SUBPAGE_READ(chip) && !oob)
1371 ret = chip->ecc.read_subpage(mtd, chip, col, bytes, bufpoi);
1374 +#if defined(CONFIG_JZ4740)
1375 + bufpoi[0] = (uint8_t)page;
1376 + bufpoi[1] = (uint8_t)(page >> 8);
1377 + bufpoi[2] = (uint8_t)(page >> 16);
1378 + bufpoi[3] = (uint8_t)(page >> 24);
1381 ret = chip->ecc.read_page(mtd, chip, bufpoi,
1387 @@ -2791,8 +2870,13 @@ int nand_scan_tail(struct mtd_info *mtd)
1390 /* Use standard hwecc read page function ? */
1391 - if (!chip->ecc.read_page)
1392 + if (!chip->ecc.read_page) {
1393 +#if defined(CONFIG_JZ4740)
1394 + chip->ecc.read_page = nand_read_page_hwecc_rs;
1396 chip->ecc.read_page = nand_read_page_hwecc;
1399 if (!chip->ecc.write_page)
1400 chip->ecc.write_page = nand_write_page_hwecc;
1401 if (!chip->ecc.read_oob)
1402 diff --git a/examples/standalone/mips.lds b/examples/standalone/mips.lds
1403 index 717b201..d4a45f8 100644
1404 --- a/examples/standalone/mips.lds
1405 +++ b/examples/standalone/mips.lds
1409 OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-bigmips")
1411 OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradbigmips")
1416 diff --git a/include/asm-mips/addrspace.h b/include/asm-mips/addrspace.h
1417 index 3a1e6d6..2ee6920 100644
1418 --- a/include/asm-mips/addrspace.h
1419 +++ b/include/asm-mips/addrspace.h
1421 * Returns the uncached address of a sdram address
1423 #ifndef __ASSEMBLY__
1424 -#if defined(CONFIG_SOC_AU1X00) || defined(CONFIG_TB0229)
1425 +#if defined(CONFIG_SOC_AU1X00) || defined(CONFIG_TB0229) || defined(CONFIG_JzRISC)
1426 /* We use a 36 bit physical address map here and
1427 cannot access physical memory directly from core */
1428 #define UNCACHED_SDRAM(a) (((unsigned long)(a)) | 0x20000000)
1429 diff --git a/include/asm-mips/global_data.h b/include/asm-mips/global_data.h
1430 index b2c4891..23f597e 100644
1431 --- a/include/asm-mips/global_data.h
1432 +++ b/include/asm-mips/global_data.h
1434 typedef struct global_data {
1436 unsigned long flags;
1437 +#if defined(CONFIG_JZSOC)
1438 + /* There are other clocks in the Jz47xx or Jz5730*/
1439 + unsigned long cpu_clk; /* CPU core clock */
1440 + unsigned long sys_clk; /* System bus clock */
1441 + unsigned long per_clk; /* Peripheral bus clock */
1442 + unsigned long mem_clk; /* Memory bus clock */
1443 + unsigned long dev_clk; /* Device clock */
1444 + unsigned long fb_base; /* base address of framebuffer */
1445 + unsigned long boot_option; /* 1: boot from sd
1446 + * 5: boot delay for 5 secs*/
1448 unsigned long baudrate;
1449 unsigned long have_console; /* serial_init() was called */
1450 phys_size_t ram_size; /* RAM size */
1451 diff --git a/include/lcd.h b/include/lcd.h
1452 index 1f85daa..997e246 100644
1455 @@ -181,8 +181,44 @@ typedef struct vidinfo {
1456 u_long mmio; /* Memory mapped registers */
1460 +#elif defined(CONFIG_JZSOC)
1462 + * LCD controller stucture for JZSOC: JZ4730 JZ4740
1464 +struct jz_fb_dma_descriptor {
1465 + u_long fdadr; /* Frame descriptor address register */
1466 + u_long fsadr; /* Frame source address register */
1467 + u_long fidr; /* Frame ID register */
1468 + u_long ldcmd; /* Command register */
1474 +struct jz_fb_info {
1476 + u_long fdadr0; /* physical address of frame/palette descriptor */
1477 + u_long fdadr1; /* physical address of frame descriptor */
1479 + /* DMA descriptors */
1480 + struct jz_fb_dma_descriptor * dmadesc_fblow;
1481 + struct jz_fb_dma_descriptor * dmadesc_fbhigh;
1482 + struct jz_fb_dma_descriptor * dmadesc_palette;
1483 + u_long screen; /* address of frame buffer */
1484 + u_long palette; /* address of palette memory */
1485 + u_int palette_size;
1487 +typedef struct vidinfo {
1488 + ushort vl_col; /* Number of columns (i.e. 640) */
1489 + ushort vl_row; /* Number of rows (i.e. 480) */
1490 + u_char vl_bpix; /* Bits per pixel, 0 = 1, 1 = 2, 2 = 4, 3 = 8 */
1492 + struct jz_fb_info jz_fb;
1495 +extern vidinfo_t panel_info;
1498 typedef struct vidinfo {
1499 ushort vl_col; /* Number of columns (i.e. 160) */
1500 ushort vl_row; /* Number of rows (i.e. 100) */
1501 @@ -194,7 +230,7 @@ typedef struct vidinfo {
1502 void *priv; /* Pointer to driver-specific data */
1505 -#endif /* CONFIG_MPC823, CONFIG_PXA250 or CONFIG_MCC200 or CONFIG_ATMEL_LCD */
1506 +#endif /* CONFIG_MPC823, CONFIG_PXA250, CONFIG_MCC200 or CONFIG_JZ4740 */
1508 extern vidinfo_t panel_info;
1510 @@ -234,6 +270,7 @@ void lcd_show_board_info(void);
1511 #define LCD_COLOR4 2
1512 #define LCD_COLOR8 3
1513 #define LCD_COLOR16 4
1514 +#define LCD_COLOR32 5
1516 /*----------------------------------------------------------------------*/
1517 #if defined(CONFIG_LCD_INFO_BELOW_LOGO)
1518 @@ -285,13 +322,22 @@ void lcd_show_board_info(void);
1519 # define CONSOLE_COLOR_GREY 14
1520 # define CONSOLE_COLOR_WHITE 15 /* Must remain last / highest */
1523 +#elif LCD_BPP == LCD_COLOR16
1526 * 16bpp color definitions
1528 # define CONSOLE_COLOR_BLACK 0x0000
1529 -# define CONSOLE_COLOR_WHITE 0xffff /* Must remain last / highest */
1530 +# define CONSOLE_COLOR_WHITE 0xffff /* Must remain last / highest */
1532 +#elif LCD_BPP == LCD_COLOR32
1534 + * 18,24,32 bpp color definitions
1536 +# define CONSOLE_COLOR_BLACK 0x00000000
1537 +# define CONSOLE_COLOR_WHITE 0xffffffff /* Must remain last / highest */
1541 #endif /* color definitions */
1543 @@ -322,7 +368,7 @@ void lcd_show_board_info(void);
1544 #if LCD_BPP == LCD_MONOCHROME
1545 # define COLOR_MASK(c) ((c) | (c) << 1 | (c) << 2 | (c) << 3 | \
1546 (c) << 4 | (c) << 5 | (c) << 6 | (c) << 7)
1547 -#elif (LCD_BPP == LCD_COLOR8) || (LCD_BPP == LCD_COLOR16)
1548 +#elif (LCD_BPP == LCD_COLOR8) || (LCD_BPP == LCD_COLOR16) || (LCD_BPP == LCD_COLOR32)
1549 # define COLOR_MASK(c) (c)
1551 # error Unsupported LCD BPP.
1552 diff --git a/lib_mips/board.c b/lib_mips/board.c
1553 index b2d113e..87cb12d 100644
1554 --- a/lib_mips/board.c
1555 +++ b/lib_mips/board.c
1556 @@ -49,6 +49,10 @@ DECLARE_GLOBAL_DATA_PTR;
1560 +#if defined(CONFIG_JZSOC)
1561 +extern int jz_board_init(void);
1564 extern int timer_init(void);
1566 extern int incaip_set_cpuclk(void);
1567 @@ -78,7 +82,6 @@ int __board_early_init_f(void)
1569 int board_early_init_f(void) __attribute__((weak, alias("__board_early_init_f")));
1572 static int init_func_ram (void)
1574 #ifdef CONFIG_BOARD_TYPES
1575 @@ -98,7 +101,6 @@ static int init_func_ram (void)
1577 static int display_banner(void)
1580 printf ("\n\n%s\n\n", version_string);
1583 @@ -147,6 +149,9 @@ static int init_baudrate (void)
1584 typedef int (init_fnc_t) (void);
1586 init_fnc_t *init_sequence[] = {
1587 +#if defined(CONFIG_JZSOC)
1588 + jz_board_init, /* init gpio/clocks/dram etc. */
1592 env_init, /* initialize environment */
1593 @@ -162,7 +167,6 @@ init_fnc_t *init_sequence[] = {
1598 void board_init_f(ulong bootflag)
1601 @@ -202,6 +206,12 @@ void board_init_f(ulong bootflag)
1602 addr &= ~(4096 - 1);
1603 debug ("Top of RAM usable for U-Boot at: %08lx\n", addr);
1606 + /* reserve memory for LCD display (always full pages) */
1607 + addr = lcd_setmem (addr);
1608 + gd->fb_base = addr;
1609 +#endif /* CONFIG_LCD */
1611 /* Reserve memory for U-Boot code, data & bss
1612 * round down to next 16 kB limit
1614 @@ -349,9 +359,9 @@ void board_init_r (gd_t *id, ulong dest_addr)
1615 size = flash_init();
1616 display_flash_config (size);
1617 bd->bi_flashsize = size;
1618 + bd->bi_flashstart = CONFIG_SYS_FLASH_BASE;
1621 - bd->bi_flashstart = CONFIG_SYS_FLASH_BASE;
1622 #if CONFIG_SYS_MONITOR_BASE == CONFIG_SYS_FLASH_BASE
1623 bd->bi_flashoffset = monitor_flash_len; /* reserved area for U-Boot */
1625 diff --git a/lib_mips/bootm.c b/lib_mips/bootm.c
1626 index 54af24c..64bcad9 100644
1627 --- a/lib_mips/bootm.c
1628 +++ b/lib_mips/bootm.c
1629 @@ -46,7 +46,9 @@ static void linux_env_set (char * env_name, char * env_val);
1630 int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
1632 void (*theKernel) (int, char **, char **, int *);
1633 - char *commandline = getenv ("bootargs");
1634 + char *commandline = gd->boot_option == 1 ?
1635 + getenv ("bootargsfromsd") :
1636 + getenv ("bootargs");
1640 @@ -98,6 +100,9 @@ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
1643 /* we assume that the kernel is in place */
1644 + if (gd->boot_option == 1)
1645 + printf ("\n *** Booting from mircoSD ***\n");
1647 printf ("\nStarting kernel ...\n\n");
1649 theKernel (linux_argc, linux_argv, linux_env, 0);
1650 diff --git a/lib_mips/time.c b/lib_mips/time.c
1651 index 07e356d..4654bf4 100644
1652 --- a/lib_mips/time.c
1653 +++ b/lib_mips/time.c
1656 #include <asm/mipsregs.h>
1658 +#ifndef CONFIG_JzRISC
1660 static unsigned long timestamp;
1662 /* how many counter cycles in a jiffy */
1663 @@ -96,3 +98,5 @@ ulong get_tbclk(void)
1665 return CONFIG_SYS_HZ;
1668 +#endif /* !CONFIG_JzRISC */