* [U-Boot] [PATCH 1/2] tiny-printf: Support sprintf()
@ 2016-05-31 21:12 Marek Vasut
2016-05-31 21:12 ` [U-Boot] [PATCH 2/2] ARM: omap: Enable tiny printf on omap3_logic Marek Vasut
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Marek Vasut @ 2016-05-31 21:12 UTC (permalink / raw)
To: u-boot
Add a simple version of this function for SPL. It does not check the buffer
size as this would add to the code size.
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Stefan Roese <sr@denx.de>
Cc: Tom Rini <trini@konsulko.com>
Cc: lesne at alse-fr.com
---
lib/tiny-printf.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/lib/tiny-printf.c b/lib/tiny-printf.c
index 4b70263..5ea2555 100644
--- a/lib/tiny-printf.c
+++ b/lib/tiny-printf.c
@@ -147,8 +147,7 @@ static void putc_outstr(char ch)
*outstr++ = ch;
}
-/* Note that size is ignored */
-int snprintf(char *buf, size_t size, const char *fmt, ...)
+int sprintf(char *buf, const char *fmt, ...)
{
va_list va;
int ret;
@@ -161,3 +160,16 @@ int snprintf(char *buf, size_t size, const char *fmt, ...)
return ret;
}
+
+/* Note that size is ignored */
+int snprintf(char *buf, size_t size, const char *fmt, ...)
+{
+ va_list va;
+ int ret;
+
+ va_start(va, fmt);
+ ret = sprintf(buf, fmt, va);
+ va_end(va);
+
+ return ret;
+}
--
2.7.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH 2/2] ARM: omap: Enable tiny printf on omap3_logic
2016-05-31 21:12 [U-Boot] [PATCH 1/2] tiny-printf: Support sprintf() Marek Vasut
@ 2016-05-31 21:12 ` Marek Vasut
2016-05-31 22:55 ` Tom Rini
2016-06-03 14:00 ` [U-Boot] [U-Boot, " Tom Rini
2016-05-31 22:55 ` [U-Boot] [PATCH 1/2] tiny-printf: Support sprintf() Tom Rini
` (2 subsequent siblings)
3 siblings, 2 replies; 7+ messages in thread
From: Marek Vasut @ 2016-05-31 21:12 UTC (permalink / raw)
To: u-boot
Enable support for tiny printf on the omap3_logic board to trim down
the SPL size. This makes the SPL actually build again and fit into
the SRAM.
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
Cc: lesne at alse-fr.com
---
configs/omap3_logic_defconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/configs/omap3_logic_defconfig b/configs/omap3_logic_defconfig
index 3226247..e7bf385 100644
--- a/configs/omap3_logic_defconfig
+++ b/configs/omap3_logic_defconfig
@@ -1,6 +1,7 @@
CONFIG_ARM=y
CONFIG_OMAP34XX=y
CONFIG_TARGET_OMAP3_LOGIC=y
+CONFIG_USE_TINY_PRINTF=y
CONFIG_SPL=y
CONFIG_FIT=y
CONFIG_SYS_EXTRA_OPTIONS="NAND"
--
2.7.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH 1/2] tiny-printf: Support sprintf()
2016-05-31 21:12 [U-Boot] [PATCH 1/2] tiny-printf: Support sprintf() Marek Vasut
2016-05-31 21:12 ` [U-Boot] [PATCH 2/2] ARM: omap: Enable tiny printf on omap3_logic Marek Vasut
@ 2016-05-31 22:55 ` Tom Rini
2016-06-01 8:16 ` Sylvain Lesne
2016-06-03 14:00 ` [U-Boot] [U-Boot,1/2] " Tom Rini
3 siblings, 0 replies; 7+ messages in thread
From: Tom Rini @ 2016-05-31 22:55 UTC (permalink / raw)
To: u-boot
On Tue, May 31, 2016 at 11:12:46PM +0200, Marek Vasut wrote:
> Add a simple version of this function for SPL. It does not check the buffer
> size as this would add to the code size.
>
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Stefan Roese <sr@denx.de>
> Cc: Tom Rini <trini@konsulko.com>
> Cc: lesne at alse-fr.com
Reviewed-by: Tom Rini <trini@konsulko.com>
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160531/42053a4e/attachment.sig>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH 2/2] ARM: omap: Enable tiny printf on omap3_logic
2016-05-31 21:12 ` [U-Boot] [PATCH 2/2] ARM: omap: Enable tiny printf on omap3_logic Marek Vasut
@ 2016-05-31 22:55 ` Tom Rini
2016-06-03 14:00 ` [U-Boot] [U-Boot, " Tom Rini
1 sibling, 0 replies; 7+ messages in thread
From: Tom Rini @ 2016-05-31 22:55 UTC (permalink / raw)
To: u-boot
On Tue, May 31, 2016 at 11:12:47PM +0200, Marek Vasut wrote:
> Enable support for tiny printf on the omap3_logic board to trim down
> the SPL size. This makes the SPL actually build again and fit into
> the SRAM.
>
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Tom Rini <trini@konsulko.com>
> Cc: lesne at alse-fr.com
Reviewed-by: Tom Rini <trini@konsulko.com>
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160531/7bbd0b25/attachment.sig>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH 1/2] tiny-printf: Support sprintf()
2016-05-31 21:12 [U-Boot] [PATCH 1/2] tiny-printf: Support sprintf() Marek Vasut
2016-05-31 21:12 ` [U-Boot] [PATCH 2/2] ARM: omap: Enable tiny printf on omap3_logic Marek Vasut
2016-05-31 22:55 ` [U-Boot] [PATCH 1/2] tiny-printf: Support sprintf() Tom Rini
@ 2016-06-01 8:16 ` Sylvain Lesne
2016-06-03 14:00 ` [U-Boot] [U-Boot,1/2] " Tom Rini
3 siblings, 0 replies; 7+ messages in thread
From: Sylvain Lesne @ 2016-06-01 8:16 UTC (permalink / raw)
To: u-boot
Hi,
On 05/31/2016 11:12 PM, Marek Vasut wrote:
> Add a simple version of this function for SPL. It does not check the buffer
> size as this would add to the code size.
>
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Stefan Roese <sr@denx.de>
> Cc: Tom Rini <trini@konsulko.com>
> Cc: lesne at alse-fr.com
This is how I would do it as well, and I can confirm that it builds
and boots on a socfpga platform (sockit), when using part_dos.c
(that includes sprintf() calls).
Reviewed-by: Sylvain Lesne <lesne@alse-fr.com>
Tested-by: Sylvain Lesne <lesne@alse-fr.com>
--
Sylvain
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [U-Boot,1/2] tiny-printf: Support sprintf()
2016-05-31 21:12 [U-Boot] [PATCH 1/2] tiny-printf: Support sprintf() Marek Vasut
` (2 preceding siblings ...)
2016-06-01 8:16 ` Sylvain Lesne
@ 2016-06-03 14:00 ` Tom Rini
3 siblings, 0 replies; 7+ messages in thread
From: Tom Rini @ 2016-06-03 14:00 UTC (permalink / raw)
To: u-boot
On Tue, May 31, 2016 at 11:12:46PM +0200, Marek Vasut wrote:
> Add a simple version of this function for SPL. It does not check the buffer
> size as this would add to the code size.
>
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Stefan Roese <sr@denx.de>
> Cc: Tom Rini <trini@konsulko.com>
> Cc: lesne at alse-fr.com
> Reviewed-by: Tom Rini <trini@konsulko.com>
> Reviewed-by: Sylvain Lesne <lesne@alse-fr.com>
> Tested-by: Sylvain Lesne <lesne@alse-fr.com>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160603/72f63bd1/attachment.sig>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [U-Boot, 2/2] ARM: omap: Enable tiny printf on omap3_logic
2016-05-31 21:12 ` [U-Boot] [PATCH 2/2] ARM: omap: Enable tiny printf on omap3_logic Marek Vasut
2016-05-31 22:55 ` Tom Rini
@ 2016-06-03 14:00 ` Tom Rini
1 sibling, 0 replies; 7+ messages in thread
From: Tom Rini @ 2016-06-03 14:00 UTC (permalink / raw)
To: u-boot
On Tue, May 31, 2016 at 11:12:47PM +0200, Marek Vasut wrote:
> Enable support for tiny printf on the omap3_logic board to trim down
> the SPL size. This makes the SPL actually build again and fit into
> the SRAM.
>
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Tom Rini <trini@konsulko.com>
> Cc: lesne at alse-fr.com
> Reviewed-by: Tom Rini <trini@konsulko.com>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160603/b7084dd8/attachment.sig>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-06-03 14:00 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-31 21:12 [U-Boot] [PATCH 1/2] tiny-printf: Support sprintf() Marek Vasut
2016-05-31 21:12 ` [U-Boot] [PATCH 2/2] ARM: omap: Enable tiny printf on omap3_logic Marek Vasut
2016-05-31 22:55 ` Tom Rini
2016-06-03 14:00 ` [U-Boot] [U-Boot, " Tom Rini
2016-05-31 22:55 ` [U-Boot] [PATCH 1/2] tiny-printf: Support sprintf() Tom Rini
2016-06-01 8:16 ` Sylvain Lesne
2016-06-03 14:00 ` [U-Boot] [U-Boot,1/2] " Tom Rini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox