Skip to contentSkip to conversation

mpc52xx, mucmc52, uc101: config cleanup

PATCH Superseded Heiko Schocher 4 participants 10 messages Sep 9, 2009 – Sep 14, 2009

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 mpc52xx, mucmc52, uc101: config cleanup

- as this boards are similiar, collect common config option in manroland-common.h
- add OF support
- update default environment

---
 board/mucmc52/mucmc52.c            |    7 +
 board/uc101/uc101.c                |    7 +
 include/configs/manroland-common.h |  336 ++++++++++++++++++++++++++++++++++++
 include/configs/mucmc52.h          |  256 +--------------------------
 include/configs/uc101.h            |  266 +---------------------------
 5 files changed, 368 insertions(+), 504 deletions(-)
 create mode 100644 include/configs/manroland-common.h
board/mucmc52/mucmc52.c +7 -0
index 7181bd8..bac49be 100644
@@ -398,3 +398,10 @@ void pci_init_board (void)
 	pci_mpc5xxx_init (&hose);
 }
 #endif
+
+#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
+void ft_board_setup(void *blob, bd_t *bd)
+{
+	ft_cpu_setup(blob, bd);
+}
+#endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
board/uc101/uc101.c +7 -0
index 7df349f..4030b9d 100644
@@ -371,3 +371,10 @@ void hw_watchdog_reset(void)
 	*(vu_long *)MPC5XXX_GPT0_ENABLE = GPT_OUT_0;
 }
 #endif
+
+#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
+void ft_board_setup(void *blob, bd_t *bd)
+{
+	ft_cpu_setup(blob, bd);
+}
+#endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
include/configs/manroland-common.h new file +336 -0

336 lines not on this page · raw message

include/configs/mucmc52.h +8 -248

315 lines not on this page · raw message

include/configs/uc101.h +10 -256

328 lines not on this page · raw message

Signature · 5 lines
1.6.0.6

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

PATCH 1/2 mpc52xx, mucmc52, uc101: config cleanup

Dear Heiko Schocher,

Quoted 6 lines · In message <[email protected]> you wrote:

- as this boards are similiar, collect common config option in manroland-common.h
- add OF support
- update default environment

Quoted 8 lines
---
 board/mucmc52/mucmc52.c            |    7 +
 board/uc101/uc101.c                |    7 +
 include/configs/manroland-common.h |  336 ++++++++++++++++++++++++++++++++++++
 include/configs/mucmc52.h          |  256 +--------------------------
 include/configs/uc101.h            |  266 +---------------------------
 5 files changed, 368 insertions(+), 504 deletions(-)
 create mode 100644 include/configs/manroland-common.h

Applied to mpc5xxx repo.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Drawing on my fine command of language, I said nothing.
#2 lore raw

PATCH 1/2 mpc52xx, mucmc52, uc101: config cleanup

In reply to Heiko Schocher

Hi Heiko,

Quoted 14 lines

- as this boards are similiar, collect common config option in manroland-common.h
- add OF support
- update default environment

---
 board/mucmc52/mucmc52.c            |    7 +
 board/uc101/uc101.c                |    7 +
 include/configs/manroland-common.h |  336 ++++++++++++++++++++++++++++++++++++
 include/configs/mucmc52.h          |  256 +--------------------------
 include/configs/uc101.h            |  266 +---------------------------
 5 files changed, 368 insertions(+), 504 deletions(-)
 create mode 100644 include/configs/manroland-common.h

[...]

include/configs/manroland-common.h line 34

Quoted 7 lines

+ * High Level Configuration Options
+ * (easy to change)
+ */

include/configs/manroland-common.h new file +4 -0
+#define CONFIG_MPC5xxx		1	/* This is an MPC5xxx CPU		*/
+#define CONFIG_MPC5200		1	/* (more precisely an MPC5200 CPU)	*/
+
+#define CONFIG_SYS_MPC5XXX_CLKIN	33000000 /* ... running at 33.000000MHz	*/

Are you sure that this is a good choice to put in a manufacturer common header file? Isn't the probability of this becoming incorrect nearly 100% for the next board from this manufacturer?

I'd advise to keep CPU stuff in the individual board config files - maybe, if you really want, create a "manroland-mpc52xx-common.h". The rest of the common configs should be re-evaluated in the same spirit.

Cheers
Detlev

