All of lore.kernel.org
 help / color / mirror / Atom feed
* [u-boot PATCH] board: ti: am57xx-idk: Prevent boot for invalid configuation
@ 2020-02-10  9:59 Roger Quadros
  2020-02-14  9:53 ` Lokesh Vutla
  0 siblings, 1 reply; 2+ messages in thread
From: Roger Quadros @ 2020-02-10  9:59 UTC (permalink / raw)
  To: u-boot

On am571x-idk there can be following configurations based on Jumper J51
and LCD panel detected.

1) J51 removed (6port): 6 port Ethernet. Disable LCD panel.
2) J51 placed (LCD) + Panel detected: 4 port Ethernet with appropriate LCD.
3) J51 placed (LCD) + Panel not detected/not supported.

Configuration 3 is considered invalid as we can't use display nor ICSS1
ethernet ports due to hardware muxing. Alert the user to fix the
configuration and prevent boot.

Alternative was to allow boot and limit to 4 port Ethernet with no display
but this involved introduction of another DTB for the kernel and was
considered not worth the hassle.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Acked-by: Suman Anna <s-anna@ti.com>
---
 board/ti/am57xx/board.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/board/ti/am57xx/board.c b/board/ti/am57xx/board.c
index d70ab0c4d0..683d3aa8da 100644
--- a/board/ti/am57xx/board.c
+++ b/board/ti/am57xx/board.c
@@ -706,6 +706,18 @@ void am57x_idk_lcd_detect(void)
 	}
 out:
 	env_set("idk_lcd", idk_lcd);
+
+	/*
+	 * On AM571x_IDK, no Display with J51 set to LCD is considered as an
+	 * invalid configuration and we prevent boot to get user attention.
+	 */
+	if (board_is_am571x_idk() && am571x_idk_needs_lcd() &&
+	    !strncmp(idk_lcd, "no", 2)) {
+		printf("%s: Invalid HW configuration: display not detected/supported but J51 is set. Remove J51 to boot without display.\n",
+		       __func__);
+		hang();
+	}
+
 	return;
 }
 
-- 
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [u-boot PATCH] board: ti: am57xx-idk: Prevent boot for invalid configuation
  2020-02-10  9:59 [u-boot PATCH] board: ti: am57xx-idk: Prevent boot for invalid configuation Roger Quadros
@ 2020-02-14  9:53 ` Lokesh Vutla
  0 siblings, 0 replies; 2+ messages in thread
From: Lokesh Vutla @ 2020-02-14  9:53 UTC (permalink / raw)
  To: u-boot



On 10/02/20 3:29 PM, Roger Quadros wrote:
> On am571x-idk there can be following configurations based on Jumper J51
> and LCD panel detected.
> 
> 1) J51 removed (6port): 6 port Ethernet. Disable LCD panel.
> 2) J51 placed (LCD) + Panel detected: 4 port Ethernet with appropriate LCD.
> 3) J51 placed (LCD) + Panel not detected/not supported.
> 
> Configuration 3 is considered invalid as we can't use display nor ICSS1
> ethernet ports due to hardware muxing. Alert the user to fix the
> configuration and prevent boot.
> 
> Alternative was to allow boot and limit to 4 port Ethernet with no display
> but this involved introduction of another DTB for the kernel and was
> considered not worth the hassle.
> 
> Signed-off-by: Roger Quadros <rogerq@ti.com>
> Acked-by: Suman Anna <s-anna@ti.com>

Merged into u-boot-ti.

Thanks and regards,
Lokesh

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-02-14  9:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-10  9:59 [u-boot PATCH] board: ti: am57xx-idk: Prevent boot for invalid configuation Roger Quadros
2020-02-14  9:53 ` Lokesh Vutla

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.