Date:2010-01-18 09:03:37 (3 years 4 months ago)
Author:Xiangfu Liu
Commit:53e4635ac92969ab0deb123fdec4aa6e26fd7334
Message:update u-boot to version 2009.11

Files: target/linux/xburst/image/u-boot/Makefile (1 diff)
target/linux/xburst/image/u-boot/patches/0001-add-xburst-platform-files.patch (5 diffs)
target/linux/xburst/image/u-boot/patches/0002-add-xburst-support.patch (23 diffs)
target/linux/xburst/image/u-boot/patches/0003-other-function-for-ben.patch (1 diff)

Change Details

target/linux/xburst/image/u-boot/Makefile
1010include $(INCLUDE_DIR)/kernel.mk
1111
1212PKG_NAME:=u-boot
13PKG_VERSION:=2009.08
13PKG_VERSION:=2009.11
1414
1515PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
1616PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
target/linux/xburst/image/u-boot/patches/0001-add-xburst-platform-files.patch
1From 23f08521fd9f997876d5e90354b9ad957bb4e982 Mon Sep 17 00:00:00 2001
1From 07e50d40b5c79fbaa244ae7f8a60873d63bc4924 Mon Sep 17 00:00:00 2001
22From: Xiangfu Liu <xiangfu@qi-hardware.com>
3Date: Wed, 18 Nov 2009 23:23:56 +0800
4Subject: [PATCH 1/2] add new file
3Date: Sat, 16 Jan 2010 12:56:31 +0800
4Subject: [PATCH 1/2] new files
55
66---
77 board/qi_lb60/Makefile | 38 +
88 board/qi_lb60/config.mk | 31 +
99 board/qi_lb60/flash.c | 50 +
10 board/qi_lb60/qi_lb60.c | 105 +
10 board/qi_lb60/qi_lb60.c | 107 +
1111 board/qi_lb60/u-boot-nand.lds | 63 +
1212 board/qi_lb60/u-boot.lds | 63 +
1313 cpu/mips/jz4740.c | 574 +++++
1414 cpu/mips/jz4740_cpm_test.c | 98 +
15 cpu/mips/jz4740_nand.c | 198 ++
15 cpu/mips/jz4740_nand.c | 199 ++
1616 cpu/mips/jz_cs8900.c | 397 +++
1717 cpu/mips/jz_cs8900.h | 258 ++
1818 cpu/mips/jz_eth.c | 376 +++
...... 
2626 cpu/mips/mmc_protocol.h | 273 +++
2727 cpu/mips/qi_lb60_gpm940b0.c | 420 ++++
2828 cpu/mips/qi_lb60_gpm940b0.h | 212 ++
29 cpu/mips/usb_boot.S | 821 +++++++
29 cpu/mips/usb_boot.S | 880 +++++++
3030 include/asm-mips/jz4740.h | 4880 +++++++++++++++++++++++++++++++++++++
3131 include/configs/qi_lb60.h | 213 ++
3232 nand_spl/board/qi_lb60/Makefile | 104 +
3333 nand_spl/board/qi_lb60/config.mk | 34 +
3434 nand_spl/board/qi_lb60/u-boot.lds | 63 +
3535 nand_spl/nand_boot_jz4740.c | 456 ++++
36 29 files changed, 13575 insertions(+), 0 deletions(-)
36 29 files changed, 13637 insertions(+), 0 deletions(-)
3737 create mode 100644 board/qi_lb60/Makefile
3838 create mode 100644 board/qi_lb60/config.mk
3939 create mode 100644 board/qi_lb60/flash.c
...... 
203203+}
204204diff --git a/board/qi_lb60/qi_lb60.c b/board/qi_lb60/qi_lb60.c
205205new file mode 100644
206index 0000000..d13f2ab
206index 0000000..54625c3
207207--- /dev/null
208208+++ b/board/qi_lb60/qi_lb60.c
209209@@ -0,0 +1,107 @@
...... 
11381138+#endif /* CONFIG_JZ4740 */
11391139diff --git a/cpu/mips/jz4740_nand.c b/cpu/mips/jz4740_nand.c
11401140new file mode 100644
1141index 0000000..7b1cdf3
1141index 0000000..c1d1511
11421142--- /dev/null
11431143+++ b/cpu/mips/jz4740_nand.c
11441144@@ -0,0 +1,199 @@
...... 
72057205+#endif /* __QI_LB60_GPM940B0_H__ */
72067206diff --git a/cpu/mips/usb_boot.S b/cpu/mips/usb_boot.S
72077207new file mode 100644
7208index 0000000..6c3788f
7208index 0000000..f556e04
72097209--- /dev/null
72107210+++ b/cpu/mips/usb_boot.S
72117211@@ -0,0 +1,880 @@
target/linux/xburst/image/u-boot/patches/0002-add-xburst-support.patch
1From 7f32a7a2ec1cf7472684869a5cec40013134c92b Mon Sep 17 00:00:00 2001
2From: Xiangfu Liu <xiangfu@qi-hardware.com>
3Date: Wed, 18 Nov 2009 23:24:14 +0800
4Subject: [PATCH 2/2] add-xburst-support
1From 64c6e9b3ad9241d88411867cc4d5478bb6c6f3dd Mon Sep 17 00:00:00 2001
2From: Xiangfu Liu <xiangfu@sharism.cc>
3Date: Mon, 18 Jan 2010 15:52:15 +0800
4Subject: [PATCH 2/2] change file
55
66---
77 Makefile | 10 +
8 board/qi_lb60/qi_lb60.c | 39 +++-
9 common/env_common.c | 2 +-
810 common/lcd.c | 45 ++++-
11 common/main.c | 4 +-
912 cpu/mips/Makefile | 4 +
1013 cpu/mips/cache.S | 280 ++++++++++----------------
1114 cpu/mips/config.mk | 6 +-
1215 cpu/mips/cpu.c | 75 +++++++
1316 cpu/mips/start.S | 432 +++++++++++++++++++++++++++++++--------
14 drivers/mtd/nand/nand_base.c | 87 ++++++++-
17 drivers/mtd/nand/nand_base.c | 88 ++++++++-
1518 examples/standalone/mips.lds | 2 +-
1619 include/asm-mips/addrspace.h | 2 +-
17 include/asm-mips/global_data.h | 9 +
20 include/asm-mips/global_data.h | 11 +
21 include/configs/qi_lb60.h | 2 +
1822 include/lcd.h | 56 +++++-
1923 lib_mips/board.c | 18 ++-
24 lib_mips/bootm.c | 4 +-
2025 lib_mips/time.c | 4 +
21 14 files changed, 744 insertions(+), 286 deletions(-)
26 nand_spl/nand_boot_jz4740.c | 46 ++---
27 20 files changed, 797 insertions(+), 333 deletions(-)
2228
2329diff --git a/Makefile b/Makefile
24index e4499d7..e492d6a 100644
30index f06a97c..a318eb4 100644
2531--- a/Makefile
2632+++ b/Makefile
27@@ -3381,6 +3381,16 @@ qemu_mips_config : unconfig
33@@ -3439,6 +3439,16 @@ qemu_mips_config : unconfig
2834     @$(MKCONFIG) -a qemu-mips mips mips qemu-mips
2935
3036 #########################################################################
...... 
4147 ## MIPS64 5Kc
4248 #########################################################################
4349
50diff --git a/board/qi_lb60/qi_lb60.c b/board/qi_lb60/qi_lb60.c
51index 54625c3..aa7b85b 100644
52--- a/board/qi_lb60/qi_lb60.c
53@@ -12,6 +12,8 @@
54 #include <asm/mipsregs.h>
55 #include <asm/jz4740.h>
56
57+DECLARE_GLOBAL_DATA_PTR;
58+
59 static void gpio_init(void)
60 {
61     /*
62@@ -25,11 +27,6 @@ static void gpio_init(void)
63     __gpio_as_sdram_32bit();
64
65     /*
66- * Initialize UART0 pins
67- */
68- __gpio_as_uart0();
69-
70- /*
71      * Initialize LCD pins
72      */
73     __gpio_as_lcd_18bit();
74@@ -43,17 +40,31 @@ static void gpio_init(void)
75      * Initialize Other pins
76      */
77     unsigned int i;
78+ for (i = 0; i < 7; i++){
79+ __gpio_as_input(GPIO_KEYIN_BASE + i);
80+ __gpio_enable_pull(GPIO_KEYIN_BASE + i);
81+ }
82+
83     for (i = 0; i < 8; i++) {
84         __gpio_as_output(GPIO_KEYOUT_BASE + i);
85- __gpio_set_pin(GPIO_KEYOUT_BASE + i);
86+ __gpio_clear_pin(GPIO_KEYOUT_BASE + i);
87     }
88
89- for (i = 0; i < 7; i++){
90- __gpio_as_input(GPIO_KEYIN_BASE + i);
91- __gpio_enable_pull(GPIO_KEYIN_BASE + i);
92+ /*
93+ * Initialize UART0 pins, in Ben NanoNote uart0 and keyin8 use the
94+ * same gpio, init the gpio as uart0 cause a keyboard bug. so for
95+ * end user we disable the uart0
96+ */
97+ if (__gpio_get_pin(GPIO_KEYIN_BASE + 2) == 0){
98+ /* if pressed [S] */
99+ printf("[S] pressed, enable UART0\n");
100+ gd->boot_option = 5;
101+ __gpio_as_uart0();
102+ } else {
103+ printf("[S] not pressed, disable UART0\n");
104+ __gpio_as_input(GPIO_KEYIN_8);
105+ __gpio_enable_pull(GPIO_KEYIN_8);
106     }
107- /* __gpio_as_input( GPIO_KEYIN_8 ); */
108- /* __gpio_enable_pull( GPIO_KEYIN_8 ); */
109
110     __gpio_as_output(GPIO_AUDIO_POP);
111     __gpio_set_pin(GPIO_AUDIO_POP);
112@@ -73,6 +84,11 @@ static void gpio_init(void)
113
114     __gpio_as_input(GPIO_USB_DETECT);
115     __gpio_enable_pull(GPIO_USB_DETECT);
116+
117+ if (__gpio_get_pin(GPIO_KEYIN_BASE + 3) == 0) {
118+ printf("[M] pressed, boot from sd card\n");
119+ gd->boot_option = 1;
120+ }
121 }
122
123 static void cpm_init(void)
124@@ -98,7 +114,6 @@ void board_early_init(void)
125
126 int checkboard (void)
127 {
128- DECLARE_GLOBAL_DATA_PTR;
129
130     printf("Board: Qi LB60 (Ingenic XBurst Jz4740 SoC, Speed %d MHz)\n",
131            gd->cpu_clk/1000000);
132diff --git a/common/env_common.c b/common/env_common.c
133index 439a4a9..6cfe30b 100644
134--- a/common/env_common.c
135@@ -134,7 +134,7 @@ uchar default_environment[] = {
136     "pcidelay=" MK_STR(CONFIG_PCI_BOOTDELAY) "\0"
137 #endif
138 #ifdef CONFIG_EXTRA_ENV_SETTINGS
139- CONFIG_EXTRA_ENV_SETTINGS
140+ "bootargsfromsd=" CONFIG_BOOTARGSFROMSD "\0"
141 #endif
142     "\0"
143 };
44144diff --git a/common/lcd.c b/common/lcd.c
45index dc8fea6..b68b1ca 100644
145index 4e31618..ddd5aa8 100644
46146--- a/common/lcd.c
47147+++ b/common/lcd.c
48148@@ -64,7 +64,9 @@
...... 
56158 # endif
57159 #endif
58160
59@@ -270,6 +272,14 @@ static void lcd_drawchars (ushort x, ushort y, uchar *str, int count)
161@@ -249,6 +251,14 @@ static void lcd_drawchars (ushort x, ushort y, uchar *str, int count)
60162                         lcd_color_fg : lcd_color_bg;
61163                 bits <<= 1;
62164             }
...... 
71173 #endif
72174         }
73175 #if LCD_BPP == LCD_MONOCHROME
74@@ -336,6 +346,9 @@ static void test_pattern (void)
176@@ -315,6 +325,9 @@ static void test_pattern (void)
75177 }
76178 #endif /* LCD_TEST_PATTERN */
77179
...... 
81183
82184 /************************************************************************/
83185 /* ** GENERIC Initialization Routines */
84@@ -402,6 +415,7 @@ static int lcd_clear (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
186@@ -381,6 +394,7 @@ static int lcd_clear (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
85187         COLOR_MASK(lcd_getbgcolor()),
86188         lcd_line_length*panel_info.vl_row);
87189 #endif
...... 
89191     /* Paint the logo and retrieve LCD base address */
90192     debug ("[LCD] Drawing the logo...\n");
91193     lcd_console_address = lcd_logo ();
92@@ -479,6 +493,8 @@ static void lcd_setfgcolor (int color)
194@@ -458,6 +472,8 @@ static void lcd_setfgcolor (int color)
93195 {
94196 #ifdef CONFIG_ATMEL_LCD
95197     lcd_color_fg = color;
...... 
98200 #else
99201     lcd_color_fg = color & 0x0F;
100202 #endif
101@@ -490,6 +506,8 @@ static void lcd_setbgcolor (int color)
203@@ -469,6 +485,8 @@ static void lcd_setbgcolor (int color)
102204 {
103205 #ifdef CONFIG_ATMEL_LCD
104206     lcd_color_bg = color;
...... 
107209 #else
108210     lcd_color_bg = color & 0x0F;
109211 #endif
110@@ -528,6 +546,7 @@ void bitmap_plot (int x, int y)
212@@ -507,6 +525,7 @@ void bitmap_plot (int x, int y)
111213     uchar *bmap;
112214     uchar *fb;
113215     ushort *fb16;
...... 
115217 #if defined(CONFIG_PXA250)
116218     struct pxafb_info *fbi = &panel_info.pxa;
117219 #elif defined(CONFIG_MPC823)
118@@ -588,13 +607,25 @@ void bitmap_plot (int x, int y)
220@@ -567,13 +586,25 @@ void bitmap_plot (int x, int y)
119221         }
120222     }
121223     else { /* true color mode */
...... 
147249         }
148250     }
149251
252diff --git a/common/main.c b/common/main.c
253index 10d8904..ff11ad7 100644
254--- a/common/main.c
255@@ -372,7 +372,9 @@ void main_loop (void)
256 #if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0)
257     s = getenv ("bootdelay");
258     bootdelay = s ? (int)simple_strtol(s, NULL, 10) : CONFIG_BOOTDELAY;
259-
260+ DECLARE_GLOBAL_DATA_PTR;
261+ if (gd->boot_option == 5)
262+ bootdelay = gd->boot_option;
263     debug ("### main_loop entered: bootdelay=%d\n\n", bootdelay);
264
265 # ifdef CONFIG_BOOT_RETRY_TIME
150266diff --git a/cpu/mips/Makefile b/cpu/mips/Makefile
151267index 28a1cbb..5207bc5 100644
152268--- a/cpu/mips/Makefile
...... 
12171334+
12181335+#endif /* CONFIG_JZ4730 */
12191336diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
1220index 360b070..88717e9 100644
1337index 426bb95..6e5fbd3 100644
12211338--- a/drivers/mtd/nand/nand_base.c
12221339+++ b/drivers/mtd/nand/nand_base.c
12231340@@ -109,6 +109,22 @@ static struct nand_ecclayout nand_oob_16 = {
...... 
12511368
12521369 static struct nand_ecclayout nand_oob_128 = {
12531370     .eccbytes = 48,
1254@@ -1068,6 +1085,60 @@ static int nand_read_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip,
1371@@ -1116,6 +1133,60 @@ static int nand_read_page_hwecc_oob_first(struct mtd_info *mtd,
12551372 }
12561373
12571374 /**
...... 
13121429  * nand_read_page_syndrome - [REPLACABLE] hardware ecc syndrom based page read
13131430  * @mtd: mtd info structure
13141431  * @chip: nand chip info structure
1315@@ -1222,8 +1293,15 @@ static int nand_do_read_ops(struct mtd_info *mtd, loff_t from,
1316                 ret = chip->ecc.read_page_raw(mtd, chip, bufpoi);
1432@@ -1271,9 +1342,17 @@ static int nand_do_read_ops(struct mtd_info *mtd, loff_t from,
1433                         bufpoi, page);
13171434             else if (!aligned && NAND_SUBPAGE_READ(chip) && !oob)
13181435                 ret = chip->ecc.read_subpage(mtd, chip, col, bytes, bufpoi);
13191436- else
1320+ else {
1437+ else {
13211438+#if defined(CONFIG_JZ4740)
13221439+ bufpoi[0] = (uint8_t)page;
13231440+ bufpoi[1] = (uint8_t)(page >> 8);
13241441+ bufpoi[2] = (uint8_t)(page >> 16);
13251442+ bufpoi[3] = (uint8_t)(page >> 24);
13261443+#endif
1327                 ret = chip->ecc.read_page(mtd, chip, bufpoi);
1444+
1445                 ret = chip->ecc.read_page(mtd, chip, bufpoi,
1446                         page);
13281447+ }
13291448             if (ret < 0)
13301449                 break;
13311450
1332@@ -2730,8 +2808,13 @@ int nand_scan_tail(struct mtd_info *mtd)
1333     switch (chip->ecc.mode) {
1451@@ -2791,8 +2870,13 @@ int nand_scan_tail(struct mtd_info *mtd)
1452
13341453     case NAND_ECC_HW:
13351454         /* Use standard hwecc read page function ? */
13361455- if (!chip->ecc.read_page)
...... 
13721491    cannot access physical memory directly from core */
13731492 #define UNCACHED_SDRAM(a) (((unsigned long)(a)) | 0x20000000)
13741493diff --git a/include/asm-mips/global_data.h b/include/asm-mips/global_data.h
1375index b2c4891..db88704 100644
1494index b2c4891..23f597e 100644
13761495--- a/include/asm-mips/global_data.h
13771496+++ b/include/asm-mips/global_data.h
1378@@ -39,6 +39,15 @@
1497@@ -39,6 +39,17 @@
13791498 typedef struct global_data {
13801499     bd_t *bd;
13811500     unsigned long flags;
...... 
13871506+ unsigned long mem_clk; /* Memory bus clock */
13881507+ unsigned long dev_clk; /* Device clock */
13891508+ unsigned long fb_base; /* base address of framebuffer */
1509+ unsigned long boot_option; /* 1: boot from sd
1510+ * 5: boot delay for 5 secs*/
13901511+#endif
13911512     unsigned long baudrate;
13921513     unsigned long have_console; /* serial_init() was called */
13931514     phys_size_t ram_size; /* RAM size */
1515diff --git a/include/configs/qi_lb60.h b/include/configs/qi_lb60.h
1516index 02af607..c3bf9c7 100644
1517--- a/include/configs/qi_lb60.h
1518@@ -45,6 +45,8 @@
1519 #define CONFIG_BOOTDELAY 0
1520 #define CONFIG_BOOTFILE "uImage" /* file to load */
1521 #define CONFIG_BOOTARGS "mem=32M console=ttyS0,57600n8 ubi.mtd=2 rootfstype=ubifs root=ubi0:rootfs rw rootwait"
1522+#define CONFIG_EXTRA_ENV_SETTINGS 1
1523+#define CONFIG_BOOTARGSFROMSD "mem=32M console=ttyS0,57600n8 rootfstype=ext2 root=/dev/mmcblk0p1 rw rootwait"
1524 #define CONFIG_BOOTCOMMAND "nand read 0x80600000 0x400000 0x200000;bootm"
1525
1526 /*
13941527diff --git a/include/lcd.h b/include/lcd.h
13951528index 1f85daa..997e246 100644
13961529--- a/include/lcd.h
...... 
14931627 #else
14941628 # error Unsupported LCD BPP.
14951629diff --git a/lib_mips/board.c b/lib_mips/board.c
1496index aa5b129..ea5166c 100644
1630index b2d113e..87cb12d 100644
14971631--- a/lib_mips/board.c
14981632+++ b/lib_mips/board.c
1499@@ -45,6 +45,10 @@ DECLARE_GLOBAL_DATA_PTR;
1633@@ -49,6 +49,10 @@ DECLARE_GLOBAL_DATA_PTR;
15001634
15011635 #undef DEBUG
15021636
...... 
15071641 extern int timer_init(void);
15081642
15091643 extern int incaip_set_cpuclk(void);
1510@@ -109,7 +113,6 @@ void *sbrk (ptrdiff_t increment)
1511     return ((void *) old);
1644@@ -78,7 +82,6 @@ int __board_early_init_f(void)
15121645 }
1646 int board_early_init_f(void) __attribute__((weak, alias("__board_early_init_f")));
15131647
15141648-
15151649 static int init_func_ram (void)
15161650 {
15171651 #ifdef CONFIG_BOARD_TYPES
1518@@ -129,7 +132,6 @@ static int init_func_ram (void)
1652@@ -98,7 +101,6 @@ static int init_func_ram (void)
15191653
15201654 static int display_banner(void)
15211655 {
...... 
15231657     printf ("\n\n%s\n\n", version_string);
15241658     return (0);
15251659 }
1526@@ -178,6 +180,9 @@ static int init_baudrate (void)
1660@@ -147,6 +149,9 @@ static int init_baudrate (void)
15271661 typedef int (init_fnc_t) (void);
15281662
15291663 init_fnc_t *init_sequence[] = {
...... 
15331667     board_early_init_f,
15341668     timer_init,
15351669     env_init, /* initialize environment */
1536@@ -193,7 +198,6 @@ init_fnc_t *init_sequence[] = {
1670@@ -162,7 +167,6 @@ init_fnc_t *init_sequence[] = {
15371671     NULL,
15381672 };
15391673
...... 
15411675 void board_init_f(ulong bootflag)
15421676 {
15431677     gd_t gd_data, *id;
1544@@ -233,6 +237,12 @@ void board_init_f(ulong bootflag)
1678@@ -202,6 +206,12 @@ void board_init_f(ulong bootflag)
15451679     addr &= ~(4096 - 1);
15461680     debug ("Top of RAM usable for U-Boot at: %08lx\n", addr);
15471681
...... 
15541688     /* Reserve memory for U-Boot code, data & bss
15551689      * round down to next 16 kB limit
15561690      */
1557@@ -379,9 +389,9 @@ void board_init_r (gd_t *id, ulong dest_addr)
1691@@ -349,9 +359,9 @@ void board_init_r (gd_t *id, ulong dest_addr)
15581692     size = flash_init();
15591693     display_flash_config (size);
15601694     bd->bi_flashsize = size;
...... 
15651699 #if CONFIG_SYS_MONITOR_BASE == CONFIG_SYS_FLASH_BASE
15661700     bd->bi_flashoffset = monitor_flash_len; /* reserved area for U-Boot */
15671701 #else
1702diff --git a/lib_mips/bootm.c b/lib_mips/bootm.c
1703index 54af24c..34150e9 100644
1704--- a/lib_mips/bootm.c
1705@@ -46,7 +46,9 @@ static void linux_env_set (char * env_name, char * env_val);
1706 int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
1707 {
1708     void (*theKernel) (int, char **, char **, int *);
1709- char *commandline = getenv ("bootargs");
1710+ char *commandline = gd->boot_option == 1 ?
1711+ getenv ("bootargsfromsd") :
1712+ getenv ("bootargs");
1713     char env_buf[12];
1714     char *cp;
1715
15681716diff --git a/lib_mips/time.c b/lib_mips/time.c
15691717index 07e356d..4654bf4 100644
15701718--- a/lib_mips/time.c
...... 
15841733 }
15851734+
15861735+#endif /* !CONFIG_JzRISC */
1736diff --git a/nand_spl/nand_boot_jz4740.c b/nand_spl/nand_boot_jz4740.c
1737index 924a47a..146de19 100644
1738--- a/nand_spl/nand_boot_jz4740.c
1739@@ -24,10 +24,8 @@
1740 #include <asm/io.h>
1741 #include <asm/jz4740.h>
1742
1743-#define KEY_1_OUT (32 * 3 + 21)
1744-#define KEY_1_IN (32 * 3 + 19)
1745-#define KEY_2_OUT (32 * 3 + 25)
1746-#define KEY_2_IN (32 * 3 + 26)
1747+#define KEY_U_OUT (32 * 2 + 16)
1748+#define KEY_U_IN (32 * 3 + 19)
1749
1750 /*
1751  * NAND flash definitions
1752@@ -350,40 +348,25 @@ static void gpio_init(void)
1753
1754 static int is_usb_boot()
1755 {
1756- int key2,keyh;
1757-
1758- key2 = 0;
1759- keyh = 0;
1760+ int keyU = 0;
1761
1762- __gpio_as_output(KEY_1_OUT);
1763- __gpio_as_output(KEY_2_OUT);
1764- __gpio_as_input(KEY_1_IN);
1765- __gpio_as_input(KEY_2_IN);
1766- __gpio_disable_pull(KEY_1_IN);
1767- __gpio_disable_pull(KEY_2_IN);
1768+ __gpio_as_input(KEY_U_IN);
1769+ __gpio_enable_pull(KEY_U_IN);
1770
1771- __gpio_clear_pin(KEY_1_OUT);
1772- __gpio_clear_pin(KEY_2_OUT);
1773-
1774- key2 = __gpio_get_pin(KEY_2_IN);
1775- keyh = __gpio_get_pin(KEY_1_IN);
1776+ __gpio_as_output(KEY_U_OUT);
1777+ __gpio_clear_pin(KEY_U_OUT);
1778
1779- if(key2)
1780- serial_puts("key2");
1781- else
1782- serial_puts("key2--");
1783+ keyU = __gpio_get_pin(KEY_U_IN);
1784
1785- if(keyh)
1786- serial_puts("keyh");
1787+ if (keyU)
1788+ serial_puts("[U] not pressed\n");
1789     else
1790- serial_puts("keyh--");
1791+ serial_puts("[U] pressed\n");
1792
1793-
1794- if( ( key2 == 0 ) && ( keyh == 0 ) )
1795+ if (keyU == 0)
1796         return 1;
1797     else
1798         return 0;
1799-
1800 }
1801
1802 void nand_boot(void)
1803@@ -402,9 +385,8 @@ void nand_boot(void)
1804     pll_init();
1805     sdram_init();
1806
1807- int ret = 0;
1808- ret = is_usb_boot();
1809- if(ret) {
1810+ if(is_usb_boot()) {
1811+ serial_puts("enter USB BOOT mode\n");
1812         usb_boot();
1813     }
1814
15871815--
158818161.6.3.3
15891817
target/linux/xburst/image/u-boot/patches/0003-other-function-for-ben.patch
1diff --git a/board/qi_lb60/qi_lb60.c b/board/qi_lb60/qi_lb60.c
2index d13f2ab..93c2571 100644
3+++ b/board/qi_lb60/qi_lb60.c
4@@ -12,6 +12,8 @@
5 #include <asm/mipsregs.h>
6 #include <asm/jz4740.h>
7
8+DECLARE_GLOBAL_DATA_PTR;
9+
10 static void gpio_init(void)
11 {
12     /*
13@@ -25,11 +27,6 @@ static void gpio_init(void)
14     __gpio_as_sdram_32bit();
15
16     /*
17- * Initialize UART0 pins
18- */
19- __gpio_as_uart0();
20-
21- /*
22      * Initialize LCD pins
23      */
24     __gpio_as_lcd_18bit();
25@@ -43,17 +40,31 @@ static void gpio_init(void)
26      * Initialize Other pins
27      */
28     unsigned int i;
29+ for (i = 0; i < 7; i++){
30+ __gpio_as_input(GPIO_KEYIN_BASE + i);
31+ __gpio_enable_pull(GPIO_KEYIN_BASE + i);
32+ }
33+
34     for (i = 0; i < 8; i++) {
35         __gpio_as_output(GPIO_KEYOUT_BASE + i);
36- __gpio_set_pin(GPIO_KEYOUT_BASE + i);
37+ __gpio_clear_pin(GPIO_KEYOUT_BASE + i);
38     }
39
40- for (i = 0; i < 7; i++){
41- __gpio_as_input(GPIO_KEYIN_BASE + i);
42- __gpio_enable_pull(GPIO_KEYIN_BASE + i);
43+ /*
44+ * Initialize UART0 pins, in Ben NanoNote uart0 and keyin8 use the
45+ * same gpio, init the gpio as uart0 cause a keyboard bug. so for
46+ * end user we disable the uart0
47+ */
48+ if (__gpio_get_pin(GPIO_KEYIN_BASE + 2) == 0){
49+ /* if pressed [S] */
50+ printf("[S] pressed, enable UART0\n");
51+ gd->boot_option = 5;
52+ __gpio_as_uart0();
53+ } else {
54+ printf("[S] not pressed, disable UART0\n");
55+ __gpio_as_input(GPIO_KEYIN_8);
56+ __gpio_enable_pull(GPIO_KEYIN_8);
57     }
58- /* __gpio_as_input( GPIO_KEYIN_8 ); */
59- /* __gpio_enable_pull( GPIO_KEYIN_8 ); */
60
61     __gpio_as_output(GPIO_AUDIO_POP);
62     __gpio_set_pin(GPIO_AUDIO_POP);
63@@ -73,6 +84,11 @@ static void gpio_init(void)
64
65     __gpio_as_input(GPIO_USB_DETECT);
66     __gpio_enable_pull(GPIO_USB_DETECT);
67+
68+ if (__gpio_get_pin(GPIO_KEYIN_BASE + 3) == 0) {
69+ printf("[M] pressed, boot from sd card\n");
70+ gd->boot_option = 1;
71+ }
72 }
73
74 static void cpm_init(void)
75@@ -96,7 +112,6 @@ void board_early_init(void)
76
77 int checkboard (void)
78 {
79- DECLARE_GLOBAL_DATA_PTR;
80
81     printf("Board: Qi LB60 (Ingenic XBurst Jz4740 SoC, Speed %d MHz)\n",
82            gd->cpu_clk/1000000);
83diff --git a/common/env_common.c b/common/env_common.c
84index be64d13..54bf0ea 100644
85+++ b/common/env_common.c
86@@ -134,7 +134,7 @@ uchar default_environment[] = {
87     "pcidelay=" MK_STR(CONFIG_PCI_BOOTDELAY) "\0"
88 #endif
89 #ifdef CONFIG_EXTRA_ENV_SETTINGS
90- CONFIG_EXTRA_ENV_SETTINGS
91+ "bootargsfromsd=" CONFIG_BOOTARGSFROMSD "\0"
92 #endif
93     "\0"
94 };
95diff --git a/common/main.c b/common/main.c
96index 026edd1..1703d4f 100644
97+++ b/common/main.c
98@@ -372,7 +372,9 @@ void main_loop (void)
99 #if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0)
100     s = getenv ("bootdelay");
101     bootdelay = s ? (int)simple_strtol(s, NULL, 10) : CONFIG_BOOTDELAY;
102-
103+ DECLARE_GLOBAL_DATA_PTR;
104+ if (gd->boot_option == 5)
105+ bootdelay = gd->boot_option;
106     debug ("### main_loop entered: bootdelay=%d\n\n", bootdelay);
107
108 # ifdef CONFIG_BOOT_RETRY_TIME
109diff --git a/include/asm-mips/global_data.h b/include/asm-mips/global_data.h
110index db88704..23f597e 100644
111+++ b/include/asm-mips/global_data.h
112@@ -47,6 +47,8 @@ typedef struct global_data {
113         unsigned long mem_clk; /* Memory bus clock */
114         unsigned long dev_clk; /* Device clock */
115         unsigned long fb_base; /* base address of framebuffer */
116+ unsigned long boot_option; /* 1: boot from sd
117+ * 5: boot delay for 5 secs*/
118 #endif
119     unsigned long baudrate;
120     unsigned long have_console; /* serial_init() was called */
121diff --git a/include/configs/qi_lb60.h b/include/configs/qi_lb60.h
122index 02af607..c3bf9c7 100644
123+++ b/include/configs/qi_lb60.h
124@@ -45,6 +45,8 @@
125 #define CONFIG_BOOTDELAY 0
126 #define CONFIG_BOOTFILE "uImage" /* file to load */
127 #define CONFIG_BOOTARGS "mem=32M console=ttyS0,57600n8 ubi.mtd=2 rootfstype=ubifs root=ubi0:rootfs rw rootwait"
128+#define CONFIG_EXTRA_ENV_SETTINGS 1
129+#define CONFIG_BOOTARGSFROMSD "mem=32M console=ttyS0,57600n8 rootfstype=ext2 root=/dev/mmcblk0p1 rw rootwait"
130 #define CONFIG_BOOTCOMMAND "nand read 0x80600000 0x400000 0x200000;bootm"
131
132 /*
133diff --git a/lib_mips/bootm.c b/lib_mips/bootm.c
134index 54af24c..34150e9 100644
135+++ b/lib_mips/bootm.c
136@@ -46,7 +46,9 @@ static void linux_env_set (char * env_name, char * env_val);
137 int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
138 {
139     void (*theKernel) (int, char **, char **, int *);
140- char *commandline = getenv ("bootargs");
141+ char *commandline = gd->boot_option == 1 ?
142+ getenv ("bootargsfromsd") :
143+ getenv ("bootargs");
144     char env_buf[12];
145     char *cp;
146
147diff --git a/nand_spl/nand_boot_jz4740.c b/nand_spl/nand_boot_jz4740.c
148index 924a47a..146de19 100644
149+++ b/nand_spl/nand_boot_jz4740.c
150@@ -24,10 +24,8 @@
151 #include <asm/io.h>
152 #include <asm/jz4740.h>
153
154-#define KEY_1_OUT (32 * 3 + 21)
155-#define KEY_1_IN (32 * 3 + 19)
156-#define KEY_2_OUT (32 * 3 + 25)
157-#define KEY_2_IN (32 * 3 + 26)
158+#define KEY_U_OUT (32 * 2 + 16)
159+#define KEY_U_IN (32 * 3 + 19)
160
161 /*
162  * NAND flash definitions
163@@ -350,40 +348,25 @@ static void gpio_init(void)
164
165 static int is_usb_boot()
166 {
167- int key2,keyh;
168-
169- key2 = 0;
170- keyh = 0;
171+ int keyU = 0;
172
173- __gpio_as_output(KEY_1_OUT);
174- __gpio_as_output(KEY_2_OUT);
175- __gpio_as_input(KEY_1_IN);
176- __gpio_as_input(KEY_2_IN);
177- __gpio_disable_pull(KEY_1_IN);
178- __gpio_disable_pull(KEY_2_IN);
179+ __gpio_as_input(KEY_U_IN);
180+ __gpio_enable_pull(KEY_U_IN);
181
182- __gpio_clear_pin(KEY_1_OUT);
183- __gpio_clear_pin(KEY_2_OUT);
184-
185- key2 = __gpio_get_pin(KEY_2_IN);
186- keyh = __gpio_get_pin(KEY_1_IN);
187+ __gpio_as_output(KEY_U_OUT);
188+ __gpio_clear_pin(KEY_U_OUT);
189
190- if(key2)
191- serial_puts("key2");
192- else
193- serial_puts("key2--");
194+ keyU = __gpio_get_pin(KEY_U_IN);
195
196- if(keyh)
197- serial_puts("keyh");
198+ if (keyU)
199+ serial_puts("[U] not pressed\n");
200     else
201- serial_puts("keyh--");
202+ serial_puts("[U] pressed\n");
203
204-
205- if( ( key2 == 0 ) && ( keyh == 0 ) )
206+ if (keyU == 0)
207         return 1;
208     else
209         return 0;
210-
211 }
212
213 void nand_boot(void)
214@@ -402,9 +385,8 @@ void nand_boot(void)
215     pll_init();
216     sdram_init();
217
218- int ret = 0;
219- ret = is_usb_boot();
220- if(ret) {
221+ if(is_usb_boot()) {
222+ serial_puts("enter USB BOOT mode\n");
223         usb_boot();
224     }
225

Archive Download the corresponding diff file



interactive