Signature · 8 lines
LISP has  jokingly been  described as  "the most  intelligent way to  misuse a
computer".  I think that  description a great  compliment because it transmits
the full  flavour of  liberation:  it has assisted a number of our most gifted
fellow humans in thinking previously impossible thoughts. - Edsger W. Dijkstra
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
#3 lore raw

PATCH 1/2 mpc52xx, mucmc52, uc101: config cleanup

Dear Detlev Zundel,

Quoted 10 lines · In message <[email protected]> you wrote:

include/configs/manroland-common.h line 34

Quoted 5 lines
include/configs/manroland-common.h new file +4 -0
+#define CONFIG_MPC5xxx		1	/* This is an MPC5xxx CPU		*/
+#define CONFIG_MPC5200		1	/* (more precisely an MPC5200 CPU)	*/
+
+#define CONFIG_SYS_MPC5XXX_CLKIN	33000000 /* ... running at 33.000000MHz	*/

Are you sure that this is a good choice to put in a manufacturer common header file? Isn't the probability of this becoming incorrect nearly 100% for the next board from this manufacturer?

Quoted 3 lines

I'd advise to keep CPU stuff in the individual board config files - maybe, if you really want, create a "manroland-mpc52xx-common.h". The rest of the common configs should be re-evaluated in the same spirit.

And right you are. Thanks for pointing out.

Heiko, please rework. I haven't pushed the repo out yet, so I just remove that commit again.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Every solution breeds new problems.
#4 lore raw

PATCH v2 1/2 mpc52xx, mucmc52, uc101: config cleanup

- as this boards are similiar, collect common config option in manroland-common.h and manroland-mpc52xx-common.h for mpc52xx specific common options for this manufacturer.
- add OF support
- update default environment

---

- changes since v1:
added suggestion from Detlev Zundel, to collect mpc52xx specific config options in manroland-mpc52xx-common.h

 board/mucmc52/mucmc52.c                    |    7 +
 board/uc101/uc101.c                        |    7 +
 include/configs/manroland-common.h         |  139 +++++++++++++++
 include/configs/manroland-mpc52xx-common.h |  230 ++++++++++++++++++++++++
 include/configs/mucmc52.h                  |  257 +--------------------------
 include/configs/uc101.h                    |  267 ++--------------------------
 6 files changed, 403 insertions(+), 504 deletions(-)
 create mode 100644 include/configs/manroland-common.h
 create mode 100644 include/configs/manroland-mpc52xx-common.h
board/mucmc52/mucmc52.c +7 -0
index 7181bd8..bac49be 100644
@@ -398,3 +398,10 @@ void pci_init_board (void)
 	pci_mpc5xxx_init (&hose);
 }
 #endif
+
+#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
+void ft_board_setup(void *blob, bd_t *bd)
+{
+	ft_cpu_setup(blob, bd);
+}
+#endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
board/uc101/uc101.c +7 -0
index 7df349f..4030b9d 100644
@@ -371,3 +371,10 @@ void hw_watchdog_reset(void)
 	*(vu_long *)MPC5XXX_GPT0_ENABLE = GPT_OUT_0;
 }
 #endif
+
+#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
+void ft_board_setup(void *blob, bd_t *bd)
+{
+	ft_cpu_setup(blob, bd);
+}
+#endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
include/configs/manroland-common.h new file +139 -0

139 lines not on this page · raw message

include/configs/manroland-mpc52xx-common.h new file +230 -0

230 lines not on this page · raw message

include/configs/mucmc52.h +9 -248

316 lines not on this page · raw message

include/configs/uc101.h +11 -256

329 lines not on this page · raw message

Signature · 1 line
1.6.0.6
#5 lore raw

PATCH v2 1/2 mpc52xx, mucmc52, uc101: config cleanup

Hello Heiko,

Quoted 5 lines

- as this boards are similiar, collect common config option in manroland-common.h and manroland-mpc52xx-common.h for mpc52xx specific common options for this manufacturer.
- add OF support
- update default environment

Argh, sorry for interrupting again, but I think I suggested something problematic on second thought:

Quoted 1 line
 include/configs/manroland-mpc52xx-common.h |  230 ++++++++++++++++++++++++

[...]

Quoted 5 lines
include/configs/manroland-mpc52xx-common.h new file +0 -0
new file mode 100644
index 0000000..b29ef9b

