Root/package/uboot-xburst/patches/001-xburst.patch

1diff --git a/Makefile b/Makefile
2index d7a6921..d57c6ee 100644
3--- a/Makefile
4+++ b/Makefile
5@@ -2647,6 +2647,16 @@ ppmc7xx_config: unconfig
6 ZUMA_config: unconfig
7     @$(MKCONFIG) $(@:_config=) powerpc 74xx_7xx evb64260
8 
9+#########################################################################
10+## MIPS32 XBurst jz4740
11+#########################################################################
12+qi_lb60_config : unconfig
13+ @echo "#define CONFIG_NAND_U_BOOT" > $(obj)include/config.h
14+ @echo "Compile NAND boot image for QI LB60"
15+ @$(MKCONFIG) -a qi_lb60 mips xburst nanonote xburst
16+ @echo "TEXT_BASE = 0x80100000" > $(obj)board/xburst/nanonote/config.tmp
17+ @echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk
18+
19 #========================================================================
20 # ARM
21 #========================================================================
22diff --git a/arch/mips/include/asm/global_data.h b/arch/mips/include/asm/global_data.h
23index b2c4891..9f93fb4 100644
24--- a/arch/mips/include/asm/global_data.h
25+++ b/arch/mips/include/asm/global_data.h
26@@ -39,6 +39,18 @@
27 typedef struct global_data {
28     bd_t *bd;
29     unsigned long flags;
30+#if defined(CONFIG_JZSOC)
31+ /* There are other clocks in the Jz47xx or Jz5730*/
32+ unsigned long cpu_clk; /* CPU core clock */
33+ unsigned long sys_clk; /* System bus clock */
34+ unsigned long per_clk; /* Peripheral bus clock */
35+ unsigned long mem_clk; /* Memory bus clock */
36+ unsigned long dev_clk; /* Device clock */
37+ unsigned long fb_base; /* base address of framebuffer */
38+#endif
39+#if defined(CONFIG_NANONOTE)
40+ unsigned long boot_option;
41+#endif
42     unsigned long baudrate;
43     unsigned long have_console; /* serial_init() was called */
44     phys_size_t ram_size; /* RAM size */
45diff --git a/arch/mips/lib/board.c b/arch/mips/lib/board.c
46index b2d113e..4774016 100644
47--- a/arch/mips/lib/board.c
48+++ b/arch/mips/lib/board.c
49@@ -144,9 +144,15 @@ static int init_baudrate (void)
50  * argument, and returns an integer return code, where 0 means
51  * "continue" and != 0 means "fatal error, hang the system".
52  */
53+#if defined(CONFIG_JZSOC)
54+extern int jz_board_init(void);
55+#endif
56 typedef int (init_fnc_t) (void);
57 
58 init_fnc_t *init_sequence[] = {
59+#if defined(CONFIG_JZSOC)
60+ jz_board_init, /* init gpio/clocks/dram etc. */
61+#endif
62     board_early_init_f,
63     timer_init,
64     env_init, /* initialize environment */
65@@ -202,6 +208,12 @@ void board_init_f(ulong bootflag)
66     addr &= ~(4096 - 1);
67     debug ("Top of RAM usable for U-Boot at: %08lx\n", addr);
68 
69+#ifdef CONFIG_LCD
70+ /* reserve memory for LCD display (always full pages) */
71+ addr = lcd_setmem (addr);
72+ gd->fb_base = addr;
73+#endif /* CONFIG_LCD */
74+
75     /* Reserve memory for U-Boot code, data & bss
76      * round down to next 16 kB limit
77      */
78@@ -349,9 +361,9 @@ void board_init_r (gd_t *id, ulong dest_addr)
79     size = flash_init();
80     display_flash_config (size);
81     bd->bi_flashsize = size;
82+ bd->bi_flashstart = CONFIG_SYS_FLASH_BASE;
83 #endif
84 
85- bd->bi_flashstart = CONFIG_SYS_FLASH_BASE;
86 #if CONFIG_SYS_MONITOR_BASE == CONFIG_SYS_FLASH_BASE
87     bd->bi_flashoffset = monitor_flash_len; /* reserved area for U-Boot */
88 #else
89diff --git a/arch/mips/lib/bootm.c b/arch/mips/lib/bootm.c
90index 54af24c..24a40cc 100644
91--- a/arch/mips/lib/bootm.c
92+++ b/arch/mips/lib/bootm.c
93@@ -46,10 +46,17 @@ static void linux_env_set (char * env_name, char * env_val);
94 int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
95 {
96     void (*theKernel) (int, char **, char **, int *);
97- char *commandline = getenv ("bootargs");
98+ char *commandline;
99     char env_buf[12];
100     char *cp;
101 
102+#if defined(CONFIG_NANONOTE)
103+ if (gd->boot_option & BOOT_FROM_SDCARD)
104+ commandline = getenv ("bootargsfromsd");
105+ else
106+#endif
107+ commandline = getenv ("bootargs");
108+
109     if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
110         return 1;
111 
112diff --git a/arch/mips/lib/time.c b/arch/mips/lib/time.c
113index 0e66441..653be6c 100644
114--- a/arch/mips/lib/time.c
115+++ b/arch/mips/lib/time.c
116@@ -24,6 +24,7 @@
117 #include <common.h>
118 #include <asm/mipsregs.h>
119 
120+#ifndef CONFIG_JZSOC
121 static unsigned long timestamp;
122 
123 /* how many counter cycles in a jiffy */
124@@ -96,3 +97,4 @@ ulong get_tbclk(void)
125 {
126     return CONFIG_SYS_HZ;
127 }
128+#endif
129diff --git a/common/env_common.c b/common/env_common.c
130index 439a4a9..7ac2b6b 100644
131--- a/common/env_common.c
132+++ b/common/env_common.c
133@@ -133,6 +133,12 @@ uchar default_environment[] = {
134 #if defined(CONFIG_PCI_BOOTDELAY) && (CONFIG_PCI_BOOTDELAY > 0)
135     "pcidelay=" MK_STR(CONFIG_PCI_BOOTDELAY) "\0"
136 #endif
137+#ifdef CONFIG_BOOTARGSFROMSD
138+ "bootargsfromsd=" CONFIG_BOOTARGSFROMSD "\0"
139+#endif
140+#ifdef CONFIG_BOOTCOMMANDFROMSD
141+ "bootcmdfromsd=" CONFIG_BOOTCOMMANDFROMSD "\0"
142+#endif
143 #ifdef CONFIG_EXTRA_ENV_SETTINGS
144     CONFIG_EXTRA_ENV_SETTINGS
145 #endif
146diff --git a/common/lcd.c b/common/lcd.c
147index 64fb1c6..23d848d 100644
148--- a/common/lcd.c
149+++ b/common/lcd.c
150@@ -253,6 +253,14 @@ static void lcd_drawchars (ushort x, ushort y, uchar *str, int count)
151                         lcd_color_fg : lcd_color_bg;
152                 bits <<= 1;
153             }
154+#elif LCD_BPP == LCD_COLOR32
155+ uint *m = (uint *)d;
156+ for (c=0; c<32; ++c) {
157+ *m++ = (bits & 0x80) ?
158+ lcd_color_fg : lcd_color_bg;
159+ //d+=4;
160+ bits <<= 1;
161+ }
162 #endif
163         }
164 #if LCD_BPP == LCD_MONOCHROME
165@@ -319,6 +327,9 @@ static void test_pattern (void)
166 }
167 #endif /* LCD_TEST_PATTERN */
168 
169+#ifdef CONFIG_JzRISC /* JzRISC core */
170+extern int flush_cache_all(void);
171+#endif
172 
173 /************************************************************************/
174 /* ** GENERIC Initialization Routines */
175@@ -385,6 +396,7 @@ static int lcd_clear (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
176         COLOR_MASK(lcd_getbgcolor()),
177         lcd_line_length*panel_info.vl_row);
178 #endif
179+
180     /* Paint the logo and retrieve LCD base address */
181     debug ("[LCD] Drawing the logo...\n");
182     lcd_console_address = lcd_logo ();
183@@ -503,6 +515,7 @@ void bitmap_plot (int x, int y)
184     uchar *bmap;
185     uchar *fb;
186     ushort *fb16;
187+ uint *fb32;
188 #if defined(CONFIG_PXA250)
189     struct pxafb_info *fbi = &panel_info.pxa;
190 #elif defined(CONFIG_MPC823)
191diff --git a/common/main.c b/common/main.c
192index f7e7c1c..c64979f 100644
193--- a/common/main.c
194+++ b/common/main.c
195@@ -372,7 +372,11 @@ void main_loop (void)
196 #if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0)
197     s = getenv ("bootdelay");
198     bootdelay = s ? (int)simple_strtol(s, NULL, 10) : CONFIG_BOOTDELAY;
199-
200+#if defined(CONFIG_NANONOTE)
201+ DECLARE_GLOBAL_DATA_PTR;
202+ if (gd->boot_option & BOOT_WITH_ENABLE_UART)
203+ bootdelay = 3;
204+# endif
205     debug ("### main_loop entered: bootdelay=%d\n\n", bootdelay);
206 
207 # ifdef CONFIG_BOOT_RETRY_TIME
208@@ -393,7 +397,12 @@ void main_loop (void)
209     }
210     else
211 #endif /* CONFIG_BOOTCOUNT_LIMIT */
212- s = getenv ("bootcmd");
213+#if defined(CONFIG_NANONOTE)
214+ if (gd->boot_option & BOOT_FROM_SDCARD)
215+ s = getenv ("bootcmdfromsd");
216+ else
217+#endif
218+ s = getenv ("bootcmd");
219 
220     debug ("### main_loop: bootcmd=\"%s\"\n", s ? s : "<UNDEFINED>");
221 
222diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile
223index 6fa04b8..b08a800 100644
224--- a/drivers/mmc/Makefile
225+++ b/drivers/mmc/Makefile
226@@ -32,6 +32,7 @@ COBJS-$(CONFIG_OMAP3_MMC) += omap3_mmc.o
227 COBJS-$(CONFIG_FSL_ESDHC) += fsl_esdhc.o
228 COBJS-$(CONFIG_MXC_MMC) += mxcmmc.o
229 COBJS-$(CONFIG_PXA_MMC) += pxa_mmc.o
230+COBJS-$(CONFIG_JZ4740_MMC) += jz_mmc.o
231 
232 COBJS := $(COBJS-y)
233 SRCS := $(COBJS:.o=.c)
234diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile
235index 28f27da..427d963 100644
236--- a/drivers/mtd/nand/Makefile
237+++ b/drivers/mtd/nand/Makefile
238@@ -50,6 +50,7 @@ COBJS-$(CONFIG_NAND_S3C64XX) += s3c64xx.o
239 COBJS-$(CONFIG_NAND_SPEAR) += spr_nand.o
240 COBJS-$(CONFIG_NAND_OMAP_GPMC) += omap_gpmc.o
241 COBJS-$(CONFIG_NAND_PLAT) += nand_plat.o
242+COBJS-$(CONFIG_NAND_JZ4740) += jz4740_nand.o
243 endif
244 
245 COBJS := $(COBJS-y)
246diff --git a/drivers/video/Makefile b/drivers/video/Makefile
247index 7d84fc7..39f981d 100644
248--- a/drivers/video/Makefile
249+++ b/drivers/video/Makefile
250@@ -38,6 +38,7 @@ COBJS-$(CONFIG_SED156X) += sed156x.o
251 COBJS-$(CONFIG_VIDEO_SM501) += sm501.o
252 COBJS-$(CONFIG_VIDEO_SMI_LYNXEM) += smiLynxEM.o videomodes.o
253 COBJS-$(CONFIG_VIDEO_VCXK) += bus_vcxk.o
254+COBJS-$(CONFIG_VIDEO_GPM940B0) += nanonote_gpm940b0.o
255 
256 COBJS := $(COBJS-y)
257 SRCS := $(COBJS:.o=.c)
258diff --git a/examples/standalone/mips.lds b/examples/standalone/mips.lds
259index 717b201..d4a45f8 100644
260--- a/examples/standalone/mips.lds
261+++ b/examples/standalone/mips.lds
262@@ -23,8 +23,8 @@
263 
264 /*
265 OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-bigmips")
266-*/
267 OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradbigmips")
268+*/
269 OUTPUT_ARCH(mips)
270 SECTIONS
271 {
272diff --git a/include/lcd.h b/include/lcd.h
273index 1f85daa..ff95576 100644
274--- a/include/lcd.h
275+++ b/include/lcd.h
276@@ -181,8 +181,44 @@ typedef struct vidinfo {
277     u_long mmio; /* Memory mapped registers */
278 } vidinfo_t;
279 
280-#else
281+#elif defined(CONFIG_JZSOC)
282+/*
283+ * LCD controller stucture for JZSOC: JZ4740
284+ */
285+struct jz_fb_dma_descriptor {
286+ u_long fdadr; /* Frame descriptor address register */
287+ u_long fsadr; /* Frame source address register */
288+ u_long fidr; /* Frame ID register */
289+ u_long ldcmd; /* Command register */
290+};
291 
292+/*
293+ * Jz LCD info
294+ */
295+struct jz_fb_info {
296+
297+ u_long fdadr0; /* physical address of frame/palette descriptor */
298+ u_long fdadr1; /* physical address of frame descriptor */
299+
300+ /* DMA descriptors */
301+ struct jz_fb_dma_descriptor * dmadesc_fblow;
302+ struct jz_fb_dma_descriptor * dmadesc_fbhigh;
303+ struct jz_fb_dma_descriptor * dmadesc_palette;
304+ u_long screen; /* address of frame buffer */
305+ u_long palette; /* address of palette memory */
306+ u_int palette_size;
307+};
308+typedef struct vidinfo {
309+ ushort vl_col; /* Number of columns (i.e. 640) */
310+ ushort vl_row; /* Number of rows (i.e. 480) */
311+ u_char vl_bpix; /* Bits per pixel, 0 = 1, 1 = 2, 2 = 4, 3 = 8 */
312+
313+ struct jz_fb_info jz_fb;
314+} vidinfo_t;
315+
316+extern vidinfo_t panel_info;
317+
318+#else
319 typedef struct vidinfo {
320     ushort vl_col; /* Number of columns (i.e. 160) */
321     ushort vl_row; /* Number of rows (i.e. 100) */
322@@ -194,7 +230,7 @@ typedef struct vidinfo {
323     void *priv; /* Pointer to driver-specific data */
324 } vidinfo_t;
325 
326-#endif /* CONFIG_MPC823, CONFIG_PXA250 or CONFIG_MCC200 or CONFIG_ATMEL_LCD */
327+#endif /* CONFIG_MPC823, CONFIG_PXA250 or CONFIG_MCC200 or CONFIG_ATMEL_LCD CONFIG_JZ4740*/
328 
329 extern vidinfo_t panel_info;
330 
331@@ -234,6 +270,7 @@ void lcd_show_board_info(void);
332 #define LCD_COLOR4 2
333 #define LCD_COLOR8 3
334 #define LCD_COLOR16 4
335+#define LCD_COLOR32 5
336 
337 /*----------------------------------------------------------------------*/
338 #if defined(CONFIG_LCD_INFO_BELOW_LOGO)
339@@ -285,7 +322,7 @@ void lcd_show_board_info(void);
340 # define CONSOLE_COLOR_GREY 14
341 # define CONSOLE_COLOR_WHITE 15 /* Must remain last / highest */
342 
343-#else
344+#elif LCD_BPP == LCD_COLOR16
345 
346 /*
347  * 16bpp color definitions
348@@ -293,6 +330,15 @@ void lcd_show_board_info(void);
349 # define CONSOLE_COLOR_BLACK 0x0000
350 # define CONSOLE_COLOR_WHITE 0xffff /* Must remain last / highest */
351 
352+#elif LCD_BPP == LCD_COLOR32
353+/*
354+ * 18,24,32 bpp color definitions
355+ */
356+# define CONSOLE_COLOR_BLACK 0x00000000
357+# define CONSOLE_COLOR_WHITE 0xffffffff /* Must remain last / highest */
358+
359+#else
360+
361 #endif /* color definitions */
362 
363 /************************************************************************/
364@@ -322,7 +368,7 @@ void lcd_show_board_info(void);
365 #if LCD_BPP == LCD_MONOCHROME
366 # define COLOR_MASK(c) ((c) | (c) << 1 | (c) << 2 | (c) << 3 | \
367                  (c) << 4 | (c) << 5 | (c) << 6 | (c) << 7)
368-#elif (LCD_BPP == LCD_COLOR8) || (LCD_BPP == LCD_COLOR16)
369+#elif (LCD_BPP == LCD_COLOR8) || (LCD_BPP == LCD_COLOR16) || (LCD_BPP == LCD_COLOR32)
370 # define COLOR_MASK(c) (c)
371 #else
372 # error Unsupported LCD BPP.
373

Archive Download this file



interactive