diff mbox

[U-Boot] omap4_common: config: remove I2C for SPL mode

Message ID 1389146816-5056-1-git-send-email-nm@ti.com
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Nishanth Menon Jan. 8, 2014, 2:06 a.m. UTC
Commit 6789e84ecaa8f45d053084e08c381284a04abff7 (i2c, omap24xx:
convert driver to new mutlibus/mutliadapter framework) intended to
make I2C driver compatible with latest changes. It unfortunately has
had a impact on size on SPL as well. For example on SDP4430,
32032 bytes before/MLO
35416 bytes after/MLO

With this mentioned commit, MLO stops booting on SDP4430 as only 32K
is accessible for non-secure (bootloader) s/w on GP devices and the size
increase to 56K fails boot.

On the latest u-boot commit e7be18225fbea76d1f0034b224f0d1e60f07cfcf,
MLO is now at size 35592 bytes, However, I2C is not necessary for SPL
to function as we use SR_I2C for controlling the PMIC.
Disabling I2C reduces MLO to 32224 bytes which allows
OMAP4 GP platform to boot up.

Since this is common for all OMAP4 platforms, remove the need for I2C
for SPL builds in the common config.

Signed-off-by: Nishanth Menon <nm@ti.com>
---

Though I originally reported this for SDP4430[1], a test on PandaBoard-ES
also indicated fail to boot!

Tested on PandaBoard-ES and SDP4430
Build result: http://pastebin.mozilla.org/3963101

Test log:
SDP4430: http://pastebin.mozilla.org/3963123
PandaBoard-ES: http://pastebin.mozilla.org/3963134

[1] http://marc.info/?l=u-boot&m=138914031918099&w=2

 include/configs/omap4_common.h |    6 ++++++
 1 file changed, 6 insertions(+)

Comments

SRICHARAN R Jan. 8, 2014, 6:33 a.m. UTC | #1
Hi Nishanth,
On Wednesday 08 January 2014 07:36 AM, Nishanth Menon wrote:
> Commit 6789e84ecaa8f45d053084e08c381284a04abff7 (i2c, omap24xx:
> convert driver to new mutlibus/mutliadapter framework) intended to
> make I2C driver compatible with latest changes. It unfortunately has
> had a impact on size on SPL as well. For example on SDP4430,
> 32032 bytes before/MLO
> 35416 bytes after/MLO
> 
> With this mentioned commit, MLO stops booting on SDP4430 as only 32K
> is accessible for non-secure (bootloader) s/w on GP devices and the size
> increase to 56K fails boot.
> 
> On the latest u-boot commit e7be18225fbea76d1f0034b224f0d1e60f07cfcf,
> MLO is now at size 35592 bytes, However, I2C is not necessary for SPL
> to function as we use SR_I2C for controlling the PMIC.
> Disabling I2C reduces MLO to 32224 bytes which allows
> OMAP4 GP platform to boot up.
> 
> Since this is common for all OMAP4 platforms, remove the need for I2C
> for SPL builds in the common config.
> 
> Signed-off-by: Nishanth Menon <nm@ti.com>
> ---
> 
> Though I originally reported this for SDP4430[1], a test on PandaBoard-ES
> also indicated fail to boot!
> 
> Tested on PandaBoard-ES and SDP4430
> Build result: http://pastebin.mozilla.org/3963101
> 
> Test log:
> SDP4430: http://pastebin.mozilla.org/3963123
> PandaBoard-ES: http://pastebin.mozilla.org/3963134
> 
> [1] http://marc.info/?l=u-boot&m=138914031918099&w=2
> 
>  include/configs/omap4_common.h |    6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/include/configs/omap4_common.h b/include/configs/omap4_common.h
> index ea56eeb..7cfd471 100644
> --- a/include/configs/omap4_common.h
> +++ b/include/configs/omap4_common.h
> @@ -154,4 +154,10 @@
>  #define CONFIG_SPL_DISPLAY_PRINT
>  #define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/omap-common/u-boot-spl.lds"
>  
> +#ifdef CONFIG_SPL_BUILD
> +/* No need for i2c in SPL mode as we will use SRI2C for PMIC access on OMAP4 */
> +#undef CONFIG_SYS_I2C
> +#undef CONFIG_SYS_I2C_OMAP24XX
> +#endif
> +
>  #endif /* __CONFIG_OMAP4_COMMON_H */

correct. Thanks for the fix. Also with size remaining still as 32224 bytes OMAP4 HS devices
might not boot up. Anyways thats separate and something more like this
patch has to be removed.

Reviewed-by: Sricharan R <r.sricharan@ti.com>

Regards,
 Sricharan
Tom Rini Jan. 8, 2014, 12:58 p.m. UTC | #2
On Tue, Jan 07, 2014 at 08:06:56PM -0600, Nishanth Menon wrote:

