diff mbox

[U-Boot,v5,2/2] OMAP3: igep00x0: add boot status GPIO LED

Message ID 1356615361-14849-1-git-send-email-javier.martinez@collabora.co.uk
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Javier Martinez Canillas Dec. 27, 2012, 1:36 p.m. UTC
This patch adds an GPIO LED boot status for IGEP boards.

The GPIO LED used is the red LED0 while the Linux kernel
uses the green LED0 as the boot status.

By using different GPIO LEDs, the user can know in which
step of the boot process the board currently is.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
---

Changes since v4:
    - Since gpio_direction_output() sets the value, there is no need
      to call gpio_set_value() as suggested by Igor Grinberg.

Changes since v3:
    - Avoid code duplication but having a single show_boot_progress()
      function as suggested by Wolfgang Denk.

Changes since v2:
    - Use show_boot_progress() instead implementing yet another boot status
      signalling as suggested by Wolfgang Denk.

Changes since v1:
    - Don't set gd->bd->bi_arch_number since is done in arch/arm/lib/board.c
    - Use CONFIG_MACH_TYPE == MACH_TYPE_IGEP0020 instead of check bi_arch_number
      as suggested by Igor Grinberg.

 board/isee/igep00x0/igep00x0.c |   13 +++++++++++++
 board/isee/igep00x0/igep00x0.h |    8 ++++++++
 include/configs/igep00x0.h     |    3 +++
 3 files changed, 24 insertions(+), 0 deletions(-)

Comments

Igor Grinberg Dec. 27, 2012, 2:25 p.m. UTC | #1
On 12/27/12 15:36, Javier Martinez Canillas wrote:
> This patch adds an GPIO LED boot status for IGEP boards.
> 
> The GPIO LED used is the red LED0 while the Linux kernel
> uses the green LED0 as the boot status.
> 
> By using different GPIO LEDs, the user can know in which
> step of the boot process the board currently is.
> 
> Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>

Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Javier Martinez Canillas Jan. 10, 2013, 9:43 a.m. UTC | #2
On Thu, Dec 27, 2012 at 3:25 PM, Igor Grinberg <grinberg@compulab.co.il> wrote:
> On 12/27/12 15:36, Javier Martinez Canillas wrote:
>> This patch adds an GPIO LED boot status for IGEP boards.
>>
>> The GPIO LED used is the red LED0 while the Linux kernel
>> uses the green LED0 as the boot status.
>>
>> By using different GPIO LEDs, the user can know in which
>> step of the boot process the board currently is.
>>
>> Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
>
> Acked-by: Igor Grinberg <grinberg@compulab.co.il>
>

Hello Tom,

Any news of merging this patch?

Thanks a lot and best regards,
Javier
Tom Rini Jan. 10, 2013, 3:35 p.m. UTC | #3
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 01/10/2013 04:43 AM, Javier Martinez Canillas wrote:
> On Thu, Dec 27, 2012 at 3:25 PM, Igor Grinberg
> <grinberg@compulab.co.il> wrote:
>> On 12/27/12 15:36, Javier Martinez Canillas wrote:
>>> This patch adds an GPIO LED boot status for IGEP boards.
>>> 
>>> The GPIO LED used is the red LED0 while the Linux kernel uses
>>> the green LED0 as the boot status.
>>> 
>>> By using different GPIO LEDs, the user can know in which step
>>> of the boot process the board currently is.
>>> 
>>> Signed-off-by: Javier Martinez Canillas
>>> <javier.martinez@collabora.co.uk>
>> 
>> Acked-by: Igor Grinberg <grinberg@compulab.co.il>
>> 
> 
> Hello Tom,
> 
> Any news of merging this patch?

Things look good, sorry.  I'm going to try and get to starting a next
branch but I might not get a chance before the next release.