[...]

include/configs/manroland-mpc52xx-common.h line 32

Quoted 2 lines
include/configs/manroland-mpc52xx-common.h new file +2 -0
+#define CONFIG_MPC5xxx		1	/* This is an MPC5xxx CPU		*/
+#define CONFIG_MPC5200		1	/* (more precisely an MPC5200 CPU)	*/

So all boards using manroland-mpc52xx-common.h are in fact 5200s. In this case, I should have suggested the filename "manroland-mpc5200-common.h" as the "xx" part surely cannot be anything else then "00".

Sorry for this wrong lead.

Cheers
Detlev

Signature · 7 lines
Some people seem to think that C is a real programming language, but they are
sadly mistaken.  It really is about writing almost-portable assembly language
[...]               -- Linus Torvalds 10404265599082718160noreply at blogger.com
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
#6 lore raw

PATCH v2 1/2 mpc52xx, mucmc52, uc101: config cleanup

Hello Detlev,

Quoted 21 lines · Detlev Zundel
Quoted 5 lines

- as this boards are similiar, collect common config option in manroland-common.h and manroland-mpc52xx-common.h for mpc52xx specific common options for this manufacturer.
- add OF support
- update default environment

Argh, sorry for interrupting again, but I think I suggested something problematic on second thought:

Quoted 1 line
 include/configs/manroland-mpc52xx-common.h |  230 ++++++++++++++++++++++++

[...]

Quoted 5 lines
include/configs/manroland-mpc52xx-common.h new file +0 -0
new file mode 100644
index 0000000..b29ef9b

[...]

Quoted 7 lines

include/configs/manroland-mpc52xx-common.h line 32

Quoted 2 lines
include/configs/manroland-mpc52xx-common.h new file +2 -0
+#define CONFIG_MPC5xxx		1	/* This is an MPC5xxx CPU		*/
+#define CONFIG_MPC5200		1	/* (more precisely an MPC5200 CPU)	*/

So all boards using manroland-mpc52xx-common.h are in fact 5200s. In this case, I should have suggested the filename "manroland-mpc5200-common.h" as the "xx" part surely cannot be anything else then "00".

Argh.. and I didn;t detected it too ;-)

Quoted 1 line

Sorry for this wrong lead.

No problem, I send a patch soon, if the rest of this patch is ok.

bye
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#7 lore raw

PATCH v3 1/2 mpc5200, mucmc52, uc101: config cleanup

In reply to Detlev Zundel

- as this boards are similiar, collect common config option in manroland/common.h and manroland/mpc52xx-common.h for mpc5200 specific common options for this manufacturer.
- add OF support
- update default environment

---

- changes since v1:
added suggestion from Detlev Zundel, to collect mpc52xx specific config options in manroland-mpc52xx-common.h

- changes since v2:
as discussed with Wolfgang and Detlev, moved the manroland common headers in include/configs/manroland

 board/mucmc52/mucmc52.c                    |    7 +
 board/uc101/uc101.c                        |    7 +
 include/configs/manroland/common.h         |  139 +++++++++++++++
 include/configs/manroland/mpc5200-common.h |  229 ++++++++++++++++++++++++
 include/configs/mucmc52.h                  |  257 +--------------------------
 include/configs/uc101.h                    |  267 ++--------------------------
 6 files changed, 402 insertions(+), 504 deletions(-)
 create mode 100644 include/configs/manroland/common.h
 create mode 100644 include/configs/manroland/mpc5200-common.h
board/mucmc52/mucmc52.c +7 -0
index 7181bd8..bac49be 100644
@@ -398,3 +398,10 @@ void pci_init_board (void)
 	pci_mpc5xxx_init (&hose);
 }
 #endif
+
+#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
+void ft_board_setup(void *blob, bd_t *bd)
+{
+	ft_cpu_setup(blob, bd);
+}
+#endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
board/uc101/uc101.c +7 -0
index 7df349f..4030b9d 100644
@@ -371,3 +371,10 @@ void hw_watchdog_reset(void)
 	*(vu_long *)MPC5XXX_GPT0_ENABLE = GPT_OUT_0;
 }
 #endif
+
+#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
+void ft_board_setup(void *blob, bd_t *bd)
+{
+	ft_cpu_setup(blob, bd);
+}
+#endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
include/configs/manroland/common.h new file +139 -0

