• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

修訂248d426abdbbbf4f73835ce45017d62ca8ddddc3 (tree)
時間2016-04-17 18:04:10
作者Yoshinori Sato <ysato@user...>
CommiterYoshinori Sato

Log Message

spl: disable serial output for !CONFIG_SPL_SERIAL

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>

Change Summary

差異

--- a/common/console.c
+++ b/common/console.c
@@ -267,7 +267,7 @@ static inline void console_doenv(int file, struct stdio_dev *dev)
267267 #endif /* defined(CONFIG_CONSOLE_MUX) */
268268
269269 /** U-Boot INITIAL CONSOLE-NOT COMPATIBLE FUNCTIONS *************************/
270-
270+#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_SERIAL_SUPPORT)
271271 int serial_printf(const char *fmt, ...)
272272 {
273273 va_list args;
@@ -285,6 +285,12 @@ int serial_printf(const char *fmt, ...)
285285 serial_puts(printbuffer);
286286 return i;
287287 }
288+#else
289+int serial_printf(const char *fmt, ...)
290+{
291+ return 0;
292+}
293+#endif
288294
289295 int fgetc(int file)
290296 {
@@ -495,9 +501,11 @@ void putc(const char c)
495501 /* Send to the standard output */
496502 fputc(stdout, c);
497503 } else {
504+#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_SERIAL_SUPPORT)
498505 /* Send directly to the handler */
499506 pre_console_putc(c);
500507 serial_putc(c);
508+#endif
501509 }
502510 }
503511
@@ -540,9 +548,11 @@ void puts(const char *s)
540548 /* Send to the standard output */
541549 fputs(stdout, s);
542550 } else {
551+#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_SERIAL_SUPPORT)
543552 /* Send directly to the handler */
544553 pre_console_puts(s);
545554 serial_puts(s);
555+#endif
546556 }
547557 }
548558
@@ -740,13 +750,14 @@ int console_init_r(void)
740750 int iomux_err = 0;
741751 #endif
742752
753+#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_SERIAL_SUPPORT)
743754 /* set default handlers at first */
744755 gd->jt->getc = serial_getc;
745756 gd->jt->tstc = serial_tstc;
746757 gd->jt->putc = serial_putc;
747758 gd->jt->puts = serial_puts;
748759 gd->jt->printf = serial_printf;
749-
760+#endif
750761 /* stdin stdout and stderr are in environment */
751762 /* scan for it */
752763 stdinname = getenv("stdin");
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -32,8 +32,10 @@ DECLARE_GLOBAL_DATA_PTR;
3232 u32 *boot_params_ptr = NULL;
3333 struct spl_image_info spl_image;
3434
35+#ifdef CONFIG_SPL_SERIAL_SUPPORT
3536 /* Define board data structure */
3637 static bd_t bdata __attribute__ ((section(".data")));
38+#endif
3739
3840 /*
3941 * Default function to determine if u-boot or the OS should
@@ -408,6 +410,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
408410 jump_to_image_no_args(&spl_image);
409411 }
410412
413+#ifdef CONFIG_SPL_SERIAL_SUPPORT
411414 /*
412415 * This requires UART clocks to be enabled. In order for this to work the
413416 * caller must ensure that the gd pointer is valid.
@@ -475,3 +478,4 @@ ulong spl_relocate_stack_gd(void)
475478 return 0;
476479 #endif
477480 }
481+#endif
--- a/include/command.h
+++ b/include/command.h
@@ -92,7 +92,7 @@ extern int cmd_get_data_size(char* arg, int default_size);
9292 #ifdef CONFIG_CMD_BOOTD
9393 extern int do_bootd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
9494 #endif
95-#ifdef CONFIG_CMD_BOOTM
95+#if defined(CONFIG_CMD_BOOTM) && !defined(CONFIG_SPL_BUILD)
9696 extern int do_bootm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
9797 extern int bootm_maybe_autostart(cmd_tbl_t *cmdtp, const char *cmd);
9898 #else
--- a/include/common.h
+++ b/include/common.h
@@ -856,15 +856,13 @@ int tstc(void);
856856 #if defined(CONFIG_SPL_BUILD) && !defined(CONFIG_SPL_SERIAL_SUPPORT)
857857 #define putc(...) do { } while (0)
858858 #define puts(...) do { } while (0)
859-#define printf(...) do { } while (0)
860-#define vprintf(...) do { } while (0)
861859 #else
862860 void putc(const char c);
863861 void puts(const char *s);
862+#endif
864863 int printf(const char *fmt, ...)
865864 __attribute__ ((format (__printf__, 1, 2)));
866865 int vprintf(const char *fmt, va_list args);
867-#endif
868866
869867 /* stderr */
870868 #define eputc(c) fputc(stderr, c)
--- a/include/exports.h
+++ b/include/exports.h
@@ -11,11 +11,13 @@ struct spi_slave;
1111
1212 /* These are declarations of exported functions available in C code */
1313 unsigned long get_version(void);
14+#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_SERIAL_SUPPORT)
1415 int getc(void);
1516 int tstc(void);
1617 void putc(const char);
1718 void puts(const char*);
1819 int printf(const char* fmt, ...);
20+#endif
1921 void install_hdlr(int, interrupt_handler_t, void*);
2022 void free_hdlr(int);
2123 void *malloc(size_t);
@@ -24,7 +26,9 @@ void free(void*);
2426 #endif
2527 void __udelay(unsigned long);
2628 unsigned long get_timer(unsigned long);
29+#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_SERIAL_SUPPORT)
2730 int vprintf(const char *, va_list);
31+#endif
2832 unsigned long simple_strtoul(const char *cp, char **endp, unsigned int base);
2933 int strict_strtoul(const char *cp, unsigned int base, unsigned long *res);
3034 char *getenv (const char *name);
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -83,9 +83,9 @@ obj-$(CONFIG_LIB_RAND) += rand.o
8383 ifdef CONFIG_SPL_BUILD
8484 # SPL U-Boot may use full-printf, tiny-printf or none at all
8585 ifdef CONFIG_USE_TINY_PRINTF
86-obj-$(CONFIG_SPL_SERIAL_SUPPORT) += tiny-printf.o panic.o strto.o
86+obj-y += tiny-printf.o panic.o strto.o
8787 else
88-obj-$(CONFIG_SPL_SERIAL_SUPPORT) += vsprintf.o panic.o strto.o
88+obj-y += vsprintf.o panic.o strto.o
8989 endif
9090 else
9191 # Main U-Boot always uses the full printf support