- -- 
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iQIcBAEBAgAGBQJQ7t/CAAoJENk4IS6UOR1WvFQP/3XHlrYBbksBo2OZ4Q8pNC44
V8VYI2voK05WSy6sOdOPenoycCgbwsLSSY6c8UjL89QCkQUs9PcoD5PwHk91IAyu
xQgrMB3IuyedTEWkDydxNQnQpo26r74kFUC8cminhwSwMl7Z9aRIB62AKDe+6bpb
55ByYPw0jocaCGy8uKf7OVYhmGdQVuhhUsdAnTOmYxttxkfZGuoE9DwcCI7ciTyT
P0fCHiW8gbRYTu5Jd9r/9YPCHRznCUMB/xeDlO2gKZQxwE9N09w7vJsKsF9cU3Hq
yh35yG+mqilcLsO0kMvZ47VFpYBlFhjV52iEyNUQ5RBbDepqgLtmA0+W/8XOLFim
j9HbBrjVeFqp1NrXFKl+u1mVQd+dY1dSfKTgo5w6e4xmHChGXI02dlf2BYI6dJLF
yg/q+djIvW64fmW5wNue4rTEiHQmhCFfkcVoUMSZnZ+kFfzBEqb8IUk2WB61ULRt
3ZiKqYJ7qkzPF4OjiV4xJFaowSaHcmAONPvCD23f8wG1MuKRD+ls77cGS3mWV/Zd
qzuoInRlj/gTmaPlmuR/RVr7fJAsScAQtp21aO97exhtWRi0rvDwwaS4nz4WzpYM
EImbHhi3rAUzcvh5wmdbmojNKbu1ueXac+OxYvIyU83SnOZO4KVNiu5+ijl9GI6G
P5l9EJKo+32MUSY3B43j
=2eCE
-----END PGP SIGNATURE-----
Javier Martinez Canillas Jan. 10, 2013, 4:16 p.m. UTC | #4
On Thu, Jan 10, 2013 at 4:35 PM, Tom Rini <trini@ti.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 01/10/2013 04:43 AM, Javier Martinez Canillas wrote:
>> On Thu, Dec 27, 2012 at 3:25 PM, Igor Grinberg
>> <grinberg@compulab.co.il> wrote:
>>> On 12/27/12 15:36, Javier Martinez Canillas wrote:
>>>> This patch adds an GPIO LED boot status for IGEP boards.
>>>>
>>>> The GPIO LED used is the red LED0 while the Linux kernel uses
>>>> the green LED0 as the boot status.
>>>>
>>>> By using different GPIO LEDs, the user can know in which step
>>>> of the boot process the board currently is.
>>>>
>>>> Signed-off-by: Javier Martinez Canillas
>>>> <javier.martinez@collabora.co.uk>
>>>
>>> Acked-by: Igor Grinberg <grinberg@compulab.co.il>
>>>
>>
>> Hello Tom,
>>
>> Any news of merging this patch?
>
> Things look good, sorry.  I'm going to try and get to starting a next
> branch but I might not get a chance before the next release.
>
> - --
> Tom

Great, waiting for the next release is not an issue.

There are also two more patches for IGEP boards that were acked but
not picked for this release:

[U-Boot,v2,1/2] OMAP3: use a single board file for IGEP devices [1]
[U-Boot,1/1] OMAP3: igep00x0: add CONFIG_SPL_BOARD_INIT for
CONFIG_SPL_NAND_SUPPORT [2]

Thanks a lot and best regards,
Javier

[1]: http://patchwork.ozlabs.org/patch/208296/
[2]: http://patchwork.ozlabs.org/patch/208481/
Tom Rini Jan. 10, 2013, 5:26 p.m. UTC | #5
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 01/10/2013 11:16 AM, Javier Martinez Canillas wrote:
> On Thu, Jan 10, 2013 at 4:35 PM, Tom Rini <trini@ti.com> wrote:
>> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
>> 
>> On 01/10/2013 04:43 AM, Javier Martinez Canillas wrote:
>>> On Thu, Dec 27, 2012 at 3:25 PM, Igor Grinberg 
>>> <grinberg@compulab.co.il> wrote:
>>>> On 12/27/12 15:36, Javier Martinez Canillas wrote:
>>>>> This patch adds an GPIO LED boot status for IGEP boards.
>>>>> 
>>>>> The GPIO LED used is the red LED0 while the Linux kernel 
>>>>> uses the green LED0 as the boot status.
>>>>> 
>>>>> By using different GPIO LEDs, the user can know in which 
>>>>> step of the boot process the board currently is.
>>>>> 
>>>>> Signed-off-by: Javier Martinez Canillas 
>>>>> <javier.martinez@collabora.co.uk>
>>>> 
>>>> Acked-by: Igor Grinberg <grinberg@compulab.co.il>
>>>> 
>>> 
>>> Hello Tom,
>>> 
>>> Any news of merging this patch?
>> 
>> Things look good, sorry.  I'm going to try and get to starting a
>>  next branch but I might not get a chance before the next 
>> release.
>> 
>> - -- Tom
> 
> Great, waiting for the next release is not an issue.
> 
> There are also two more patches for IGEP boards that were acked
> but not picked for this release:
> 
> [U-Boot,v2,1/2] OMAP3: use a single board file for IGEP devices
> [1] [U-Boot,1/1] OMAP3: igep00x0: add CONFIG_SPL_BOARD_INIT for 
> CONFIG_SPL_NAND_SUPPORT [2]