139 lines not on this page · raw message

include/configs/manroland/mpc5200-common.h new file +229 -0

229 lines not on this page · raw message

include/configs/mucmc52.h +9 -248

316 lines not on this page · raw message

include/configs/uc101.h +11 -256

329 lines not on this page · raw message

Signature · 5 lines
1.6.0.6

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

PATCH v3 2/2 mucmc52, uc101: delete ata@3a00 node, if no CF card is detected

In reply to Detlev Zundel

U-Boot can detect, if a ide device is present or not. If not and this new config option is activated, u-boot removes the ata node from the DTS before booting Linux, so the Linux IDE driver didn;t crashs, when probing the device. This is needed for buggy hardware (uc101) where no pull down resistor is connected to the signal IDE5V_DD7.

---

changes since v1:
- added comment from Wolfgang Denk, to move this to a more common place, so others can also use it, and made it therefore per CONFIG_OF_IDE_FIXUP selectable.

changes since v2:
- add CONFIG_OF_IDE_FIXUP to mpc5200-common.h

 README                                     |    9 +++++++++
 cpu/mpc5xxx/cpu.c                          |   18 ++++++++++++++++++
 include/configs/manroland/mpc5200-common.h |    1 +
 3 files changed, 28 insertions(+), 0 deletions(-)
README +9 -0
index ff4ed8b..b9364bf 100644
@@ -386,6 +386,15 @@ The following options need to be configured:
 		This define fills in the correct boot CPU in the boot
 		param header, the default value is zero if undefined.
 
+		CONFIG_OF_IDE_FIXUP
+
+		U-Boot can detect, if a ide device is present or not.
+		If not and this config option is activated, u-boot
+		removes the ata node from the DTS before booting Linux,
+		so the Linux IDE driver didn;t crashs, when probing the
+		device. This is needed for buggy hardware (uc101) where
+		no pull down resistor is connected to the signal IDE5V_DD7.
+
 - vxWorks boot parameters:
 
 		bootvx constructs a valid bootline using the following
cpu/mpc5xxx/cpu.c +18 -0
index f6258c7..a2fc323 100644
@@ -125,6 +125,9 @@ void ft_cpu_setup(void *blob, bd_t *bd)
 	uchar enetaddr[6];
 	char * eth_path = "/" OF_SOC "/ethernet at 3000";
 #endif
+#if defined(CONFIG_OF_IDE_FIXUP)
+	extern block_dev_desc_t ide_dev_desc[CONFIG_SYS_IDE_MAXDEVICE];
+#endif
 
 	do_fixup_by_path_u32(blob, cpu_path, "timebase-frequency", OF_TBCLK, 1);
 	do_fixup_by_path_u32(blob, cpu_path, "bus-frequency", bd->bi_busfreq, 1);
@@ -137,6 +140,21 @@ void ft_cpu_setup(void *blob, bd_t *bd)
 	do_fixup_by_path(blob, eth_path, "mac-address", enetaddr, 6, 0);
 	do_fixup_by_path(blob, eth_path, "local-mac-address", enetaddr, 6, 0);
 #endif
+#if defined(CONFIG_OF_IDE_FIXUP)
+	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
 }
 #endif
 
include/configs/manroland/mpc5200-common.h +1 -0
index 2f092b1..b29ef9b 100644
@@ -225,5 +225,6 @@
 #define OF_SOC			"soc5200 at f0000000"
 #define OF_TBCLK		(bd->bi_busfreq / 4)
 #define OF_STDOUT_PATH		"/soc5200 at f0000000/serial at 2000"
+#define CONFIG_OF_IDE_FIXUP
 
 #endif /* __MANROLAND_MPC52XX__COMMON_H */
Signature · 6 lines
1.6.0.6


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

PATCH v3 1/2 mpc5200, mucmc52, uc101: config cleanup

In reply to Heiko Schocher

Hi Heiko,

Quoted 7 lines

- as this boards are similiar, collect common config option in manroland/common.h and manroland/mpc52xx-common.h for mpc5200 specific common options for this manufacturer.
- add OF support
- update default environment

Thanks
Detlev

Signature · 7 lines
Some people seem to think that C is a real programming language, but they are
sadly mistaken.  It really is about writing almost-portable assembly language
[...]               -- Linus Torvalds 10404265599082718160noreply at blogger.com
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de