> Commit 6789e84ecaa8f45d053084e08c381284a04abff7 (i2c, omap24xx:
> convert driver to new mutlibus/mutliadapter framework) intended to
> make I2C driver compatible with latest changes. It unfortunately has
> had a impact on size on SPL as well. For example on SDP4430,
> 32032 bytes before/MLO
> 35416 bytes after/MLO

Ah toolchain fun, that's why I hadn't seen this, all of mine build
around 32KiB.

So, where is the 38KiB max size we set valid, on OMAP4 devices?
Michael Nazzareno Trimarchi Jan. 8, 2014, 1:02 p.m. UTC | #3
HI

On Wed, Jan 8, 2014 at 1:58 PM, Tom Rini <trini@ti.com> wrote:
> On Tue, Jan 07, 2014 at 08:06:56PM -0600, Nishanth Menon wrote:
>
>> Commit 6789e84ecaa8f45d053084e08c381284a04abff7 (i2c, omap24xx:
>> convert driver to new mutlibus/mutliadapter framework) intended to
>> make I2C driver compatible with latest changes. It unfortunately has
>> had a impact on size on SPL as well. For example on SDP4430,
>> 32032 bytes before/MLO
>> 35416 bytes after/MLO
>
> Ah toolchain fun, that's why I hadn't seen this, all of mine build
> around 32KiB.
>
> So, where is the 38KiB max size we set valid, on OMAP4 devices?
>

I'm working on a different version of u-boot for omap4460 and my spl
is very big

/* Defines for SPL */
#define CONFIG_SPL
#if 0
#define CONFIG_SPL_TEXT_BASE           0x40303080
#define CONFIG_SPL_MAX_SIZE            (38 * 1024)
#else
#define CONFIG_SPL_TEXT_BASE            0x40303080
#define CONFIG_SPL_MAX_SIZE             ((40 * 1024) + 512)
#endif

With this size I can boot from serial and from sdcard.

Michael

> --
> Tom
>
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
Nishanth Menon Jan. 8, 2014, 1:49 p.m. UTC | #4
On Wed, Jan 8, 2014 at 6:58 AM, Tom Rini <trini@ti.com> wrote:
>
> Ah toolchain fun, that's why I hadn't seen this, all of mine build
> around 32KiB.
>
arm-linux-gnueabi-gcc --version
arm-linux-gnueabi-gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


> So, where is the 38KiB max size we set valid, on OMAP4 devices?

as I mentioned in my commit message,

32k limit is on OMAP4 devices -> Default accessible "non-secure" SRAM
out of the total of 56K is only 32K.

Sricharan already pointed at
http://git.denx.de/?p=u-boot/u-boot-arm.git;a=commit;h=dcc23576384dbb875a4427dcfa9ac8d237230d42

Any further savings will be great.
Regards,
Nishanth Menon
Tom Rini Feb. 21, 2014, 7:14 p.m. UTC | #5
On Tue, Jan 07, 2014 at 08:06:56PM -0600, Nishanth Menon wrote:

> Commit 6789e84ecaa8f45d053084e08c381284a04abff7 (i2c, omap24xx:
> convert driver to new mutlibus/mutliadapter framework) intended to
> make I2C driver compatible with latest changes. It unfortunately has
> had a impact on size on SPL as well. For example on SDP4430,
> 32032 bytes before/MLO
> 35416 bytes after/MLO
> 
> With this mentioned commit, MLO stops booting on SDP4430 as only 32K
> is accessible for non-secure (bootloader) s/w on GP devices and the size
> increase to 56K fails boot.
> 
> On the latest u-boot commit e7be18225fbea76d1f0034b224f0d1e60f07cfcf,
> MLO is now at size 35592 bytes, However, I2C is not necessary for SPL
> to function as we use SR_I2C for controlling the PMIC.
> Disabling I2C reduces MLO to 32224 bytes which allows
> OMAP4 GP platform to boot up.
> 
> Since this is common for all OMAP4 platforms, remove the need for I2C
> for SPL builds in the common config.
> 
> Signed-off-by: Nishanth Menon <nm@ti.com>
> Reviewed-by: Sricharan R <r.sricharan@ti.com>

Applied to u-boot-ti/master, thanks!
diff mbox

Patch

diff --git a/include/configs/omap4_common.h b/include/configs/omap4_common.h
index ea56eeb..7cfd471 100644
--- a/include/configs/omap4_common.h
+++ b/include/configs/omap4_common.h
@@ -154,4 +154,10 @@ 
 #define CONFIG_SPL_DISPLAY_PRINT
 #define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/omap-common/u-boot-spl.lds"
 
+#ifdef CONFIG_SPL_BUILD
+/* No need for i2c in SPL mode as we will use SRI2C for PMIC access on OMAP4 */
+#undef CONFIG_SYS_I2C
+#undef CONFIG_SYS_I2C_OMAP24XX
+#endif
+
 #endif /* __CONFIG_OMAP4_COMMON_H */