For the second path, did SPL+NAND for the IGEP devices get added already?

- -- 
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iQIcBAEBAgAGBQJQ7vnPAAoJENk4IS6UOR1WmtQP/00tbURLxdS+NBKLnOvNQcek
cYdAuYOhuNTmCIAJcGBTUDwn6Qt4OeAqSHi4H9ylsliNiDMMaQ9RuhIg9biXb3Hn
5ICeMwCgpoFhjjlxaEtMIrc2ZwxKMOfLyetrx10IM2dldzSFG5dScT2rXeyYjNkv
XAEh/h8/lXOs42YacBTOa6Lew57U6mw+u+1OAhYkw/EGN3WAph4V3FKmBLxWfad7
OZlE//oOwyIlTlcVYTTp74ugXU36eURL+B8qyFXO26Z3U+H+bi3BDaj7DDQ0Z03Q
yTJ10w+7TR9UyLGLcfwOtzHwrSgZK71Y90yhTuAbGheBcj+aX6Gvfl3jov9cWvk4
W/sg6zwKtDpypTXpZtHmWLiQwvhGUhz1VMZE1ECrDH7+LmJgcNWlEPNwXXvNTn3i
bz/pGdA275hdiXmslPQKUteuqN2781qFr2EQQDs7i4HzMjKN5G3xisivqhQDv3cg
ebLHjCfIM9Qa7LT4eLoRTy14TZLvY27ZrEVrgBObm57yRBjZEALTwCLMwJl6s/px
mi7ZbO1xmnF7H0OefEGAlgfE42lAw+luMnbkw6FbxgGVyTHDmKlK+EaEcJZONrIE
younmDvDYSK7BwN1WQe2yFBVjmxIMG8Vbx34/Qh6rCs9GmPgxBx0HXs/3aFgYlRZ
1GMy8UMZWqVXjYllR5xt
=RaiF
-----END PGP SIGNATURE-----
Javier Martinez Canillas Jan. 10, 2013, 7:26 p.m. UTC | #6
On Thu, Jan 10, 2013 at 6:26 PM, Tom Rini <trini@ti.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 01/10/2013 11:16 AM, Javier Martinez Canillas wrote:
>> On Thu, Jan 10, 2013 at 4:35 PM, Tom Rini <trini@ti.com> wrote:
>>> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
>>>
>>> On 01/10/2013 04:43 AM, Javier Martinez Canillas wrote:
>>>> On Thu, Dec 27, 2012 at 3:25 PM, Igor Grinberg
>>>> <grinberg@compulab.co.il> wrote:
>>>>> On 12/27/12 15:36, Javier Martinez Canillas wrote:
>>>>>> This patch adds an GPIO LED boot status for IGEP boards.
>>>>>>
>>>>>> The GPIO LED used is the red LED0 while the Linux kernel
>>>>>> uses the green LED0 as the boot status.
>>>>>>
>>>>>> By using different GPIO LEDs, the user can know in which
>>>>>> step of the boot process the board currently is.
>>>>>>
>>>>>> Signed-off-by: Javier Martinez Canillas
>>>>>> <javier.martinez@collabora.co.uk>
>>>>>
>>>>> Acked-by: Igor Grinberg <grinberg@compulab.co.il>
>>>>>
>>>>
>>>> Hello Tom,
>>>>
>>>> Any news of merging this patch?
>>>
>>> Things look good, sorry.  I'm going to try and get to starting a
>>>  next branch but I might not get a chance before the next
>>> release.
>>>
>>> - -- Tom
>>
>> Great, waiting for the next release is not an issue.
>>
>> There are also two more patches for IGEP boards that were acked
>> but not picked for this release:
>>
>> [U-Boot,v2,1/2] OMAP3: use a single board file for IGEP devices
>> [1] [U-Boot,1/1] OMAP3: igep00x0: add CONFIG_SPL_BOARD_INIT for
>> CONFIG_SPL_NAND_SUPPORT [2]
>
> For the second path, did SPL+NAND for the IGEP devices get added already?
>
> - --
> Tom

