public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 2/2] mucmc52, uc101: delete ata@3a00 node, if no CF card is detected
@ 2009-09-09  7:14 Heiko Schocher
  2009-09-09  8:38 ` Wolfgang Denk
  0 siblings, 1 reply; 18+ messages in thread
From: Heiko Schocher @ 2009-09-09  7:14 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Heiko Schocher <hs@denx.de>
---
 board/mucmc52/mucmc52.c |   15 +++++++++++++++
 board/uc101/uc101.c     |   15 +++++++++++++++
 2 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/board/mucmc52/mucmc52.c b/board/mucmc52/mucmc52.c
index bac49be..950798a 100644
--- a/board/mucmc52/mucmc52.c
+++ b/board/mucmc52/mucmc52.c
@@ -400,8 +400,23 @@ void pci_init_board (void)
 #endif

 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
+#include <libfdt.h>
 void ft_board_setup(void *blob, bd_t *bd)
 {
+	extern block_dev_desc_t ide_dev_desc[CONFIG_SYS_IDE_MAXDEVICE];
+
 	ft_cpu_setup(blob, bd);
+	if (ide_dev_desc[0].type == DEV_TYPE_UNKNOWN) {
+		/* NO CF card detected -> delete ata node in DTS */
+		int nodeoffset = 0;
+		char nodename[] = "/soc5200 at f0000000/ata at 3a00";
+
+		nodeoffset = fdt_path_offset (blob, nodename);
+		if (nodeoffset >= 0) {
+			fdt_del_node(blob, nodeoffset);
+		} else
+			printf("%s: cannot find %s node err:%s\n",
+				__func__, nodename, fdt_strerror(nodeoffset));
+	}
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
diff --git a/board/uc101/uc101.c b/board/uc101/uc101.c
index 4030b9d..4d39a08 100644
--- a/board/uc101/uc101.c
+++ b/board/uc101/uc101.c
@@ -373,8 +373,23 @@ void hw_watchdog_reset(void)
 #endif

 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
+#include <libfdt.h>
 void ft_board_setup(void *blob, bd_t *bd)
 {
+	extern block_dev_desc_t ide_dev_desc[CONFIG_SYS_IDE_MAXDEVICE];
+
 	ft_cpu_setup(blob, bd);
+	if (ide_dev_desc[0].type == DEV_TYPE_UNKNOWN) {
+		/* NO CF card detected -> delete ata node in DTS */
+		int nodeoffset = 0;
+		char nodename[] = "/soc5200 at f0000000/ata at 3a00";
+
+		nodeoffset = fdt_path_offset (blob, nodename);
+		if (nodeoffset >= 0) {
+			fdt_del_node(blob, nodeoffset);
+		} else
+			printf("%s: cannot find %s node err:%s\n",
+				__func__, nodename, fdt_strerror(nodeoffset));
+	}
 }
 #endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
-- 
1.6.0.6

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

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

end of thread, other threads:[~2009-09-14 16:04 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-09  7:14 [U-Boot] [PATCH 2/2] mucmc52, uc101: delete ata@3a00 node, if no CF card is detected Heiko Schocher
2009-09-09  8:38 ` Wolfgang Denk
2009-09-09  9:12   ` Heiko Schocher
2009-09-09  9:03     ` Wolfgang Denk
2009-09-10  5:56       ` [U-Boot] [PATCHv2 " Heiko Schocher
2009-09-14 13:07         ` Detlev Zundel
2009-09-14 15:06           ` Heiko Schocher
2009-09-14 15:06           ` [U-Boot] [PATCH v4 " Heiko Schocher
2009-09-14 15:03             ` Stefan Roese
2009-09-14 15:26               ` Heiko Schocher
2009-09-14 15:29                 ` Stefan Roese
2009-09-14 15:55                   ` Heiko Schocher
2009-09-14 15:44                     ` Stefan Roese
2009-09-14 16:04                       ` Heiko Schocher
2009-09-14 15:08             ` Stefan Roese
2009-09-14 15:36               ` Heiko Schocher
2009-09-14 15:09             ` Jerry Van Baren
2009-09-14 15:38               ` Heiko Schocher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox