From: Vignesh R Date: Thu, 6 Apr 2017 18:04:07 +0530 Subject: [U-Boot] [PATCH v2] net: eth_common: Don't use %pM when USE_TINY_PRINTF is enabled In-Reply-To: <20170403200851.B9F4312090E@gemini.denx.de> References: <20170403054659.32553-1-vigneshr@ti.com> <20170403063307.C7BFD12090E@gemini.denx.de> <2c453144-8aba-3e66-8f1f-fe468bcdc382@ti.com> <20170403200851.B9F4312090E@gemini.denx.de> Message-ID: <434f10b4-3559-5170-5bd1-dbdfcfed32c3@ti.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tuesday 04 April 2017 01:38 AM, Wolfgang Denk wrote: > Dear Vignesh, > > In message <2c453144-8aba-3e66-8f1f-fe468bcdc382@ti.com> you wrote: >> >> I agree, networking widely uses %pM for printing mac addresses. >> Are you suggesting to port %pM support from lib/vsprintf.c to >> lib/tiny-printf.c and make it available based on CONFIG_CMD_NET? > > I don't think we should add another #ifdef for this. How much (in > terms of number of bytes) does it hurt to add it without an #ifdef? > I ported minimal support for %p? to tiny-printf and here are the stats: With changes to support %p?(%p %pa[p], %pI[46], %pm, %pM) format in tiny printf SPL size increases by 509 bytes. With changes to support just %p, %pa[p] formats in tiny-printf delta is ~75 bytes wrt plain SPL Therefore, if %pM and other net related printf formats are disabled based on CONFIG_CMD_NET savings is ~434 bytes Compiler used is: arm-linux-gnueabihf-gcc (Linaro GCC 6.2-2016.11) 6.2.1 20161016 > I guess we cannot handle this in some intelligent automatic way > similar to dead code elimination? > >> I am trying to use RNDIS boot on am437x/am335x boards with >> CONFIG_USE_TINY_PRINTF(to reduce code size due to internal SRAM size >> constraint) and therefore need networking support in SPL. > > So you need networking _and_ USB and still care about the printf() > size? Ouch... > USB RNDIS boot has been supported on am335x platform in mainline u-boot for quite some time. But the SPL size is steadily increasing due to which CONFIG_USE_TINY_PRINTF needs to be enabled to avoid SRAM overflow. > Best regards, > > Wolfgang Denk > -- Regards Vignesh