Yes, it was added on mainline commit d271a6114 "OMAP3: igep00x0: add
SPL support for IGEP-based boards"

Before posting that patch I only tested SPL booting from the uSD/MMC
and later when trying SPL boot from NAND I realized that
CONFIG_SPL_BOARD_INIT was missing to initialize the GPMC.

Sorry, my bad. I should have tested both MMC and NAND booting before
posting the SPL support patch.

Thanks a lot and best regards,
Javier
Tom Rini Jan. 10, 2013, 7:40 p.m. UTC | #7
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 01/10/2013 02:26 PM, Javier Martinez Canillas wrote:
> On Thu, Jan 10, 2013 at 6:26 PM, Tom Rini <trini@ti.com> wrote:
>> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
>> 
>> On 01/10/2013 11:16 AM, Javier Martinez Canillas wrote:
>>> On Thu, Jan 10, 2013 at 4:35 PM, Tom Rini <trini@ti.com> 
>>> wrote:
>>>> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
>>>> 
>>>> On 01/10/2013 04:43 AM, Javier Martinez Canillas wrote:
>>>>> On Thu, Dec 27, 2012 at 3:25 PM, Igor Grinberg 
>>>>> <grinberg@compulab.co.il> wrote:
>>>>>> On 12/27/12 15:36, Javier Martinez Canillas wrote:
>>>>>>> This patch adds an GPIO LED boot status for IGEP 
>>>>>>> boards.
>>>>>>> 
>>>>>>> The GPIO LED used is the red LED0 while the Linux 
>>>>>>> kernel uses the green LED0 as the boot status.
>>>>>>> 
>>>>>>> By using different GPIO LEDs, the user can know in 
>>>>>>> which step of the boot process the board currently is.
>>>>>>> 
>>>>>>> Signed-off-by: Javier Martinez Canillas 
>>>>>>> <javier.martinez@collabora.co.uk>
>>>>>> 
>>>>>> Acked-by: Igor Grinberg <grinberg@compulab.co.il>
>>>>>> 
>>>>> 
>>>>> Hello Tom,
>>>>> 
>>>>> Any news of merging this patch?
>>>> 
>>>> Things look good, sorry.  I'm going to try and get to 
>>>> starting a next branch but I might not get a chance before 
>>>> the next release.
>>>> 
>>>> - -- Tom
>>> 
>>> Great, waiting for the next release is not an issue.
>>> 
>>> There are also two more patches for IGEP boards that were acked
>>> but not picked for this release:
>>> 
>>> [U-Boot,v2,1/2] OMAP3: use a single board file for IGEP devices
>>> [1] [U-Boot,1/1] OMAP3: igep00x0: add CONFIG_SPL_BOARD_INIT for
>>> CONFIG_SPL_NAND_SUPPORT [2]
>> 
>> For the second path, did SPL+NAND for the IGEP devices get added 
>> already?
>> 
>> - -- Tom
> 
> Yes, it was added on mainline commit d271a6114 "OMAP3: igep00x0: 
> add SPL support for IGEP-based boards"
> 
> Before posting that patch I only tested SPL booting from the 
> uSD/MMC and later when trying SPL boot from NAND I realized that 
> CONFIG_SPL_BOARD_INIT was missing to initialize the GPMC.
> 
> Sorry, my bad. I should have tested both MMC and NAND booting 
> before posting the SPL support patch.

