mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 08:42:12 +02:00
common: Move serial_printf() to the serial header
Move this function header to serial.h since this function is clearly related to serial. The function itself stays in console.c since we don't have a single serial file. DM and non-DM each has a separate file so we would have to either create a new common serial file, or repeat the function in both serial.c and serial-uclass.c, neither of which seem worthwhile. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
@@ -16,6 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
#include <serial.h>
|
||||||
#include <usbdevice.h>
|
#include <usbdevice.h>
|
||||||
|
|
||||||
#define MAX_INTERFACES 2
|
#define MAX_INTERFACES 2
|
||||||
|
@@ -8,6 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
|
#include <serial.h>
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
|
|
||||||
#include <env.h>
|
#include <env.h>
|
||||||
|
@@ -37,6 +37,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
|
#include <serial.h>
|
||||||
#include <usbdevice.h>
|
#include <usbdevice.h>
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
@@ -581,7 +582,7 @@ int ep0_recv_setup (struct urb *urb)
|
|||||||
device->interface = le16_to_cpu (request->wIndex);
|
device->interface = le16_to_cpu (request->wIndex);
|
||||||
device->alternate = le16_to_cpu (request->wValue);
|
device->alternate = le16_to_cpu (request->wValue);
|
||||||
/*dbg_ep0(2, "set interface: %d alternate: %d", device->interface, device->alternate); */
|
/*dbg_ep0(2, "set interface: %d alternate: %d", device->interface, device->alternate); */
|
||||||
serial_printf ("DEVICE_SET_INTERFACE.. event?\n");
|
serial_printf("DEVICE_SET_INTERFACE.. event?\n");
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case USB_REQ_GET_STATUS:
|
case USB_REQ_GET_STATUS:
|
||||||
|
@@ -10,6 +10,7 @@
|
|||||||
*/
|
*/
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include <dm.h>
|
#include <dm.h>
|
||||||
|
#include <serial.h>
|
||||||
#include <dm/device-internal.h>
|
#include <dm/device-internal.h>
|
||||||
#include <dm/lists.h>
|
#include <dm/lists.h>
|
||||||
#include <linux/usb/otg.h>
|
#include <linux/usb/otg.h>
|
||||||
|
@@ -38,6 +38,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
|
#include <serial.h>
|
||||||
#include <usbdevice.h>
|
#include <usbdevice.h>
|
||||||
#include <usb/udc.h>
|
#include <usb/udc.h>
|
||||||
#include "../gadget/ep0.h"
|
#include "../gadget/ep0.h"
|
||||||
|
@@ -16,6 +16,7 @@
|
|||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <serial.h>
|
||||||
#include <asm/omap_common.h>
|
#include <asm/omap_common.h>
|
||||||
#include <twl4030.h>
|
#include <twl4030.h>
|
||||||
#include <twl6030.h>
|
#include <twl6030.h>
|
||||||
|
@@ -310,13 +310,6 @@ int ulz4fn(const void *src, size_t srcn, void *dst, size_t *dstn);
|
|||||||
/* lib/vsprintf.c */
|
/* lib/vsprintf.c */
|
||||||
#include <vsprintf.h>
|
#include <vsprintf.h>
|
||||||
|
|
||||||
/*
|
|
||||||
* STDIO based functions (can always be used)
|
|
||||||
*/
|
|
||||||
/* serial stuff */
|
|
||||||
int serial_printf (const char *fmt, ...)
|
|
||||||
__attribute__ ((format (__printf__, 1, 2)));
|
|
||||||
|
|
||||||
/* lib/net_utils.c */
|
/* lib/net_utils.c */
|
||||||
#include <net.h>
|
#include <net.h>
|
||||||
|
|
||||||
|
@@ -324,4 +324,15 @@ void pl01x_serial_initialize(void);
|
|||||||
void pxa_serial_initialize(void);
|
void pxa_serial_initialize(void);
|
||||||
void sh_serial_initialize(void);
|
void sh_serial_initialize(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* serial_printf() - Write a formatted string to the serial console
|
||||||
|
*
|
||||||
|
* The total size of the output must be less than CONFIG_SYS_PBSIZE.
|
||||||
|
*
|
||||||
|
* @fmt: Printf format string, followed by format arguments
|
||||||
|
* @return number of characters written
|
||||||
|
*/
|
||||||
|
int serial_printf(const char *fmt, ...)
|
||||||
|
__attribute__ ((format (__printf__, 1, 2)));
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user