OK, that makes it a bugfix.  Albert, OK if I pull a bugfix patch
(adding a #define to a config) for a TI platform into master or do you
want it to go via u-boot-ti -> u-boot-arm ?  Thanks!

- -- 
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iQIcBAEBAgAGBQJQ7xklAAoJENk4IS6UOR1WxckQAKzSJF9cmf5uH2dTAWZ++r7f
Y5CS/Ro5E72OWgpjZCNwWts6Rr1uiP8hU15rOSq3a3An1tWPZuP6+xb4YTb2cvpb
X8EgeFQs9R++hJssCLn9lOYCmNdfF73siXJGSunVNUjxWlZePAHIUhLHeXFlYH8C
qAJ4chtD08fWJ5I/XWW5QdX8zAeF9M41U3jwYg1baeg0wiVWX7loV5s3AO76Wogp
qa6OLGXdvWzpV6+1A+vgRzjI9r0GA/rhpCD4vuoComenP6sBJezAK0Mn7s2slqmo
tXLMfi0G1FD7NF37wm3VYXLB8FlPJQfxfxbAk5oreIzl/BYieiGT27NiNrv1mzmm
5e/m1D7e7LJpJSeEJsRcwVrV1P9usEH1n1TVhMhlGOD3Z/XMC2sFX5GOPG4sMgkq
FxmXSM7mTrbYi/kvB16QWV5gn8r9e6Pl1a570+RJcwVKHMgWomvhWV5ihHb3UFww
VH3DBF1Xp3BuYrSmUgWelHCHI5QiZrLnwJoMDxj9jSRumQ0vAgjPPtbzZrNW43Xb
9URHP2oDyO7VEZnqZDMacEhIUHuZ96ENk7nEUWtpTqasCRdWHVTkM4HV5AHYiUxn
UwlcuVL6+4TWHgA1cfCyIcfGHh0zPzjgsDAO49GXGDzYPAEo/Wl3KDggiNZIFzwL
PcNb54gxJj+XEEi2bmRH
=oJ0U
-----END PGP SIGNATURE-----
Tom Rini Jan. 25, 2013, 10:13 p.m. UTC | #8
On Thu, Dec 27, 2012 at 03:36:01AM -0000, Javier Martinez Canillas wrote:

> This patch adds an GPIO LED boot status for IGEP boards.
> 
> The GPIO LED used is the red LED0 while the Linux kernel
> uses the green LED0 as the boot status.
> 
> By using different GPIO LEDs, the user can know in which
> step of the boot process the board currently is.
> 
> Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
> Acked-by: Igor Grinberg <grinberg@compulab.co.il>

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

Patch

diff --git a/board/isee/igep00x0/igep00x0.c b/board/isee/igep00x0/igep00x0.c
index fe3522a..931416a 100644
--- a/board/isee/igep00x0/igep00x0.c
+++ b/board/isee/igep00x0/igep00x0.c
@@ -60,6 +60,19 @@  int board_init(void)
 	return 0;
 }
 
+#if defined(CONFIG_SHOW_BOOT_PROGRESS) && !defined(CONFIG_SPL_BUILD)
+void show_boot_progress(int val)
+{
+	if (val < 0) {
+		/* something went wrong */
+		return;
+	}
+
+	if (!gpio_request(IGEP00X0_GPIO_LED, ""))
+		gpio_direction_output(IGEP00X0_GPIO_LED, 1);
+}
+#endif
+
 #ifdef CONFIG_SPL_BUILD
 /*
  * Routine: omap_rev_string
diff --git a/board/isee/igep00x0/igep00x0.h b/board/isee/igep00x0/igep00x0.h
index 3133e41..fefdb89 100644
--- a/board/isee/igep00x0/igep00x0.h
+++ b/board/isee/igep00x0/igep00x0.h
@@ -23,6 +23,14 @@ 
 #ifndef _IGEP00X0_H_
 #define _IGEP00X0_H_
 
+#if (CONFIG_MACH_TYPE == MACH_TYPE_IGEP0020)
+#define IGEP00X0_GPIO_LED 27
+#endif
+
+#if (CONFIG_MACH_TYPE == MACH_TYPE_IGEP0030)
+#define IGEP00X0_GPIO_LED 16
+#endif
+
 const omap3_sysinfo sysinfo = {
 	DDR_STACKED,
 #if (CONFIG_MACH_TYPE == MACH_TYPE_IGEP0020)
diff --git a/include/configs/igep00x0.h b/include/configs/igep00x0.h
index 15e233b..47f637e 100644
--- a/include/configs/igep00x0.h
+++ b/include/configs/igep00x0.h
@@ -82,6 +82,9 @@ 
 #define CONFIG_OMAP_HSMMC		1
 #define CONFIG_DOS_PARTITION		1
 
+/* define to enable boot progress via leds */
+#define CONFIG_SHOW_BOOT_PROGRESS
+
 /* USB */
 #define CONFIG_MUSB_UDC			1
 #define CONFIG_USB_OMAP3		1